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