diff --git a/demos/event-markers.html b/demos/event-markers.html
new file mode 100644
index 00000000..d2a040de
--- /dev/null
+++ b/demos/event-markers.html
@@ -0,0 +1,85 @@
+
+
+
+
+ Events Markers Series
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demos/eventMarkers.js b/demos/eventMarkers.js
new file mode 100644
index 00000000..1e1d96a8
--- /dev/null
+++ b/demos/eventMarkers.js
@@ -0,0 +1,112 @@
+function eventMarkers(opts) {
+ opts = opts || {};
+
+ let labels = [];
+ let textFill = "black";
+ let rectFill = "white";
+ let rectStroke = "black";
+
+ let showLabels = opts.showLabels == null ? true: opts.showLabels;
+ let labelsAlign = opts.labelsAlign == null ? "top" : opts.labelsAlign;
+
+ function drawPathLabels(u, seriesIdx) {
+ let rectPadding = 7;
+
+ let s = u.series[seriesIdx];
+
+ textFill = s._stroke == null ? textFill : s._stroke;
+ rectFill = s._fill == null ? rectFill : s._fill;
+ rectStroke = s._stroke == null ? rectStroke : s._stroke;
+
+ u.ctx.fillStyle = textFill;
+ u.ctx.textAlign = "center";
+ u.ctx.textBaseline = "center";
+
+ labels.forEach((label) => {
+ let text = u.ctx.measureText(label.text);
+
+ let textWidth = text.width;
+ let textHeight = text.actualBoundingBoxDescent + text.actualBoundingBoxAscent;
+
+ let rectWidth = textWidth + (rectPadding * 2);
+ let rectHeight = textHeight + (rectPadding * 2);
+
+ let yOffAlign = text.actualBoundingBoxAscent + rectPadding;
+
+ if (label.align == "center")
+ {
+ yOffAlign = rectHeight;
+ }
+ else if (label.align == "bottom")
+ {
+ yOffAlign = -(text.actualBoundingBoxDescent + rectPadding);
+ }
+
+ let textCenterX = label.x;
+ let textCenterY = label.y + yOffAlign;
+
+ let rectTop = textCenterX - (rectWidth / 2);
+ let rectLeft = textCenterY - (rectHeight / 2);
+
+ u.ctx.fillStyle = rectFill;
+ u.ctx.strokeStyle = rectStroke;
+
+ u.ctx.fillRect(rectTop, rectLeft, rectWidth, rectHeight);
+ u.ctx.strokeRect(rectTop, rectLeft, rectWidth, rectHeight);
+
+ u.ctx.fillStyle = textFill;
+ u.ctx.fillText(label.text, textCenterX, textCenterY);
+ });
+ }
+
+ return (u, seriesIdx, idx0, idx1) => {
+ return uPlot.orient(u, seriesIdx, (series, dataX, dataY, scaleX, scaleY, valToPosX, valToPosY, xOff, yOff, xDim, yDim) => {
+
+ labels = [];
+
+ let pxRound = series.pxRound;
+ const _paths = {stroke: new Path2D(), fill: null, text: drawPathLabels, clip: null, band: null, gaps: null, flags: uPlot.BAND_CLIP_FILL};
+ const stroke = _paths.stroke;
+
+ let yBottom = yOff + yDim;
+ let yTop = yOff;
+
+ let labelPadding = 6;
+ let yLabel = yTop + labelPadding;
+
+ if (labelsAlign == "bottom")
+ {
+ yLabel = yBottom - labelPadding;
+ }
+ else if (labelsAlign == "center")
+ {
+ yLabel = (yBottom - yTop) / 2;
+ }
+
+ for (let i = idx0; i <= idx1; i++) {
+ let yEventName = dataY[i];
+
+ if (yEventName == null) {
+ continue;
+ }
+ let x = pxRound(valToPosX(dataX[i], scaleX, xDim, xOff));
+
+ stroke.moveTo(x, yBottom);
+ stroke.lineTo(x, yTop);
+
+ if (showLabels)
+ {
+ let labelElement = {text: dataY[i], align: labelsAlign, x: x, y: yLabel};
+ labels.push(labelElement);
+ }
+ }
+
+ _paths.gaps = null;
+ _paths.fill = null;
+ _paths.clip = null;
+ _paths.band = null;
+
+ return _paths;
+ });
+ };
+}
\ No newline at end of file
diff --git a/dist/uPlot.cjs.js b/dist/uPlot.cjs.js
index 6be03bcc..ae8712d6 100644
--- a/dist/uPlot.cjs.js
+++ b/dist/uPlot.cjs.js
@@ -3643,6 +3643,11 @@ function uPlot(opts, data, then) {
}
}
+ if (s._paths != null && s._paths.text != null)
+ {
+ s._paths.text(self, i);
+ }
+
if (ctxAlpha != 1)
ctx.globalAlpha = ctxAlpha = 1;
diff --git a/dist/uPlot.d.ts b/dist/uPlot.d.ts
index f4523248..36c9c1bd 100644
--- a/dist/uPlot.d.ts
+++ b/dist/uPlot.d.ts
@@ -623,6 +623,9 @@ declare namespace uPlot {
/** path to fill */
fill?: Path2D | Map | null;
+ /** fn to draw path labels */
+ text?: ((self: uPlot, seriesIdx: number) => void) | null;
+
/** path for clipping fill & stroke (used for gaps) */
clip?: Path2D | null;
diff --git a/dist/uPlot.esm.js b/dist/uPlot.esm.js
index 92e36bcb..edd16df0 100644
--- a/dist/uPlot.esm.js
+++ b/dist/uPlot.esm.js
@@ -3641,6 +3641,11 @@ function uPlot(opts, data, then) {
}
}
+ if (s._paths != null && s._paths.text != null)
+ {
+ s._paths.text(self, i);
+ }
+
if (ctxAlpha != 1)
ctx.globalAlpha = ctxAlpha = 1;
diff --git a/dist/uPlot.iife.js b/dist/uPlot.iife.js
index 2e9f6be0..dfa739b7 100644
--- a/dist/uPlot.iife.js
+++ b/dist/uPlot.iife.js
@@ -3644,6 +3644,11 @@ var uPlot = (function () {
}
}
+ if (s._paths != null && s._paths.text != null)
+ {
+ s._paths.text(self, i);
+ }
+
if (ctxAlpha != 1)
ctx.globalAlpha = ctxAlpha = 1;
diff --git a/dist/uPlot.iife.min.js b/dist/uPlot.iife.min.js
index 7ee758ea..57bca9c9 100644
--- a/dist/uPlot.iife.min.js
+++ b/dist/uPlot.iife.min.js
@@ -1,2 +1,2 @@
/*! https://github.com/leeoniya/uPlot (v1.6.19) */
-var uPlot=function(){"use strict";function e(e,t,l,n){let i;l=l||0;let o=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=o?l+n>>1:x((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function t(e,t,l,n){for(let i=1==n?t:l;i>=t&&l>=i;i+=n)if(null!=e[i])return i;return-1}const l=[0,0];function n(e,t,n,i){return l[0]=0>n?I(e,-n):e,l[1]=0>i?I(t,-i):t,l}function i(e,t,l,i){let o,s,r,u=y(e),a=10==l?M:S;return e==t&&(-1==u?(e*=l,t/=l):(e/=l,t*=l)),i?(o=x(a(e)),s=_(a(t)),r=n(v(l,o),v(l,s),o,s),e=r[0],t=r[1]):(o=x(a(g(e))),s=x(a(g(t))),r=n(v(l,o),v(l,s),o,s),e=L(e,r[0]),t=R(t,r[1])),[e,t]}function o(e,t,l,n){let o=i(e,t,l,n);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}const s={mode:3,pad:.1},r={pad:0,soft:null,mode:0},u={min:r,max:r};function a(e,t,l,n){return q(l)?f(e,t,l):(r.pad=l,r.soft=n?0:null,r.mode=n?3:0,f(e,t,u))}function c(e,t){return null==e?t:e}function f(e,t,l){let n=l.min,i=l.max,o=c(n.pad,0),s=c(i.pad,0),r=c(n.hard,-D),u=c(i.hard,D),a=c(n.soft,D),f=c(i.soft,-D),h=c(n.mode,0),d=c(i.mode,0),p=t-e;1e-9>p&&(p=0,0!=e&&0!=t||(p=1e-9,2==h&&a!=D&&(o=0),2==d&&f!=-D&&(s=0)));let m=p||g(t)||1e3,w=M(m),_=v(10,x(w)),y=I(L(e-m*(0==p?0==e?.1:1:o),_/10),9),S=a>e||1!=h&&(3!=h||y>a)&&(2!=h||a>y)?D:a,E=b(r,S>y&&e>=S?S:k(S,y)),z=I(R(t+m*(0==p?0==t?.1:1:s),_/10),9),T=t>f||1!=d&&(3!=d||f>z)&&(2!=d||z>f)?-D:f,P=k(u,z>T&&T>=t?T:b(T,z));return E==P&&0==E&&(P=100),[E,P]}const h=new Intl.NumberFormat(navigator.language),d=e=>h.format(e),p=Math,m=p.PI,g=p.abs,x=p.floor,w=p.round,_=p.ceil,k=p.min,b=p.max,v=p.pow,y=p.sign,M=p.log10,S=p.log2,E=(e,t=1)=>p.asinh(e/t),D=1/0;function z(e){return 1+(0|M((e^e>>31)-(e>>31)))}function T(e,t){return w(e/t)*t}function P(e,t,l){return k(b(e,t),l)}function A(e){return"function"==typeof e?e:()=>e}const W=e=>e,Y=(e,t)=>t,C=()=>null,F=()=>!0,H=(e,t)=>e==t;function R(e,t){return _(e/t)*t}function L(e,t){return x(e/t)*t}function I(e,t){return w(e*(t=10**t))/t}const G=new Map;function O(e){return((""+e).split(".")[1]||"").length}function N(e,t,l,n){let i=[],o=n.map(O);for(let s=t;l>s;s++){let t=g(s),l=I(v(e,s),t);for(let e=0;n.length>e;e++){let r=n[e]*l,u=(0>r||0>s?t:0)+(o[e]>s?o[e]:0),a=I(r,u);i.push(a),G.set(a,u)}}return i}const j={},B=[],V=[null,null],U=Array.isArray;function J(e){return"string"==typeof e}function q(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function K(e){return null!=e&&"object"==typeof e}function Z(e,t=q){let l;if(U(e)){let n=e.find((e=>null!=e));if(U(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=Z(e[n],t)}else l=e.slice()}else if(t(e)){l={};for(let n in e)l[n]=Z(e[n],t)}else l=e;return l}function $(e){let t=arguments;for(let l=1;t.length>l;l++){let n=t[l];for(let t in n)q(e[t])?$(e[t],Z(n[t])):e[t]=Z(n[t])}return e}function X(e,t,l){for(let n,i=0,o=-1;t.length>i;i++){let s=t[i];if(s>o){for(n=s-1;n>=0&&null==e[n];)e[n--]=null;for(n=s+1;l>n&&null==e[n];)e[o=n++]=null}}}const Q="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask,ee="width",te="height",le="top",ne="bottom",ie="left",oe="right",se="#000",re="mousemove",ue="mousedown",ae="mouseup",ce="mouseenter",fe="mouseleave",he="dblclick",de="change",pe="dppxchange",me="u-off",ge="u-label",xe=document,we=window;let _e,ke;function be(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function ve(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function ye(e,t,l){e.style[t]=l+"px"}function Me(e,t,l,n){let i=xe.createElement(e);return null!=t&&be(i,t),null!=l&&l.insertBefore(i,n),i}function Se(e,t){return Me("div",e,t)}const Ee=new WeakMap;function De(e,t,l,n,i){let o="translate("+t+"px,"+l+"px)";o!=Ee.get(e)&&(e.style.transform=o,Ee.set(e,o),0>t||0>l||t>n||l>i?be(e,me):ve(e,me))}const ze=new WeakMap;function Te(e,t,l){let n=t+l;n!=ze.get(e)&&(ze.set(e,n),e.style.background=t,e.style.borderColor=l)}const Pe=new WeakMap;function Ae(e,t,l,n){let i=t+""+l;i!=Pe.get(e)&&(Pe.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const We={passive:!0},Ye=$({capture:!0},We);function Ce(e,t,l,n){t.addEventListener(e,l,n?Ye:We)}function Fe(e,t,l,n){t.removeEventListener(e,l,n?Ye:We)}!function e(){let t=devicePixelRatio;_e!=t&&(_e=t,ke&&Fe(de,ke,e),ke=matchMedia(`(min-resolution: ${_e-.001}dppx) and (max-resolution: ${_e+.001}dppx)`),Ce(de,ke,e),we.dispatchEvent(new CustomEvent(pe)))}();const He=["January","February","March","April","May","June","July","August","September","October","November","December"],Re=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Le(e){return e.slice(0,3)}const Ie=Re.map(Le),Ge=He.map(Le),Oe={MMMM:He,MMM:Ge,WWWW:Re,WWW:Ie};function Ne(e){return(10>e?"0":"")+e}const je={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Ne(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Ne(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Ne(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>12>e.getHours()?"AM":"PM",aa:e=>12>e.getHours()?"am":"pm",a:e=>12>e.getHours()?"a":"p",mm:e=>Ne(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Ne(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>function(e){return(10>e?"00":100>e?"0":"")+e}(e.getMilliseconds())};function Be(e,t){t=t||Oe;let l,n=[],i=/\{([a-z]+)\}|[^{]+/gi;for(;l=i.exec(e);)n.push("{"==l[0][0]?je[l[1]]:l[0]);return e=>{let l="";for(let i=0;n.length>i;i++)l+="string"==typeof n[i]?n[i]:n[i](e,t);return l}}const Ve=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Ue=e=>e%1==0,Je=[1,2,2.5,5],qe=N(10,-16,0,Je),Ke=N(10,0,16,Je),Ze=Ke.filter(Ue),$e=qe.concat(Ke),Xe="{YYYY}",Qe="\n"+Xe,et="{M}/{D}",tt="\n"+et,lt=tt+"/{YY}",nt="{aa}",it="{h}:{mm}"+nt,ot="\n"+it,st=":{ss}",rt=null;function ut(e){let t=1e3*e,l=60*t,n=60*l,i=24*n,o=30*i,s=365*i;return[(1==e?N(10,0,3,Je).filter(Ue):N(10,-3,0,Je)).concat([t,5*t,10*t,15*t,30*t,l,5*l,10*l,15*l,30*l,n,2*n,3*n,4*n,6*n,8*n,12*n,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,o,2*o,3*o,4*o,6*o,s,2*s,5*s,10*s,25*s,50*s,100*s]),[[s,Xe,rt,rt,rt,rt,rt,rt,1],[28*i,"{MMM}",Qe,rt,rt,rt,rt,rt,1],[i,et,Qe,rt,rt,rt,rt,rt,1],[n,"{h}"+nt,lt,rt,tt,rt,rt,rt,1],[l,it,lt,rt,tt,rt,rt,rt,1],[t,st,lt+" "+it,rt,tt+" "+it,rt,ot,rt,1],[e,st+".{fff}",lt+" "+it,rt,tt+" "+it,rt,ot,rt,1]],function(t){return(r,u,a,c,f,h)=>{let d=[],p=f>=s,m=f>=o&&s>f,g=t(a),_=I(g*e,3),k=xt(g.getFullYear(),p?0:g.getMonth(),m||p?1:g.getDate()),b=I(k*e,3);if(m||p){let l=m?f/o:0,n=p?f/s:0,i=_==b?_:I(xt(k.getFullYear()+n,k.getMonth()+l,1)*e,3),r=new Date(w(i/e)),u=r.getFullYear(),a=r.getMonth();for(let o=0;c>=i;o++){let s=xt(u+n*o,a+l*o,1),r=s-t(I(s*e,3));i=I((+s+r)*e,3),i>c||d.push(i)}}else{let o=i>f?f:i,s=b+(x(a)-x(_))+R(_-b,o);d.push(s);let p=t(s),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=f/n,w=h/r.axes[u]._space;for(;s=I(s+f,1==e?0:3),c>=s;)if(g>1){let e=x(I(m+g,6))%24,l=t(s).getHours()-e;l>1&&(l=-1),s-=l*n,m=(m+g)%24,.7>I((s-d[d.length-1])/f,3)*w||d.push(s)}else d.push(s)}return d}}]}const[at,ct,ft]=ut(1),[ht,dt,pt]=ut(.001);function mt(e,t){return e.map((e=>e.map(((l,n)=>0==n||8==n||null==l?l:t(1==n||0==e[8]?l:e[1]+l)))))}function gt(e,t){return(l,n,i,o,s)=>{let r,u,a,c,f,h,d=t.find((e=>s>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),i=l.getMonth(),o=l.getDate(),s=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=r&&d[2]||i!=u&&d[3]||o!=a&&d[4]||s!=c&&d[5]||p!=f&&d[6]||m!=h&&d[7]||d[1];return r=n,u=i,a=o,c=s,f=p,h=m,g(l)}))}}function xt(e,t,l){return new Date(e,t,l)}function wt(e,t){return t(e)}function _t(e,t){return(l,n)=>t(e(n))}N(2,-53,53,[1]);const kt={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},bt=[0,0];function vt(e,t,l){return e=>{0==e.button&&l(e)}}function yt(e,t,l){return l}const Mt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return bt[0]=t,bt[1]=l,bt},points:{show:function(e,t){let l=e.cursor.points,n=Se(),i=l.size(e,t);ye(n,ee,i),ye(n,te,i);let o=i/-2;ye(n,"marginLeft",o),ye(n,"marginTop",o);let s=l.width(e,t,i);return s&&ye(n,"borderWidth",s),n},size:function(e,t){return Bt(e.series[t].points.width,1)},width:0,stroke:function(e,t){let l=e.series[t].points;return l._stroke||l._fill},fill:function(e,t){let l=e.series[t].points;return l._fill||l._stroke}},bind:{mousedown:vt,mouseup:vt,click:vt,dblclick:vt,mousemove:yt,mouseleave:yt,mouseenter:yt},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(e,t,l){return l},idxs:null},St={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Et=$({},St,{filter:Y}),Dt=$({},Et,{size:10}),zt=$({},St,{show:!1}),Tt='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"',Pt="bold "+Tt,At={show:!0,scale:"x",stroke:se,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Pt,side:2,grid:Et,ticks:Dt,border:zt,font:Tt,rotate:0},Wt={show:!0,scale:"x",auto:!1,sorted:1,min:D,max:-D,idxs:[]};function Yt(e,t){return t.map((e=>null==e?"":d(e)))}function Ct(e,t,l,n,i,o,s){let r=[],u=G.get(i)||0;for(let e=l=s?l:I(R(l,i),u);n>=e;e=I(e+i,u))r.push(Object.is(e,-0)?0:e);return r}function Ft(e,t,l,n,i){const o=[],s=e.scales[e.axes[t].scale].log,r=x((10==s?M:S)(l));i=v(s,r),0>r&&(i=I(i,-r));let u=l;do{o.push(u),u=I(u+i,G.get(i)),i*s>u||(i=u)}while(n>=u);return o}function Ht(e,t,l,n,i){let o=e.scales[e.axes[t].scale].asinh,s=n>o?Ft(e,t,b(o,l),n,i):[o],r=0>n||l>0?[]:[0];return(-o>l?Ft(e,t,b(o,-n),-l,i):[o]).reverse().map((e=>-e)).concat(r,s)}const Rt=/./,Lt=/[12357]/,It=/[125]/,Gt=/1/;function Ot(e,t,l){let n=e.axes[l],i=n.scale,o=e.scales[i];if(3==o.distr&&2==o.log)return t;let s=e.valToPos,r=n._space,u=s(10,i),a=s(9,i)-u4==o.distr&&0==e||a.test(e)?e:null))}function Nt(e,t){return null==t?"":d(t)}const jt={show:!0,scale:"y",stroke:se,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Pt,side:3,grid:Et,ticks:Dt,border:zt,font:Tt,rotate:0};function Bt(e,t){return I((3+2*(e||1))*t,3)}const Vt={scale:null,auto:!0,sorted:0,min:D,max:-D},Ut={show:!0,auto:!0,sorted:0,alpha:1,facets:[$({},Vt,{scale:"x"}),$({},Vt,{scale:"y"})]},Jt={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:(e,t,l,n,i)=>i,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],i=e._data[0],o=e.valToPos(i[n[0]],l,!0),s=e.valToPos(i[n[1]],l,!0);return g(s-o)/(e.series[t].points.space*_e)>=n[1]-n[0]},filter:null},values:null,min:D,max:-D,idxs:[],path:null,clip:null};function qt(e,t,l){return l/10}const Kt={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Zt=$({},Kt,{time:!1,ori:1}),$t={};function Xt(e){let t=$t[e];return t||(t={key:e,plots:[],sub(e){t.plots.push(e)},unsub(e){t.plots=t.plots.filter((t=>t!=e))},pub(e,l,n,i,o,s,r){for(let u=0;t.plots.length>u;u++)t.plots[u]!=l&&t.plots[u].pub(e,l,n,i,o,s,r)}},null!=e&&($t[e]=t)),t}function Qt(e,t,l){const n=e.series[t],i=e.scales,o=e.bbox;let s=e._data[0],r=e._data[t],u=2==e.mode?i[n.facets[0].scale]:i[e.series[0].scale],a=2==e.mode?i[n.facets[1].scale]:i[n.scale],c=o.left,f=o.top,h=o.width,d=o.height,p=e.valToPosH,m=e.valToPosV;return 0==u.ori?l(n,s,r,u,a,p,m,c,f,h,d,rl,al,fl,dl,ml):l(n,s,r,u,a,m,p,f,c,d,h,ul,cl,hl,pl,gl)}function el(e,t){let l=0,n=0,i=c(e.bands,B);for(let e=0;i.length>e;e++){let o=i[e];o.series[0]==t?l=o.dir:o.series[1]==t&&(n|=1==o.dir?1:2)}return[l,1==n?-1:2==n?1:3==n?2:0]}function tl(e,t,l,n,i){let o=e.scales[e.series[t].scale];return-1==i?o.min:1==i?o.max:3==o.distr?1==o.dir?o.min:o.max:0}function ll(e,t,l,n,i,o){return Qt(e,t,((e,t,s,r,u,a,c,f,h,d,p)=>{let m=e.pxRound;const g=0==r.ori?al:cl;let x,w;1==r.dir*(0==r.ori?1:-1)?(x=l,w=n):(x=n,w=l);let _=m(a(t[x],r,d,f)),k=m(c(s[x],u,p,h)),b=m(a(t[w],r,d,f)),v=m(c(1==o?u.max:u.min,u,p,h)),y=new Path2D(i);return g(y,b,v),g(y,_,v),g(y,_,k),y}))}function nl(e,t,l,n,i,o){let s=null;if(e.length>0){s=new Path2D;const r=0==t?fl:hl;let u=l;for(let t=0;e.length>t;t++){let l=e[t];if(l[1]>l[0]){let e=l[0]-u;e>0&&r(s,u,n,e,n+o),u=l[1]}}let a=l+i-u;a>0&&r(s,u,n,a,n+o)}return s}function il(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])}function ol(e){return 0==e?W:1==e?w:t=>T(t,e)}function sl(e){let t=0==e?rl:ul,l=0==e?(e,t,l,n,i,o)=>{e.arcTo(t,l,n,i,o)}:(e,t,l,n,i,o)=>{e.arcTo(l,t,i,n,o)},n=0==e?(e,t,l,n,i)=>{e.rect(t,l,n,i)}:(e,t,l,n,i)=>{e.rect(l,t,i,n)};return(e,i,o,s,r,u=0)=>{0==u?n(e,i,o,s,r):(u=k(u,s/2,r/2),t(e,i+u,o),l(e,i+s,o,i+s,o+r,u),l(e,i+s,o+r,i,o+r,u),l(e,i,o+r,i,o,u),l(e,i,o,i+s,o,u),e.closePath())}}const rl=(e,t,l)=>{e.moveTo(t,l)},ul=(e,t,l)=>{e.moveTo(l,t)},al=(e,t,l)=>{e.lineTo(t,l)},cl=(e,t,l)=>{e.lineTo(l,t)},fl=sl(0),hl=sl(1),dl=(e,t,l,n,i,o)=>{e.arc(t,l,n,i,o)},pl=(e,t,l,n,i,o)=>{e.arc(l,t,n,i,o)},ml=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(t,l,n,i,o,s)},gl=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(l,t,i,n,s,o)};function xl(){return(e,t,l,n,i)=>Qt(e,t,((t,o,s,r,u,a,c,f,h,d,p)=>{let g,x,{pxRound:w,points:_}=t;0==r.ori?(g=rl,x=dl):(g=ul,x=pl);const k=I(_.width*_e,3);let b=(_.size-_.width)/2*_e,v=I(2*b,3),y=new Path2D,M=new Path2D,{left:S,top:E,width:D,height:z}=e.bbox;fl(M,S-v,E-v,D+2*v,z+2*v);const T=e=>{if(null!=s[e]){let t=w(a(o[e],r,d,f)),l=w(c(s[e],u,p,h));g(y,t+b,l),x(y,t,l,b,0,2*m)}};if(i)i.forEach(T);else for(let e=l;n>=e;e++)T(e);return{stroke:k>0?y:null,fill:y,clip:M,flags:3}}))}function wl(e){return(t,l,n,i,o,s)=>{n!=i&&(o!=n&&s!=n&&e(t,l,n),o!=i&&s!=i&&e(t,l,i),e(t,l,s))}}const _l=wl(al),kl=wl(cl);function bl(){return(e,l,n,i)=>Qt(e,l,((o,s,r,u,a,c,f,h,d,p,m)=>{let g,x,w=o.pxRound;0==u.ori?(g=al,x=_l):(g=cl,x=kl);const _=u.dir*(0==u.ori?1:-1),v={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},y=v.stroke;let M,S,E,z,T=D,P=-D,A=[],W=w(c(s[1==_?n:i],u,p,h)),Y=!1,C=!1,F=t(r,n,i,1*_),H=t(r,n,i,-1*_),R=w(c(s[F],u,p,h)),L=w(c(s[H],u,p,h));R>h&&il(A,h,R);for(let e=1==_?n:i;e>=n&&i>=e;e+=_){let t=w(c(s[e],u,p,h));if(t==W)null!=r[e]?(S=w(f(r[e],a,m,d)),T==D&&(g(y,t,S),M=S),T=k(S,T),P=b(S,P)):null===r[e]&&(Y=C=!0);else{let l=!1;T!=D?(x(y,W,T,P,M,S),E=z=W):Y&&(l=!0,Y=!1),null!=r[e]?(S=w(f(r[e],a,m,d)),g(y,t,S),T=P=M=S,C&&t-W>1&&(l=!0),C=!1):(T=D,P=-D,null===r[e]&&(Y=!0,t-W>1&&(l=!0))),l&&il(A,E,t),W=t}}T!=D&&T!=P&&z!=W&&x(y,W,T,P,M,S),h+p>L&&il(A,L,h+p);let[I,G]=el(e,l);if(null!=o.fill||0!=I){let t=v.fill=new Path2D(y),n=w(f(o.fillTo(e,l,o.min,o.max,I),a,m,d));g(t,L,n),g(t,R,n)}return v.gaps=A=o.gaps(e,l,n,i,A),o.spanGaps||(v.clip=nl(A,u.ori,h,d,p,m)),0!=G&&(v.band=2==G?[ll(e,l,n,i,y,-1),ll(e,l,n,i,y,1)]:ll(e,l,n,i,y,G)),v}))}function vl(e,t,l,n,i){const o=e.length;if(2>o)return null;const s=new Path2D;if(l(s,e[0],t[0]),2==o)n(s,e[1],t[1]);else{let l=Array(o),n=Array(o-1),r=Array(o-1),u=Array(o-1);for(let l=0;o-1>l;l++)r[l]=t[l+1]-t[l],u[l]=e[l+1]-e[l],n[l]=r[l]/u[l];l[0]=n[0];for(let e=1;o-1>e;e++)0===n[e]||0===n[e-1]||n[e-1]>0!=n[e]>0?l[e]=0:(l[e]=3*(u[e-1]+u[e])/((2*u[e]+u[e-1])/n[e-1]+(u[e]+2*u[e-1])/n[e]),isFinite(l[e])||(l[e]=0));l[o-1]=n[o-2];for(let n=0;o-1>n;n++)i(s,e[n]+u[n]/3,t[n]+l[n]*u[n]/3,e[n+1]-u[n]/3,t[n+1]-l[n+1]*u[n]/3,e[n+1],t[n+1])}return s}const yl=new Set;function Ml(){yl.forEach((e=>{e.syncRect(!0)}))}Ce("resize",we,Ml),Ce("scroll",we,Ml,!0);const Sl=bl(),El=xl();function Dl(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>zl(e,n,t,l)))}function zl(e,t,l,n){return $({},0==t?l:n,e)}function Tl(e,t,l){return null==t?V:[t,l]}const Pl=Tl;function Al(e,t,l){return null==t?V:a(t,l,.1,!0)}function Wl(e,t,l,n){return null==t?V:i(t,l,e.scales[n].log,!1)}const Yl=Wl;function Cl(e,t,l,n){return null==t?V:o(t,l,e.scales[n].log,!1)}const Fl=Cl;function Hl(t,l,n,i,o){let s=b(z(t),z(l)),r=l-t,u=e(o/i*r,n);do{let e=n[u],t=i*e/r;if(t>=o&&17>=s+(5>e?G.get(e):0))return[e,t]}while(++u(t=w((l=+n)*_e))+"px")),t,l]}function Ll(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=I(e[2]*_e,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Il(t,l,n){const r={mode:c(t.mode,1)},u=r.mode;function f(e,t){return((3==t.distr?M(e>0?e:t.clamp(r,e,t.min,t.max,t.key)):4==t.distr?E(e,t.asinh):e)-t._min)/(t._max-t._min)}function h(e,t,l,n){let i=f(e,t);return n+l*(-1==t.dir?1-i:i)}function d(e,t,l,n){let i=f(e,t);return n+l*(-1==t.dir?i:1-i)}function x(e,t,l,n){return 0==t.ori?h(e,t,l,n):d(e,t,l,n)}r.valToPosH=h,r.valToPosV=d;let y=!1;r.status=0;const S=r.root=Se("uplot");null!=t.id&&(S.id=t.id),be(S,t.class),t.title&&(Se("u-title",S).textContent=t.title);const z=Me("canvas"),W=r.ctx=z.getContext("2d"),L=Se("u-wrap",S),G=r.under=Se("u-under",L);L.appendChild(z);const O=r.over=Se("u-over",L),N=+c((t=Z(t)).pxAlign,1),X=ol(N);(t.plugins||[]).forEach((e=>{e.opts&&(t=e.opts(r,t)||t)}));const se=t.ms||.001,de=r.series=1==u?Dl(t.series||[],Wt,Jt,!1):function(e,t){return e.map(((e,l)=>0==l?null:$({},t,e)))}(t.series||[null],Ut),ke=r.axes=Dl(t.axes||[],At,jt,!0),Ee=r.scales={},ze=r.bands=t.bands||[];ze.forEach((e=>{e.fill=A(e.fill||null),e.dir=c(e.dir,-1)}));const Pe=2==u?de[1].facets[0].scale:de[0].scale,We={axes:function(){for(let e=0;ke.length>e;e++){let t=ke[e];if(!t.show||!t._show)continue;let l,n,i=t.side,o=i%2,s=t.stroke(r,e),u=0==i||3==i?-1:1;if(t.label){let e=w((t._lpos+t.labelGap*u)*_e);ql(t.labelFont[0],s,"center",2==i?le:ne),W.save(),1==o?(l=n=0,W.translate(e,w(Rt+It/2)),W.rotate((3==i?-m:m)/2)):(l=w(Pt+Lt/2),n=e),W.fillText(t.label,l,n),W.restore()}let[a,c]=t._found;if(0==c)continue;let f=Ee[t.scale],h=0==o?Lt:It,d=0==o?Pt:Rt,p=w(t.gap*_e),g=t._splits,_=2==f.distr?g.map((e=>jl[e])):g,k=2==f.distr?jl[g[1]]-jl[g[0]]:a,b=t.ticks,v=t.border,y=b.show?w(b.size*_e):0,M=t._rotate*-m/180,S=X(t._pos*_e),E=S+(y+p)*u;n=0==o?E:0,l=1==o?E:0,ql(t.font[0],s,1==t.align?ie:2==t.align?oe:M>0?ie:0>M?oe:0==o?"center":3==i?oe:ie,M||1==o?"middle":2==i?le:ne);let D=1.5*t.font[1],z=g.map((e=>X(x(e,f,h,d)))),T=t._values;for(let e=0;T.length>e;e++){let t=T[e];if(null!=t){0==o?l=z[e]:n=z[e],t=""+t;let i=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;i.length>e;e++){let t=i[e];M?(W.save(),W.translate(l,n+e*D),W.rotate(M),W.fillText(t,0,0),W.restore()):W.fillText(t,l,n+e*D)}}}b.show&&tn(z,b.filter(r,_,e,c,k),o,i,S,y,I(b.width*_e,3),b.stroke(r,e),b.dash,b.cap);let P=t.grid;P.show&&tn(z,P.filter(r,_,e,c,k),o,0==o?2:1,0==o?Rt:Pt,0==o?It:Lt,I(P.width*_e,3),P.stroke(r,e),P.dash,P.cap),v.show&&tn([S],[1],0==o?1:0,0==o?1:2,1==o?Rt:Pt,1==o?It:Lt,I(v.width*_e,3),v.stroke(r,e),v.dash,v.cap)}ti("drawAxes")},series:function(){pl>0&&(de.forEach(((e,t)=>{if(t>0&&e.show&&null==e._paths){let n=function(e){let t=P(ml-1,0,pl-1),l=P(gl+1,0,pl-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&pl-1>l;)l++;return[t,l]}(l[t]);e._paths=e.paths(r,t,n[0],n[1])}})),de.forEach(((e,t)=>{if(t>0&&e.show){Nl!=e.alpha&&(W.globalAlpha=Nl=e.alpha),Zl(t,!1),e._paths&&$l(t,!1);{Zl(t,!0);let l=e.points.show(r,t,ml,gl),n=e.points.filter(r,t,l,e._paths?e._paths.gaps:null);(l||n)&&(e.points._paths=e.points.paths(r,t,ml,gl,n),$l(t,!0))}1!=Nl&&(W.globalAlpha=Nl=1),ti("drawSeries",t)}})))}},Ye=(t.drawOrder||["axes","series"]).map((e=>We[e]));function He(e){let l=Ee[e];if(null==l){let n=(t.scales||j)[e]||j;if(null!=n.from)He(n.from),Ee[e]=$({},Ee[n.from],n,{key:e});else{l=Ee[e]=$({},e==Pe?Kt:Zt,n),l.key=e;let t=l.time,i=l.range,o=U(i);if((e!=Pe||2==u&&!t)&&(!o||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?s:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?s:{mode:1,hard:i[1],soft:i[1]}},o=!1),!o&&q(i))){let e=i;i=(t,l,n)=>null==l?V:a(l,n,e)}l.range=A(i||(t?Pl:e==Pe?3==l.distr?Yl:4==l.distr?Fl:Tl:3==l.distr?Wl:4==l.distr?Cl:Al)),l.auto=A(!o&&l.auto),l.clamp=A(l.clamp||qt),l._min=l._max=null}}}He("x"),He("y"),1==u&&de.forEach((e=>{He(e.scale)})),ke.forEach((e=>{He(e.scale)}));for(let e in t.scales)He(e);const Re=Ee[Pe],Le=Re.distr;let Ie,Ge;0==Re.ori?(be(S,"u-hz"),Ie=h,Ge=d):(be(S,"u-vt"),Ie=d,Ge=h);const Oe={};for(let e in Ee){let t=Ee[e];null==t.min&&null==t.max||(Oe[e]={min:t.min,max:t.max},t.min=t.max=null)}const Ne=t.tzDate||(e=>new Date(w(e/se))),je=t.fmtDate||Be,Ve=1==se?ft(Ne):pt(Ne),Ue=gt(Ne,mt(1==se?ct:dt,je)),Je=_t(Ne,wt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",je)),qe=[],Ke=r.legend=$({},kt,t.legend),Xe=Ke.show,Qe=Ke.markers;let et;Ke.idxs=qe,Qe.width=A(Qe.width),Qe.dash=A(Qe.dash),Qe.stroke=A(Qe.stroke),Qe.fill=A(Qe.fill);let tt,lt=[],nt=[],it=!1,ot={};if(Ke.live){const e=de[1]?de[1].values:null;it=null!=e,tt=it?e(r,1,0):{_:0};for(let e in tt)ot[e]="--"}if(Xe)if(et=Me("table","u-legend",S),it){let e=Me("tr","u-thead",et);for(var st in Me("th",null,e),tt)Me("th",ge,e).textContent=st}else be(et,"u-inline"),Ke.live&&be(et,"u-live");const rt={show:!0},ut={show:!1},xt=new Map;function bt(e,t,l){const n=xt.get(t)||{},i=il.bind[e](r,t,l);i&&(Ce(e,t,n[e]=i),xt.set(t,n))}function vt(e,t){const l=xt.get(t)||{};for(let n in l)null!=e&&n!=e||(Fe(n,t,l[n]),delete l[n]);null==e&&xt.delete(t)}let yt=0,St=0,Et=0,Dt=0,zt=0,Tt=0,Pt=0,Rt=0,Lt=0,It=0;r.bbox={};let Gt=!1,Vt=!1,$t=!1,Qt=!1,el=!1;function ll(e,t,l){(l||e!=r.width||t!=r.height)&&nl(e,t),on(!1),$t=!0,Vt=!0,Qt=el=il.left>=0,_n()}function nl(e,t){r.width=yt=Et=e,r.height=St=Dt=t,zt=Tt=0,function(){let e=!1,t=!1,l=!1,n=!1;ke.forEach((i=>{if(i.show&&i._show){let{side:o,_size:s}=i,r=o%2,u=s+(null!=i.label?i.labelSize:0);u>0&&(r?(Et-=u,3==o?(zt+=u,n=!0):l=!0):(Dt-=u,0==o?(Tt+=u,e=!0):t=!0))}})),cl[0]=e,cl[1]=l,cl[2]=t,cl[3]=n,Et-=dl[1]+dl[3],zt+=dl[3],Dt-=dl[2]+dl[0],Tt+=dl[0]}(),function(){let e=zt+Et,t=Tt+Dt,l=zt,n=Tt;function i(i,o){switch(i){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return l-=o,l+o;case 0:return n-=o,n+o}}ke.forEach((e=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),null!=e.label&&(e._lpos=i(t,e.labelSize))}}))}();let l=r.bbox;Pt=l.left=T(zt*_e,.5),Rt=l.top=T(Tt*_e,.5),Lt=l.width=T(Et*_e,.5),It=l.height=T(Dt*_e,.5)}r.setSize=function({width:e,height:t}){ll(e,t)};const il=r.cursor=$({},Mt,{drag:{y:2==u}},t.cursor);{il.idxs=qe,il._lock=!1;let e=il.points;e.show=A(e.show),e.size=A(e.size),e.stroke=A(e.stroke),e.width=A(e.width),e.fill=A(e.fill)}const sl=r.focus=$({},t.focus||{alpha:.3},il.focus),rl=sl.prox>=0;let ul=[null];function al(e,t){if(1==u||t>0){let t=1==u&&Ee[e.scale].time,l=e.value;e.value=t?J(l)?_t(Ne,wt(l,je)):l||Je:l||Nt,e.label=e.label||(t?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Sl||C,e.fillTo=A(e.fillTo||tl),e.pxAlign=+c(e.pxAlign,N),e.pxRound=ol(e.pxAlign),e.stroke=A(e.stroke||null),e.fill=A(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=Bt(e.width,1),l=e.points=$({},{size:t,width:b(1,.2*t),stroke:e.stroke,space:2*t,paths:El,_stroke:null,_fill:null},e.points);l.show=A(l.show),l.filter=A(l.filter),l.fill=A(l.fill),l.stroke=A(l.stroke),l.paths=A(l.paths),l.pxAlign=e.pxAlign}if(Xe){let l=function(e,t){if(0==t&&(it||!Ke.live||2==u))return V;let l=[],n=Me("tr","u-series",et,et.childNodes[t]);be(n,e.class),e.show||be(n,me);let i=Me("th",null,n);if(Qe.show){let e=Se("u-marker",i);if(t>0){let l=Qe.width(r,t);l&&(e.style.border=l+"px "+Qe.dash(r,t)+" "+Qe.stroke(r,t)),e.style.background=Qe.fill(r,t)}}let o=Se(ge,i);for(var s in o.textContent=e.label,t>0&&(Qe.show||(o.style.color=e.width>0?Qe.stroke(r,t):Qe.fill(r,t)),bt("click",i,(t=>{if(il._lock)return;let l=de.indexOf(e);if((t.ctrlKey||t.metaKey)!=Ke.isolate){let e=de.some(((e,t)=>t>0&&t!=l&&e.show));de.forEach(((t,n)=>{n>0&&Pn(n,e?n==l?rt:ut:rt,!0,li.setSeries)}))}else Pn(l,{show:!e.show},!0,li.setSeries)})),rl&&bt(ce,i,(()=>{il._lock||Pn(de.indexOf(e),Cn,!0,li.setSeries)}))),tt){let e=Me("td","u-value",n);e.textContent="--",l.push(e)}return[n,l]}(e,t);lt.splice(t,0,l[0]),nt.splice(t,0,l[1]),Ke.values.push(null)}if(il.show){qe.splice(t,0,null);let l=function(e,t){if(t>0){let l=il.points.show(r,t);if(l)return be(l,"u-cursor-pt"),be(l,e.class),De(l,-10,-10,Et,Dt),O.insertBefore(l,ul[t]),l}}(e,t);l&&ul.splice(t,0,l)}ti("addSeries",t)}r.addSeries=function(e,t){e=zl(e,t=null==t?de.length:t,Wt,Jt),de.splice(t,0,e),al(de[t],t)},r.delSeries=function(e){if(de.splice(e,1),Xe){Ke.values.splice(e,1),nt.splice(e,1);let t=lt.splice(e,1)[0];vt(null,t.firstChild),t.remove()}il.show&&(qe.splice(e,1),ul.length>1&&ul.splice(e,1)[0].remove()),ti("delSeries",e)};const cl=[!1,!1,!1,!1];function fl(e,t,l){let[n,i,o,s]=l,r=t%2,u=0;return 0==r&&(s||i)&&(u=0==t&&!n||2==t&&!o?w(At.size/3):0),1==r&&(n||o)&&(u=1==t&&!i||3==t&&!s?w(jt.size/2):0),u}const hl=r.padding=(t.padding||[fl,fl,fl,fl]).map((e=>A(c(e,fl)))),dl=r._padding=hl.map(((e,t)=>e(r,t,cl,0)));let pl,ml=null,gl=null;const xl=1==u?de[0].idxs:null;let wl,_l,kl,bl,vl,Ml,Il,Gl,Ol,Nl,jl=null,Bl=!1;function Vl(e,t){if(l=null==e?[]:Z(e,K),2==u){pl=0;for(let e=1;de.length>e;e++)pl+=l[e][0].length;r.data=l=e}else if(null==l[0]&&(l[0]=[]),r.data=l.slice(),jl=l[0],pl=jl.length,2==Le){l[0]=Array(pl);for(let e=0;pl>e;e++)l[0][e]=e}if(r._data=l,on(!0),ti("setData"),!1!==t){let e=Re;e.auto(r,Bl)?Ul():Tn(Pe,e.min,e.max),Qt=il.left>=0,el=!0,_n()}}function Ul(){let e,t;Bl=!0,1==u&&(pl>0?(ml=xl[0]=0,gl=xl[1]=pl-1,e=l[0][ml],t=l[0][gl],2==Le?(e=ml,t=gl):1==pl&&(3==Le?[e,t]=i(e,e,Re.log,!1):4==Le?[e,t]=o(e,e,Re.log,!1):Re.time?t=e+w(86400/se):[e,t]=a(e,t,.1,!0))):(ml=xl[0]=e=null,gl=xl[1]=t=null)),Tn(Pe,e,t)}function Jl(e="#0000",t,l=B,n="butt",i="#0000",o="round"){e!=wl&&(W.strokeStyle=wl=e),i!=_l&&(W.fillStyle=_l=i),t!=kl&&(W.lineWidth=kl=t),o!=vl&&(W.lineJoin=vl=o),n!=Ml&&(W.lineCap=Ml=n),l!=bl&&W.setLineDash(bl=l)}function ql(e,t,l,n){t!=_l&&(W.fillStyle=_l=t),e!=Il&&(W.font=Il=e),l!=Gl&&(W.textAlign=Gl=l),n!=Ol&&(W.textBaseline=Ol=n)}function Kl(e,t,l,n,i=0){if(e.auto(r,Bl)&&(null==t||null==t.min)){let t=c(ml,0),o=c(gl,n.length-1),s=null==l.min?3==e.distr?function(e,t,l){let n=D,i=-D;for(let o=t;l>=o;o++)e[o]>0&&(n=k(n,e[o]),i=b(i,e[o]));return[n==D?1:n,i==-D?10:i]}(n,t,o):function(e,t,l,n){let i=D,o=-D;if(1==n)i=e[t],o=e[l];else if(-1==n)i=e[l],o=e[t];else for(let n=t;l>=n;n++)null!=e[n]&&(i=k(i,e[n]),o=b(o,e[n]));return[i,o]}(n,t,o,i):[l.min,l.max];e.min=k(e.min,l.min=s[0]),e.max=b(e.max,l.max=s[1])}}function Zl(e,t){let l=t?de[e].points:de[e];l._stroke=l.stroke(r,e),l._fill=l.fill(r,e)}function $l(e,t){let n=t?de[e].points:de[e],i=n._stroke,o=n._fill,{stroke:s,fill:u,clip:a,flags:f}=n._paths,h=null,d=I(n.width*_e,3),p=d%2/2;t&&null==o&&(o=d>0?"#fff":i);let m=1==n.pxAlign;if(m&&W.translate(p,p),!t){let e=Pt,t=Rt,l=Lt,i=It,o=d*_e/2;0==n.min&&(i+=o),0==n.max&&(t-=o,i+=o),h=new Path2D,h.rect(e,t,l,i)}t?Xl(i,d,n.dash,n.cap,o,s,u,f,a):function(e,t,n,i,o,s,u,a,f,h,d){let p=!1;ze.forEach(((m,g)=>{if(m.series[0]==e){let e,x=de[m.series[1]],w=l[m.series[1]],_=(x._paths||j).band;U(_)&&(_=1==m.dir?_[0]:_[1]);let k=null;x.show&&_&&function(e,t,l){for(t=c(t,0),l=c(l,e.length-1);l>=t;){if(null!=e[t])return!0;t++}return!1}(w,ml,gl)?(k=m.fill(r,g)||s,e=x._paths.clip):_=null,Xl(t,n,i,o,k,u,a,f,h,d,e,_),p=!0}})),p||Xl(t,n,i,o,s,u,a,f,h,d)}(e,i,d,n.dash,n.cap,o,s,u,f,h,a),m&&W.translate(-p,-p)}function Xl(e,t,l,n,i,o,s,r,u,a,c,f){Jl(e,t,l,n,i),(u||a||f)&&(W.save(),u&&W.clip(u),a&&W.clip(a)),f?3==(3&r)?(W.clip(f),c&&W.clip(c),en(i,s),Ql(e,o,t)):2&r?(en(i,s),W.clip(f),Ql(e,o,t)):1&r&&(W.save(),W.clip(f),c&&W.clip(c),en(i,s),W.restore(),Ql(e,o,t)):(en(i,s),Ql(e,o,t)),(u||a||f)&&W.restore()}function Ql(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{W.strokeStyle=wl=t,W.stroke(e)})):null!=t&&e&&W.stroke(t))}function en(e,t){t instanceof Map?t.forEach(((e,t)=>{W.fillStyle=_l=t,W.fill(e)})):null!=t&&e&&W.fill(t)}function tn(e,t,l,n,i,o,s,r,u,a){let c=s%2/2;1==N&&W.translate(c,c),Jl(r,s,u,a,r),W.beginPath();let f,h,d,p,m=i+(0==n||3==n?-o:o);0==l?(h=i,p=m):(f=i,d=m);for(let n=0;e.length>n;n++)null!=t[n]&&(0==l?f=d=e[n]:h=p=e[n],W.moveTo(f,h),W.lineTo(d,p));W.stroke(),1==N&&W.translate(-c,-c)}function ln(e){let t=!0;return ke.forEach(((l,n)=>{if(!l.show)return;let i=Ee[l.scale];if(null==i.min)return void(l._show&&(t=!1,l._show=!1,on(!1)));l._show||(t=!1,l._show=!0,on(!1));let o=l.side,s=o%2,{min:u,max:a}=i,[c,f]=function(e,t,l,n){let i,o=ke[e];if(n>0){let s=o._space=o.space(r,e,t,l,n);i=Hl(t,l,o._incrs=o.incrs(r,e,t,l,n,s),n,s)}else i=[0,0];return o._found=i}(n,u,a,0==s?Et:Dt);if(0==f)return;let h=l._splits=l.splits(r,n,u,a,c,f,2==i.distr),d=2==i.distr?h.map((e=>jl[e])):h,p=2==i.distr?jl[h[1]]-jl[h[0]]:c,m=l._values=l.values(r,l.filter(r,d,n,f,p),n,f,p);l._rotate=2==o?l.rotate(r,m,n,f):0;let g=l._size;l._size=_(l.size(r,m,n,e)),null!=g&&l._size!=g&&(t=!1)})),t}function nn(e){let t=!0;return hl.forEach(((l,n)=>{let i=l(r,n,cl,e);i!=dl[n]&&(t=!1),dl[n]=i})),t}function on(e){de.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==u?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}r.setData=Vl;let sn,rn,un,an,cn,fn,hn,dn,pn,mn,gn,xn,wn=!1;function _n(){wn||(Q(kn),wn=!0)}function kn(){Gt&&(function(){let t=Z(Ee,K);for(let e in t){let l=t[e],n=Oe[e];if(null!=n&&null!=n.min)$(l,n),e==Pe&&on(!0);else if(e!=Pe||2==u)if(0==pl&&null==l.from){let t=l.range(r,null,null,e);l.min=t[0],l.max=t[1]}else l.min=D,l.max=-D}if(pl>0){de.forEach(((n,i)=>{if(1==u){let o=n.scale,s=t[o],u=Oe[o];if(0==i){let t=s.range(r,s.min,s.max,o);s.min=t[0],s.max=t[1],ml=e(s.min,l[0]),gl=e(s.max,l[0]),s.min>l[0][ml]&&ml++,l[0][gl]>s.max&&gl--,n.min=jl[ml],n.max=jl[gl]}else n.show&&n.auto&&Kl(s,u,n,l[i],n.sorted);n.idxs[0]=ml,n.idxs[1]=gl}else if(i>0&&n.show&&n.auto){let[e,o]=n.facets,s=e.scale,r=o.scale,[u,a]=l[i];Kl(t[s],Oe[s],e,u,e.sorted),Kl(t[r],Oe[r],o,a,o.sorted),n.min=o.min,n.max=o.max}}));for(let e in t){let l=t[e],n=Oe[e];if(null==l.from&&(null==n||null==n.min)){let t=l.range(r,l.min==D?null:l.min,l.max==-D?null:l.max,e);l.min=t[0],l.max=t[1]}}}for(let e in t){let l=t[e];if(null!=l.from){let n=t[l.from];if(null==n.min)l.min=l.max=null;else{let t=l.range(r,n.min,n.max,e);l.min=t[0],l.max=t[1]}}}let n={},i=!1;for(let e in t){let l=t[e],o=Ee[e];if(o.min!=l.min||o.max!=l.max){o.min=l.min,o.max=l.max;let t=o.distr;o._min=3==t?M(o.min):4==t?E(o.min,o.asinh):o.min,o._max=3==t?M(o.max):4==t?E(o.max,o.asinh):o.max,n[e]=i=!0}}if(i){de.forEach(((e,t)=>{2==u?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)}));for(let e in n)$t=!0,ti("setScale",e);il.show&&(Qt=el=il.left>=0)}for(let e in Oe)Oe[e]=null}(),Gt=!1),$t&&(function(){let e=!1,t=0;for(;!e;){t++;let l=ln(t),n=nn(t);e=3==t||l&&n,e||(nl(r.width,r.height),Vt=!0)}}(),$t=!1),Vt&&(ye(G,ie,zt),ye(G,le,Tt),ye(G,ee,Et),ye(G,te,Dt),ye(O,ie,zt),ye(O,le,Tt),ye(O,ee,Et),ye(O,te,Dt),ye(L,ee,yt),ye(L,te,St),z.width=w(yt*_e),z.height=w(St*_e),ke.forEach((({_el:e,_show:t,_size:l,_pos:n,side:i})=>{if(null!=e)if(t){let t=i%2==1;ye(e,t?"left":"top",n-(3===i||0===i?l:0)),ye(e,t?"width":"height",l),ye(e,t?"top":"left",t?Tt:zt),ye(e,t?"height":"width",t?Dt:Et),ve(e,me)}else be(e,me)})),wl=_l=kl=vl=Ml=Il=Gl=Ol=bl=null,Nl=1,Bn(!0),ti("setSize"),Vt=!1),yt>0&&St>0&&(W.clearRect(0,0,z.width,z.height),ti("drawClear"),Ye.forEach((e=>e())),ti("draw")),il.show&&Qt&&(Nn(null,!0,!1),Qt=!1),y||(y=!0,r.status=1,ti("ready")),Bl=!1,wn=!1}function bn(t,n){let i=Ee[t];if(null==i.from){if(0==pl){let e=i.range(r,n.min,n.max,t);n.min=e[0],n.max=e[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(pl>1&&null!=n.min&&null!=n.max&&1e-16>n.max-n.min)return;t==Pe&&2==i.distr&&pl>0&&(n.min=e(n.min,l[0]),n.max=e(n.max,l[0]),n.min==n.max&&n.max++),Oe[t]=n,Gt=!0,_n()}}r.redraw=(e,t)=>{$t=t||!1,!1!==e?Tn(Pe,Re.min,Re.max):_n()},r.setScale=bn;let vn=!1;const yn=il.drag;let Mn=yn.x,Sn=yn.y;il.show&&(il.x&&(sn=Se("u-cursor-x",O)),il.y&&(rn=Se("u-cursor-y",O)),0==Re.ori?(un=sn,an=rn):(un=rn,an=sn),gn=il.left,xn=il.top);const En=r.select=$({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Dn=En.show?Se("u-select",En.over?O:G):null;function zn(e,t){if(En.show){for(let t in e)ye(Dn,t,En[t]=e[t]);!1!==t&&ti("setSelect")}}function Tn(e,t,l){bn(e,{min:t,max:l})}function Pn(e,t,l,n){let i=de[e];null!=t.focus&&function(e){if(e!=Yn){let t=null==e,l=1!=sl.alpha;de.forEach(((n,i)=>{let o=t||0==i||i==e;n._focus=t?null:o,l&&function(e,t){de[e].alpha=t,il.show&&ul[e]&&(ul[e].style.opacity=t),Xe&<[e]&&(lt[e].style.opacity=t)}(i,o?1:sl.alpha)})),Yn=e,l&&_n()}}(e),null!=t.show&&(i.show=t.show,function(e){let t=Xe?lt[e]:null;de[e].show?t&&ve(t,me):(t&&be(t,me),ul.length>1&&De(ul[e],-10,-10,Et,Dt))}(e),Tn(2==u?i.facets[1].scale:i.scale,null,null),_n()),!1!==l&&ti("setSeries",e,t),n&&oi("setSeries",r,e,t)}let An,Wn,Yn;r.setSelect=zn,r.setSeries=Pn,r.addBand=function(e,t){e.fill=A(e.fill||null),e.dir=c(e.dir,-1),ze.splice(t=null==t?ze.length:t,0,e)},r.setBand=function(e,t){$(ze[e],t)},r.delBand=function(e){null==e?ze.length=0:ze.splice(e,1)};const Cn={focus:!0};function Fn(e,t,l){let n=Ee[t];l&&(e=e/_e-(1==n.ori?Tt:zt));let i=Et;1==n.ori&&(i=Dt,e=i-e),-1==n.dir&&(e=i-e);let o=n._min,s=o+e/i*(n._max-o),r=n.distr;return 3==r?v(10,s):4==r?((e,t=1)=>p.sinh(e)*t)(s,n.asinh):s}function Hn(e,t){ye(Dn,ie,En.left=e),ye(Dn,ee,En.width=t)}function Rn(e,t){ye(Dn,le,En.top=e),ye(Dn,te,En.height=t)}Xe&&rl&&Ce(fe,et,(()=>{il._lock||null!=Yn&&Pn(null,Cn,!0,li.setSeries)})),r.valToIdx=t=>e(t,l[0]),r.posToIdx=function(t,n){return e(Fn(t,Pe,n),l[0],ml,gl)},r.posToVal=Fn,r.valToPos=(e,t,l)=>0==Ee[t].ori?h(e,Ee[t],l?Lt:Et,l?Pt:0):d(e,Ee[t],l?It:Dt,l?Rt:0),r.batch=function(e){e(r),_n()},r.setCursor=(e,t,l)=>{gn=e.left,xn=e.top,Nn(null,t,l)};let Ln=0==Re.ori?Hn:Rn,In=1==Re.ori?Hn:Rn;function Gn(e,t){if(null!=e){let t=e.idx;Ke.idx=t,de.forEach(((e,l)=>{(l>0||!it)&&On(l,t)}))}Xe&&Ke.live&&function(){if(Xe&&Ke.live)for(let e=2==u?1:0;de.length>e;e++){if(0==e&&it)continue;let t=Ke.values[e],l=0;for(let n in t)nt[e][l++].firstChild.nodeValue=t[n]}}(),el=!1,!1!==t&&ti("setLegend")}function On(e,t){let n;if(null==t)n=ot;else{let i=de[e],o=0==e&&2==Le?jl:l[e];n=it?i.values(r,e,t):{_:i.value(r,o[t],e,t)}}Ke.values[e]=n}function Nn(t,n,i){let o;pn=gn,mn=xn,[gn,xn]=il.move(r,gn,xn),il.show&&(un&&De(un,w(gn),0,Et,Dt),an&&De(an,0,w(xn),Et,Dt)),An=D;let s=0==Re.ori?Et:Dt,a=1==Re.ori?Et:Dt;if(0>gn||0==pl||ml>gl){o=null;for(let e=0;de.length>e;e++)e>0&&ul.length>1&&De(ul[e],-10,-10,Et,Dt);if(rl&&Pn(null,Cn,!0,null==t&&li.setSeries),Ke.live){qe.fill(null),el=!0;for(let e=0;de.length>e;e++)Ke.values[e]=ot}}else{let t,n,i;1==u&&(t=0==Re.ori?gn:xn,n=Fn(t,Pe),o=e(n,l[0],ml,gl),i=R(Ie(l[0][o],Re,s,0),.5));for(let e=2==u?1:0;de.length>e;e++){let t=de[e],c=qe[e],f=1==u?l[e][c]:l[e][1][c],h=il.dataIdx(r,e,o,n),d=1==u?l[e][h]:l[e][1][h];el=el||d!=f||h!=c,qe[e]=h;let p=h==o?i:R(Ie(1==u?l[0][h]:l[e][0][h],Re,s,0),.5);if(e>0&&t.show){let l,n,i=null==d?-10:R(Ge(d,1==u?Ee[t.scale]:Ee[t.facets[1].scale],a,0),.5);if(i>0&&1==u){let t=g(i-xn);t>An||(An=t,Wn=e)}if(0==Re.ori?(l=p,n=i):(l=i,n=p),el&&ul.length>1){Te(ul[e],il.points.fill(r,e),il.points.stroke(r,e));let t,i,o,s,u=!0,a=il.points.bbox;if(null!=a){u=!1;let l=a(r,e);o=l.left,s=l.top,t=l.width,i=l.height}else o=l,s=n,t=i=il.points.size(r,e);Ae(ul[e],t,i,u),De(ul[e],o,s,Et,Dt)}}if(Ke.live){if(!el||0==e&&it)continue;On(e,h)}}}if(il.idx=o,il.left=gn,il.top=xn,el&&(Ke.idx=o,Gn()),En.show&&vn)if(null!=t){let[e,l]=li.scales,[n,i]=li.match,[o,r]=t.cursor.sync.scales,u=t.cursor.drag;if(Mn=u._x,Sn=u._y,Mn||Sn){let u,c,f,h,d,{left:p,top:m,width:x,height:w}=t.select,_=t.scales[e].ori,b=t.posToVal,v=null!=e&&n(e,o),y=null!=l&&i(l,r);v?(0==_?(u=p,c=x):(u=m,c=w),f=Ee[e],h=Ie(b(u,o),f,s,0),d=Ie(b(u+c,o),f,s,0),Ln(k(h,d),g(d-h))):Ln(0,s),y?(1==_?(u=p,c=x):(u=m,c=w),f=Ee[l],h=Ge(b(u,r),f,a,0),d=Ge(b(u+c,r),f,a,0),In(k(h,d),g(d-h))):In(0,a)}else qn()}else{let e=g(pn-cn),t=g(mn-fn);if(1==Re.ori){let l=e;e=t,t=l}Mn=yn.x&&e>=yn.dist,Sn=yn.y&&t>=yn.dist;let l,n,i=yn.uni;null!=i?Mn&&Sn&&(Mn=e>=i,Sn=t>=i,Mn||Sn||(t>e?Sn=!0:Mn=!0)):yn.x&&yn.y&&(Mn||Sn)&&(Mn=Sn=!0),Mn&&(0==Re.ori?(l=hn,n=gn):(l=dn,n=xn),Ln(k(l,n),g(n-l)),Sn||In(0,a)),Sn&&(1==Re.ori?(l=hn,n=gn):(l=dn,n=xn),In(k(l,n),g(n-l)),Mn||Ln(0,s)),Mn||Sn||(Ln(0,0),In(0,0))}if(yn._x=Mn,yn._y=Sn,null==t){if(i){if(null!=ni){let[e,t]=li.scales;li.values[0]=null!=e?Fn(0==Re.ori?gn:xn,e):null,li.values[1]=null!=t?Fn(1==Re.ori?gn:xn,t):null}oi(re,r,gn,xn,Et,Dt,o)}if(rl){let e=i&&li.setSeries,t=sl.prox;null==Yn?An>t||Pn(Wn,Cn,!0,e):An>t?Pn(null,Cn,!0,e):Wn!=Yn&&Pn(Wn,Cn,!0,e)}}y&&!1!==n&&ti("setCursor")}r.setLegend=Gn;let jn=null;function Bn(e){!0===e?jn=null:(jn=O.getBoundingClientRect(),ti("syncRect",jn))}function Vn(e,t,l,n,i,o){il._lock||(Un(e,t,l,n,i,o,0,!1,null!=e),null!=e?Nn(null,!0,!0):Nn(t,!0,!1))}function Un(e,t,l,n,i,o,s,u,a){if(null==jn&&Bn(!1),null!=e)l=e.clientX-jn.left,n=e.clientY-jn.top;else{if(0>l||0>n)return gn=-10,void(xn=-10);let[e,s]=li.scales,r=t.cursor.sync,[u,a]=r.values,[c,f]=r.scales,[h,d]=li.match,p=t.axes[0].side%2==1,m=0==Re.ori?Et:Dt,g=1==Re.ori?Et:Dt,w=p?o:i,_=p?i:o,k=p?n:l,b=p?l:n;if(l=null!=c?h(e,c)?x(u,Ee[e],m,0):-10:m*(k/w),n=null!=f?d(s,f)?x(a,Ee[s],g,0):-10:g*(b/_),1==Re.ori){let e=l;l=n,n=e}}a&&(l>1&&Et-1>l||(l=T(l,Et)),n>1&&Dt-1>n||(n=T(n,Dt))),u?(cn=l,fn=n,[hn,dn]=il.move(r,l,n)):(gn=l,xn=n)}const Jn={width:0,height:0};function qn(){zn(Jn,!1)}function Kn(e,t,l,n,i,o){vn=!0,Mn=Sn=yn._x=yn._y=!1,Un(e,t,l,n,i,o,0,!0,!1),null!=e&&(bt(ae,xe,Zn),oi(ue,r,hn,dn,Et,Dt,null))}function Zn(e,t,l,n,i,o){vn=yn._x=yn._y=!1,Un(e,t,l,n,i,o,0,!1,!0);let{left:s,top:u,width:a,height:c}=En,f=a>0||c>0;if(f&&zn(En),yn.setScale&&f){let e=s,t=a,l=u,n=c;if(1==Re.ori&&(e=u,t=c,l=s,n=a),Mn&&Tn(Pe,Fn(e,Pe),Fn(e+t,Pe)),Sn)for(let e in Ee){let t=Ee[e];e!=Pe&&null==t.from&&t.min!=D&&Tn(e,Fn(l+n,e),Fn(l,e))}qn()}else il.lock&&(il._lock=!il._lock,il._lock||Nn(null,!0,!1));null!=e&&(vt(ae,xe),oi(ae,r,gn,xn,Et,Dt,null))}function $n(e){Ul(),qn(),null!=e&&oi(he,r,gn,xn,Et,Dt,null)}function Xn(){ke.forEach(Ll),ll(r.width,r.height,!0)}Ce(pe,we,Xn);const Qn={};Qn.mousedown=Kn,Qn.mousemove=Vn,Qn.mouseup=Zn,Qn.dblclick=$n,Qn.setSeries=(e,t,l,n)=>{Pn(l,n,!0,!1)},il.show&&(bt(ue,O,Kn),bt(re,O,Vn),bt(ce,O,Bn),bt(fe,O,(function(){if(!il._lock){let e=vn;if(vn){let e,t,l=!0,n=!0,i=10;0==Re.ori?(e=Mn,t=Sn):(e=Sn,t=Mn),e&&t&&(l=i>=gn||gn>=Et-i,n=i>=xn||xn>=Dt-i),e&&l&&(gn=hn>gn?0:Et),t&&n&&(xn=dn>xn?0:Dt),Nn(null,!0,!0),vn=!1}gn=-10,xn=-10,Nn(null,!0,!0),e&&(vn=e)}})),bt(he,O,$n),yl.add(r),r.syncRect=Bn);const ei=r.hooks=t.hooks||{};function ti(e,t,l){e in ei&&ei[e].forEach((e=>{e.call(null,r,t,l)}))}(t.plugins||[]).forEach((e=>{for(let t in e.hooks)ei[t]=(ei[t]||[]).concat(e.hooks[t])}));const li=$({key:null,setSeries:!1,filters:{pub:F,sub:F},scales:[Pe,de[1]?de[1].scale:null],match:[H,H],values:[null,null]},il.sync);il.sync=li;const ni=li.key,ii=Xt(ni);function oi(e,t,l,n,i,o,s){li.filters.pub(e,t,l,n,i,o,s)&&ii.pub(e,t,l,n,i,o,s)}function si(){ti("init",t,l),Vl(l||t.data,!1),Oe[Pe]?bn(Pe,Oe[Pe]):Ul(),ll(t.width,t.height),Nn(null,!0,!1),zn(En,!1)}return ii.sub(r),r.pub=function(e,t,l,n,i,o,s){li.filters.sub(e,t,l,n,i,o,s)&&Qn[e](null,t,l,n,i,o,s)},r.destroy=function(){ii.unsub(r),yl.delete(r),xt.clear(),Fe(pe,we,Xn),S.remove(),ti("destroy")},de.forEach(al),ke.forEach((function(e,t){if(e._show=e.show,e.show){let l=e.side%2,n=Ee[e.scale];null==n&&(e.scale=l?de[1].scale:Pe,n=Ee[e.scale]);let i=n.time;e.size=A(e.size),e.space=A(e.space),e.rotate=A(e.rotate),e.incrs=A(e.incrs||(2==n.distr?Ze:i?1==se?at:ht:$e)),e.splits=A(e.splits||(i&&1==n.distr?Ve:3==n.distr?Ft:4==n.distr?Ht:Ct)),e.stroke=A(e.stroke),e.grid.stroke=A(e.grid.stroke),e.ticks.stroke=A(e.ticks.stroke),e.border.stroke=A(e.border.stroke);let o=e.values;e.values=U(o)&&!U(o[0])?A(o):i?U(o)?gt(Ne,mt(o,je)):J(o)?function(e,t){let l=Be(t);return(t,n)=>n.map((t=>l(e(t))))}(Ne,o):o||Ue:o||Yt,e.filter=A(e.filter||(3>n.distr?Y:Ot)),e.font=Rl(e.font),e.labelFont=Rl(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(cl[t]=!0,e._el=Se("u-axis",L))}})),n?n instanceof HTMLElement?(n.appendChild(S),si()):n(r,si):si(),r}Il.assign=$,Il.fmtNum=d,Il.rangeNum=a,Il.rangeLog=i,Il.rangeAsinh=o,Il.orient=Qt,Il.join=function(e,t){let l=new Set;for(let t=0;e.length>t;t++){let n=e[t][0],i=n.length;for(let e=0;i>e;e++)l.add(n[e])}let n=[Array.from(l).sort(((e,t)=>e-t))],i=n[0].length,o=new Map;for(let e=0;i>e;e++)o.set(n[0][e],e);for(let l=0;e.length>l;l++){let s=e[l],r=s[0];for(let e=1;s.length>e;e++){let u=s[e],a=Array(i).fill(void 0),c=t?t[l][e]:1,f=[];for(let e=0;u.length>e;e++){let t=u[e],l=o.get(r[e]);null===t?0!=c&&(a[l]=t,2==c&&f.push(l)):a[l]=t}X(a,f,i),n.push(a)}}return n},Il.fmtDate=Be,Il.tzDate=function(e,t){let l;return"UTC"==t||"Etc/UTC"==t?l=new Date(+e+6e4*e.getTimezoneOffset()):t==Ve?l=e:(l=new Date(e.toLocaleString("en-US",{timeZone:t})),l.setMilliseconds(e.getMilliseconds())),l},Il.sync=Xt;{Il.addGap=il,Il.clipGaps=nl;let e=Il.paths={points:xl};e.linear=bl,e.stepped=function(e){const l=c(e.align,1),n=c(e.ascDesc,!1);return(e,i,o,s)=>Qt(e,i,((r,u,a,c,f,h,d,p,m,g,x)=>{let w=r.pxRound,_=0==c.ori?al:cl;const k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},b=k.stroke,v=1*c.dir*(0==c.ori?1:-1);o=t(a,o,s,1),s=t(a,o,s,-1);let y=[],M=!1,S=w(d(a[1==v?o:s],f,x,m)),E=w(h(u[1==v?o:s],c,g,p)),D=E;_(b,E,S);for(let e=1==v?o:s;e>=o&&s>=e;e+=v){let t=a[e],n=w(h(u[e],c,g,p));if(null==t){null===t&&(il(y,D,n),M=!0);continue}let i=w(d(t,f,x,m));M&&(il(y,D,n),M=!1),1==l?_(b,n,S):_(b,D,i),_(b,n,i),S=i,D=n}let[z,T]=el(e,i);if(null!=r.fill||0!=z){let t=k.fill=new Path2D(b),l=w(d(r.fillTo(e,i,r.min,r.max,z),f,x,m));_(t,D,l),_(t,E,l)}k.gaps=y=r.gaps(e,i,o,s,y);let P=r.width*_e/2,A=n||1==l?P:-P,W=n||-1==l?-P:P;return y.forEach((e=>{e[0]+=A,e[1]+=W})),r.spanGaps||(k.clip=nl(y,c.ori,p,m,g,x)),0!=T&&(k.band=2==T?[ll(e,i,o,s,b,-1),ll(e,i,o,s,b,1)]:ll(e,i,o,s,b,T)),k}))},e.bars=function(e){const t=c((e=e||j).size,[.6,D,1]),l=e.align||0,n=(e.gap||0)*_e,i=c(e.radius,0),o=1-t[0],s=c(t[1],D)*_e,r=c(t[2],1)*_e,u=c(e.disp,j),a=c(e.each,(()=>{})),{fill:f,stroke:h}=u;return(e,t,d,p)=>Qt(e,t,((m,w,_,v,y,M,S,E,D,z,T)=>{let P=m.pxRound;const A=v.dir*(0==v.ori?1:-1),W=y.dir*(1==y.ori?1:-1);let Y,C,F=0==v.ori?fl:hl,H=0==v.ori?a:(e,t,l,n,i,o,s)=>{a(e,t,l,i,n,s,o)},[R,L]=el(e,t),I=3==y.distr?1==R?y.max:y.min:0,G=S(I,y,T,D),O=P(m.width*_e),N=!1,j=null,B=null,V=null,U=null;null==f||0!=O&&null==h||(N=!0,j=f.values(e,t,d,p),B=new Map,new Set(j).forEach((e=>{null!=e&&B.set(e,new Path2D)})),O>0&&(V=h.values(e,t,d,p),U=new Map,new Set(V).forEach((e=>{null!=e&&U.set(e,new Path2D)}))));let{x0:J,size:q}=u;if(null!=J&&null!=q){w=J.values(e,t,d,p),2==J.unit&&(w=w.map((t=>e.posToVal(E+t*z,v.key,!0))));let l=q.values(e,t,d,p);C=2==q.unit?l[0]*z:M(l[0],v,z,E)-M(0,v,z,E),C=P(C-O),Y=1==A?-O/2:C+O/2}else{let e=z;if(w.length>1){let t=null;for(let l=0,n=1/0;w.length>l;l++)if(void 0!==_[l]){if(null!=t){let i=g(w[l]-w[t]);n>i&&(n=i,e=g(M(w[l],v,z,E)-M(w[t],v,z,E)))}t=l}}C=P(k(s,b(r,e-e*o))-O-n),Y=(0==l?C/2:l==A?0:C)-l*A*n/2}const K={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let Z;0!=L&&(K.band=new Path2D,Z=P(S(1==L?y.max:y.min,y,T,D)));const $=N?null:new Path2D,X=K.band;let{y0:Q,y1:ee}=u,te=null;null!=Q&&null!=ee&&(_=ee.values(e,t,d,p),te=Q.values(e,t,d,p));for(let l=1==A?d:p;l>=d&&p>=l;l+=A){let n=_[l],o=M(2!=v.distr||null!=u?w[l]:l,v,z,E),s=S(c(n,I),y,T,D);null!=te&&null!=n&&(G=S(te[l],y,T,D));let r=P(o-Y),a=P(b(s,G)),f=P(k(s,G)),h=a-f,d=i*C;null!=n&&(N?(O>0&&null!=V[l]&&F(U.get(V[l]),r,f+x(O/2),C,b(0,h-O),d),null!=j[l]&&F(B.get(j[l]),r,f+x(O/2),C,b(0,h-O),d)):F($,r,f+x(O/2),C,b(0,h-O),d),H(e,t,l,r-O/2,f,C+O,h)),0!=L&&(W*L==1?(a=f,f=Z):(f=a,a=Z),h=a-f,F(X,r-O/2,f,C+O,b(0,h),0))}return O>0&&(K.stroke=N?U:$),K.fill=N?B:$,K}))},e.spline=function(){return function(e){return(l,n,i,o)=>Qt(l,n,((s,r,u,a,c,f,h,d,p,m,g)=>{let x,w,_,k=s.pxRound;0==a.ori?(x=rl,_=al,w=ml):(x=ul,_=cl,w=gl);const b=1*a.dir*(0==a.ori?1:-1);i=t(u,i,o,1),o=t(u,i,o,-1);let v=[],y=!1,M=k(f(r[1==b?i:o],a,m,d)),S=M,E=[],D=[];for(let e=1==b?i:o;e>=i&&o>=e;e+=b){let t=u[e],l=f(r[e],a,m,d);null!=t?(y&&(il(v,S,l),y=!1),E.push(S=l),D.push(h(u[e],c,g,p))):null===t&&(il(v,S,l),y=!0)}const z={stroke:e(E,D,x,_,w,k),fill:null,clip:null,band:null,gaps:null,flags:1},T=z.stroke;let[P,A]=el(l,n);if(null!=s.fill||0!=P){let e=z.fill=new Path2D(T),t=k(h(s.fillTo(l,n,s.min,s.max,P),c,g,p));_(e,S,t),_(e,M,t)}return z.gaps=v=s.gaps(l,n,i,o,v),s.spanGaps||(z.clip=nl(v,a.ori,d,p,m,g)),0!=A&&(z.band=2==A?[ll(l,n,i,o,T,-1),ll(l,n,i,o,T,1)]:ll(l,n,i,o,T,A)),z}))}(vl)}}return Il}();
+var uPlot=function(){"use strict";function e(e,t,l,n){let i;l=l||0;let o=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=o?l+n>>1:x((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function t(e,t,l,n){for(let i=1==n?t:l;i>=t&&l>=i;i+=n)if(null!=e[i])return i;return-1}const l=[0,0];function n(e,t,n,i){return l[0]=0>n?I(e,-n):e,l[1]=0>i?I(t,-i):t,l}function i(e,t,l,i){let o,s,r,u=y(e),a=10==l?M:S;return e==t&&(-1==u?(e*=l,t/=l):(e/=l,t*=l)),i?(o=x(a(e)),s=_(a(t)),r=n(v(l,o),v(l,s),o,s),e=r[0],t=r[1]):(o=x(a(g(e))),s=x(a(g(t))),r=n(v(l,o),v(l,s),o,s),e=L(e,r[0]),t=R(t,r[1])),[e,t]}function o(e,t,l,n){let o=i(e,t,l,n);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}const s={mode:3,pad:.1},r={pad:0,soft:null,mode:0},u={min:r,max:r};function a(e,t,l,n){return q(l)?f(e,t,l):(r.pad=l,r.soft=n?0:null,r.mode=n?3:0,f(e,t,u))}function c(e,t){return null==e?t:e}function f(e,t,l){let n=l.min,i=l.max,o=c(n.pad,0),s=c(i.pad,0),r=c(n.hard,-D),u=c(i.hard,D),a=c(n.soft,D),f=c(i.soft,-D),h=c(n.mode,0),d=c(i.mode,0),p=t-e;1e-9>p&&(p=0,0!=e&&0!=t||(p=1e-9,2==h&&a!=D&&(o=0),2==d&&f!=-D&&(s=0)));let m=p||g(t)||1e3,w=M(m),_=v(10,x(w)),y=I(L(e-m*(0==p?0==e?.1:1:o),_/10),9),S=a>e||1!=h&&(3!=h||y>a)&&(2!=h||a>y)?D:a,E=b(r,S>y&&e>=S?S:k(S,y)),z=I(R(t+m*(0==p?0==t?.1:1:s),_/10),9),T=t>f||1!=d&&(3!=d||f>z)&&(2!=d||z>f)?-D:f,P=k(u,z>T&&T>=t?T:b(T,z));return E==P&&0==E&&(P=100),[E,P]}const h=new Intl.NumberFormat(navigator.language),d=e=>h.format(e),p=Math,m=p.PI,g=p.abs,x=p.floor,w=p.round,_=p.ceil,k=p.min,b=p.max,v=p.pow,y=p.sign,M=p.log10,S=p.log2,E=(e,t=1)=>p.asinh(e/t),D=1/0;function z(e){return 1+(0|M((e^e>>31)-(e>>31)))}function T(e,t){return w(e/t)*t}function P(e,t,l){return k(b(e,t),l)}function A(e){return"function"==typeof e?e:()=>e}const W=e=>e,Y=(e,t)=>t,C=()=>null,F=()=>!0,H=(e,t)=>e==t;function R(e,t){return _(e/t)*t}function L(e,t){return x(e/t)*t}function I(e,t){return w(e*(t=10**t))/t}const G=new Map;function O(e){return((""+e).split(".")[1]||"").length}function N(e,t,l,n){let i=[],o=n.map(O);for(let s=t;l>s;s++){let t=g(s),l=I(v(e,s),t);for(let e=0;n.length>e;e++){let r=n[e]*l,u=(0>r||0>s?t:0)+(o[e]>s?o[e]:0),a=I(r,u);i.push(a),G.set(a,u)}}return i}const j={},B=[],V=[null,null],U=Array.isArray;function J(e){return"string"==typeof e}function q(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function K(e){return null!=e&&"object"==typeof e}function Z(e,t=q){let l;if(U(e)){let n=e.find((e=>null!=e));if(U(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=Z(e[n],t)}else l=e.slice()}else if(t(e)){l={};for(let n in e)l[n]=Z(e[n],t)}else l=e;return l}function $(e){let t=arguments;for(let l=1;t.length>l;l++){let n=t[l];for(let t in n)q(e[t])?$(e[t],Z(n[t])):e[t]=Z(n[t])}return e}function X(e,t,l){for(let n,i=0,o=-1;t.length>i;i++){let s=t[i];if(s>o){for(n=s-1;n>=0&&null==e[n];)e[n--]=null;for(n=s+1;l>n&&null==e[n];)e[o=n++]=null}}}const Q="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask,ee="width",te="height",le="top",ne="bottom",ie="left",oe="right",se="#000",re="mousemove",ue="mousedown",ae="mouseup",ce="mouseenter",fe="mouseleave",he="dblclick",de="change",pe="dppxchange",me="u-off",ge="u-label",xe=document,we=window;let _e,ke;function be(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function ve(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function ye(e,t,l){e.style[t]=l+"px"}function Me(e,t,l,n){let i=xe.createElement(e);return null!=t&&be(i,t),null!=l&&l.insertBefore(i,n),i}function Se(e,t){return Me("div",e,t)}const Ee=new WeakMap;function De(e,t,l,n,i){let o="translate("+t+"px,"+l+"px)";o!=Ee.get(e)&&(e.style.transform=o,Ee.set(e,o),0>t||0>l||t>n||l>i?be(e,me):ve(e,me))}const ze=new WeakMap;function Te(e,t,l){let n=t+l;n!=ze.get(e)&&(ze.set(e,n),e.style.background=t,e.style.borderColor=l)}const Pe=new WeakMap;function Ae(e,t,l,n){let i=t+""+l;i!=Pe.get(e)&&(Pe.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const We={passive:!0},Ye=$({capture:!0},We);function Ce(e,t,l,n){t.addEventListener(e,l,n?Ye:We)}function Fe(e,t,l,n){t.removeEventListener(e,l,n?Ye:We)}!function e(){let t=devicePixelRatio;_e!=t&&(_e=t,ke&&Fe(de,ke,e),ke=matchMedia(`(min-resolution: ${_e-.001}dppx) and (max-resolution: ${_e+.001}dppx)`),Ce(de,ke,e),we.dispatchEvent(new CustomEvent(pe)))}();const He=["January","February","March","April","May","June","July","August","September","October","November","December"],Re=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Le(e){return e.slice(0,3)}const Ie=Re.map(Le),Ge=He.map(Le),Oe={MMMM:He,MMM:Ge,WWWW:Re,WWW:Ie};function Ne(e){return(10>e?"0":"")+e}const je={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>Ne(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Ne(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Ne(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>12>e.getHours()?"AM":"PM",aa:e=>12>e.getHours()?"am":"pm",a:e=>12>e.getHours()?"a":"p",mm:e=>Ne(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Ne(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>function(e){return(10>e?"00":100>e?"0":"")+e}(e.getMilliseconds())};function Be(e,t){t=t||Oe;let l,n=[],i=/\{([a-z]+)\}|[^{]+/gi;for(;l=i.exec(e);)n.push("{"==l[0][0]?je[l[1]]:l[0]);return e=>{let l="";for(let i=0;n.length>i;i++)l+="string"==typeof n[i]?n[i]:n[i](e,t);return l}}const Ve=(new Intl.DateTimeFormat).resolvedOptions().timeZone,Ue=e=>e%1==0,Je=[1,2,2.5,5],qe=N(10,-16,0,Je),Ke=N(10,0,16,Je),Ze=Ke.filter(Ue),$e=qe.concat(Ke),Xe="{YYYY}",Qe="\n"+Xe,et="{M}/{D}",tt="\n"+et,lt=tt+"/{YY}",nt="{aa}",it="{h}:{mm}"+nt,ot="\n"+it,st=":{ss}",rt=null;function ut(e){let t=1e3*e,l=60*t,n=60*l,i=24*n,o=30*i,s=365*i;return[(1==e?N(10,0,3,Je).filter(Ue):N(10,-3,0,Je)).concat([t,5*t,10*t,15*t,30*t,l,5*l,10*l,15*l,30*l,n,2*n,3*n,4*n,6*n,8*n,12*n,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,o,2*o,3*o,4*o,6*o,s,2*s,5*s,10*s,25*s,50*s,100*s]),[[s,Xe,rt,rt,rt,rt,rt,rt,1],[28*i,"{MMM}",Qe,rt,rt,rt,rt,rt,1],[i,et,Qe,rt,rt,rt,rt,rt,1],[n,"{h}"+nt,lt,rt,tt,rt,rt,rt,1],[l,it,lt,rt,tt,rt,rt,rt,1],[t,st,lt+" "+it,rt,tt+" "+it,rt,ot,rt,1],[e,st+".{fff}",lt+" "+it,rt,tt+" "+it,rt,ot,rt,1]],function(t){return(r,u,a,c,f,h)=>{let d=[],p=f>=s,m=f>=o&&s>f,g=t(a),_=I(g*e,3),k=xt(g.getFullYear(),p?0:g.getMonth(),m||p?1:g.getDate()),b=I(k*e,3);if(m||p){let l=m?f/o:0,n=p?f/s:0,i=_==b?_:I(xt(k.getFullYear()+n,k.getMonth()+l,1)*e,3),r=new Date(w(i/e)),u=r.getFullYear(),a=r.getMonth();for(let o=0;c>=i;o++){let s=xt(u+n*o,a+l*o,1),r=s-t(I(s*e,3));i=I((+s+r)*e,3),i>c||d.push(i)}}else{let o=i>f?f:i,s=b+(x(a)-x(_))+R(_-b,o);d.push(s);let p=t(s),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=f/n,w=h/r.axes[u]._space;for(;s=I(s+f,1==e?0:3),c>=s;)if(g>1){let e=x(I(m+g,6))%24,l=t(s).getHours()-e;l>1&&(l=-1),s-=l*n,m=(m+g)%24,.7>I((s-d[d.length-1])/f,3)*w||d.push(s)}else d.push(s)}return d}}]}const[at,ct,ft]=ut(1),[ht,dt,pt]=ut(.001);function mt(e,t){return e.map((e=>e.map(((l,n)=>0==n||8==n||null==l?l:t(1==n||0==e[8]?l:e[1]+l)))))}function gt(e,t){return(l,n,i,o,s)=>{let r,u,a,c,f,h,d=t.find((e=>s>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),i=l.getMonth(),o=l.getDate(),s=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=r&&d[2]||i!=u&&d[3]||o!=a&&d[4]||s!=c&&d[5]||p!=f&&d[6]||m!=h&&d[7]||d[1];return r=n,u=i,a=o,c=s,f=p,h=m,g(l)}))}}function xt(e,t,l){return new Date(e,t,l)}function wt(e,t){return t(e)}function _t(e,t){return(l,n)=>t(e(n))}N(2,-53,53,[1]);const kt={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},bt=[0,0];function vt(e,t,l){return e=>{0==e.button&&l(e)}}function yt(e,t,l){return l}const Mt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return bt[0]=t,bt[1]=l,bt},points:{show:function(e,t){let l=e.cursor.points,n=Se(),i=l.size(e,t);ye(n,ee,i),ye(n,te,i);let o=i/-2;ye(n,"marginLeft",o),ye(n,"marginTop",o);let s=l.width(e,t,i);return s&&ye(n,"borderWidth",s),n},size:function(e,t){return Bt(e.series[t].points.width,1)},width:0,stroke:function(e,t){let l=e.series[t].points;return l._stroke||l._fill},fill:function(e,t){let l=e.series[t].points;return l._fill||l._stroke}},bind:{mousedown:vt,mouseup:vt,click:vt,dblclick:vt,mousemove:yt,mouseleave:yt,mouseenter:yt},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(e,t,l){return l},idxs:null},St={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Et=$({},St,{filter:Y}),Dt=$({},Et,{size:10}),zt=$({},St,{show:!1}),Tt='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"',Pt="bold "+Tt,At={show:!0,scale:"x",stroke:se,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Pt,side:2,grid:Et,ticks:Dt,border:zt,font:Tt,rotate:0},Wt={show:!0,scale:"x",auto:!1,sorted:1,min:D,max:-D,idxs:[]};function Yt(e,t){return t.map((e=>null==e?"":d(e)))}function Ct(e,t,l,n,i,o,s){let r=[],u=G.get(i)||0;for(let e=l=s?l:I(R(l,i),u);n>=e;e=I(e+i,u))r.push(Object.is(e,-0)?0:e);return r}function Ft(e,t,l,n,i){const o=[],s=e.scales[e.axes[t].scale].log,r=x((10==s?M:S)(l));i=v(s,r),0>r&&(i=I(i,-r));let u=l;do{o.push(u),u=I(u+i,G.get(i)),i*s>u||(i=u)}while(n>=u);return o}function Ht(e,t,l,n,i){let o=e.scales[e.axes[t].scale].asinh,s=n>o?Ft(e,t,b(o,l),n,i):[o],r=0>n||l>0?[]:[0];return(-o>l?Ft(e,t,b(o,-n),-l,i):[o]).reverse().map((e=>-e)).concat(r,s)}const Rt=/./,Lt=/[12357]/,It=/[125]/,Gt=/1/;function Ot(e,t,l){let n=e.axes[l],i=n.scale,o=e.scales[i];if(3==o.distr&&2==o.log)return t;let s=e.valToPos,r=n._space,u=s(10,i),a=s(9,i)-u4==o.distr&&0==e||a.test(e)?e:null))}function Nt(e,t){return null==t?"":d(t)}const jt={show:!0,scale:"y",stroke:se,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Pt,side:3,grid:Et,ticks:Dt,border:zt,font:Tt,rotate:0};function Bt(e,t){return I((3+2*(e||1))*t,3)}const Vt={scale:null,auto:!0,sorted:0,min:D,max:-D},Ut={show:!0,auto:!0,sorted:0,alpha:1,facets:[$({},Vt,{scale:"x"}),$({},Vt,{scale:"y"})]},Jt={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:(e,t,l,n,i)=>i,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],i=e._data[0],o=e.valToPos(i[n[0]],l,!0),s=e.valToPos(i[n[1]],l,!0);return g(s-o)/(e.series[t].points.space*_e)>=n[1]-n[0]},filter:null},values:null,min:D,max:-D,idxs:[],path:null,clip:null};function qt(e,t,l){return l/10}const Kt={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Zt=$({},Kt,{time:!1,ori:1}),$t={};function Xt(e){let t=$t[e];return t||(t={key:e,plots:[],sub(e){t.plots.push(e)},unsub(e){t.plots=t.plots.filter((t=>t!=e))},pub(e,l,n,i,o,s,r){for(let u=0;t.plots.length>u;u++)t.plots[u]!=l&&t.plots[u].pub(e,l,n,i,o,s,r)}},null!=e&&($t[e]=t)),t}function Qt(e,t,l){const n=e.series[t],i=e.scales,o=e.bbox;let s=e._data[0],r=e._data[t],u=2==e.mode?i[n.facets[0].scale]:i[e.series[0].scale],a=2==e.mode?i[n.facets[1].scale]:i[n.scale],c=o.left,f=o.top,h=o.width,d=o.height,p=e.valToPosH,m=e.valToPosV;return 0==u.ori?l(n,s,r,u,a,p,m,c,f,h,d,rl,al,fl,dl,ml):l(n,s,r,u,a,m,p,f,c,d,h,ul,cl,hl,pl,gl)}function el(e,t){let l=0,n=0,i=c(e.bands,B);for(let e=0;i.length>e;e++){let o=i[e];o.series[0]==t?l=o.dir:o.series[1]==t&&(n|=1==o.dir?1:2)}return[l,1==n?-1:2==n?1:3==n?2:0]}function tl(e,t,l,n,i){let o=e.scales[e.series[t].scale];return-1==i?o.min:1==i?o.max:3==o.distr?1==o.dir?o.min:o.max:0}function ll(e,t,l,n,i,o){return Qt(e,t,((e,t,s,r,u,a,c,f,h,d,p)=>{let m=e.pxRound;const g=0==r.ori?al:cl;let x,w;1==r.dir*(0==r.ori?1:-1)?(x=l,w=n):(x=n,w=l);let _=m(a(t[x],r,d,f)),k=m(c(s[x],u,p,h)),b=m(a(t[w],r,d,f)),v=m(c(1==o?u.max:u.min,u,p,h)),y=new Path2D(i);return g(y,b,v),g(y,_,v),g(y,_,k),y}))}function nl(e,t,l,n,i,o){let s=null;if(e.length>0){s=new Path2D;const r=0==t?fl:hl;let u=l;for(let t=0;e.length>t;t++){let l=e[t];if(l[1]>l[0]){let e=l[0]-u;e>0&&r(s,u,n,e,n+o),u=l[1]}}let a=l+i-u;a>0&&r(s,u,n,a,n+o)}return s}function il(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])}function ol(e){return 0==e?W:1==e?w:t=>T(t,e)}function sl(e){let t=0==e?rl:ul,l=0==e?(e,t,l,n,i,o)=>{e.arcTo(t,l,n,i,o)}:(e,t,l,n,i,o)=>{e.arcTo(l,t,i,n,o)},n=0==e?(e,t,l,n,i)=>{e.rect(t,l,n,i)}:(e,t,l,n,i)=>{e.rect(l,t,i,n)};return(e,i,o,s,r,u=0)=>{0==u?n(e,i,o,s,r):(u=k(u,s/2,r/2),t(e,i+u,o),l(e,i+s,o,i+s,o+r,u),l(e,i+s,o+r,i,o+r,u),l(e,i,o+r,i,o,u),l(e,i,o,i+s,o,u),e.closePath())}}const rl=(e,t,l)=>{e.moveTo(t,l)},ul=(e,t,l)=>{e.moveTo(l,t)},al=(e,t,l)=>{e.lineTo(t,l)},cl=(e,t,l)=>{e.lineTo(l,t)},fl=sl(0),hl=sl(1),dl=(e,t,l,n,i,o)=>{e.arc(t,l,n,i,o)},pl=(e,t,l,n,i,o)=>{e.arc(l,t,n,i,o)},ml=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(t,l,n,i,o,s)},gl=(e,t,l,n,i,o,s)=>{e.bezierCurveTo(l,t,i,n,s,o)};function xl(){return(e,t,l,n,i)=>Qt(e,t,((t,o,s,r,u,a,c,f,h,d,p)=>{let g,x,{pxRound:w,points:_}=t;0==r.ori?(g=rl,x=dl):(g=ul,x=pl);const k=I(_.width*_e,3);let b=(_.size-_.width)/2*_e,v=I(2*b,3),y=new Path2D,M=new Path2D,{left:S,top:E,width:D,height:z}=e.bbox;fl(M,S-v,E-v,D+2*v,z+2*v);const T=e=>{if(null!=s[e]){let t=w(a(o[e],r,d,f)),l=w(c(s[e],u,p,h));g(y,t+b,l),x(y,t,l,b,0,2*m)}};if(i)i.forEach(T);else for(let e=l;n>=e;e++)T(e);return{stroke:k>0?y:null,fill:y,clip:M,flags:3}}))}function wl(e){return(t,l,n,i,o,s)=>{n!=i&&(o!=n&&s!=n&&e(t,l,n),o!=i&&s!=i&&e(t,l,i),e(t,l,s))}}const _l=wl(al),kl=wl(cl);function bl(){return(e,l,n,i)=>Qt(e,l,((o,s,r,u,a,c,f,h,d,p,m)=>{let g,x,w=o.pxRound;0==u.ori?(g=al,x=_l):(g=cl,x=kl);const _=u.dir*(0==u.ori?1:-1),v={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},y=v.stroke;let M,S,E,z,T=D,P=-D,A=[],W=w(c(s[1==_?n:i],u,p,h)),Y=!1,C=!1,F=t(r,n,i,1*_),H=t(r,n,i,-1*_),R=w(c(s[F],u,p,h)),L=w(c(s[H],u,p,h));R>h&&il(A,h,R);for(let e=1==_?n:i;e>=n&&i>=e;e+=_){let t=w(c(s[e],u,p,h));if(t==W)null!=r[e]?(S=w(f(r[e],a,m,d)),T==D&&(g(y,t,S),M=S),T=k(S,T),P=b(S,P)):null===r[e]&&(Y=C=!0);else{let l=!1;T!=D?(x(y,W,T,P,M,S),E=z=W):Y&&(l=!0,Y=!1),null!=r[e]?(S=w(f(r[e],a,m,d)),g(y,t,S),T=P=M=S,C&&t-W>1&&(l=!0),C=!1):(T=D,P=-D,null===r[e]&&(Y=!0,t-W>1&&(l=!0))),l&&il(A,E,t),W=t}}T!=D&&T!=P&&z!=W&&x(y,W,T,P,M,S),h+p>L&&il(A,L,h+p);let[I,G]=el(e,l);if(null!=o.fill||0!=I){let t=v.fill=new Path2D(y),n=w(f(o.fillTo(e,l,o.min,o.max,I),a,m,d));g(t,L,n),g(t,R,n)}return v.gaps=A=o.gaps(e,l,n,i,A),o.spanGaps||(v.clip=nl(A,u.ori,h,d,p,m)),0!=G&&(v.band=2==G?[ll(e,l,n,i,y,-1),ll(e,l,n,i,y,1)]:ll(e,l,n,i,y,G)),v}))}function vl(e,t,l,n,i){const o=e.length;if(2>o)return null;const s=new Path2D;if(l(s,e[0],t[0]),2==o)n(s,e[1],t[1]);else{let l=Array(o),n=Array(o-1),r=Array(o-1),u=Array(o-1);for(let l=0;o-1>l;l++)r[l]=t[l+1]-t[l],u[l]=e[l+1]-e[l],n[l]=r[l]/u[l];l[0]=n[0];for(let e=1;o-1>e;e++)0===n[e]||0===n[e-1]||n[e-1]>0!=n[e]>0?l[e]=0:(l[e]=3*(u[e-1]+u[e])/((2*u[e]+u[e-1])/n[e-1]+(u[e]+2*u[e-1])/n[e]),isFinite(l[e])||(l[e]=0));l[o-1]=n[o-2];for(let n=0;o-1>n;n++)i(s,e[n]+u[n]/3,t[n]+l[n]*u[n]/3,e[n+1]-u[n]/3,t[n+1]-l[n+1]*u[n]/3,e[n+1],t[n+1])}return s}const yl=new Set;function Ml(){yl.forEach((e=>{e.syncRect(!0)}))}Ce("resize",we,Ml),Ce("scroll",we,Ml,!0);const Sl=bl(),El=xl();function Dl(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>zl(e,n,t,l)))}function zl(e,t,l,n){return $({},0==t?l:n,e)}function Tl(e,t,l){return null==t?V:[t,l]}const Pl=Tl;function Al(e,t,l){return null==t?V:a(t,l,.1,!0)}function Wl(e,t,l,n){return null==t?V:i(t,l,e.scales[n].log,!1)}const Yl=Wl;function Cl(e,t,l,n){return null==t?V:o(t,l,e.scales[n].log,!1)}const Fl=Cl;function Hl(t,l,n,i,o){let s=b(z(t),z(l)),r=l-t,u=e(o/i*r,n);do{let e=n[u],t=i*e/r;if(t>=o&&17>=s+(5>e?G.get(e):0))return[e,t]}while(++u(t=w((l=+n)*_e))+"px")),t,l]}function Ll(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=I(e[2]*_e,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Il(t,l,n){const r={mode:c(t.mode,1)},u=r.mode;function f(e,t){return((3==t.distr?M(e>0?e:t.clamp(r,e,t.min,t.max,t.key)):4==t.distr?E(e,t.asinh):e)-t._min)/(t._max-t._min)}function h(e,t,l,n){let i=f(e,t);return n+l*(-1==t.dir?1-i:i)}function d(e,t,l,n){let i=f(e,t);return n+l*(-1==t.dir?i:1-i)}function x(e,t,l,n){return 0==t.ori?h(e,t,l,n):d(e,t,l,n)}r.valToPosH=h,r.valToPosV=d;let y=!1;r.status=0;const S=r.root=Se("uplot");null!=t.id&&(S.id=t.id),be(S,t.class),t.title&&(Se("u-title",S).textContent=t.title);const z=Me("canvas"),W=r.ctx=z.getContext("2d"),L=Se("u-wrap",S),G=r.under=Se("u-under",L);L.appendChild(z);const O=r.over=Se("u-over",L),N=+c((t=Z(t)).pxAlign,1),X=ol(N);(t.plugins||[]).forEach((e=>{e.opts&&(t=e.opts(r,t)||t)}));const se=t.ms||.001,de=r.series=1==u?Dl(t.series||[],Wt,Jt,!1):function(e,t){return e.map(((e,l)=>0==l?null:$({},t,e)))}(t.series||[null],Ut),ke=r.axes=Dl(t.axes||[],At,jt,!0),Ee=r.scales={},ze=r.bands=t.bands||[];ze.forEach((e=>{e.fill=A(e.fill||null),e.dir=c(e.dir,-1)}));const Pe=2==u?de[1].facets[0].scale:de[0].scale,We={axes:function(){for(let e=0;ke.length>e;e++){let t=ke[e];if(!t.show||!t._show)continue;let l,n,i=t.side,o=i%2,s=t.stroke(r,e),u=0==i||3==i?-1:1;if(t.label){let e=w((t._lpos+t.labelGap*u)*_e);ql(t.labelFont[0],s,"center",2==i?le:ne),W.save(),1==o?(l=n=0,W.translate(e,w(Rt+It/2)),W.rotate((3==i?-m:m)/2)):(l=w(Pt+Lt/2),n=e),W.fillText(t.label,l,n),W.restore()}let[a,c]=t._found;if(0==c)continue;let f=Ee[t.scale],h=0==o?Lt:It,d=0==o?Pt:Rt,p=w(t.gap*_e),g=t._splits,_=2==f.distr?g.map((e=>jl[e])):g,k=2==f.distr?jl[g[1]]-jl[g[0]]:a,b=t.ticks,v=t.border,y=b.show?w(b.size*_e):0,M=t._rotate*-m/180,S=X(t._pos*_e),E=S+(y+p)*u;n=0==o?E:0,l=1==o?E:0,ql(t.font[0],s,1==t.align?ie:2==t.align?oe:M>0?ie:0>M?oe:0==o?"center":3==i?oe:ie,M||1==o?"middle":2==i?le:ne);let D=1.5*t.font[1],z=g.map((e=>X(x(e,f,h,d)))),T=t._values;for(let e=0;T.length>e;e++){let t=T[e];if(null!=t){0==o?l=z[e]:n=z[e],t=""+t;let i=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;i.length>e;e++){let t=i[e];M?(W.save(),W.translate(l,n+e*D),W.rotate(M),W.fillText(t,0,0),W.restore()):W.fillText(t,l,n+e*D)}}}b.show&&tn(z,b.filter(r,_,e,c,k),o,i,S,y,I(b.width*_e,3),b.stroke(r,e),b.dash,b.cap);let P=t.grid;P.show&&tn(z,P.filter(r,_,e,c,k),o,0==o?2:1,0==o?Rt:Pt,0==o?It:Lt,I(P.width*_e,3),P.stroke(r,e),P.dash,P.cap),v.show&&tn([S],[1],0==o?1:0,0==o?1:2,1==o?Rt:Pt,1==o?It:Lt,I(v.width*_e,3),v.stroke(r,e),v.dash,v.cap)}ti("drawAxes")},series:function(){pl>0&&(de.forEach(((e,t)=>{if(t>0&&e.show&&null==e._paths){let n=function(e){let t=P(ml-1,0,pl-1),l=P(gl+1,0,pl-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&pl-1>l;)l++;return[t,l]}(l[t]);e._paths=e.paths(r,t,n[0],n[1])}})),de.forEach(((e,t)=>{if(t>0&&e.show){Nl!=e.alpha&&(W.globalAlpha=Nl=e.alpha),Zl(t,!1),e._paths&&$l(t,!1);{Zl(t,!0);let l=e.points.show(r,t,ml,gl),n=e.points.filter(r,t,l,e._paths?e._paths.gaps:null);(l||n)&&(e.points._paths=e.points.paths(r,t,ml,gl,n),$l(t,!0))}null!=e._paths&&null!=e._paths.text&&e._paths.text(r,t),1!=Nl&&(W.globalAlpha=Nl=1),ti("drawSeries",t)}})))}},Ye=(t.drawOrder||["axes","series"]).map((e=>We[e]));function He(e){let l=Ee[e];if(null==l){let n=(t.scales||j)[e]||j;if(null!=n.from)He(n.from),Ee[e]=$({},Ee[n.from],n,{key:e});else{l=Ee[e]=$({},e==Pe?Kt:Zt,n),l.key=e;let t=l.time,i=l.range,o=U(i);if((e!=Pe||2==u&&!t)&&(!o||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?s:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?s:{mode:1,hard:i[1],soft:i[1]}},o=!1),!o&&q(i))){let e=i;i=(t,l,n)=>null==l?V:a(l,n,e)}l.range=A(i||(t?Pl:e==Pe?3==l.distr?Yl:4==l.distr?Fl:Tl:3==l.distr?Wl:4==l.distr?Cl:Al)),l.auto=A(!o&&l.auto),l.clamp=A(l.clamp||qt),l._min=l._max=null}}}He("x"),He("y"),1==u&&de.forEach((e=>{He(e.scale)})),ke.forEach((e=>{He(e.scale)}));for(let e in t.scales)He(e);const Re=Ee[Pe],Le=Re.distr;let Ie,Ge;0==Re.ori?(be(S,"u-hz"),Ie=h,Ge=d):(be(S,"u-vt"),Ie=d,Ge=h);const Oe={};for(let e in Ee){let t=Ee[e];null==t.min&&null==t.max||(Oe[e]={min:t.min,max:t.max},t.min=t.max=null)}const Ne=t.tzDate||(e=>new Date(w(e/se))),je=t.fmtDate||Be,Ve=1==se?ft(Ne):pt(Ne),Ue=gt(Ne,mt(1==se?ct:dt,je)),Je=_t(Ne,wt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",je)),qe=[],Ke=r.legend=$({},kt,t.legend),Xe=Ke.show,Qe=Ke.markers;let et;Ke.idxs=qe,Qe.width=A(Qe.width),Qe.dash=A(Qe.dash),Qe.stroke=A(Qe.stroke),Qe.fill=A(Qe.fill);let tt,lt=[],nt=[],it=!1,ot={};if(Ke.live){const e=de[1]?de[1].values:null;it=null!=e,tt=it?e(r,1,0):{_:0};for(let e in tt)ot[e]="--"}if(Xe)if(et=Me("table","u-legend",S),it){let e=Me("tr","u-thead",et);for(var st in Me("th",null,e),tt)Me("th",ge,e).textContent=st}else be(et,"u-inline"),Ke.live&&be(et,"u-live");const rt={show:!0},ut={show:!1},xt=new Map;function bt(e,t,l){const n=xt.get(t)||{},i=il.bind[e](r,t,l);i&&(Ce(e,t,n[e]=i),xt.set(t,n))}function vt(e,t){const l=xt.get(t)||{};for(let n in l)null!=e&&n!=e||(Fe(n,t,l[n]),delete l[n]);null==e&&xt.delete(t)}let yt=0,St=0,Et=0,Dt=0,zt=0,Tt=0,Pt=0,Rt=0,Lt=0,It=0;r.bbox={};let Gt=!1,Vt=!1,$t=!1,Qt=!1,el=!1;function ll(e,t,l){(l||e!=r.width||t!=r.height)&&nl(e,t),on(!1),$t=!0,Vt=!0,Qt=el=il.left>=0,_n()}function nl(e,t){r.width=yt=Et=e,r.height=St=Dt=t,zt=Tt=0,function(){let e=!1,t=!1,l=!1,n=!1;ke.forEach((i=>{if(i.show&&i._show){let{side:o,_size:s}=i,r=o%2,u=s+(null!=i.label?i.labelSize:0);u>0&&(r?(Et-=u,3==o?(zt+=u,n=!0):l=!0):(Dt-=u,0==o?(Tt+=u,e=!0):t=!0))}})),cl[0]=e,cl[1]=l,cl[2]=t,cl[3]=n,Et-=dl[1]+dl[3],zt+=dl[3],Dt-=dl[2]+dl[0],Tt+=dl[0]}(),function(){let e=zt+Et,t=Tt+Dt,l=zt,n=Tt;function i(i,o){switch(i){case 1:return e+=o,e-o;case 2:return t+=o,t-o;case 3:return l-=o,l+o;case 0:return n-=o,n+o}}ke.forEach((e=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),null!=e.label&&(e._lpos=i(t,e.labelSize))}}))}();let l=r.bbox;Pt=l.left=T(zt*_e,.5),Rt=l.top=T(Tt*_e,.5),Lt=l.width=T(Et*_e,.5),It=l.height=T(Dt*_e,.5)}r.setSize=function({width:e,height:t}){ll(e,t)};const il=r.cursor=$({},Mt,{drag:{y:2==u}},t.cursor);{il.idxs=qe,il._lock=!1;let e=il.points;e.show=A(e.show),e.size=A(e.size),e.stroke=A(e.stroke),e.width=A(e.width),e.fill=A(e.fill)}const sl=r.focus=$({},t.focus||{alpha:.3},il.focus),rl=sl.prox>=0;let ul=[null];function al(e,t){if(1==u||t>0){let t=1==u&&Ee[e.scale].time,l=e.value;e.value=t?J(l)?_t(Ne,wt(l,je)):l||Je:l||Nt,e.label=e.label||(t?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Sl||C,e.fillTo=A(e.fillTo||tl),e.pxAlign=+c(e.pxAlign,N),e.pxRound=ol(e.pxAlign),e.stroke=A(e.stroke||null),e.fill=A(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=Bt(e.width,1),l=e.points=$({},{size:t,width:b(1,.2*t),stroke:e.stroke,space:2*t,paths:El,_stroke:null,_fill:null},e.points);l.show=A(l.show),l.filter=A(l.filter),l.fill=A(l.fill),l.stroke=A(l.stroke),l.paths=A(l.paths),l.pxAlign=e.pxAlign}if(Xe){let l=function(e,t){if(0==t&&(it||!Ke.live||2==u))return V;let l=[],n=Me("tr","u-series",et,et.childNodes[t]);be(n,e.class),e.show||be(n,me);let i=Me("th",null,n);if(Qe.show){let e=Se("u-marker",i);if(t>0){let l=Qe.width(r,t);l&&(e.style.border=l+"px "+Qe.dash(r,t)+" "+Qe.stroke(r,t)),e.style.background=Qe.fill(r,t)}}let o=Se(ge,i);for(var s in o.textContent=e.label,t>0&&(Qe.show||(o.style.color=e.width>0?Qe.stroke(r,t):Qe.fill(r,t)),bt("click",i,(t=>{if(il._lock)return;let l=de.indexOf(e);if((t.ctrlKey||t.metaKey)!=Ke.isolate){let e=de.some(((e,t)=>t>0&&t!=l&&e.show));de.forEach(((t,n)=>{n>0&&Pn(n,e?n==l?rt:ut:rt,!0,li.setSeries)}))}else Pn(l,{show:!e.show},!0,li.setSeries)})),rl&&bt(ce,i,(()=>{il._lock||Pn(de.indexOf(e),Cn,!0,li.setSeries)}))),tt){let e=Me("td","u-value",n);e.textContent="--",l.push(e)}return[n,l]}(e,t);lt.splice(t,0,l[0]),nt.splice(t,0,l[1]),Ke.values.push(null)}if(il.show){qe.splice(t,0,null);let l=function(e,t){if(t>0){let l=il.points.show(r,t);if(l)return be(l,"u-cursor-pt"),be(l,e.class),De(l,-10,-10,Et,Dt),O.insertBefore(l,ul[t]),l}}(e,t);l&&ul.splice(t,0,l)}ti("addSeries",t)}r.addSeries=function(e,t){e=zl(e,t=null==t?de.length:t,Wt,Jt),de.splice(t,0,e),al(de[t],t)},r.delSeries=function(e){if(de.splice(e,1),Xe){Ke.values.splice(e,1),nt.splice(e,1);let t=lt.splice(e,1)[0];vt(null,t.firstChild),t.remove()}il.show&&(qe.splice(e,1),ul.length>1&&ul.splice(e,1)[0].remove()),ti("delSeries",e)};const cl=[!1,!1,!1,!1];function fl(e,t,l){let[n,i,o,s]=l,r=t%2,u=0;return 0==r&&(s||i)&&(u=0==t&&!n||2==t&&!o?w(At.size/3):0),1==r&&(n||o)&&(u=1==t&&!i||3==t&&!s?w(jt.size/2):0),u}const hl=r.padding=(t.padding||[fl,fl,fl,fl]).map((e=>A(c(e,fl)))),dl=r._padding=hl.map(((e,t)=>e(r,t,cl,0)));let pl,ml=null,gl=null;const xl=1==u?de[0].idxs:null;let wl,_l,kl,bl,vl,Ml,Il,Gl,Ol,Nl,jl=null,Bl=!1;function Vl(e,t){if(l=null==e?[]:Z(e,K),2==u){pl=0;for(let e=1;de.length>e;e++)pl+=l[e][0].length;r.data=l=e}else if(null==l[0]&&(l[0]=[]),r.data=l.slice(),jl=l[0],pl=jl.length,2==Le){l[0]=Array(pl);for(let e=0;pl>e;e++)l[0][e]=e}if(r._data=l,on(!0),ti("setData"),!1!==t){let e=Re;e.auto(r,Bl)?Ul():Tn(Pe,e.min,e.max),Qt=il.left>=0,el=!0,_n()}}function Ul(){let e,t;Bl=!0,1==u&&(pl>0?(ml=xl[0]=0,gl=xl[1]=pl-1,e=l[0][ml],t=l[0][gl],2==Le?(e=ml,t=gl):1==pl&&(3==Le?[e,t]=i(e,e,Re.log,!1):4==Le?[e,t]=o(e,e,Re.log,!1):Re.time?t=e+w(86400/se):[e,t]=a(e,t,.1,!0))):(ml=xl[0]=e=null,gl=xl[1]=t=null)),Tn(Pe,e,t)}function Jl(e="#0000",t,l=B,n="butt",i="#0000",o="round"){e!=wl&&(W.strokeStyle=wl=e),i!=_l&&(W.fillStyle=_l=i),t!=kl&&(W.lineWidth=kl=t),o!=vl&&(W.lineJoin=vl=o),n!=Ml&&(W.lineCap=Ml=n),l!=bl&&W.setLineDash(bl=l)}function ql(e,t,l,n){t!=_l&&(W.fillStyle=_l=t),e!=Il&&(W.font=Il=e),l!=Gl&&(W.textAlign=Gl=l),n!=Ol&&(W.textBaseline=Ol=n)}function Kl(e,t,l,n,i=0){if(e.auto(r,Bl)&&(null==t||null==t.min)){let t=c(ml,0),o=c(gl,n.length-1),s=null==l.min?3==e.distr?function(e,t,l){let n=D,i=-D;for(let o=t;l>=o;o++)e[o]>0&&(n=k(n,e[o]),i=b(i,e[o]));return[n==D?1:n,i==-D?10:i]}(n,t,o):function(e,t,l,n){let i=D,o=-D;if(1==n)i=e[t],o=e[l];else if(-1==n)i=e[l],o=e[t];else for(let n=t;l>=n;n++)null!=e[n]&&(i=k(i,e[n]),o=b(o,e[n]));return[i,o]}(n,t,o,i):[l.min,l.max];e.min=k(e.min,l.min=s[0]),e.max=b(e.max,l.max=s[1])}}function Zl(e,t){let l=t?de[e].points:de[e];l._stroke=l.stroke(r,e),l._fill=l.fill(r,e)}function $l(e,t){let n=t?de[e].points:de[e],i=n._stroke,o=n._fill,{stroke:s,fill:u,clip:a,flags:f}=n._paths,h=null,d=I(n.width*_e,3),p=d%2/2;t&&null==o&&(o=d>0?"#fff":i);let m=1==n.pxAlign;if(m&&W.translate(p,p),!t){let e=Pt,t=Rt,l=Lt,i=It,o=d*_e/2;0==n.min&&(i+=o),0==n.max&&(t-=o,i+=o),h=new Path2D,h.rect(e,t,l,i)}t?Xl(i,d,n.dash,n.cap,o,s,u,f,a):function(e,t,n,i,o,s,u,a,f,h,d){let p=!1;ze.forEach(((m,g)=>{if(m.series[0]==e){let e,x=de[m.series[1]],w=l[m.series[1]],_=(x._paths||j).band;U(_)&&(_=1==m.dir?_[0]:_[1]);let k=null;x.show&&_&&function(e,t,l){for(t=c(t,0),l=c(l,e.length-1);l>=t;){if(null!=e[t])return!0;t++}return!1}(w,ml,gl)?(k=m.fill(r,g)||s,e=x._paths.clip):_=null,Xl(t,n,i,o,k,u,a,f,h,d,e,_),p=!0}})),p||Xl(t,n,i,o,s,u,a,f,h,d)}(e,i,d,n.dash,n.cap,o,s,u,f,h,a),m&&W.translate(-p,-p)}function Xl(e,t,l,n,i,o,s,r,u,a,c,f){Jl(e,t,l,n,i),(u||a||f)&&(W.save(),u&&W.clip(u),a&&W.clip(a)),f?3==(3&r)?(W.clip(f),c&&W.clip(c),en(i,s),Ql(e,o,t)):2&r?(en(i,s),W.clip(f),Ql(e,o,t)):1&r&&(W.save(),W.clip(f),c&&W.clip(c),en(i,s),W.restore(),Ql(e,o,t)):(en(i,s),Ql(e,o,t)),(u||a||f)&&W.restore()}function Ql(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{W.strokeStyle=wl=t,W.stroke(e)})):null!=t&&e&&W.stroke(t))}function en(e,t){t instanceof Map?t.forEach(((e,t)=>{W.fillStyle=_l=t,W.fill(e)})):null!=t&&e&&W.fill(t)}function tn(e,t,l,n,i,o,s,r,u,a){let c=s%2/2;1==N&&W.translate(c,c),Jl(r,s,u,a,r),W.beginPath();let f,h,d,p,m=i+(0==n||3==n?-o:o);0==l?(h=i,p=m):(f=i,d=m);for(let n=0;e.length>n;n++)null!=t[n]&&(0==l?f=d=e[n]:h=p=e[n],W.moveTo(f,h),W.lineTo(d,p));W.stroke(),1==N&&W.translate(-c,-c)}function ln(e){let t=!0;return ke.forEach(((l,n)=>{if(!l.show)return;let i=Ee[l.scale];if(null==i.min)return void(l._show&&(t=!1,l._show=!1,on(!1)));l._show||(t=!1,l._show=!0,on(!1));let o=l.side,s=o%2,{min:u,max:a}=i,[c,f]=function(e,t,l,n){let i,o=ke[e];if(n>0){let s=o._space=o.space(r,e,t,l,n);i=Hl(t,l,o._incrs=o.incrs(r,e,t,l,n,s),n,s)}else i=[0,0];return o._found=i}(n,u,a,0==s?Et:Dt);if(0==f)return;let h=l._splits=l.splits(r,n,u,a,c,f,2==i.distr),d=2==i.distr?h.map((e=>jl[e])):h,p=2==i.distr?jl[h[1]]-jl[h[0]]:c,m=l._values=l.values(r,l.filter(r,d,n,f,p),n,f,p);l._rotate=2==o?l.rotate(r,m,n,f):0;let g=l._size;l._size=_(l.size(r,m,n,e)),null!=g&&l._size!=g&&(t=!1)})),t}function nn(e){let t=!0;return hl.forEach(((l,n)=>{let i=l(r,n,cl,e);i!=dl[n]&&(t=!1),dl[n]=i})),t}function on(e){de.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==u?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}r.setData=Vl;let sn,rn,un,an,cn,fn,hn,dn,pn,mn,gn,xn,wn=!1;function _n(){wn||(Q(kn),wn=!0)}function kn(){Gt&&(function(){let t=Z(Ee,K);for(let e in t){let l=t[e],n=Oe[e];if(null!=n&&null!=n.min)$(l,n),e==Pe&&on(!0);else if(e!=Pe||2==u)if(0==pl&&null==l.from){let t=l.range(r,null,null,e);l.min=t[0],l.max=t[1]}else l.min=D,l.max=-D}if(pl>0){de.forEach(((n,i)=>{if(1==u){let o=n.scale,s=t[o],u=Oe[o];if(0==i){let t=s.range(r,s.min,s.max,o);s.min=t[0],s.max=t[1],ml=e(s.min,l[0]),gl=e(s.max,l[0]),s.min>l[0][ml]&&ml++,l[0][gl]>s.max&&gl--,n.min=jl[ml],n.max=jl[gl]}else n.show&&n.auto&&Kl(s,u,n,l[i],n.sorted);n.idxs[0]=ml,n.idxs[1]=gl}else if(i>0&&n.show&&n.auto){let[e,o]=n.facets,s=e.scale,r=o.scale,[u,a]=l[i];Kl(t[s],Oe[s],e,u,e.sorted),Kl(t[r],Oe[r],o,a,o.sorted),n.min=o.min,n.max=o.max}}));for(let e in t){let l=t[e],n=Oe[e];if(null==l.from&&(null==n||null==n.min)){let t=l.range(r,l.min==D?null:l.min,l.max==-D?null:l.max,e);l.min=t[0],l.max=t[1]}}}for(let e in t){let l=t[e];if(null!=l.from){let n=t[l.from];if(null==n.min)l.min=l.max=null;else{let t=l.range(r,n.min,n.max,e);l.min=t[0],l.max=t[1]}}}let n={},i=!1;for(let e in t){let l=t[e],o=Ee[e];if(o.min!=l.min||o.max!=l.max){o.min=l.min,o.max=l.max;let t=o.distr;o._min=3==t?M(o.min):4==t?E(o.min,o.asinh):o.min,o._max=3==t?M(o.max):4==t?E(o.max,o.asinh):o.max,n[e]=i=!0}}if(i){de.forEach(((e,t)=>{2==u?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)}));for(let e in n)$t=!0,ti("setScale",e);il.show&&(Qt=el=il.left>=0)}for(let e in Oe)Oe[e]=null}(),Gt=!1),$t&&(function(){let e=!1,t=0;for(;!e;){t++;let l=ln(t),n=nn(t);e=3==t||l&&n,e||(nl(r.width,r.height),Vt=!0)}}(),$t=!1),Vt&&(ye(G,ie,zt),ye(G,le,Tt),ye(G,ee,Et),ye(G,te,Dt),ye(O,ie,zt),ye(O,le,Tt),ye(O,ee,Et),ye(O,te,Dt),ye(L,ee,yt),ye(L,te,St),z.width=w(yt*_e),z.height=w(St*_e),ke.forEach((({_el:e,_show:t,_size:l,_pos:n,side:i})=>{if(null!=e)if(t){let t=i%2==1;ye(e,t?"left":"top",n-(3===i||0===i?l:0)),ye(e,t?"width":"height",l),ye(e,t?"top":"left",t?Tt:zt),ye(e,t?"height":"width",t?Dt:Et),ve(e,me)}else be(e,me)})),wl=_l=kl=vl=Ml=Il=Gl=Ol=bl=null,Nl=1,Bn(!0),ti("setSize"),Vt=!1),yt>0&&St>0&&(W.clearRect(0,0,z.width,z.height),ti("drawClear"),Ye.forEach((e=>e())),ti("draw")),il.show&&Qt&&(Nn(null,!0,!1),Qt=!1),y||(y=!0,r.status=1,ti("ready")),Bl=!1,wn=!1}function bn(t,n){let i=Ee[t];if(null==i.from){if(0==pl){let e=i.range(r,n.min,n.max,t);n.min=e[0],n.max=e[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(pl>1&&null!=n.min&&null!=n.max&&1e-16>n.max-n.min)return;t==Pe&&2==i.distr&&pl>0&&(n.min=e(n.min,l[0]),n.max=e(n.max,l[0]),n.min==n.max&&n.max++),Oe[t]=n,Gt=!0,_n()}}r.redraw=(e,t)=>{$t=t||!1,!1!==e?Tn(Pe,Re.min,Re.max):_n()},r.setScale=bn;let vn=!1;const yn=il.drag;let Mn=yn.x,Sn=yn.y;il.show&&(il.x&&(sn=Se("u-cursor-x",O)),il.y&&(rn=Se("u-cursor-y",O)),0==Re.ori?(un=sn,an=rn):(un=rn,an=sn),gn=il.left,xn=il.top);const En=r.select=$({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Dn=En.show?Se("u-select",En.over?O:G):null;function zn(e,t){if(En.show){for(let t in e)ye(Dn,t,En[t]=e[t]);!1!==t&&ti("setSelect")}}function Tn(e,t,l){bn(e,{min:t,max:l})}function Pn(e,t,l,n){let i=de[e];null!=t.focus&&function(e){if(e!=Yn){let t=null==e,l=1!=sl.alpha;de.forEach(((n,i)=>{let o=t||0==i||i==e;n._focus=t?null:o,l&&function(e,t){de[e].alpha=t,il.show&&ul[e]&&(ul[e].style.opacity=t),Xe&<[e]&&(lt[e].style.opacity=t)}(i,o?1:sl.alpha)})),Yn=e,l&&_n()}}(e),null!=t.show&&(i.show=t.show,function(e){let t=Xe?lt[e]:null;de[e].show?t&&ve(t,me):(t&&be(t,me),ul.length>1&&De(ul[e],-10,-10,Et,Dt))}(e),Tn(2==u?i.facets[1].scale:i.scale,null,null),_n()),!1!==l&&ti("setSeries",e,t),n&&oi("setSeries",r,e,t)}let An,Wn,Yn;r.setSelect=zn,r.setSeries=Pn,r.addBand=function(e,t){e.fill=A(e.fill||null),e.dir=c(e.dir,-1),ze.splice(t=null==t?ze.length:t,0,e)},r.setBand=function(e,t){$(ze[e],t)},r.delBand=function(e){null==e?ze.length=0:ze.splice(e,1)};const Cn={focus:!0};function Fn(e,t,l){let n=Ee[t];l&&(e=e/_e-(1==n.ori?Tt:zt));let i=Et;1==n.ori&&(i=Dt,e=i-e),-1==n.dir&&(e=i-e);let o=n._min,s=o+e/i*(n._max-o),r=n.distr;return 3==r?v(10,s):4==r?((e,t=1)=>p.sinh(e)*t)(s,n.asinh):s}function Hn(e,t){ye(Dn,ie,En.left=e),ye(Dn,ee,En.width=t)}function Rn(e,t){ye(Dn,le,En.top=e),ye(Dn,te,En.height=t)}Xe&&rl&&Ce(fe,et,(()=>{il._lock||null!=Yn&&Pn(null,Cn,!0,li.setSeries)})),r.valToIdx=t=>e(t,l[0]),r.posToIdx=function(t,n){return e(Fn(t,Pe,n),l[0],ml,gl)},r.posToVal=Fn,r.valToPos=(e,t,l)=>0==Ee[t].ori?h(e,Ee[t],l?Lt:Et,l?Pt:0):d(e,Ee[t],l?It:Dt,l?Rt:0),r.batch=function(e){e(r),_n()},r.setCursor=(e,t,l)=>{gn=e.left,xn=e.top,Nn(null,t,l)};let Ln=0==Re.ori?Hn:Rn,In=1==Re.ori?Hn:Rn;function Gn(e,t){if(null!=e){let t=e.idx;Ke.idx=t,de.forEach(((e,l)=>{(l>0||!it)&&On(l,t)}))}Xe&&Ke.live&&function(){if(Xe&&Ke.live)for(let e=2==u?1:0;de.length>e;e++){if(0==e&&it)continue;let t=Ke.values[e],l=0;for(let n in t)nt[e][l++].firstChild.nodeValue=t[n]}}(),el=!1,!1!==t&&ti("setLegend")}function On(e,t){let n;if(null==t)n=ot;else{let i=de[e],o=0==e&&2==Le?jl:l[e];n=it?i.values(r,e,t):{_:i.value(r,o[t],e,t)}}Ke.values[e]=n}function Nn(t,n,i){let o;pn=gn,mn=xn,[gn,xn]=il.move(r,gn,xn),il.show&&(un&&De(un,w(gn),0,Et,Dt),an&&De(an,0,w(xn),Et,Dt)),An=D;let s=0==Re.ori?Et:Dt,a=1==Re.ori?Et:Dt;if(0>gn||0==pl||ml>gl){o=null;for(let e=0;de.length>e;e++)e>0&&ul.length>1&&De(ul[e],-10,-10,Et,Dt);if(rl&&Pn(null,Cn,!0,null==t&&li.setSeries),Ke.live){qe.fill(null),el=!0;for(let e=0;de.length>e;e++)Ke.values[e]=ot}}else{let t,n,i;1==u&&(t=0==Re.ori?gn:xn,n=Fn(t,Pe),o=e(n,l[0],ml,gl),i=R(Ie(l[0][o],Re,s,0),.5));for(let e=2==u?1:0;de.length>e;e++){let t=de[e],c=qe[e],f=1==u?l[e][c]:l[e][1][c],h=il.dataIdx(r,e,o,n),d=1==u?l[e][h]:l[e][1][h];el=el||d!=f||h!=c,qe[e]=h;let p=h==o?i:R(Ie(1==u?l[0][h]:l[e][0][h],Re,s,0),.5);if(e>0&&t.show){let l,n,i=null==d?-10:R(Ge(d,1==u?Ee[t.scale]:Ee[t.facets[1].scale],a,0),.5);if(i>0&&1==u){let t=g(i-xn);t>An||(An=t,Wn=e)}if(0==Re.ori?(l=p,n=i):(l=i,n=p),el&&ul.length>1){Te(ul[e],il.points.fill(r,e),il.points.stroke(r,e));let t,i,o,s,u=!0,a=il.points.bbox;if(null!=a){u=!1;let l=a(r,e);o=l.left,s=l.top,t=l.width,i=l.height}else o=l,s=n,t=i=il.points.size(r,e);Ae(ul[e],t,i,u),De(ul[e],o,s,Et,Dt)}}if(Ke.live){if(!el||0==e&&it)continue;On(e,h)}}}if(il.idx=o,il.left=gn,il.top=xn,el&&(Ke.idx=o,Gn()),En.show&&vn)if(null!=t){let[e,l]=li.scales,[n,i]=li.match,[o,r]=t.cursor.sync.scales,u=t.cursor.drag;if(Mn=u._x,Sn=u._y,Mn||Sn){let u,c,f,h,d,{left:p,top:m,width:x,height:w}=t.select,_=t.scales[e].ori,b=t.posToVal,v=null!=e&&n(e,o),y=null!=l&&i(l,r);v?(0==_?(u=p,c=x):(u=m,c=w),f=Ee[e],h=Ie(b(u,o),f,s,0),d=Ie(b(u+c,o),f,s,0),Ln(k(h,d),g(d-h))):Ln(0,s),y?(1==_?(u=p,c=x):(u=m,c=w),f=Ee[l],h=Ge(b(u,r),f,a,0),d=Ge(b(u+c,r),f,a,0),In(k(h,d),g(d-h))):In(0,a)}else qn()}else{let e=g(pn-cn),t=g(mn-fn);if(1==Re.ori){let l=e;e=t,t=l}Mn=yn.x&&e>=yn.dist,Sn=yn.y&&t>=yn.dist;let l,n,i=yn.uni;null!=i?Mn&&Sn&&(Mn=e>=i,Sn=t>=i,Mn||Sn||(t>e?Sn=!0:Mn=!0)):yn.x&&yn.y&&(Mn||Sn)&&(Mn=Sn=!0),Mn&&(0==Re.ori?(l=hn,n=gn):(l=dn,n=xn),Ln(k(l,n),g(n-l)),Sn||In(0,a)),Sn&&(1==Re.ori?(l=hn,n=gn):(l=dn,n=xn),In(k(l,n),g(n-l)),Mn||Ln(0,s)),Mn||Sn||(Ln(0,0),In(0,0))}if(yn._x=Mn,yn._y=Sn,null==t){if(i){if(null!=ni){let[e,t]=li.scales;li.values[0]=null!=e?Fn(0==Re.ori?gn:xn,e):null,li.values[1]=null!=t?Fn(1==Re.ori?gn:xn,t):null}oi(re,r,gn,xn,Et,Dt,o)}if(rl){let e=i&&li.setSeries,t=sl.prox;null==Yn?An>t||Pn(Wn,Cn,!0,e):An>t?Pn(null,Cn,!0,e):Wn!=Yn&&Pn(Wn,Cn,!0,e)}}y&&!1!==n&&ti("setCursor")}r.setLegend=Gn;let jn=null;function Bn(e){!0===e?jn=null:(jn=O.getBoundingClientRect(),ti("syncRect",jn))}function Vn(e,t,l,n,i,o){il._lock||(Un(e,t,l,n,i,o,0,!1,null!=e),null!=e?Nn(null,!0,!0):Nn(t,!0,!1))}function Un(e,t,l,n,i,o,s,u,a){if(null==jn&&Bn(!1),null!=e)l=e.clientX-jn.left,n=e.clientY-jn.top;else{if(0>l||0>n)return gn=-10,void(xn=-10);let[e,s]=li.scales,r=t.cursor.sync,[u,a]=r.values,[c,f]=r.scales,[h,d]=li.match,p=t.axes[0].side%2==1,m=0==Re.ori?Et:Dt,g=1==Re.ori?Et:Dt,w=p?o:i,_=p?i:o,k=p?n:l,b=p?l:n;if(l=null!=c?h(e,c)?x(u,Ee[e],m,0):-10:m*(k/w),n=null!=f?d(s,f)?x(a,Ee[s],g,0):-10:g*(b/_),1==Re.ori){let e=l;l=n,n=e}}a&&(l>1&&Et-1>l||(l=T(l,Et)),n>1&&Dt-1>n||(n=T(n,Dt))),u?(cn=l,fn=n,[hn,dn]=il.move(r,l,n)):(gn=l,xn=n)}const Jn={width:0,height:0};function qn(){zn(Jn,!1)}function Kn(e,t,l,n,i,o){vn=!0,Mn=Sn=yn._x=yn._y=!1,Un(e,t,l,n,i,o,0,!0,!1),null!=e&&(bt(ae,xe,Zn),oi(ue,r,hn,dn,Et,Dt,null))}function Zn(e,t,l,n,i,o){vn=yn._x=yn._y=!1,Un(e,t,l,n,i,o,0,!1,!0);let{left:s,top:u,width:a,height:c}=En,f=a>0||c>0;if(f&&zn(En),yn.setScale&&f){let e=s,t=a,l=u,n=c;if(1==Re.ori&&(e=u,t=c,l=s,n=a),Mn&&Tn(Pe,Fn(e,Pe),Fn(e+t,Pe)),Sn)for(let e in Ee){let t=Ee[e];e!=Pe&&null==t.from&&t.min!=D&&Tn(e,Fn(l+n,e),Fn(l,e))}qn()}else il.lock&&(il._lock=!il._lock,il._lock||Nn(null,!0,!1));null!=e&&(vt(ae,xe),oi(ae,r,gn,xn,Et,Dt,null))}function $n(e){Ul(),qn(),null!=e&&oi(he,r,gn,xn,Et,Dt,null)}function Xn(){ke.forEach(Ll),ll(r.width,r.height,!0)}Ce(pe,we,Xn);const Qn={};Qn.mousedown=Kn,Qn.mousemove=Vn,Qn.mouseup=Zn,Qn.dblclick=$n,Qn.setSeries=(e,t,l,n)=>{Pn(l,n,!0,!1)},il.show&&(bt(ue,O,Kn),bt(re,O,Vn),bt(ce,O,Bn),bt(fe,O,(function(){if(!il._lock){let e=vn;if(vn){let e,t,l=!0,n=!0,i=10;0==Re.ori?(e=Mn,t=Sn):(e=Sn,t=Mn),e&&t&&(l=i>=gn||gn>=Et-i,n=i>=xn||xn>=Dt-i),e&&l&&(gn=hn>gn?0:Et),t&&n&&(xn=dn>xn?0:Dt),Nn(null,!0,!0),vn=!1}gn=-10,xn=-10,Nn(null,!0,!0),e&&(vn=e)}})),bt(he,O,$n),yl.add(r),r.syncRect=Bn);const ei=r.hooks=t.hooks||{};function ti(e,t,l){e in ei&&ei[e].forEach((e=>{e.call(null,r,t,l)}))}(t.plugins||[]).forEach((e=>{for(let t in e.hooks)ei[t]=(ei[t]||[]).concat(e.hooks[t])}));const li=$({key:null,setSeries:!1,filters:{pub:F,sub:F},scales:[Pe,de[1]?de[1].scale:null],match:[H,H],values:[null,null]},il.sync);il.sync=li;const ni=li.key,ii=Xt(ni);function oi(e,t,l,n,i,o,s){li.filters.pub(e,t,l,n,i,o,s)&&ii.pub(e,t,l,n,i,o,s)}function si(){ti("init",t,l),Vl(l||t.data,!1),Oe[Pe]?bn(Pe,Oe[Pe]):Ul(),ll(t.width,t.height),Nn(null,!0,!1),zn(En,!1)}return ii.sub(r),r.pub=function(e,t,l,n,i,o,s){li.filters.sub(e,t,l,n,i,o,s)&&Qn[e](null,t,l,n,i,o,s)},r.destroy=function(){ii.unsub(r),yl.delete(r),xt.clear(),Fe(pe,we,Xn),S.remove(),ti("destroy")},de.forEach(al),ke.forEach((function(e,t){if(e._show=e.show,e.show){let l=e.side%2,n=Ee[e.scale];null==n&&(e.scale=l?de[1].scale:Pe,n=Ee[e.scale]);let i=n.time;e.size=A(e.size),e.space=A(e.space),e.rotate=A(e.rotate),e.incrs=A(e.incrs||(2==n.distr?Ze:i?1==se?at:ht:$e)),e.splits=A(e.splits||(i&&1==n.distr?Ve:3==n.distr?Ft:4==n.distr?Ht:Ct)),e.stroke=A(e.stroke),e.grid.stroke=A(e.grid.stroke),e.ticks.stroke=A(e.ticks.stroke),e.border.stroke=A(e.border.stroke);let o=e.values;e.values=U(o)&&!U(o[0])?A(o):i?U(o)?gt(Ne,mt(o,je)):J(o)?function(e,t){let l=Be(t);return(t,n)=>n.map((t=>l(e(t))))}(Ne,o):o||Ue:o||Yt,e.filter=A(e.filter||(3>n.distr?Y:Ot)),e.font=Rl(e.font),e.labelFont=Rl(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(cl[t]=!0,e._el=Se("u-axis",L))}})),n?n instanceof HTMLElement?(n.appendChild(S),si()):n(r,si):si(),r}Il.assign=$,Il.fmtNum=d,Il.rangeNum=a,Il.rangeLog=i,Il.rangeAsinh=o,Il.orient=Qt,Il.join=function(e,t){let l=new Set;for(let t=0;e.length>t;t++){let n=e[t][0],i=n.length;for(let e=0;i>e;e++)l.add(n[e])}let n=[Array.from(l).sort(((e,t)=>e-t))],i=n[0].length,o=new Map;for(let e=0;i>e;e++)o.set(n[0][e],e);for(let l=0;e.length>l;l++){let s=e[l],r=s[0];for(let e=1;s.length>e;e++){let u=s[e],a=Array(i).fill(void 0),c=t?t[l][e]:1,f=[];for(let e=0;u.length>e;e++){let t=u[e],l=o.get(r[e]);null===t?0!=c&&(a[l]=t,2==c&&f.push(l)):a[l]=t}X(a,f,i),n.push(a)}}return n},Il.fmtDate=Be,Il.tzDate=function(e,t){let l;return"UTC"==t||"Etc/UTC"==t?l=new Date(+e+6e4*e.getTimezoneOffset()):t==Ve?l=e:(l=new Date(e.toLocaleString("en-US",{timeZone:t})),l.setMilliseconds(e.getMilliseconds())),l},Il.sync=Xt;{Il.addGap=il,Il.clipGaps=nl;let e=Il.paths={points:xl};e.linear=bl,e.stepped=function(e){const l=c(e.align,1),n=c(e.ascDesc,!1);return(e,i,o,s)=>Qt(e,i,((r,u,a,c,f,h,d,p,m,g,x)=>{let w=r.pxRound,_=0==c.ori?al:cl;const k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},b=k.stroke,v=1*c.dir*(0==c.ori?1:-1);o=t(a,o,s,1),s=t(a,o,s,-1);let y=[],M=!1,S=w(d(a[1==v?o:s],f,x,m)),E=w(h(u[1==v?o:s],c,g,p)),D=E;_(b,E,S);for(let e=1==v?o:s;e>=o&&s>=e;e+=v){let t=a[e],n=w(h(u[e],c,g,p));if(null==t){null===t&&(il(y,D,n),M=!0);continue}let i=w(d(t,f,x,m));M&&(il(y,D,n),M=!1),1==l?_(b,n,S):_(b,D,i),_(b,n,i),S=i,D=n}let[z,T]=el(e,i);if(null!=r.fill||0!=z){let t=k.fill=new Path2D(b),l=w(d(r.fillTo(e,i,r.min,r.max,z),f,x,m));_(t,D,l),_(t,E,l)}k.gaps=y=r.gaps(e,i,o,s,y);let P=r.width*_e/2,A=n||1==l?P:-P,W=n||-1==l?-P:P;return y.forEach((e=>{e[0]+=A,e[1]+=W})),r.spanGaps||(k.clip=nl(y,c.ori,p,m,g,x)),0!=T&&(k.band=2==T?[ll(e,i,o,s,b,-1),ll(e,i,o,s,b,1)]:ll(e,i,o,s,b,T)),k}))},e.bars=function(e){const t=c((e=e||j).size,[.6,D,1]),l=e.align||0,n=(e.gap||0)*_e,i=c(e.radius,0),o=1-t[0],s=c(t[1],D)*_e,r=c(t[2],1)*_e,u=c(e.disp,j),a=c(e.each,(()=>{})),{fill:f,stroke:h}=u;return(e,t,d,p)=>Qt(e,t,((m,w,_,v,y,M,S,E,D,z,T)=>{let P=m.pxRound;const A=v.dir*(0==v.ori?1:-1),W=y.dir*(1==y.ori?1:-1);let Y,C,F=0==v.ori?fl:hl,H=0==v.ori?a:(e,t,l,n,i,o,s)=>{a(e,t,l,i,n,s,o)},[R,L]=el(e,t),I=3==y.distr?1==R?y.max:y.min:0,G=S(I,y,T,D),O=P(m.width*_e),N=!1,j=null,B=null,V=null,U=null;null==f||0!=O&&null==h||(N=!0,j=f.values(e,t,d,p),B=new Map,new Set(j).forEach((e=>{null!=e&&B.set(e,new Path2D)})),O>0&&(V=h.values(e,t,d,p),U=new Map,new Set(V).forEach((e=>{null!=e&&U.set(e,new Path2D)}))));let{x0:J,size:q}=u;if(null!=J&&null!=q){w=J.values(e,t,d,p),2==J.unit&&(w=w.map((t=>e.posToVal(E+t*z,v.key,!0))));let l=q.values(e,t,d,p);C=2==q.unit?l[0]*z:M(l[0],v,z,E)-M(0,v,z,E),C=P(C-O),Y=1==A?-O/2:C+O/2}else{let e=z;if(w.length>1){let t=null;for(let l=0,n=1/0;w.length>l;l++)if(void 0!==_[l]){if(null!=t){let i=g(w[l]-w[t]);n>i&&(n=i,e=g(M(w[l],v,z,E)-M(w[t],v,z,E)))}t=l}}C=P(k(s,b(r,e-e*o))-O-n),Y=(0==l?C/2:l==A?0:C)-l*A*n/2}const K={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let Z;0!=L&&(K.band=new Path2D,Z=P(S(1==L?y.max:y.min,y,T,D)));const $=N?null:new Path2D,X=K.band;let{y0:Q,y1:ee}=u,te=null;null!=Q&&null!=ee&&(_=ee.values(e,t,d,p),te=Q.values(e,t,d,p));for(let l=1==A?d:p;l>=d&&p>=l;l+=A){let n=_[l],o=M(2!=v.distr||null!=u?w[l]:l,v,z,E),s=S(c(n,I),y,T,D);null!=te&&null!=n&&(G=S(te[l],y,T,D));let r=P(o-Y),a=P(b(s,G)),f=P(k(s,G)),h=a-f,d=i*C;null!=n&&(N?(O>0&&null!=V[l]&&F(U.get(V[l]),r,f+x(O/2),C,b(0,h-O),d),null!=j[l]&&F(B.get(j[l]),r,f+x(O/2),C,b(0,h-O),d)):F($,r,f+x(O/2),C,b(0,h-O),d),H(e,t,l,r-O/2,f,C+O,h)),0!=L&&(W*L==1?(a=f,f=Z):(f=a,a=Z),h=a-f,F(X,r-O/2,f,C+O,b(0,h),0))}return O>0&&(K.stroke=N?U:$),K.fill=N?B:$,K}))},e.spline=function(){return function(e){return(l,n,i,o)=>Qt(l,n,((s,r,u,a,c,f,h,d,p,m,g)=>{let x,w,_,k=s.pxRound;0==a.ori?(x=rl,_=al,w=ml):(x=ul,_=cl,w=gl);const b=1*a.dir*(0==a.ori?1:-1);i=t(u,i,o,1),o=t(u,i,o,-1);let v=[],y=!1,M=k(f(r[1==b?i:o],a,m,d)),S=M,E=[],D=[];for(let e=1==b?i:o;e>=i&&o>=e;e+=b){let t=u[e],l=f(r[e],a,m,d);null!=t?(y&&(il(v,S,l),y=!1),E.push(S=l),D.push(h(u[e],c,g,p))):null===t&&(il(v,S,l),y=!0)}const z={stroke:e(E,D,x,_,w,k),fill:null,clip:null,band:null,gaps:null,flags:1},T=z.stroke;let[P,A]=el(l,n);if(null!=s.fill||0!=P){let e=z.fill=new Path2D(T),t=k(h(s.fillTo(l,n,s.min,s.max,P),c,g,p));_(e,S,t),_(e,M,t)}return z.gaps=v=s.gaps(l,n,i,o,v),s.spanGaps||(z.clip=nl(v,a.ori,d,p,m,g)),0!=A&&(z.band=2==A?[ll(l,n,i,o,T,-1),ll(l,n,i,o,T,1)]:ll(l,n,i,o,T,A)),z}))}(vl)}}return Il}();
diff --git a/src/uPlot.js b/src/uPlot.js
index 49f88e92..9110b920 100644
--- a/src/uPlot.js
+++ b/src/uPlot.js
@@ -1399,6 +1399,11 @@ export default function uPlot(opts, data, then) {
}
}
+ if (s._paths != null && s._paths.text != null)
+ {
+ s._paths.text(self, i);
+ }
+
if (ctxAlpha != 1)
ctx.globalAlpha = ctxAlpha = 1;