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