sensor-dashboard/uPlot.iife.min.js
2023-09-27 11:14:27 +02:00

3 lines
44 KiB
JavaScript

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