From 91df7ebd220f9f241a42e9a5d16f474d69b3ba37 Mon Sep 17 00:00:00 2001 From: pvictor Date: Tue, 3 Sep 2024 20:11:13 +0200 Subject: [PATCH] Updated uplot to 1.6.30 --- DESCRIPTION | 4 ++-- NEWS.md | 3 +++ inst/htmlwidgets/uPlot.js | 2 +- package-lock.json | 14 +++++++------- package.json | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 NEWS.md diff --git a/DESCRIPTION b/DESCRIPTION index 7c51ead..bd46b21 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: uPlot Title: Fast Interactive Charts with 'µPlot' 'JavaScript' Library -Version: 0.0.0.9200 +Version: 0.0.0.9300 Authors@R: c(person(given = "Victor", family = "Perrier", @@ -19,7 +19,7 @@ Description: An interface for 'µPlot' 'JavaScript' library in R. License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Imports: htmlwidgets, magrittr diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..dc9b952 --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +# uPlot (development version) + +* Updated uplot to 1.6.30. diff --git a/inst/htmlwidgets/uPlot.js b/inst/htmlwidgets/uPlot.js index 69dfabe..c83fb6b 100644 --- a/inst/htmlwidgets/uPlot.js +++ b/inst/htmlwidgets/uPlot.js @@ -1 +1 @@ -(()=>{"use strict";var e={350:(e,t,l)=>{l.d(t,{Z:()=>s});var n=l(81),o=l.n(n),i=l(645),r=l.n(i)()(o());r.push([e.id,'.uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: 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";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: ":";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline "background" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}',""]);const s=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var l="",n=void 0!==t[5];return t[4]&&(l+="@supports (".concat(t[4],") {")),t[2]&&(l+="@media ".concat(t[2]," {")),n&&(l+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),l+=e(t),n&&(l+="}"),t[2]&&(l+="}"),t[4]&&(l+="}"),l})).join("")},t.i=function(e,l,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(n)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),l&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=l):c[2]=l),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var t=[];function l(e){for(var l=-1,n=0;n{var t={};e.exports=function(e,l){var n=function(e){if(void 0===t[e]){var l=document.querySelector(e);if(window.HTMLIFrameElement&&l instanceof window.HTMLIFrameElement)try{l=l.contentDocument.head}catch(e){l=null}t[e]=l}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(l)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,l)=>{e.exports=function(e){var t=l.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(l){!function(e,t,l){var n="";l.supports&&(n+="@supports (".concat(l.supports,") {")),l.media&&(n+="@media ".concat(l.media," {"));var o=void 0!==l.layer;o&&(n+="@layer".concat(l.layer.length>0?" ".concat(l.layer):""," {")),n+=l.css,o&&(n+="}"),l.media&&(n+="}"),l.supports&&(n+="}");var i=l.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,l)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function l(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,l),i.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nc=void 0;var n={};(()=>{l.r(n),l.d(n,{drawPoints:()=>hn,uPlot:()=>ql}),window.HTMLWidgets;const e="u-off",t="u-label",o="width",i="height",r="top",s="bottom",u="left",a="right",c="#000",f="#0000",d="mousemove",h="mousedown",p="mouseup",m="mouseenter",g="mouseleave",x="dblclick",w="change",v="dppxchange",b="--",y="undefined"!=typeof window,k=y?document:null,_=y?window:null,M=y?navigator:null;let S,E;function T(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function z(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function P(e,t,l){e.style[t]=l+"px"}function D(e,t,l,n){let o=k.createElement(e);return null!=t&&T(o,t),null!=l&&l.insertBefore(o,n),o}function A(e,t){return D("div",e,t)}const C=new WeakMap;function W(t,l,n,o,i){let r="translate("+l+"px,"+n+"px)";r!=C.get(t)&&(t.style.transform=r,C.set(t,r),l<0||n<0||l>o||n>i?T(t,e):z(t,e))}const H=new WeakMap;function I(e,t,l){let n=t+l;n!=H.get(e)&&(H.set(e,n),e.style.background=t,e.style.borderColor=l)}const Y=new WeakMap;function R(e,t,l,n){let o=t+""+l;o!=Y.get(e)&&(Y.set(e,o),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 O={passive:!0},j={...O,capture:!0};function L(e,t,l,n){t.addEventListener(e,l,n?j:O)}function F(e,t,l,n){t.removeEventListener(e,l,n?j:O)}function N(e,t,l,n){let o;l=l||0;let i=(n=n||t.length-1)<=2147483647;for(;n-l>1;)o=i?l+n>>1:ne((l+n)/2),t[o]=t&&o<=l;o+=n)if(null!=e[o])return o;return-1}function U(e,t,l,n){let o=ae(e),i=ae(t),r=10==l?ce:fe;e==t&&(-1==o?(e*=l,t/=l):(e/=l,t*=l));let s=1==i?ie:ne,u=(1==o?ne:ie)(r(le(e))),a=s(r(le(t))),c=ue(l,u),f=ue(l,a);return 10==l&&(u<0&&(c=Ee(c,-u)),a<0&&(f=Ee(f,-a))),n||2==l?(e=c*o,t=f*i):(e=Se(e,c),t=Me(t,f)),[e,t]}function B(e,t,l,n){let o=U(e,t,l,n);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}y&&function e(){let t=devicePixelRatio;S!=t&&(S=t,E&&F(w,E,e),E=matchMedia(`(min-resolution: ${S-.001}dppx) and (max-resolution: ${S+.001}dppx)`),L(w,E,e),_.dispatchEvent(new CustomEvent(v)))}();const V={mode:3,pad:.1},Z={pad:0,soft:null,mode:0},q={min:Z,max:Z};function J(e,t,l,n){return Ye(l)?X(e,t,l):(Z.pad=l,Z.soft=n?0:null,Z.mode=n?3:0,X(e,t,q))}function K(e,t){return null==e?t:e}function X(e,t,l){let n=l.min,o=l.max,i=K(n.pad,0),r=K(o.pad,0),s=K(n.hard,-he),u=K(o.hard,he),a=K(n.soft,he),c=K(o.soft,-he),f=K(n.mode,0),d=K(o.mode,0),h=t-e,p=ce(h),m=se(le(e),le(t)),g=ce(m),x=le(g-p);(h<1e-9||x>10)&&(h=0,0!=e&&0!=t||(h=1e-9,2==f&&a!=he&&(i=0),2==d&&c!=-he&&(r=0)));let w=h||m||1e3,v=ce(w),b=ue(10,ne(v)),y=Ee(Se(e-w*(0==h?0==e?.1:1:i),b/10),9),k=e>=a&&(1==f||3==f&&y<=a||2==f&&y>=a)?a:he,_=se(s,y=k?k:re(k,y)),M=Ee(Me(t+w*(0==h?0==t?.1:1:r),b/10),9),S=t<=c&&(1==d||3==d&&M>=c||2==d&&M<=c)?c:-he,E=re(u,M>S&&t<=S?S:se(S,M));return _==E&&0==_&&(E=100),[_,E]}const $=new Intl.NumberFormat(y?M.language:"en-US"),Q=e=>$.format(e),ee=Math,te=ee.PI,le=ee.abs,ne=ee.floor,oe=ee.round,ie=ee.ceil,re=ee.min,se=ee.max,ue=ee.pow,ae=ee.sign,ce=ee.log10,fe=ee.log2,de=(e,t=1)=>ee.asinh(e/t),he=1/0;function pe(e){return 1+(0|ce((e^e>>31)-(e>>31)))}function me(e,t,l){return re(se(e,t),l)}function ge(e){return"function"==typeof e?e:()=>e}const xe=e=>e,we=(e,t)=>t,ve=e=>null,be=e=>!0,ye=(e,t)=>e==t,ke=e=>Ee(e,14);function _e(e,t){return ke(Ee(ke(e/t))*t)}function Me(e,t){return ke(ie(ke(e/t))*t)}function Se(e,t){return ke(ne(ke(e/t))*t)}function Ee(e,t=0){if(He(e))return e;let l=10**t,n=e*l*(1+Number.EPSILON);return oe(n)/l}const Te=new Map;function ze(e){return((""+e).split(".")[1]||"").length}function Pe(e,t,l,n){let o=[],i=n.map(ze);for(let r=t;r=0&&r>=0?0:t)+(r>=i[e]?0:i[e]),a=Ee(s,u);o.push(a),Te.set(a,u)}}return o}const De={},Ae=[],Ce=[null,null],We=Array.isArray,He=Number.isInteger;function Ie(e){return"string"==typeof e}function Ye(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function Re(e){return null!=e&&"object"==typeof e}const Oe=Object.getPrototypeOf(Uint8Array);function je(e,t=Ye){let l;if(We(e)){let n=e.find((e=>null!=e));if(We(n)||t(n)){l=Array(e.length);for(let n=0;ni){for(n=r-1;n>=0&&null==e[n];)e[n--]=null;for(n=r+1;nPromise.resolve().then(e):queueMicrotask,Ge=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Be(e){return e.slice(0,3)}const Ve=Ue.map(Be),Ze=Ge.map(Be),qe={MMMM:Ge,MMM:Ze,WWWW:Ue,WWW:Ve};function Je(e){return(e<10?"0":"")+e}const Ke={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=>Je(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Je(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Je(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Je(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Je(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Xe(e,t){t=t||qe;let l,n=[],o=/\{([a-z]+)\}|[^{]+/gi;for(;l=o.exec(e);)n.push("{"==l[0][0]?Ke[l[1]]:l[0]);return e=>{let l="";for(let o=0;oe%1==0,et=[1,2,2.5,5],tt=Pe(10,-16,0,et),lt=Pe(10,0,16,et),nt=lt.filter(Qe),ot=tt.concat(lt),it="{YYYY}",rt="\n"+it,st="{M}/{D}",ut="\n"+st,at=ut+"/{YY}",ct="{aa}",ft="{h}:{mm}"+ct,dt="\n"+ft,ht=":{ss}",pt=null;function mt(e){let t=1e3*e,l=60*t,n=60*l,o=24*n,i=30*o,r=365*o;return[(1==e?Pe(10,0,3,et).filter(Qe):Pe(10,-3,0,et)).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,o,2*o,3*o,4*o,5*o,6*o,7*o,8*o,9*o,10*o,15*o,i,2*i,3*i,4*i,6*i,r,2*r,5*r,10*r,25*r,50*r,100*r]),[[r,it,pt,pt,pt,pt,pt,pt,1],[28*o,"{MMM}",rt,pt,pt,pt,pt,pt,1],[o,st,rt,pt,pt,pt,pt,pt,1],[n,"{h}"+ct,at,pt,ut,pt,pt,pt,1],[l,ft,at,pt,ut,pt,pt,pt,1],[t,ht,at+" "+ft,pt,ut+" "+ft,pt,dt,pt,1],[e,ht+".{fff}",at+" "+ft,pt,ut+" "+ft,pt,dt,pt,1]],function(t){return(s,u,a,c,f,d)=>{let h=[],p=f>=r,m=f>=i&&f=o?o:f,r=v+(ne(a)-ne(x))+Me(x-v,i);h.push(r);let p=t(r),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=f/n,w=d/s.axes[u]._space;for(;r=Ee(r+f,1==e?0:3),!(r>c);)if(g>1){let e=ne(Ee(m+g,6))%24,l=t(r).getHours()-e;l>1&&(l=-1),r-=l*n,m=(m+g)%24,Ee((r-h[h.length-1])/f,3)*w>=.7&&h.push(r)}else h.push(r)}return h}}]}const[gt,xt,wt]=mt(1),[vt,bt,yt]=mt(.001);function kt(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,o,i,r)=>{let s,u,a,c,f,d,h=t.find((e=>r>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),o=l.getMonth(),i=l.getDate(),r=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=s&&h[2]||o!=u&&h[3]||i!=a&&h[4]||r!=c&&h[5]||p!=f&&h[6]||m!=d&&h[7]||h[1];return s=n,u=o,a=i,c=r,f=p,d=m,g(l)}))}}function Mt(e,t,l){return new Date(e,t,l)}function St(e,t){return t(e)}function Et(e,t){return(l,n,o,i)=>null==i?b:t(e(n))}Pe(2,-53,53,[1]);const Tt={show:!0,live:!0,isolate:!1,mount:()=>{},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:[]},zt=[0,0];function Pt(e,t,l,n=!0){return e=>{0==e.button&&(!n||e.target==t)&&l(e)}}function Dt(e,t,l,n=!0){return e=>{(!n||e.target==t)&&l(e)}}const At={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return zt[0]=t,zt[1]=l,zt},points:{show:function(e,t){let l=e.cursor.points,n=A(),r=l.size(e,t);P(n,o,r),P(n,i,r);let s=r/-2;P(n,"marginLeft",s),P(n,"marginTop",s);let u=l.width(e,t,r);return u&&P(n,"borderWidth",u),n},size:function(e,t){return e.series[t].points.size},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:Pt,mouseup:Pt,click:Pt,dblclick:Pt,mousemove:Dt,mouseleave:Dt,mouseenter:Dt},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{prox:-1,bias:0},left:-10,top:-10,idx:null,dataIdx:function(e,t,l){return l},idxs:null,event:null},Ct={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Wt=Le({},Ct,{filter:we}),Ht=Le({},Wt,{size:10}),It=Le({},Ct,{show:!1}),Yt='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"',Rt="bold "+Yt,Ot={show:!0,scale:"x",stroke:c,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Rt,side:2,grid:Wt,ticks:Ht,border:It,font:Yt,lineGap:1.5,rotate:0},jt={show:!0,scale:"x",auto:!1,sorted:1,min:he,max:-he,idxs:[]};function Lt(e,t,l,n,o){return t.map((e=>null==e?"":Q(e)))}function Ft(e,t,l,n,o,i,r){let s=[],u=Te.get(o)||0;for(let e=l=r?l:Ee(Me(l,o),u);e<=n;e=Ee(e+o,u))s.push(Object.is(e,-0)?0:e);return s}function Nt(e,t,l,n,o,i,r){const s=[],u=e.scales[e.axes[t].scale].log,a=ne((10==u?ce:fe)(l));o=ue(u,a),10==u&&a<0&&(o=Ee(o,-a));let c=l;do{s.push(c),c+=o,10==u&&(c=Ee(c,Te.get(o))),c>=o*u&&(o=c)}while(c<=n);return s}function Gt(e,t,l,n,o,i,r){let s=e.scales[e.axes[t].scale].asinh,u=n>s?Nt(e,t,se(s,l),n,o):[s],a=n>=0&&l<=0?[0]:[];return(l<-s?Nt(e,t,se(s,-n),-l,o):[s]).reverse().map((e=>-e)).concat(a,u)}const Ut=/./,Bt=/[12357]/,Vt=/[125]/,Zt=/1/,qt=(e,t,l,n)=>e.map(((e,o)=>4==t&&0==e||o%n==0&&l.test(e.toExponential()[e<0?1:0])?e:null));function Jt(e,t,l,n,o){let i=e.axes[l],r=i.scale,s=e.scales[r],u=e.valToPos,a=i._space,c=u(10,r),f=u(9,r)-c>=a?Ut:u(7,r)-c>=a?Bt:u(5,r)-c>=a?Vt:Zt;if(f==Zt){let e=le(u(1,r)-c);if(eo,tl={show:!0,auto:!0,sorted:0,gaps:el,alpha:1,facets:[Le({},Qt,{scale:"x"}),Le({},Qt,{scale:"y"})]},ll={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:el,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],o=e._data[0],i=e.valToPos(o[n[0]],l,!0),r=e.valToPos(o[n[1]],l,!0),s=le(r-i)/(e.series[t].points.space*S);return n[1]-n[0]<=s},filter:null},values:null,min:he,max:-he,idxs:[],path:null,clip:null};function nl(e,t,l,n,o){return l/10}const ol={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},il=Le({},ol,{time:!1,ori:1}),rl={};function sl(e,t){let l=rl[e];return l||(l={key:e,plots:[],sub(e){l.plots.push(e)},unsub(e){l.plots=l.plots.filter((t=>t!=e))},pub(e,t,n,o,i,r,s){for(let u=0;u{let m=e.pxRound;const g=s.dir*(0==s.ori?1:-1),x=0==s.ori?wl:vl;let w,v;1==g?(w=l,v=n):(w=n,v=l);let b=m(a(t[w],s,h,f)),y=m(c(r[w],u,p,d)),k=m(a(t[v],s,h,f)),_=m(c(1==i?u.max:u.min,u,p,d)),M=new Path2D(o);return x(M,k,_),x(M,b,_),x(M,b,y),M}))}function dl(e,t,l,n,o,i){let r=null;if(e.length>0){r=new Path2D;const s=0==t?bl:yl;let u=l;for(let t=0;tl[0]){let e=l[0]-u;e>0&&s(r,u,n,e,n+i),u=l[1]}}let a=l+o-u,c=10;a>0&&s(r,u,n-c/2,a,n+i+c)}return r}function hl(e,t,l,n,o,i,r){let s=[],u=e.length;for(let a=1==o?l:n;a>=l&&a<=n;a+=o)if(null===t[a]){let c=a,f=a;if(1==o)for(;++a<=n&&null===t[a];)f=a;else for(;--a>=l&&null===t[a];)f=a;let d=i(e[c]),h=f==c?d:i(e[f]),p=c-o;d=r<=0&&p>=0&&p=0&&m>=0&&m=d&&s.push([d,h])}return s}function pl(e){return 0==e?xe:1==e?oe:t=>_e(t,e)}function ml(e){let t=0==e?gl:xl,l=0==e?(e,t,l,n,o,i)=>{e.arcTo(t,l,n,o,i)}:(e,t,l,n,o,i)=>{e.arcTo(l,t,o,n,i)},n=0==e?(e,t,l,n,o)=>{e.rect(t,l,n,o)}:(e,t,l,n,o)=>{e.rect(l,t,o,n)};return(e,o,i,r,s,u=0,a=0)=>{0==u&&0==a?n(e,o,i,r,s):(u=re(u,r/2,s/2),a=re(a,r/2,s/2),t(e,o+u,i),l(e,o+r,i,o+r,i+s,u),l(e,o+r,i+s,o,i+s,a),l(e,o,i+s,o,i,a),l(e,o,i,o+r,i,u),e.closePath())}}const gl=(e,t,l)=>{e.moveTo(t,l)},xl=(e,t,l)=>{e.moveTo(l,t)},wl=(e,t,l)=>{e.lineTo(t,l)},vl=(e,t,l)=>{e.lineTo(l,t)},bl=ml(0),yl=ml(1),kl=(e,t,l,n,o,i)=>{e.arc(t,l,n,o,i)},_l=(e,t,l,n,o,i)=>{e.arc(l,t,n,o,i)},Ml=(e,t,l,n,o,i,r)=>{e.bezierCurveTo(t,l,n,o,i,r)},Sl=(e,t,l,n,o,i,r)=>{e.bezierCurveTo(l,t,o,n,r,i)};function El(e){return(e,t,l,n,o)=>ul(e,t,((t,i,r,s,u,a,c,f,d,h,p)=>{let m,g,{pxRound:x,points:w}=t;0==s.ori?(m=gl,g=kl):(m=xl,g=_l);const v=Ee(w.width*S,3);let b=(w.size-w.width)/2*S,y=Ee(2*b,3),k=new Path2D,_=new Path2D,{left:M,top:E,width:T,height:z}=e.bbox;bl(_,M-y,E-y,T+2*y,z+2*y);const P=e=>{if(null!=r[e]){let t=x(a(i[e],s,h,f)),l=x(c(r[e],u,p,d));m(k,t+b,l),g(k,t,l,b,0,2*te)}};if(o)o.forEach(P);else for(let e=l;e<=n;e++)P(e);return{stroke:v>0?k:null,fill:k,clip:_,flags:3}}))}function Tl(e){return(t,l,n,o,i,r)=>{n!=o&&(i!=n&&r!=n&&e(t,l,n),i!=o&&r!=o&&e(t,l,o),e(t,l,r))}}const zl=Tl(wl),Pl=Tl(vl);function Dl(e){const t=K(e?.alignGaps,0);return(e,l,n,o)=>ul(e,l,((i,r,s,u,a,c,f,d,h,p,m)=>{let g,x,w=i.pxRound,v=e=>w(c(e,u,p,d)),b=e=>w(f(e,a,m,h));0==u.ori?(g=wl,x=zl):(g=vl,x=Pl);const y=u.dir*(0==u.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},_=k.stroke;let M,S,E,T=he,z=-he,P=v(r[1==y?n:o]),D=G(s,n,o,1*y),A=G(s,n,o,-1*y),C=v(r[D]),W=v(r[A]),H=!1;for(let e=1==y?n:o;e>=n&&e<=o;e+=y){let t=v(r[e]),l=s[e];t==P?null!=l?(S=b(l),T==he&&(g(_,t,S),M=S),T=re(S,T),z=se(S,z)):null===l&&(H=!0):(T!=he&&(x(_,P,T,z,M,S),E=P),null!=l?(S=b(l),g(_,t,S),T=z=M=S):(T=he,z=-he,null===l&&(H=!0)),P=t)}T!=he&&T!=z&&E!=P&&x(_,P,T,z,M,S);let[I,Y]=al(e,l);if(null!=i.fill||0!=I){let t=k.fill=new Path2D(_),n=b(i.fillTo(e,l,i.min,i.max,I));g(t,W,n),g(t,C,n)}if(!i.spanGaps){let a=[];H&&a.push(...hl(r,s,n,o,y,v,t)),k.gaps=a=i.gaps(e,l,n,o,a),k.clip=dl(a,u.ori,d,h,p,m)}return 0!=Y&&(k.band=2==Y?[fl(e,l,n,o,_,-1),fl(e,l,n,o,_,1)]:fl(e,l,n,o,_,Y)),k}))}function Al(e,t,l,n,o,i){const r=e.length;if(r<2)return null;const s=new Path2D;if(l(s,e[0],t[0]),2==r)n(s,e[1],t[1]);else{let l=Array(r),n=Array(r-1),i=Array(r-1),u=Array(r-1);for(let l=0;l0!=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[r-1]=n[r-2];for(let n=0;n{ql.pxRatio=S})));const Hl=Dl(),Il=El();function Yl(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>Rl(e,n,t,l)))}function Rl(e,t,l,n){return Le({},0==t?l:n,e)}function Ol(e,t,l){return null==t?Ce:[t,l]}const jl=Ol;function Ll(e,t,l){return null==t?Ce:J(t,l,.1,!0)}function Fl(e,t,l,n){return null==t?Ce:U(t,l,e.scales[n].log,!1)}const Nl=Fl;function Gl(e,t,l,n){return null==t?Ce:B(t,l,e.scales[n].log,!1)}const Ul=Gl;function Bl(e,t,l,n,o){let i=se(pe(e),pe(t)),r=t-e,s=N(o/n*r,l);do{let e=l[s],t=n*e/r;if(t>=o&&i+(e<5?Te.get(e):0)<=17)return[e,t]}while(++s(t=oe((l=+n)*S))+"px")),t,l]}function Zl(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=Ee(e[2]*S,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function ql(l,n,c){const w={mode:K(l.mode,1)},y=w.mode;function M(e,t){return((3==t.distr?ce(e>0?e:t.clamp(w,e,t.min,t.max,t.key)):4==t.distr?de(e,t.asinh):e)-t._min)/(t._max-t._min)}function E(e,t,l,n){let o=M(e,t);return n+l*(-1==t.dir?1-o:o)}function C(e,t,l,n){let o=M(e,t);return n+l*(-1==t.dir?o:1-o)}function H(e,t,l,n){return 0==t.ori?E(e,t,l,n):C(e,t,l,n)}w.valToPosH=E,w.valToPosV=C;let Y=!1;w.status=0;const O=w.root=A("uplot");null!=l.id&&(O.id=l.id),T(O,l.class),l.title&&(A("u-title",O).textContent=l.title);const j=D("canvas"),G=w.ctx=j.getContext("2d"),Z=A("u-wrap",O);L("click",Z,(e=>{e.target===X&&(Tn!=_n||zn!=Mn)&&Hn.click(w,e)}),!0);const q=w.under=A("u-under",Z);Z.appendChild(j);const X=w.over=A("u-over",Z),$=+K((l=je(l)).pxAlign,1),Q=pl($);(l.plugins||[]).forEach((e=>{e.opts&&(l=e.opts(w,l)||l)}));const ne=l.ms||.001,ae=w.series=1==y?Yl(l.series||[],jt,ll,!1):(fe=l.series||[null],pe=tl,fe.map(((e,t)=>0==t?null:Le({},pe,e))));var fe,pe;const xe=w.axes=Yl(l.axes||[],Ot,$t,!0),ke=w.scales={},Se=w.bands=l.bands||[];Se.forEach((e=>{e.fill=ge(e.fill||null),e.dir=K(e.dir,-1)}));const Pe=2==y?ae[1].facets[0].scale:ae[0].scale,He={axes:function(){for(let e=0;een[e])):v,y=2==p.distr?en[v[1]]-en[v[0]]:d,k=t.ticks,_=t.border,M=k.show?oe(k.size*S):0,E=t._rotate*-te/180,T=Q(t._pos*S),z=T+(M+x)*f;n=0==i?z:0,l=1==i?z:0,rn(t.font[0],c,1==t.align?u:2==t.align?a:E>0?u:E<0?a:0==i?"center":3==o?a:u,E||1==i?"middle":2==o?r:s);let P=t.font[1]*t.lineGap,D=v.map((e=>Q(H(e,p,m,g)))),A=t._values;for(let e=0;e0&&(ae.forEach(((e,t)=>{if(t>0&&e.show&&null==e._paths){let l=2==y?[0,n[t][0].length-1]:function(e){let t=me(El-1,0,Sl-1),l=me(Tl+1,0,Sl-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&l{if(t>0&&e.show){Ql!=e.alpha&&(G.globalAlpha=Ql=e.alpha),un(t,!1),e._paths&&an(t,!1);{un(t,!0);let l=e._paths?e._paths.gaps:null,n=e.points.show(w,t,El,Tl,l),o=e.points.filter(w,t,n,l);(n||o)&&(e.points._paths=e.points.paths(w,t,El,Tl,o),an(t,!0))}1!=Ql&&(G.globalAlpha=Ql=1),xo("drawSeries",t)}})))}},Oe=(l.drawOrder||["axes","series"]).map((e=>He[e]));function Fe(e){let t=ke[e];if(null==t){let n=(l.scales||De)[e]||De;if(null!=n.from)Fe(n.from),ke[e]=Le({},ke[n.from],n,{key:e});else{t=ke[e]=Le({},e==Pe?ol:il,n),t.key=e;let l=t.time,o=t.range,i=We(o);if((e!=Pe||2==y&&!l)&&(!i||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?V:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?V:{mode:1,hard:o[1],soft:o[1]}},i=!1),!i&&Ye(o))){let e=o;o=(t,l,n)=>null==l?Ce:J(l,n,e)}t.range=ge(o||(l?jl:e==Pe?3==t.distr?Nl:4==t.distr?Ul:Ol:3==t.distr?Fl:4==t.distr?Gl:Ll)),t.auto=ge(!i&&t.auto),t.clamp=ge(t.clamp||nl),t._min=t._max=null}}}Fe("x"),Fe("y"),1==y&&ae.forEach((e=>{Fe(e.scale)})),xe.forEach((e=>{Fe(e.scale)}));for(let e in l.scales)Fe(e);const Ge=ke[Pe],Ue=Ge.distr;let Be,Ve;0==Ge.ori?(T(O,"u-hz"),Be=E,Ve=C):(T(O,"u-vt"),Be=C,Ve=E);const Ze={};for(let e in ke){let t=ke[e];null==t.min&&null==t.max||(Ze[e]={min:t.min,max:t.max},t.min=t.max=null)}const qe=l.tzDate||(e=>new Date(oe(e/ne))),Je=l.fmtDate||Xe,Ke=1==ne?wt(qe):yt(qe),$e=_t(qe,kt(1==ne?xt:bt,Je)),Qe=Et(qe,St("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Je)),et=[],tt=w.legend=Le({},Tt,l.legend),lt=tt.show,it=tt.markers;let rt,st,ut;tt.idxs=et,it.width=ge(it.width),it.dash=ge(it.dash),it.stroke=ge(it.stroke),it.fill=ge(it.fill);let at,ct=[],ft=[],dt=!1,ht={};if(tt.live){const e=ae[1]?ae[1].values:null;dt=null!=e,at=dt?e(w,1,0):{_:0};for(let e in at)ht[e]=b}if(lt)if(rt=D("table","u-legend",O),ut=D("tbody",null,rt),tt.mount(w,rt),dt){st=D("thead",null,rt,ut);let e=D("tr",null,st);for(var pt in D("th",null,e),at)D("th",t,e).textContent=pt}else T(rt,"u-inline"),tt.live&&T(rt,"u-live");const mt={show:!0},Mt={show:!1},zt=new Map;function Pt(e,t,l,n=!0){const o=zt.get(t)||{},i=hl.bind[e](w,t,l,n);i&&(L(e,t,o[e]=i),zt.set(t,o))}function Dt(e,t,l){const n=zt.get(t)||{};for(let l in n)null!=e&&l!=e||(F(l,t,n[l]),delete n[l]);null==e&&zt.delete(t)}let Ct=0,Wt=0,Ht=0,It=0,Yt=0,Rt=0,Ut=0,Bt=0,Vt=0,Zt=0;w.bbox={};let qt=!1,Qt=!1,el=!1,rl=!1,ul=!1,al=!1;function fl(e,t,l){(l||e!=w.width||t!=w.height)&&dl(e,t),gn(!1),el=!0,Qt=!0,hl.left>=0&&(rl=al=!0),Dn()}function dl(e,t){w.width=Ct=Ht=e,w.height=Wt=It=t,Yt=Rt=0,function(){let e=!1,t=!1,l=!1,n=!1;xe.forEach(((o,i)=>{if(o.show&&o._show){let{side:i,_size:r}=o,s=i%2,u=r+(null!=o.label?o.labelSize:0);u>0&&(s?(Ht-=u,3==i?(Yt+=u,n=!0):l=!0):(It-=u,0==i?(Rt+=u,e=!0):t=!0))}})),yl[0]=e,yl[1]=l,yl[2]=t,yl[3]=n,Ht-=Ml[1]+Ml[3],Yt+=Ml[3],It-=Ml[2]+Ml[0],Rt+=Ml[0]}(),function(){let e=Yt+Ht,t=Rt+It,l=Yt,n=Rt;function o(o,i){switch(o){case 1:return e+=i,e-i;case 2:return t+=i,t-i;case 3:return l-=i,l+i;case 0:return n-=i,n+i}}xe.forEach(((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=o(t,e._size),null!=e.label&&(e._lpos=o(t,e.labelSize))}}))}();let l=w.bbox;Ut=l.left=_e(Yt*S,.5),Bt=l.top=_e(Rt*S,.5),Vt=l.width=_e(Ht*S,.5),Zt=l.height=_e(It*S,.5)}w.setSize=function({width:e,height:t}){fl(e,t)};const hl=w.cursor=Le({},At,{drag:{y:2==y}},l.cursor),ml=e=>{hl.event=e};hl.idxs=et,hl._lock=!1;let gl=hl.points;gl.show=ge(gl.show),gl.size=ge(gl.size),gl.stroke=ge(gl.stroke),gl.width=ge(gl.width),gl.fill=ge(gl.fill);const xl=w.focus=Le({},l.focus||{alpha:.3},hl.focus),wl=xl.prox>=0;let vl=[null];function bl(l,n){if(1==y||n>0){let e=1==y&&ke[l.scale].time,t=l.value;l.value=e?Ie(t)?Et(qe,St(t,Je)):t||Qe:t||Xt,l.label=l.label||(e?"Time":"Value")}if(n>0){l.width=null==l.width?1:l.width,l.paths=l.paths||Hl||ve,l.fillTo=ge(l.fillTo||cl),l.pxAlign=+K(l.pxAlign,$),l.pxRound=pl(l.pxAlign),l.stroke=ge(l.stroke||null),l.fill=ge(l.fill||null),l._stroke=l._fill=l._paths=l._focus=null;let e=Ee(1*(3+2*(se(1,l.width)||1)),3),t=l.points=Le({},{size:e,width:se(1,.2*e),stroke:l.stroke,space:2*e,paths:Il,_stroke:null,_fill:null},l.points);t.show=ge(t.show),t.filter=ge(t.filter),t.fill=ge(t.fill),t.stroke=ge(t.stroke),t.paths=ge(t.paths),t.pxAlign=l.pxAlign}if(lt){let o=function(l,n){if(0==n&&(dt||!tt.live||2==y))return Ce;let o=[],i=D("tr","u-series",ut,ut.childNodes[n]);T(i,l.class),l.show||T(i,e);let r=D("th",null,i);if(it.show){let e=A("u-marker",r);if(n>0){let t=it.width(w,n);t&&(e.style.border=t+"px "+it.dash(w,n)+" "+it.stroke(w,n)),e.style.background=it.fill(w,n)}}let s=A(t,r);for(var u in s.textContent=l.label,n>0&&(it.show||(s.style.color=l.width>0?it.stroke(w,n):it.fill(w,n)),Pt("click",r,(e=>{if(hl._lock)return;ml(e);let t=ae.indexOf(l);if((e.ctrlKey||e.metaKey)!=tt.isolate){let e=ae.some(((e,l)=>l>0&&l!=t&&e.show));ae.forEach(((l,n)=>{n>0&&Fn(n,e?n==t?mt:Mt:mt,!0,vo.setSeries)}))}else Fn(t,{show:!l.show},!0,vo.setSeries)}),!1),wl&&Pt(m,r,(e=>{hl._lock||(ml(e),Fn(ae.indexOf(l),Bn,!0,vo.setSeries))}),!1)),at){let e=D("td","u-value",i);e.textContent="--",o.push(e)}return[i,o]}(l,n);ct.splice(n,0,o[0]),ft.splice(n,0,o[1]),tt.values.push(null)}if(hl.show){et.splice(n,0,null);let e=function(e,t){if(t>0){let l=hl.points.show(w,t);if(l)return T(l,"u-cursor-pt"),T(l,e.class),W(l,-10,-10,Ht,It),X.insertBefore(l,vl[t]),l}}(l,n);e&&vl.splice(n,0,e)}xo("addSeries",n)}w.addSeries=function(e,t){t=null==t?ae.length:t,e=1==y?Rl(e,t,jt,ll):Rl(e,t,null,tl),ae.splice(t,0,e),bl(ae[t],t)},w.delSeries=function(e){if(ae.splice(e,1),lt){tt.values.splice(e,1),ft.splice(e,1);let t=ct.splice(e,1)[0];Dt(null,t.firstChild),t.remove()}hl.show&&(et.splice(e,1),vl.length>1&&vl.splice(e,1)[0].remove()),xo("delSeries",e)};const yl=[!1,!1,!1,!1];function kl(e,t,l,n){let[o,i,r,s]=l,u=t%2,a=0;return 0==u&&(s||i)&&(a=0==t&&!o||2==t&&!r?oe(Ot.size/3):0),1==u&&(o||r)&&(a=1==t&&!i||3==t&&!s?oe($t.size/2):0),a}const _l=w.padding=(l.padding||[kl,kl,kl,kl]).map((e=>ge(K(e,kl)))),Ml=w._padding=_l.map(((e,t)=>e(w,t,yl,0)));let Sl,El=null,Tl=null;const zl=1==y?ae[0].idxs:null;let Pl,Dl,Al,Wl,ql,Jl,Kl,Xl,$l,Ql,en=null,tn=!1;function ln(e,t){if(n=null==e?[]:je(e,Re),2==y){Sl=0;for(let e=1;e=0,al=!0,Dn()}}function nn(){let e,t;tn=!0,1==y&&(Sl>0?(El=zl[0]=0,Tl=zl[1]=Sl-1,e=n[0][El],t=n[0][Tl],2==Ue?(e=El,t=Tl):e==t&&(3==Ue?[e,t]=U(e,e,Ge.log,!1):4==Ue?[e,t]=B(e,e,Ge.log,!1):Ge.time?t=e+oe(86400/ne):[e,t]=J(e,t,.1,!0))):(El=zl[0]=e=null,Tl=zl[1]=t=null)),Ln(Pe,e,t)}function on(e,t,l,n,o,i){e??=f,l??=Ae,n??="butt",o??=f,i??="round",e!=Pl&&(G.strokeStyle=Pl=e),o!=Dl&&(G.fillStyle=Dl=o),t!=Al&&(G.lineWidth=Al=t),i!=ql&&(G.lineJoin=ql=i),n!=Jl&&(G.lineCap=Jl=n),l!=Wl&&G.setLineDash(Wl=l)}function rn(e,t,l,n){t!=Dl&&(G.fillStyle=Dl=t),e!=Kl&&(G.font=Kl=e),l!=Xl&&(G.textAlign=Xl=l),n!=$l&&(G.textBaseline=$l=n)}function sn(e,t,l,n,o=0){if(n.length>0&&e.auto(w,tn)&&(null==t||null==t.min)){let t=K(El,0),i=K(Tl,n.length-1),r=null==l.min?3==e.distr?function(e,t,l){let n=he,o=-he;for(let i=t;i<=l;i++){let t=e[i];null!=t&&t>0&&(to&&(o=t))}return[n==he?1:n,o==-he?10:o]}(n,t,i):function(e,t,l,n){let o=he,i=-he;if(1==n)o=e[t],i=e[l];else if(-1==n)o=e[l],i=e[t];else for(let n=t;n<=l;n++){let t=e[n];null!=t&&(ti&&(i=t))}return[o,i]}(n,t,i,o):[l.min,l.max];e.min=re(e.min,l.min=r[0]),e.max=se(e.max,l.max=r[1])}}function un(e,t){let l=t?ae[e].points:ae[e];l._stroke=l.stroke(w,e),l._fill=l.fill(w,e)}function an(e,t){let l=t?ae[e].points:ae[e],o=l._stroke,i=l._fill,{stroke:r,fill:s,clip:u,flags:a}=l._paths,c=null,f=Ee(l.width*S,3),d=f%2/2;t&&null==i&&(i=f>0?"#fff":o);let h=1==l.pxAlign&&d>0;if(h&&G.translate(d,d),!t){let e=Ut-f/2,t=Bt-f/2,l=Vt+f,n=Zt+f;c=new Path2D,c.rect(e,t,l,n)}t?cn(o,f,l.dash,l.cap,i,r,s,a,u):function(e,t,l,o,i,r,s,u,a,c,f){let d=!1;Se.forEach(((h,p)=>{if(h.series[0]==e){let e,m=ae[h.series[1]],g=n[h.series[1]],x=(m._paths||De).band;We(x)&&(x=1==h.dir?x[0]:x[1]);let v=null;m.show&&x&&function(e,t,l){for(t=K(t,0),l=K(l,e.length-1);t<=l;){if(null!=e[t])return!0;t++}return!1}(g,El,Tl)?(v=h.fill(w,p)||r,e=m._paths.clip):x=null,cn(t,l,o,i,v,s,u,a,c,f,e,x),d=!0}})),d||cn(t,l,o,i,r,s,u,a,c,f)}(e,o,f,l.dash,l.cap,i,r,s,a,c,u),h&&G.translate(-d,-d)}function cn(e,t,l,n,o,i,r,s,u,a,c,f){on(e,t,l,n,o),(u||a||f)&&(G.save(),u&&G.clip(u),a&&G.clip(a)),f?3==(3&s)?(G.clip(f),c&&G.clip(c),dn(o,r),fn(e,i,t)):2&s?(dn(o,r),G.clip(f),fn(e,i,t)):1&s&&(G.save(),G.clip(f),c&&G.clip(c),dn(o,r),G.restore(),fn(e,i,t)):(dn(o,r),fn(e,i,t)),(u||a||f)&&G.restore()}function fn(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{G.strokeStyle=Pl=t,G.stroke(e)})):null!=t&&e&&G.stroke(t))}function dn(e,t){t instanceof Map?t.forEach(((e,t)=>{G.fillStyle=Dl=t,G.fill(e)})):null!=t&&e&&G.fill(t)}function hn(e,t,l,n,o,i,r,s,u,a){let c=r%2/2;1==$&&G.translate(c,c),on(s,r,u,a,s),G.beginPath();let f,d,h,p,m=o+(0==n||3==n?-i:i);0==l?(d=o,p=m):(f=o,h=m);for(let n=0;n{if(!l.show)return;let o=ke[l.scale];if(null==o.min)return void(l._show&&(t=!1,l._show=!1,gn(!1)));l._show||(t=!1,l._show=!0,gn(!1));let i=l.side,r=i%2,{min:s,max:u}=o,[a,c]=function(e,t,l,n){let o,i=xe[e];if(n<=0)o=[0,0];else{let r=i._space=i.space(w,e,t,l,n);o=Bl(t,l,i._incrs=i.incrs(w,e,t,l,n,r),n,r)}return i._found=o}(n,s,u,0==r?Ht:It);if(0==c)return;let f=2==o.distr,d=l._splits=l.splits(w,n,s,u,a,c,f),h=2==o.distr?d.map((e=>en[e])):d,p=2==o.distr?en[d[1]]-en[d[0]]:a,m=l._values=l.values(w,l.filter(w,h,n,c,p),n,c,p);l._rotate=2==i?l.rotate(w,m,n,c):0;let g=l._size;l._size=ie(l.size(w,m,n,e)),null!=g&&l._size!=g&&(t=!1)})),t}function mn(e){let t=!0;return _l.forEach(((l,n)=>{let o=l(w,n,yl,e);o!=Ml[n]&&(t=!1),Ml[n]=o})),t}function gn(e){ae.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==y?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}w.setData=ln;let xn,wn,vn,bn,yn,kn,_n,Mn,Sn,En,Tn,zn,Pn=!1;function Dn(){Pn||(Ne(An),Pn=!0)}function An(){qt&&(function(){let e=je(ke,Re);for(let t in e){let l=e[t],n=Ze[t];if(null!=n&&null!=n.min)Le(l,n),t==Pe&&gn(!0);else if(t!=Pe||2==y)if(0==Sl&&null==l.from){let e=l.range(w,null,null,t);l.min=e[0],l.max=e[1]}else l.min=he,l.max=-he}if(Sl>0){ae.forEach(((t,l)=>{if(1==y){let o=t.scale,i=e[o],r=Ze[o];if(0==l){let e=i.range(w,i.min,i.max,o);i.min=e[0],i.max=e[1],El=N(i.min,n[0]),Tl=N(i.max,n[0]),Tl-El>1&&(n[0][El]i.max&&Tl--),t.min=en[El],t.max=en[Tl]}else t.show&&t.auto&&sn(i,r,t,n[l],t.sorted);t.idxs[0]=El,t.idxs[1]=Tl}else if(l>0&&t.show&&t.auto){let[o,i]=t.facets,r=o.scale,s=i.scale,[u,a]=n[l];sn(e[r],Ze[r],o,u,o.sorted),sn(e[s],Ze[s],i,a,i.sorted),t.min=i.min,t.max=i.max}}));for(let t in e){let l=e[t],n=Ze[t];if(null==l.from&&(null==n||null==n.min)){let e=l.range(w,l.min==he?null:l.min,l.max==-he?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(w,n.min,n.max,t);l.min=e[0],l.max=e[1]}}}let t={},l=!1;for(let n in e){let o=e[n],i=ke[n];if(i.min!=o.min||i.max!=o.max){i.min=o.min,i.max=o.max;let e=i.distr;i._min=3==e?ce(i.min):4==e?de(i.min,i.asinh):i.min,i._max=3==e?ce(i.max):4==e?de(i.max,i.asinh):i.max,t[n]=l=!0}}if(l){ae.forEach(((e,l)=>{2==y?l>0&&t.y&&(e._paths=null):t[e.scale]&&(e._paths=null)}));for(let e in t)el=!0,xo("setScale",e);hl.show&&hl.left>=0&&(rl=al=!0)}for(let e in Ze)Ze[e]=null}(),qt=!1),el&&(function(){let e=!1,t=0;for(;!e;){t++;let l=pn(t),n=mn(t);e=3==t||l&&n,e||(dl(w.width,w.height),Qt=!0)}}(),el=!1),Qt&&(P(q,u,Yt),P(q,r,Rt),P(q,o,Ht),P(q,i,It),P(X,u,Yt),P(X,r,Rt),P(X,o,Ht),P(X,i,It),P(Z,o,Ct),P(Z,i,Wt),j.width=oe(Ct*S),j.height=oe(Wt*S),xe.forEach((({_el:t,_show:l,_size:n,_pos:o,side:i})=>{if(null!=t)if(l){let l=i%2==1;P(t,l?"left":"top",o-(3===i||0===i?n:0)),P(t,l?"width":"height",n),P(t,l?"top":"left",l?Rt:Yt),P(t,l?"height":"width",l?It:Ht),z(t,e)}else T(t,e)})),Pl=Dl=Al=ql=Jl=Kl=Xl=$l=Wl=null,Ql=1,to(!0),xo("setSize"),Qt=!1),Ct>0&&Wt>0&&(G.clearRect(0,0,j.width,j.height),xo("drawClear"),Oe.forEach((e=>e())),xo("draw")),Rn.show&&ul&&(jn(Rn),ul=!1),hl.show&&rl&&(Qn(null,!0,!1),rl=!1),tt.show&&tt.live&&al&&(Xn(),al=!1),Y||(Y=!0,w.status=1,xo("ready")),tn=!1,Pn=!1}function Cn(e,t){let l=ke[e];if(null==l.from){if(0==Sl){let n=l.range(w,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(Sl>1&&null!=t.min&&null!=t.max&&t.max-t.min<1e-16)return;e==Pe&&2==l.distr&&Sl>0&&(t.min=N(t.min,n[0]),t.max=N(t.max,n[0]),t.min==t.max&&t.max++),Ze[e]=t,qt=!0,Dn()}}w.redraw=(e,t)=>{el=t||!1,!1!==e?Ln(Pe,Ge.min,Ge.max):Dn()},w.setScale=Cn;let Wn=!1;const Hn=hl.drag;let In=Hn.x,Yn=Hn.y;hl.show&&(hl.x&&(xn=A("u-cursor-x",X)),hl.y&&(wn=A("u-cursor-y",X)),0==Ge.ori?(vn=xn,bn=wn):(vn=wn,bn=xn),Tn=hl.left,zn=hl.top);const Rn=w.select=Le({show:!0,over:!0,left:0,width:0,top:0,height:0},l.select),On=Rn.show?A("u-select",Rn.over?X:q):null;function jn(e,t){if(Rn.show){for(let t in e)Rn[t]=e[t],t in oo&&P(On,t,e[t]);!1!==t&&xo("setSelect")}}function Ln(e,t,l){Cn(e,{min:t,max:l})}function Fn(t,l,n,o){null!=l.focus&&function(e){if(e!=Un){let t=null==e,l=1!=xl.alpha;ae.forEach(((n,o)=>{let i=t||0==o||o==e;n._focus=t?null:i,l&&function(e,t){ae[e].alpha=t,hl.show&&vl[e]&&(vl[e].style.opacity=t),lt&&ct[e]&&(ct[e].style.opacity=t)}(o,i?1:xl.alpha)})),Un=e,l&&Dn()}}(t),null!=l.show&&ae.forEach(((n,o)=>{o>0&&(t==o||null==t)&&(n.show=l.show,function(t,l){let n=ae[t],o=lt?ct[t]:null;n.show?o&&z(o,e):(o&&T(o,e),vl.length>1&&W(vl[t],-10,-10,Ht,It))}(o,l.show),Ln(2==y?n.facets[1].scale:n.scale,null,null),Dn())})),!1!==n&&xo("setSeries",t,l),o&&ko("setSeries",w,t,l)}let Nn,Gn,Un;w.setSelect=jn,w.setSeries=Fn,w.addBand=function(e,t){e.fill=ge(e.fill||null),e.dir=K(e.dir,-1),t=null==t?Se.length:t,Se.splice(t,0,e)},w.setBand=function(e,t){Le(Se[e],t)},w.delBand=function(e){null==e?Se.length=0:Se.splice(e,1)};const Bn={focus:!0};function Vn(e,t,l){let n=ke[t];l&&(e=e/S-(1==n.ori?Rt:Yt));let o=Ht;1==n.ori&&(o=It,e=o-e),-1==n.dir&&(e=o-e);let i=n._min,r=i+(n._max-i)*(e/o),s=n.distr;return 3==s?ue(10,r):4==s?((e,t=1)=>ee.sinh(e)*t)(r,n.asinh):r}function Zn(e,t){P(On,u,Rn.left=e),P(On,o,Rn.width=t)}function qn(e,t){P(On,r,Rn.top=e),P(On,i,Rn.height=t)}lt&&wl&&Pt(g,rt,(e=>{hl._lock||(ml(e),null!=Un&&Fn(null,Bn,!0,vo.setSeries))})),w.valToIdx=e=>N(e,n[0]),w.posToIdx=function(e,t){return N(Vn(e,Pe,t),n[0],El,Tl)},w.posToVal=Vn,w.valToPos=(e,t,l)=>0==ke[t].ori?E(e,ke[t],l?Vt:Ht,l?Ut:0):C(e,ke[t],l?Zt:It,l?Bt:0),w.batch=function(e){e(w),Dn()},w.setCursor=(e,t,l)=>{Tn=e.left,zn=e.top,Qn(null,t,l)};let Jn=0==Ge.ori?Zn:qn,Kn=1==Ge.ori?Zn:qn;function Xn(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{et[t]=e})):void 0!==e.idx&&et.fill(e.idx),tt.idx=et[0]);for(let e=0;e0||1==y&&!dt)&&$n(e,et[e]);lt&&tt.live&&function(){if(lt&&tt.live)for(let e=2==y?1:0;eTl;Nn=he;let r=0==Ge.ori?Ht:It,s=1==Ge.ori?Ht:It;if(Tn<0||0==Sl||i){o=null;for(let e=0;e0&&vl.length>1&&W(vl[e],-10,-10,Ht,It);wl&&Fn(null,Bn,!0,null==e&&vo.setSeries),tt.live&&(et.fill(o),al=!0)}else{let e,t,l;1==y&&(e=0==Ge.ori?Tn:zn,t=Vn(e,Pe),o=N(t,n[0],El,Tl),l=Be(n[0][o],Ge,r,0));for(let e=2==y?1:0;e0&&i.show){let t,l,n=null==f?-10:Me(Ve(f,1==y?ke[i.scale]:ke[i.facets[1].scale],s,0),1);if(wl&&n>=0&&1==y){let t=le(n-zn);if(t=0?1:-1;o==(f>=0?1:-1)&&(1==o?1==l?f>=n:f<=n:1==l?f<=n:f>=n)&&(Nn=t,Gn=e)}else Nn=t,Gn=e}}if(0==Ge.ori?(t=d,l=n):(t=n,l=d),al&&vl.length>1){I(vl[e],hl.points.fill(w,e),hl.points.stroke(w,e));let n,o,i,r,s=!0,u=hl.points.bbox;if(null!=u){s=!1;let t=u(w,e);i=t.left,r=t.top,n=t.width,o=t.height}else i=t,r=l,n=o=hl.points.size(w,e);R(vl[e],n,o,s),W(vl[e],i,r,Ht,It)}}}}if(hl.idx=o,hl.left=Tn,hl.top=zn,al&&(tt.idx=o,Xn()),Rn.show&&Wn)if(null!=e){let[t,l]=vo.scales,[n,o]=vo.match,[i,u]=e.cursor.sync.scales,a=e.cursor.drag;if(In=a._x,Yn=a._y,In||Yn){let a,c,f,d,h,{left:p,top:m,width:g,height:x}=e.select,w=e.scales[t].ori,v=e.posToVal,b=null!=t&&n(t,i),y=null!=l&&o(l,u);b&&In?(0==w?(a=p,c=g):(a=m,c=x),f=ke[t],d=Be(v(a,i),f,r,0),h=Be(v(a+c,i),f,r,0),Jn(re(d,h),le(h-d))):Jn(0,r),y&&Yn?(1==w?(a=p,c=g):(a=m,c=x),f=ke[l],d=Ve(v(a,u),f,s,0),h=Ve(v(a+c,u),f,s,0),Kn(re(d,h),le(h-d))):Kn(0,s)}else io()}else{let e=le(Sn-yn),t=le(En-kn);if(1==Ge.ori){let l=e;e=t,t=l}In=Hn.x&&e>=Hn.dist,Yn=Hn.y&&t>=Hn.dist;let l,n,o=Hn.uni;null!=o?In&&Yn&&(In=e>=o,Yn=t>=o,In||Yn||(t>e?Yn=!0:In=!0)):Hn.x&&Hn.y&&(In||Yn)&&(In=Yn=!0),In&&(0==Ge.ori?(l=_n,n=Tn):(l=Mn,n=zn),Jn(re(l,n),le(n-l)),Yn||Kn(0,s)),Yn&&(1==Ge.ori?(l=_n,n=Tn):(l=Mn,n=zn),Kn(re(l,n),le(n-l)),In||Jn(0,r)),In||Yn||(Jn(0,0),Kn(0,0))}if(Hn._x=In,Hn._y=Yn,null==e){if(l){if(null!=bo){let[e,t]=vo.scales;vo.values[0]=null!=e?Vn(0==Ge.ori?Tn:zn,e):null,vo.values[1]=null!=t?Vn(1==Ge.ori?Tn:zn,t):null}ko(d,w,Tn,zn,Ht,It,o)}if(wl){let e=l&&vo.setSeries,t=xl.prox;null==Un?Nn<=t&&Fn(Gn,Bn,!0,e):Nn>t?Fn(null,Bn,!0,e):Gn!=Un&&Fn(Gn,Bn,!0,e)}}!1!==t&&xo("setCursor")}w.setLegend=Xn;let eo=null;function to(e=!1){e?eo=null:(eo=X.getBoundingClientRect(),xo("syncRect",eo))}function lo(e,t,l,n,o,i,r){hl._lock||Wn&&null!=e&&0==e.movementX&&0==e.movementY||(no(e,t,l,n,o,i,0,!1,null!=e),null!=e?Qn(null,!0,!0):Qn(t,!0,!1))}function no(e,t,l,n,o,i,r,s,u){if(null==eo&&to(!1),ml(e),null!=e)l=e.clientX-eo.left,n=e.clientY-eo.top;else{if(l<0||n<0)return Tn=-10,void(zn=-10);let[e,r]=vo.scales,s=t.cursor.sync,[u,a]=s.values,[c,f]=s.scales,[d,h]=vo.match,p=t.axes[0].side%2==1,m=0==Ge.ori?Ht:It,g=1==Ge.ori?Ht:It,x=p?i:o,w=p?o:i,v=p?n:l,b=p?l:n;if(l=null!=c?d(e,c)?H(u,ke[e],m,0):-10:m*(v/x),n=null!=f?h(r,f)?H(a,ke[r],g,0):-10:g*(b/w),1==Ge.ori){let e=l;l=n,n=e}}u&&((l<=1||l>=Ht-1)&&(l=_e(l,Ht)),(n<=1||n>=It-1)&&(n=_e(n,It))),s?(yn=l,kn=n,[_n,Mn]=hl.move(w,l,n)):(Tn=l,zn=n)}Object.defineProperty(w,"rect",{get:()=>(null==eo&&to(!1),eo)});const oo={width:0,height:0,left:0,top:0};function io(){jn(oo,!1)}let ro,so,uo,ao;function co(e,t,l,n,o,i,r){Wn=!0,In=Yn=Hn._x=Hn._y=!1,no(e,t,l,n,o,i,0,!0,!1),null!=e&&(Pt(p,k,fo,!1),ko(h,w,_n,Mn,Ht,It,null));let{left:s,top:u,width:a,height:c}=Rn;ro=s,so=u,uo=a,ao=c,io()}function fo(e,t,l,n,o,i,r){Wn=Hn._x=Hn._y=!1,no(e,t,l,n,o,i,0,!1,!0);let{left:s,top:u,width:a,height:c}=Rn,f=a>0||c>0,d=ro!=s||so!=u||uo!=a||ao!=c;if(f&&d&&jn(Rn),Hn.setScale&&f&&d){let e=s,t=a,l=u,n=c;if(1==Ge.ori&&(e=u,t=c,l=s,n=a),In&&Ln(Pe,Vn(e,Pe),Vn(e+t,Pe)),Yn)for(let e in ke){let t=ke[e];e!=Pe&&null==t.from&&t.min!=he&&Ln(e,Vn(l+n,e),Vn(l,e))}io()}else hl.lock&&(hl._lock=!hl._lock,hl._lock||Qn(null,!0,!1));null!=e&&(Dt(p,k),ko(p,w,Tn,zn,Ht,It,null))}function ho(e,t,l,n,o,i,r){hl._lock||(ml(e),nn(),io(),null!=e&&ko(x,w,Tn,zn,Ht,It,null))}function po(){xe.forEach(Zl),fl(w.width,w.height,!0)}L(v,_,po);const mo={};mo.mousedown=co,mo.mousemove=lo,mo.mouseup=fo,mo.dblclick=ho,mo.setSeries=(e,t,l,n)=>{-1!=(l=(0,vo.match[2])(w,t,l))&&Fn(l,n,!0,!1)},hl.show&&(Pt(h,X,co),Pt(d,X,lo),Pt(m,X,(e=>{ml(e),to(!1)})),Pt(g,X,(function(e,t,l,n,o,i,r){if(hl._lock)return;ml(e);let s=Wn;if(Wn){let e,t,l=!0,n=!0,o=10;0==Ge.ori?(e=In,t=Yn):(e=Yn,t=In),e&&t&&(l=Tn<=o||Tn>=Ht-o,n=zn<=o||zn>=It-o),e&&l&&(Tn=Tn<_n?0:Ht),t&&n&&(zn=zn{e.call(null,w,t,l)}))}(l.plugins||[]).forEach((e=>{for(let t in e.hooks)go[t]=(go[t]||[]).concat(e.hooks[t])}));const wo=(e,t,l)=>l,vo=Le({key:null,setSeries:!1,filters:{pub:be,sub:be},scales:[Pe,ae[1]?ae[1].scale:null],match:[ye,ye,wo],values:[null,null]},hl.sync);2==vo.match.length&&vo.match.push(wo),hl.sync=vo;const bo=vo.key,yo=sl(bo);function ko(e,t,l,n,o,i,r){vo.filters.pub(e,t,l,n,o,i,r)&&yo.pub(e,t,l,n,o,i,r)}function _o(){xo("init",l,n),ln(n||l.data,!1),Ze[Pe]?Cn(Pe,Ze[Pe]):nn(),ul=Rn.show,rl=al=!0,fl(l.width,l.height)}return yo.sub(w),w.pub=function(e,t,l,n,o,i,r){vo.filters.sub(e,t,l,n,o,i,r)&&mo[e](null,t,l,n,o,i,r)},w.destroy=function(){yo.unsub(w),Cl.delete(w),zt.clear(),F(v,_,po),O.remove(),rt?.remove(),xo("destroy")},ae.forEach(bl),xe.forEach((function(e,t){if(e._show=e.show,e.show){let l=e.side%2,n=ke[e.scale];null==n&&(e.scale=l?ae[1].scale:Pe,n=ke[e.scale]);let o=n.time;e.size=ge(e.size),e.space=ge(e.space),e.rotate=ge(e.rotate),We(e.incrs)&&e.incrs.forEach((e=>{!Te.has(e)&&Te.set(e,ze(e))})),e.incrs=ge(e.incrs||(2==n.distr?nt:o?1==ne?gt:vt:ot)),e.splits=ge(e.splits||(o&&1==n.distr?Ke:3==n.distr?Nt:4==n.distr?Gt:Ft)),e.stroke=ge(e.stroke),e.grid.stroke=ge(e.grid.stroke),e.ticks.stroke=ge(e.ticks.stroke),e.border.stroke=ge(e.border.stroke);let i=e.values;e.values=We(i)&&!We(i[0])?ge(i):o?We(i)?_t(qe,kt(i,Je)):Ie(i)?function(e,t){let l=Xe(t);return(t,n,o,i,r)=>n.map((t=>l(e(t))))}(qe,i):i||$e:i||Lt,e.filter=ge(e.filter||(n.distr>=3&&10==n.log?Jt:3==n.distr&&2==n.log?Kt:we)),e.font=Vl(e.font),e.labelFont=Vl(e.labelFont),e._size=e.size(w,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(yl[t]=!0,e._el=A("u-axis",Z))}})),c?c instanceof HTMLElement?(c.appendChild(O),_o()):c(w,_o):_o(),w}ql.assign=Le,ql.fmtNum=Q,ql.rangeNum=J,ql.rangeLog=U,ql.rangeAsinh=B,ql.orient=ul,ql.pxRatio=S,ql.join=function(e,t){if(function(e){let t=e[0][0],l=t.length;for(let n=1;n=n&&null==e[o];)o--;if(o<=n)return!0;const i=se(1,ne((o-n+1)/t));for(let t=e[n],l=n+i;l<=o;l+=i){const n=e[l];if(null!=n){if(n<=t)return!1;t=n}}return!0}(t[0])||(t=function(e){let t=e[0],l=t.length,n=Array(l);for(let e=0;et[e]-t[l]));let o=[];for(let t=0;te-t))],o=n[0].length,i=new Map;for(let e=0;eul(e,i,((u,a,c,f,d,h,p,m,g,x,w)=>{let v=u.pxRound,{left:b,width:y}=e.bbox,k=e=>v(h(e,f,x,m)),_=e=>v(p(e,d,w,g)),M=0==f.ori?wl:vl;const E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},T=E.stroke,z=f.dir*(0==f.ori?1:-1);r=G(c,r,s,1),s=G(c,r,s,-1);let P=_(c[1==z?r:s]),D=k(a[1==z?r:s]),A=D,C=D;o&&-1==t&&(C=b,M(T,C,P)),M(T,D,P);for(let e=1==z?r:s;e>=r&&e<=s;e+=z){let l=c[e];if(null==l)continue;let n=k(a[e]),o=_(l);1==t?M(T,n,P):M(T,A,o),M(T,n,o),P=o,A=n}let W=A;o&&1==t&&(W=b+y,M(T,W,P));let[H,I]=al(e,i);if(null!=u.fill||0!=H){let t=E.fill=new Path2D(T),l=_(u.fillTo(e,i,u.min,u.max,H));M(t,W,l),M(t,C,l)}if(!u.spanGaps){let o=[];o.push(...hl(a,c,r,s,z,k,n));let d=u.width*S/2,h=l||1==t?d:-d,p=l||-1==t?-d:d;o.forEach((e=>{e[0]+=h,e[1]+=p})),E.gaps=o=u.gaps(e,i,r,s,o),E.clip=dl(o,f.ori,m,g,x,w)}return 0!=I&&(E.band=2==I?[fl(e,i,r,s,T,-1),fl(e,i,r,s,T,1)]:fl(e,i,r,s,T,I)),E}))},e.bars=function(e){const t=K((e=e||De).size,[.6,he,1]),l=e.align||0,n=(e.gap||0)*S;let o=e.radius;o=null==o?[0,0]:"number"==typeof o?[o,0]:o;const i=ge(o),r=1-t[0],s=K(t[1],he)*S,u=K(t[2],1)*S,a=K(e.disp,De),c=K(e.each,(e=>{})),{fill:f,stroke:d}=a;return(e,t,o,h)=>ul(e,t,((p,m,g,x,w,v,b,y,k,_,M)=>{let E,T,z=p.pxRound;0==x.ori?[E,T]=i(e,t):[T,E]=i(e,t);const P=x.dir*(0==x.ori?1:-1),D=w.dir*(1==w.ori?1:-1);let A,C,W=0==x.ori?bl:yl,H=0==x.ori?c:(e,t,l,n,o,i,r)=>{c(e,t,l,o,n,r,i)},[I,Y]=al(e,t),R=3==w.distr?1==I?w.max:w.min:0,O=b(R,w,M,k),j=z(p.width*S),L=!1,F=null,N=null,G=null,U=null;null==f||0!=j&&null==d||(L=!0,F=f.values(e,t,o,h),N=new Map,new Set(F).forEach((e=>{null!=e&&N.set(e,new Path2D)})),j>0&&(G=d.values(e,t,o,h),U=new Map,new Set(G).forEach((e=>{null!=e&&U.set(e,new Path2D)}))));let{x0:B,size:V}=a,Z=!0;if(null!=B&&null!=V){m=B.values(e,t,o,h),2==B.unit&&(m=m.map((t=>e.posToVal(y+t*_,x.key,!0))));let l=V.values(e,t,o,h);C=2==V.unit?l[0]*_:v(l[0],x,_,y)-v(0,x,_,y),j>=C&&(j=0),C=z(me(C-j,u,s)),A=1==P?-j/2:C+j/2}else{let e=_;if(m.length>1){let t=null;for(let l=0,n=1/0;l=C&&(j=0),t+n<5&&(z=xe),C=z(me(e-t,u,s)-j-n),A=(0==l?C/2:l==P?0:C)-l*P*n/2,C+j>e&&(Z=!1)}const q={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:3};let J;0!=Y&&(q.band=new Path2D,J=z(b(1==Y?w.max:w.min,w,M,k)));const X=L?null:new Path2D,$=q.band;let{y0:Q,y1:ee}=a,te=null;null!=Q&&null!=ee&&(g=ee.values(e,t,o,h),te=Q.values(e,t,o,h));let oe=E*C,ie=T*C;for(let l=1==P?o:h;l>=o&&l<=h;l+=P){let n=g[l];if(void 0===n)continue;let o=v(2!=x.distr||null!=a?m[l]:l,x,_,y),i=b(K(n,R),w,M,k);null!=te&&null!=n&&(O=b(te[l],w,M,k));let r=z(o-A),s=z(se(i,O)),u=z(re(i,O)),c=s-u;if(null!=n){let o=n<0?ie:oe,i=n<0?oe:ie;L?(j>0&&null!=G[l]&&W(U.get(G[l]),r,u+ne(j/2),C,se(0,c-j),o,i),null!=F[l]&&W(N.get(F[l]),r,u+ne(j/2),C,se(0,c-j),o,i)):W(X,r,u+ne(j/2),C,se(0,c-j),o,i),H(e,t,l,r-j/2,u,C+j,c)}0==Y||null==n&&!Z||(D*Y==1?(s=u,u=J):(u=s,s=J),c=s-u,W($,r-j/2,u,C+j,se(0,c),0,0))}return j>0&&(q.stroke=L?U:X),q.fill=L?N:X,q}))},e.spline=function(e){return function(e,t){const l=K(t?.alignGaps,0);return(t,n,o,i)=>ul(t,n,((r,s,u,a,c,f,d,h,p,m,g)=>{let x,w,v,b=r.pxRound,y=e=>b(f(e,a,m,h)),k=e=>b(d(e,c,g,p));0==a.ori?(x=gl,v=wl,w=Ml):(x=xl,v=vl,w=Sl);const _=a.dir*(0==a.ori?1:-1);o=G(u,o,i,1),i=G(u,o,i,-1);let M=y(s[1==_?o:i]),S=M,E=[],T=[];for(let e=1==_?o:i;e>=o&&e<=i;e+=_)if(null!=u[e]){let t=y(s[e]);E.push(S=t),T.push(k(u[e]))}const z={stroke:e(E,T,x,v,w,b),fill:null,clip:null,band:null,gaps:null,flags:1},P=z.stroke;let[D,A]=al(t,n);if(null!=r.fill||0!=D){let e=z.fill=new Path2D(P),l=k(r.fillTo(t,n,r.min,r.max,D));v(e,S,l),v(e,M,l)}if(!r.spanGaps){let e=[];e.push(...hl(s,u,o,i,_,y,l)),z.gaps=e=r.gaps(t,n,o,i,e),z.clip=dl(e,a.ori,h,p,m,g)}return 0!=A&&(z.band=2==A?[fl(t,n,o,i,P,-1),fl(t,n,o,i,P,1)]:fl(t,n,o,i,P,A)),z}))}(Al,e)}}var Jl=l(379),Kl=l.n(Jl),Xl=l(795),$l=l.n(Xl),Ql=l(569),en=l.n(Ql),tn=l(565),ln=l.n(tn),nn=l(216),on=l.n(nn),rn=l(589),sn=l.n(rn),un=l(350),an={};function cn(e){var t,l=HTMLWidgets.find("#"+e);return void 0!==l&&(t=l.getWidget()),t}function fn(e,t){let l=[],n=[],o=e[0].length,i=Array(o);for(let e=0;ei[t]+=+e)));for(let l=1;ln>l&&!t(n))),l]});return n=n.filter((e=>e.series[1]>-1)),{data:[e[0]].concat(l),bands:n}}an.styleTagTransform=sn(),an.setAttributes=ln(),an.insert=en().bind(null,"head"),an.domAPI=$l(),an.insertStyleElement=on(),Kl()(un.Z,an),un.Z&&un.Z.locals&&un.Z.locals;const dn=e=>(t,l)=>{new ResizeObserver((e=>{for(let l of e){let e=l.contentRect.height,n=l.contentRect.width;const o=t.root.querySelectorAll(".u-legend, .u-title");for(let t of o)e-=Math.floor(t.offsetHeight);t.setSize({width:n,height:e})}})).observe(e),e.appendChild(t.root),l()},hn=(e,t,l,n)=>{const o=5*devicePixelRatio;return ql.orient(e,t,((l,n,i,r,s,u,a,c,f,d,h,p,m,g,x)=>{let w=e.data[t];e.ctx.fillStyle=l.stroke();let v=2*Math.PI;console.time("points");let b=new Path2D;for(let e=0;e=r.min&&t<=r.max&&l>=s.min&&l<=s.max){let e=u(t,r,d,c),n=a(l,s,h,f);b.moveTo(e+o/2,n),x(b,e,n,o/2,0,v)}}console.timeEnd("points"),e.ctx.fill(b)})),null};HTMLWidgets.widget({name:"uPlot",type:"output",factory:function(e,t,l){var n,o,i;return{renderValue:function(r){void 0!==n&&n.destroy(),(o=r.config.options).width=t,o.height=l,i=r.config.data,r.stacked?(o.hooks||(o.hooks={}),o.hooks.init=[e=>{[...e.root.querySelectorAll(".u-legend .u-series")].forEach(((t,l)=>{e.series[l]._hide&&(t.style.display="none")}))}],n=function(e,t,l,n,o,i,r,s){let{opts:u,data:a}=function(e,t,l,n){let o=function(e,t){return{scales:{x:{time:!0}},series:t}}(0,t),i=fn(n?n(l):l,(e=>!1));return o.bands=i.bands,o.cursor=o.cursor||{},o.cursor.dataIdx=(e,t,n,o)=>null===l[t][n]?null:n,o.series.forEach((e=>{e.value=(e,t,n,o)=>l[n][o],e.points=e.points||{},e.points.filter=(e,t,n,o)=>{if(n){let e=[];return l[t].forEach(((t,l)=>{null!==t&&e.push(l)})),e}}})),o.scales.y={range:(e,t,l)=>{let n=uPlot.rangeNum(t,l,.1,!0);return[n[0],n[1]]}},o.hooks={setSeries:[(e,t)=>{let n=fn(l,(t=>!e.series[t].show));e.delBand(null),n.bands.forEach((t=>e.addBand(t))),e.setData(n.data)}]},{opts:o,data:i.data}}(0,t,l,n);return u.title=e,u.width=o,u.height=i,u.hooks=Object.assign(u.hooks,r),console.log(u),new uPlot(u,a,s)}(o.title,o.series,i,null,t,l,o.hooks,dn(e))):n=new ql(o,i,dn(e))},getWidget:function(){return n},resize:function(e,t){}}}}),HTMLWidgets.shinyMode&&(Shiny.addCustomMessageHandler("uplot-api",(function(e){var t=cn(e.id);void 0!==t&&t[e.name].apply(null,e.args)})),Shiny.addCustomMessageHandler("uplot-setData",(function(e){var t=cn(e.id);void 0!==t&&t.setData(e.data)})))})();var o=window;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{"use strict";var e={350:(e,t,l)=>{l.d(t,{Z:()=>r});var n=l(81),o=l.n(n),i=l(645),s=l.n(i)()(o());s.push([e.id,'.uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: 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";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: ":";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline "background" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}',""]);const r=s},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var l="",n=void 0!==t[5];return t[4]&&(l+="@supports (".concat(t[4],") {")),t[2]&&(l+="@media ".concat(t[2]," {")),n&&(l+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),l+=e(t),n&&(l+="}"),t[2]&&(l+="}"),t[4]&&(l+="}"),l})).join("")},t.i=function(e,l,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var r=0;r0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),l&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=l):c[2]=l),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var t=[];function l(e){for(var l=-1,n=0;n{var t={};e.exports=function(e,l){var n=function(e){if(void 0===t[e]){var l=document.querySelector(e);if(window.HTMLIFrameElement&&l instanceof window.HTMLIFrameElement)try{l=l.contentDocument.head}catch(e){l=null}t[e]=l}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(l)}},216:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,l)=>{e.exports=function(e){var t=l.nc;t&&e.setAttribute("nonce",t)}},795:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(l){!function(e,t,l){var n="";l.supports&&(n+="@supports (".concat(l.supports,") {")),l.media&&(n+="@media ".concat(l.media," {"));var o=void 0!==l.layer;o&&(n+="@layer".concat(l.layer.length>0?" ".concat(l.layer):""," {")),n+=l.css,o&&(n+="}"),l.media&&(n+="}"),l.supports&&(n+="}");var i=l.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,l)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function l(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,l),i.exports}l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nc=void 0;var n={};(()=>{l.r(n),l.d(n,{drawPoints:()=>pn,uPlot:()=>Jl}),window.HTMLWidgets;const e="u-off",t="u-label",o="width",i="height",s="top",r="bottom",u="left",a="right",c="#000",f="#0000",d="mousemove",h="mousedown",p="mouseup",m="mouseenter",g="mouseleave",x="dblclick",w="change",v="dppxchange",b="--",y="undefined"!=typeof window,k=y?document:null,_=y?window:null,M=y?navigator:null;let S,E;function T(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function z(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function P(e,t,l){e.style[t]=l+"px"}function D(e,t,l,n){let o=k.createElement(e);return null!=t&&T(o,t),null!=l&&l.insertBefore(o,n),o}function A(e,t){return D("div",e,t)}const C=new WeakMap;function W(t,l,n,o,i){let s="translate("+l+"px,"+n+"px)";s!=C.get(t)&&(t.style.transform=s,C.set(t,s),l<0||n<0||l>o||n>i?T(t,e):z(t,e))}const I=new WeakMap;function H(e,t,l){let n=t+l;n!=I.get(e)&&(I.set(e,n),e.style.background=t,e.style.borderColor=l)}const Y=new WeakMap;function R(e,t,l,n){let o=t+""+l;o!=Y.get(e)&&(Y.set(e,o),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 O={passive:!0},j={...O,capture:!0};function L(e,t,l,n){t.addEventListener(e,l,n?j:O)}function F(e,t,l,n){t.removeEventListener(e,l,n?j:O)}function N(e,t,l,n){let o;l=l||0;let i=(n=n||t.length-1)<=2147483647;for(;n-l>1;)o=i?l+n>>1:ne((l+n)/2),t[o]=t&&o<=l;o+=n)if(null!=e[o])return o;return-1}function U(e,t,l,n){let o=ae(e),i=ae(t);e==t&&(-1==o?(e*=l,t/=l):(e/=l,t*=l));let s=10==l?ce:fe,r=1==i?ie:ne,u=(1==o?ne:ie)(s(le(e))),a=r(s(le(t))),c=ue(l,u),f=ue(l,a);return 10==l&&(u<0&&(c=Ee(c,-u)),a<0&&(f=Ee(f,-a))),n||2==l?(e=c*o,t=f*i):(e=Se(e,c),t=Me(t,f)),[e,t]}function B(e,t,l,n){let o=U(e,t,l,n);return 0==e&&(o[0]=0),0==t&&(o[1]=0),o}y&&function e(){let t=devicePixelRatio;S!=t&&(S=t,E&&F(w,E,e),E=matchMedia(`(min-resolution: ${S-.001}dppx) and (max-resolution: ${S+.001}dppx)`),L(w,E,e),_.dispatchEvent(new CustomEvent(v)))}();const V={mode:3,pad:.1},Z={pad:0,soft:null,mode:0},q={min:Z,max:Z};function J(e,t,l,n){return Ye(l)?X(e,t,l):(Z.pad=l,Z.soft=n?0:null,Z.mode=n?3:0,X(e,t,q))}function K(e,t){return null==e?t:e}function X(e,t,l){let n=l.min,o=l.max,i=K(n.pad,0),s=K(o.pad,0),r=K(n.hard,-he),u=K(o.hard,he),a=K(n.soft,he),c=K(o.soft,-he),f=K(n.mode,0),d=K(o.mode,0),h=t-e,p=ce(h),m=re(le(e),le(t)),g=ce(m),x=le(g-p);(h<1e-9||x>10)&&(h=0,0!=e&&0!=t||(h=1e-9,2==f&&a!=he&&(i=0),2==d&&c!=-he&&(s=0)));let w=h||m||1e3,v=ce(w),b=ue(10,ne(v)),y=Ee(Se(e-w*(0==h?0==e?.1:1:i),b/10),9),k=e>=a&&(1==f||3==f&&y<=a||2==f&&y>=a)?a:he,_=re(r,y=k?k:se(k,y)),M=Ee(Me(t+w*(0==h?0==t?.1:1:s),b/10),9),S=t<=c&&(1==d||3==d&&M>=c||2==d&&M<=c)?c:-he,E=se(u,M>S&&t<=S?S:re(S,M));return _==E&&0==_&&(E=100),[_,E]}const $=new Intl.NumberFormat(y?M.language:"en-US"),Q=e=>$.format(e),ee=Math,te=ee.PI,le=ee.abs,ne=ee.floor,oe=ee.round,ie=ee.ceil,se=ee.min,re=ee.max,ue=ee.pow,ae=ee.sign,ce=ee.log10,fe=ee.log2,de=(e,t=1)=>ee.asinh(e/t),he=1/0;function pe(e){return 1+(0|ce((e^e>>31)-(e>>31)))}function me(e,t,l){return se(re(e,t),l)}function ge(e){return"function"==typeof e?e:()=>e}const xe=e=>e,we=(e,t)=>t,ve=e=>null,be=e=>!0,ye=(e,t)=>e==t,ke=e=>Ee(e,14);function _e(e,t){return ke(Ee(ke(e/t))*t)}function Me(e,t){return ke(ie(ke(e/t))*t)}function Se(e,t){return ke(ne(ke(e/t))*t)}function Ee(e,t=0){if(Ie(e))return e;let l=10**t,n=e*l*(1+Number.EPSILON);return oe(n)/l}const Te=new Map;function ze(e){return((""+e).split(".")[1]||"").length}function Pe(e,t,l,n){let o=[],i=n.map(ze);for(let s=t;s=0&&s>=0?0:t)+(s>=i[e]?0:i[e]),a=Ee(r,u);o.push(a),Te.set(a,u)}}return o}const De={},Ae=[],Ce=[null,null],We=Array.isArray,Ie=Number.isInteger;function He(e){return"string"==typeof e}function Ye(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function Re(e){return null!=e&&"object"==typeof e}const Oe=Object.getPrototypeOf(Uint8Array);function je(e,t=Ye){let l;if(We(e)){let n=e.find((e=>null!=e));if(We(n)||t(n)){l=Array(e.length);for(let n=0;ni){for(n=s-1;n>=0&&null==e[n];)e[n--]=null;for(n=s+1;nPromise.resolve().then(e):queueMicrotask,Ge=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Be(e){return e.slice(0,3)}const Ve=Ue.map(Be),Ze=Ge.map(Be),qe={MMMM:Ge,MMM:Ze,WWWW:Ue,WWW:Ve};function Je(e){return(e<10?"0":"")+e}const Ke={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=>Je(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Je(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>Je(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Je(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Je(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>{return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Xe(e,t){t=t||qe;let l,n=[],o=/\{([a-z]+)\}|[^{]+/gi;for(;l=o.exec(e);)n.push("{"==l[0][0]?Ke[l[1]]:l[0]);return e=>{let l="";for(let o=0;oe%1==0,et=[1,2,2.5,5],tt=Pe(10,-16,0,et),lt=Pe(10,0,16,et),nt=lt.filter(Qe),ot=tt.concat(lt),it="{YYYY}",st="\n"+it,rt="{M}/{D}",ut="\n"+rt,at=ut+"/{YY}",ct="{aa}",ft="{h}:{mm}"+ct,dt="\n"+ft,ht=":{ss}",pt=null;function mt(e){let t=1e3*e,l=60*t,n=60*l,o=24*n,i=30*o,s=365*o;return[(1==e?Pe(10,0,3,et).filter(Qe):Pe(10,-3,0,et)).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,o,2*o,3*o,4*o,5*o,6*o,7*o,8*o,9*o,10*o,15*o,i,2*i,3*i,4*i,6*i,s,2*s,5*s,10*s,25*s,50*s,100*s]),[[s,it,pt,pt,pt,pt,pt,pt,1],[28*o,"{MMM}",st,pt,pt,pt,pt,pt,1],[o,rt,st,pt,pt,pt,pt,pt,1],[n,"{h}"+ct,at,pt,ut,pt,pt,pt,1],[l,ft,at,pt,ut,pt,pt,pt,1],[t,ht,at+" "+ft,pt,ut+" "+ft,pt,dt,pt,1],[e,ht+".{fff}",at+" "+ft,pt,ut+" "+ft,pt,dt,pt,1]],function(t){return(r,u,a,c,f,d)=>{let h=[],p=f>=s,m=f>=i&&f=o?o:f,s=v+(ne(a)-ne(x))+Me(x-v,i);h.push(s);let p=t(s),m=p.getHours()+p.getMinutes()/l+p.getSeconds()/n,g=f/n,w=d/r.axes[u]._space;for(;s=Ee(s+f,1==e?0:3),!(s>c);)if(g>1){let e=ne(Ee(m+g,6))%24,l=t(s).getHours()-e;l>1&&(l=-1),s-=l*n,m=(m+g)%24,Ee((s-h[h.length-1])/f,3)*w>=.7&&h.push(s)}else h.push(s)}return h}}]}const[gt,xt,wt]=mt(1),[vt,bt,yt]=mt(.001);function kt(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,o,i,s)=>{let r,u,a,c,f,d,h=t.find((e=>s>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),o=l.getMonth(),i=l.getDate(),s=l.getHours(),p=l.getMinutes(),m=l.getSeconds(),g=n!=r&&h[2]||o!=u&&h[3]||i!=a&&h[4]||s!=c&&h[5]||p!=f&&h[6]||m!=d&&h[7]||h[1];return r=n,u=o,a=i,c=s,f=p,d=m,g(l)}))}}function Mt(e,t,l){return new Date(e,t,l)}function St(e,t){return t(e)}function Et(e,t){return(l,n,o,i)=>null==i?b:t(e(n))}Pe(2,-53,53,[1]);const Tt={show:!0,live:!0,isolate:!1,mount:()=>{},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:[]},zt=[0,0];function Pt(e,t,l,n=!0){return e=>{0==e.button&&(!n||e.target==t)&&l(e)}}function Dt(e,t,l,n=!0){return e=>{(!n||e.target==t)&&l(e)}}const At={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return zt[0]=t,zt[1]=l,zt},points:{show:function(e,t){let l=e.cursor.points,n=A(),s=l.size(e,t);P(n,o,s),P(n,i,s);let r=s/-2;P(n,"marginLeft",r),P(n,"marginTop",r);let u=l.width(e,t,s);return u&&P(n,"borderWidth",u),n},size:function(e,t){return e.series[t].points.size},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:Pt,mouseup:Pt,click:Pt,dblclick:Pt,mousemove:Dt,mouseleave:Dt,mouseenter:Dt},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,l,n,o)=>n-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Ct={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Wt=Le({},Ct,{filter:we}),It=Le({},Wt,{size:10}),Ht=Le({},Ct,{show:!1}),Yt='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"',Rt="bold "+Yt,Ot={show:!0,scale:"x",stroke:c,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Rt,side:2,grid:Wt,ticks:It,border:Ht,font:Yt,lineGap:1.5,rotate:0},jt={show:!0,scale:"x",auto:!1,sorted:1,min:he,max:-he,idxs:[]};function Lt(e,t,l,n,o){return t.map((e=>null==e?"":Q(e)))}function Ft(e,t,l,n,o,i,s){let r=[],u=Te.get(o)||0;for(let e=l=s?l:Ee(Me(l,o),u);e<=n;e=Ee(e+o,u))r.push(Object.is(e,-0)?0:e);return r}function Nt(e,t,l,n,o,i,s){const r=[],u=e.scales[e.axes[t].scale].log,a=ne((10==u?ce:fe)(l));o=ue(u,a),10==u&&a<0&&(o=Ee(o,-a));let c=l;do{r.push(c),c+=o,10==u&&(c=Ee(c,Te.get(o))),c>=o*u&&(o=c)}while(c<=n);return r}function Gt(e,t,l,n,o,i,s){let r=e.scales[e.axes[t].scale].asinh,u=n>r?Nt(e,t,re(r,l),n,o):[r],a=n>=0&&l<=0?[0]:[];return(l<-r?Nt(e,t,re(r,-n),-l,o):[r]).reverse().map((e=>-e)).concat(a,u)}const Ut=/./,Bt=/[12357]/,Vt=/[125]/,Zt=/1/,qt=(e,t,l,n)=>e.map(((e,o)=>4==t&&0==e||o%n==0&&l.test(e.toExponential()[e<0?1:0])?e:null));function Jt(e,t,l,n,o){let i=e.axes[l],s=i.scale,r=e.scales[s],u=e.valToPos,a=i._space,c=u(10,s),f=u(9,s)-c>=a?Ut:u(7,s)-c>=a?Bt:u(5,s)-c>=a?Vt:Zt;if(f==Zt){let e=le(u(1,s)-c);if(eo,tl={show:!0,auto:!0,sorted:0,gaps:el,alpha:1,facets:[Le({},Qt,{scale:"x"}),Le({},Qt,{scale:"y"})]},ll={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:el,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],o=e._data[0],i=e.valToPos(o[n[0]],l,!0),s=e.valToPos(o[n[1]],l,!0),r=le(s-i)/(e.series[t].points.space*S);return n[1]-n[0]<=r},filter:null},values:null,min:he,max:-he,idxs:[],path:null,clip:null};function nl(e,t,l,n,o){return l/10}const ol={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},il=Le({},ol,{time:!1,ori:1}),sl={};function rl(e,t){let l=sl[e];return l||(l={key:e,plots:[],sub(e){l.plots.push(e)},unsub(e){l.plots=l.plots.filter((t=>t!=e))},pub(e,t,n,o,i,s,r){for(let u=0;u{let m=e.pxRound;const g=r.dir*(0==r.ori?1:-1),x=0==r.ori?wl:vl;let w,v;1==g?(w=l,v=n):(w=n,v=l);let b=m(a(t[w],r,h,f)),y=m(c(s[w],u,p,d)),k=m(a(t[v],r,h,f)),_=m(c(1==i?u.max:u.min,u,p,d)),M=new Path2D(o);return x(M,k,_),x(M,b,_),x(M,b,y),M}))}function dl(e,t,l,n,o,i){let s=null;if(e.length>0){s=new Path2D;const r=0==t?bl:yl;let u=l;for(let t=0;tl[0]){let e=l[0]-u;e>0&&r(s,u,n,e,n+i),u=l[1]}}let a=l+o-u,c=10;a>0&&r(s,u,n-c/2,a,n+i+c)}return s}function hl(e,t,l,n,o,i,s){let r=[],u=e.length;for(let a=1==o?l:n;a>=l&&a<=n;a+=o)if(null===t[a]){let c=a,f=a;if(1==o)for(;++a<=n&&null===t[a];)f=a;else for(;--a>=l&&null===t[a];)f=a;let d=i(e[c]),h=f==c?d:i(e[f]),p=c-o;d=s<=0&&p>=0&&p=0&&m>=0&&m=d&&r.push([d,h])}return r}function pl(e){return 0==e?xe:1==e?oe:t=>_e(t,e)}function ml(e){let t=0==e?gl:xl,l=0==e?(e,t,l,n,o,i)=>{e.arcTo(t,l,n,o,i)}:(e,t,l,n,o,i)=>{e.arcTo(l,t,o,n,i)},n=0==e?(e,t,l,n,o)=>{e.rect(t,l,n,o)}:(e,t,l,n,o)=>{e.rect(l,t,o,n)};return(e,o,i,s,r,u=0,a=0)=>{0==u&&0==a?n(e,o,i,s,r):(u=se(u,s/2,r/2),a=se(a,s/2,r/2),t(e,o+u,i),l(e,o+s,i,o+s,i+r,u),l(e,o+s,i+r,o,i+r,a),l(e,o,i+r,o,i,a),l(e,o,i,o+s,i,u),e.closePath())}}const gl=(e,t,l)=>{e.moveTo(t,l)},xl=(e,t,l)=>{e.moveTo(l,t)},wl=(e,t,l)=>{e.lineTo(t,l)},vl=(e,t,l)=>{e.lineTo(l,t)},bl=ml(0),yl=ml(1),kl=(e,t,l,n,o,i)=>{e.arc(t,l,n,o,i)},_l=(e,t,l,n,o,i)=>{e.arc(l,t,n,o,i)},Ml=(e,t,l,n,o,i,s)=>{e.bezierCurveTo(t,l,n,o,i,s)},Sl=(e,t,l,n,o,i,s)=>{e.bezierCurveTo(l,t,o,n,s,i)};function El(e){return(e,t,l,n,o)=>ul(e,t,((t,i,s,r,u,a,c,f,d,h,p)=>{let m,g,{pxRound:x,points:w}=t;0==r.ori?(m=gl,g=kl):(m=xl,g=_l);const v=Ee(w.width*S,3);let b=(w.size-w.width)/2*S,y=Ee(2*b,3),k=new Path2D,_=new Path2D,{left:M,top:E,width:T,height:z}=e.bbox;bl(_,M-y,E-y,T+2*y,z+2*y);const P=e=>{if(null!=s[e]){let t=x(a(i[e],r,h,f)),l=x(c(s[e],u,p,d));m(k,t+b,l),g(k,t,l,b,0,2*te)}};if(o)o.forEach(P);else for(let e=l;e<=n;e++)P(e);return{stroke:v>0?k:null,fill:k,clip:_,flags:3}}))}function Tl(e){return(t,l,n,o,i,s)=>{n!=o&&(i!=n&&s!=n&&e(t,l,n),i!=o&&s!=o&&e(t,l,o),e(t,l,s))}}const zl=Tl(wl),Pl=Tl(vl);function Dl(e){const t=K(e?.alignGaps,0);return(e,l,n,o)=>ul(e,l,((i,s,r,u,a,c,f,d,h,p,m)=>{let g,x,w=i.pxRound,v=e=>w(c(e,u,p,d)),b=e=>w(f(e,a,m,h));0==u.ori?(g=wl,x=zl):(g=vl,x=Pl);const y=u.dir*(0==u.ori?1:-1),k={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},_=k.stroke;let M,S,E,T=he,z=-he,P=v(s[1==y?n:o]),D=G(r,n,o,1*y),A=G(r,n,o,-1*y),C=v(s[D]),W=v(s[A]),I=!1;for(let e=1==y?n:o;e>=n&&e<=o;e+=y){let t=v(s[e]),l=r[e];t==P?null!=l?(S=b(l),T==he&&(g(_,t,S),M=S),T=se(S,T),z=re(S,z)):null===l&&(I=!0):(T!=he&&(x(_,P,T,z,M,S),E=P),null!=l?(S=b(l),g(_,t,S),T=z=M=S):(T=he,z=-he,null===l&&(I=!0)),P=t)}T!=he&&T!=z&&E!=P&&x(_,P,T,z,M,S);let[H,Y]=al(e,l);if(null!=i.fill||0!=H){let t=k.fill=new Path2D(_),n=b(i.fillTo(e,l,i.min,i.max,H));g(t,W,n),g(t,C,n)}if(!i.spanGaps){let a=[];I&&a.push(...hl(s,r,n,o,y,v,t)),k.gaps=a=i.gaps(e,l,n,o,a),k.clip=dl(a,u.ori,d,h,p,m)}return 0!=Y&&(k.band=2==Y?[fl(e,l,n,o,_,-1),fl(e,l,n,o,_,1)]:fl(e,l,n,o,_,Y)),k}))}function Al(e,t,l,n,o,i,s=he){if(e.length>1){let r=null;for(let u=0,a=1/0;u0!=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[s-1]=n[s-2];for(let n=0;n{Jl.pxRatio=S})));const Hl=Dl(),Yl=El();function Rl(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>Ol(e,n,t,l)))}function Ol(e,t,l,n){return Le({},0==t?l:n,e)}function jl(e,t,l){return null==t?Ce:[t,l]}const Ll=jl;function Fl(e,t,l){return null==t?Ce:J(t,l,.1,!0)}function Nl(e,t,l,n){return null==t?Ce:U(t,l,e.scales[n].log,!1)}const Gl=Nl;function Ul(e,t,l,n){return null==t?Ce:B(t,l,e.scales[n].log,!1)}const Bl=Ul;function Vl(e,t,l,n,o){let i=re(pe(e),pe(t)),s=t-e,r=N(o/n*s,l);do{let e=l[r],t=n*e/s;if(t>=o&&i+(e<5?Te.get(e):0)<=17)return[e,t]}while(++r(t=oe((l=+n)*S))+"px")),t,l]}function ql(e){e.show&&[e.font,e.labelFont].forEach((e=>{let t=Ee(e[2]*S,1);e[0]=e[0].replace(/[0-9.]+px/,t+"px"),e[1]=t}))}function Jl(l,n,c){const w={mode:K(l.mode,1)},y=w.mode;function M(e,t){return((3==t.distr?ce(e>0?e:t.clamp(w,e,t.min,t.max,t.key)):4==t.distr?de(e,t.asinh):e)-t._min)/(t._max-t._min)}function E(e,t,l,n){let o=M(e,t);return n+l*(-1==t.dir?1-o:o)}function C(e,t,l,n){let o=M(e,t);return n+l*(-1==t.dir?o:1-o)}function I(e,t,l,n){return 0==t.ori?E(e,t,l,n):C(e,t,l,n)}w.valToPosH=E,w.valToPosV=C;let Y=!1;w.status=0;const O=w.root=A("uplot");null!=l.id&&(O.id=l.id),T(O,l.class),l.title&&(A("u-title",O).textContent=l.title);const j=D("canvas"),G=w.ctx=j.getContext("2d"),Z=A("u-wrap",O);L("click",Z,(e=>{e.target===X&&(In!=Dn||Hn!=An)&&Un.click(w,e)}),!0);const q=w.under=A("u-under",Z);Z.appendChild(j);const X=w.over=A("u-over",Z),$=+K((l=je(l)).pxAlign,1),Q=pl($);(l.plugins||[]).forEach((e=>{e.opts&&(l=e.opts(w,l)||l)}));const ne=l.ms||.001,ae=w.series=1==y?Rl(l.series||[],jt,ll,!1):(fe=l.series||[null],pe=tl,fe.map(((e,t)=>0==t?null:Le({},pe,e))));var fe,pe;const xe=w.axes=Rl(l.axes||[],Ot,$t,!0),ke=w.scales={},Se=w.bands=l.bands||[];Se.forEach((e=>{e.fill=ge(e.fill||null),e.dir=K(e.dir,-1)}));const Pe=2==y?ae[1].facets[0].scale:ae[0].scale,Ie={axes:function(){for(let e=0;ern[e])):v,y=2==p.distr?rn[v[1]]-rn[v[0]]:d,k=t.ticks,_=t.border,M=k.show?oe(k.size*S):0,E=t._rotate*-te/180,T=Q(t._pos*S),z=T+(M+x)*f;n=0==i?z:0,l=1==i?z:0,dn(t.font[0],c,1==t.align?u:2==t.align?a:E>0?u:E<0?a:0==i?"center":3==o?a:u,E||1==i?"middle":2==o?s:r);let P=t.font[1]*t.lineGap,D=v.map((e=>Q(I(e,p,m,g)))),A=t._values;for(let e=0;e0&&(ae.forEach(((e,t)=>{if(t>0&&e.show&&(mn(t,!1),mn(t,!0),null==e._paths)){sn!=e.alpha&&(G.globalAlpha=sn=e.alpha);let l=2==y?[0,n[t][0].length-1]:function(e){let t=me(Cl-1,0,Al-1),l=me(Il+1,0,Al-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&l{if(t>0&&e.show){sn!=e.alpha&&(G.globalAlpha=sn=e.alpha),null!=e._paths&&gn(t,!1);{let l=null!=e._paths?e._paths.gaps:null,n=e.points.show(w,t,Cl,Il,l),o=e.points.filter(w,t,n,l);(n||o)&&(e.points._paths=e.points.paths(w,t,Cl,Il,o),gn(t,!0))}1!=sn&&(G.globalAlpha=sn=1),To("drawSeries",t)}})))}},Oe=(l.drawOrder||["axes","series"]).map((e=>Ie[e]));function Fe(e){let t=ke[e];if(null==t){let n=(l.scales||De)[e]||De;if(null!=n.from)Fe(n.from),ke[e]=Le({},ke[n.from],n,{key:e});else{t=ke[e]=Le({},e==Pe?ol:il,n),t.key=e;let l=t.time,o=t.range,i=We(o);if((e!=Pe||2==y&&!l)&&(!i||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?V:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?V:{mode:1,hard:o[1],soft:o[1]}},i=!1),!i&&Ye(o))){let e=o;o=(t,l,n)=>null==l?Ce:J(l,n,e)}t.range=ge(o||(l?Ll:e==Pe?3==t.distr?Gl:4==t.distr?Bl:jl:3==t.distr?Nl:4==t.distr?Ul:Fl)),t.auto=ge(!i&&t.auto),t.clamp=ge(t.clamp||nl),t._min=t._max=null}}}Fe("x"),Fe("y"),1==y&&ae.forEach((e=>{Fe(e.scale)})),xe.forEach((e=>{Fe(e.scale)}));for(let e in l.scales)Fe(e);const Ge=ke[Pe],Ue=Ge.distr;let Be,Ve;0==Ge.ori?(T(O,"u-hz"),Be=E,Ve=C):(T(O,"u-vt"),Be=C,Ve=E);const Ze={};for(let e in ke){let t=ke[e];null==t.min&&null==t.max||(Ze[e]={min:t.min,max:t.max},t.min=t.max=null)}const qe=l.tzDate||(e=>new Date(oe(e/ne))),Je=l.fmtDate||Xe,Ke=1==ne?wt(qe):yt(qe),$e=_t(qe,kt(1==ne?xt:bt,Je)),Qe=Et(qe,St("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Je)),et=[],tt=w.legend=Le({},Tt,l.legend),lt=tt.show,it=tt.markers;let st,rt,ut;tt.idxs=et,it.width=ge(it.width),it.dash=ge(it.dash),it.stroke=ge(it.stroke),it.fill=ge(it.fill);let at,ct=[],ft=[],dt=!1,ht={};if(tt.live){const e=ae[1]?ae[1].values:null;dt=null!=e,at=dt?e(w,1,0):{_:0};for(let e in at)ht[e]=b}if(lt)if(st=D("table","u-legend",O),ut=D("tbody",null,st),tt.mount(w,st),dt){rt=D("thead",null,st,ut);let e=D("tr",null,rt);for(var pt in D("th",null,e),at)D("th",t,e).textContent=pt}else T(st,"u-inline"),tt.live&&T(st,"u-live");const mt={show:!0},Mt={show:!1},zt=new Map;function Pt(e,t,l,n=!0){const o=zt.get(t)||{},i=wl.bind[e](w,t,l,n);i&&(L(e,t,o[e]=i),zt.set(t,o))}function Dt(e,t,l){const n=zt.get(t)||{};for(let l in n)null!=e&&l!=e||(F(l,t,n[l]),delete n[l]);null==e&&zt.delete(t)}let Ct=0,Wt=0,It=0,Ht=0,Yt=0,Rt=0,Ut=Yt,Bt=Rt,Vt=It,Zt=Ht,qt=0,Qt=0,el=0,sl=0;w.bbox={};let ul=!1,al=!1,fl=!1,dl=!1,hl=!1,ml=!1;function gl(e,t,l){(l||e!=w.width||t!=w.height)&&xl(e,t),_n(!1),fl=!0,al=!0,Ln()}function xl(e,t){w.width=Ct=It=e,w.height=Wt=Ht=t,Yt=Rt=0,function(){let e=!1,t=!1,l=!1,n=!1;xe.forEach(((o,i)=>{if(o.show&&o._show){let{side:i,_size:s}=o,r=i%2,u=s+(null!=o.label?o.labelSize:0);u>0&&(r?(It-=u,3==i?(Yt+=u,n=!0):l=!0):(Ht-=u,0==i?(Rt+=u,e=!0):t=!0))}})),Tl[0]=e,Tl[1]=l,Tl[2]=t,Tl[3]=n,It-=Dl[1]+Dl[3],Yt+=Dl[3],Ht-=Dl[2]+Dl[0],Rt+=Dl[0]}(),function(){let e=Yt+It,t=Rt+Ht,l=Yt,n=Rt;function o(o,i){switch(o){case 1:return e+=i,e-i;case 2:return t+=i,t-i;case 3:return l-=i,l+i;case 0:return n-=i,n+i}}xe.forEach(((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=o(t,e._size),null!=e.label&&(e._lpos=o(t,e.labelSize))}}))}();let l=w.bbox;qt=l.left=_e(Yt*S,.5),Qt=l.top=_e(Rt*S,.5),el=l.width=_e(It*S,.5),sl=l.height=_e(Ht*S,.5)}w.setSize=function({width:e,height:t}){gl(e,t)};const wl=w.cursor=Le({},At,{drag:{y:2==y}},l.cursor);if(null==wl.dataIdx){let e=wl.hover,t=e.skip=new Set(e.skip??[]);t.add(void 0);let l=e.prox=ge(e.prox),o=e.bias??=0;wl.dataIdx=(e,i,s,r)=>{if(0==i)return s;let u=s,a=l(e,i,s,r)??he,c=a>=0&&a0;)t.has(p[e])||(l=e);if(0==o||1==o)for(e=s;null==n&&e++a&&(u=null);return u}}const vl=e=>{wl.event=e};wl.idxs=et,wl._lock=!1;let bl=wl.points;bl.show=ge(bl.show),bl.size=ge(bl.size),bl.stroke=ge(bl.stroke),bl.width=ge(bl.width),bl.fill=ge(bl.fill);const yl=w.focus=Le({},l.focus||{alpha:.3},wl.focus),kl=yl.prox>=0;let _l=[null],Ml=[null],Sl=[null];function El(l,n){if(1==y||n>0){let e=1==y&&ke[l.scale].time,t=l.value;l.value=e?He(t)?Et(qe,St(t,Je)):t||Qe:t||Xt,l.label=l.label||(e?"Time":"Value")}if(n>0){l.width=null==l.width?1:l.width,l.paths=l.paths||Hl||ve,l.fillTo=ge(l.fillTo||cl),l.pxAlign=+K(l.pxAlign,$),l.pxRound=pl(l.pxAlign),l.stroke=ge(l.stroke||null),l.fill=ge(l.fill||null),l._stroke=l._fill=l._paths=l._focus=null;let e=Ee(1*(3+2*(re(1,l.width)||1)),3),t=l.points=Le({},{size:e,width:re(1,.2*e),stroke:l.stroke,space:2*e,paths:Yl,_stroke:null,_fill:null},l.points);t.show=ge(t.show),t.filter=ge(t.filter),t.fill=ge(t.fill),t.stroke=ge(t.stroke),t.paths=ge(t.paths),t.pxAlign=l.pxAlign}if(lt){let o=function(l,n){if(0==n&&(dt||!tt.live||2==y))return Ce;let o=[],i=D("tr","u-series",ut,ut.childNodes[n]);T(i,l.class),l.show||T(i,e);let s=D("th",null,i);if(it.show){let e=A("u-marker",s);if(n>0){let t=it.width(w,n);t&&(e.style.border=t+"px "+it.dash(w,n)+" "+it.stroke(w,n)),e.style.background=it.fill(w,n)}}let r=A(t,s);for(var u in r.textContent=l.label,n>0&&(it.show||(r.style.color=l.width>0?it.stroke(w,n):it.fill(w,n)),Pt("click",s,(e=>{if(wl._lock)return;vl(e);let t=ae.indexOf(l);if((e.ctrlKey||e.metaKey)!=tt.isolate){let e=ae.some(((e,l)=>l>0&&l!=t&&e.show));ae.forEach(((l,n)=>{n>0&&Xn(n,e?n==t?mt:Mt:mt,!0,Po.setSeries)}))}else Xn(t,{show:!l.show},!0,Po.setSeries)}),!1),kl&&Pt(m,s,(e=>{wl._lock||(vl(e),Xn(ae.indexOf(l),to,!0,Po.setSeries))}),!1)),at){let e=D("td","u-value",i);e.textContent="--",o.push(e)}return[i,o]}(l,n);ct.splice(n,0,o[0]),ft.splice(n,0,o[1]),tt.values.push(null)}if(wl.show){et.splice(n,0,null);let e=function(e,t){if(t>0){let l=wl.points.show(w,t);if(l)return T(l,"u-cursor-pt"),T(l,e.class),W(l,-10,-10,It,Ht),X.insertBefore(l,_l[t]),l}}(l,n);null!=e&&(_l.splice(n,0,e),Ml.splice(n,0,0),Sl.splice(n,0,0))}To("addSeries",n)}w.addSeries=function(e,t){t=null==t?ae.length:t,e=1==y?Ol(e,t,jt,ll):Ol(e,t,null,tl),ae.splice(t,0,e),El(ae[t],t)},w.delSeries=function(e){if(ae.splice(e,1),lt){tt.values.splice(e,1),ft.splice(e,1);let t=ct.splice(e,1)[0];Dt(null,t.firstChild),t.remove()}wl.show&&(et.splice(e,1),_l.length>1&&(_l.splice(e,1)[0].remove(),Ml.splice(e,1),Sl.splice(e,1))),To("delSeries",e)};const Tl=[!1,!1,!1,!1];function zl(e,t,l,n){let[o,i,s,r]=l,u=t%2,a=0;return 0==u&&(r||i)&&(a=0==t&&!o||2==t&&!s?oe(Ot.size/3):0),1==u&&(o||s)&&(a=1==t&&!i||3==t&&!r?oe($t.size/2):0),a}const Pl=w.padding=(l.padding||[zl,zl,zl,zl]).map((e=>ge(K(e,zl)))),Dl=w._padding=Pl.map(((e,t)=>e(w,t,Tl,0)));let Al,Cl=null,Il=null;const Jl=1==y?ae[0].idxs:null;let Kl,Xl,$l,Ql,en,tn,ln,nn,on,sn,rn=null,un=!1;function an(e,t){if(n=null==e?[]:e,w.data=w._data=n,2==y){Al=0;for(let e=1;e=0,ml=!0,Ln()}}function cn(){let e,t;un=!0,1==y&&(Al>0?(Cl=Jl[0]=0,Il=Jl[1]=Al-1,e=n[0][Cl],t=n[0][Il],2==Ue?(e=Cl,t=Il):e==t&&(3==Ue?[e,t]=U(e,e,Ge.log,!1):4==Ue?[e,t]=B(e,e,Ge.log,!1):Ge.time?t=e+oe(86400/ne):[e,t]=J(e,t,.1,!0))):(Cl=Jl[0]=e=null,Il=Jl[1]=t=null)),Kn(Pe,e,t)}function fn(e,t,l,n,o,i){e??=f,l??=Ae,n??="butt",o??=f,i??="round",e!=Kl&&(G.strokeStyle=Kl=e),o!=Xl&&(G.fillStyle=Xl=o),t!=$l&&(G.lineWidth=$l=t),i!=en&&(G.lineJoin=en=i),n!=tn&&(G.lineCap=tn=n),l!=Ql&&G.setLineDash(Ql=l)}function dn(e,t,l,n){t!=Xl&&(G.fillStyle=Xl=t),e!=ln&&(G.font=ln=e),l!=nn&&(G.textAlign=nn=l),n!=on&&(G.textBaseline=on=n)}function hn(e,t,l,n,o=0){if(n.length>0&&e.auto(w,un)&&(null==t||null==t.min)){let t=K(Cl,0),i=K(Il,n.length-1),s=null==l.min?3==e.distr?function(e,t,l){let n=he,o=-he;for(let i=t;i<=l;i++){let t=e[i];null!=t&&t>0&&(to&&(o=t))}return[n,o]}(n,t,i):function(e,t,l,n){let o=he,i=-he;if(1==n)o=e[t],i=e[l];else if(-1==n)o=e[l],i=e[t];else for(let n=t;n<=l;n++){let t=e[n];null!=t&&(ti&&(i=t))}return[o,i]}(n,t,i,o):[l.min,l.max];e.min=se(e.min,l.min=s[0]),e.max=re(e.max,l.max=s[1])}}w.setData=an;const pn={min:null,max:null};function mn(e,t){let l=t?ae[e].points:ae[e];l._stroke=l.stroke(w,e),l._fill=l.fill(w,e)}function gn(e,t){let l=t?ae[e].points:ae[e],{stroke:o,fill:i,clip:s,flags:r,_stroke:u=l._stroke,_fill:a=l._fill,_width:c=l.width}=l._paths;c=Ee(c*S,3);let f=null,d=c%2/2;t&&null==a&&(a=c>0?"#fff":u);let h=1==l.pxAlign&&d>0;if(h&&G.translate(d,d),!t){let e=qt-c/2,t=Qt-c/2,l=el+c,n=sl+c;f=new Path2D,f.rect(e,t,l,n)}t?xn(u,c,l.dash,l.cap,a,o,i,r,s):function(e,t,l,o,i,s,r,u,a,c,f){let d=!1;0!=a&&Se.forEach(((h,p)=>{if(h.series[0]==e){let e,m=ae[h.series[1]],g=n[h.series[1]],x=(m._paths||De).band;We(x)&&(x=1==h.dir?x[0]:x[1]);let v=null;m.show&&x&&function(e,t,l){for(t=K(t,0),l=K(l,e.length-1);t<=l;){if(null!=e[t])return!0;t++}return!1}(g,Cl,Il)?(v=h.fill(w,p)||s,e=m._paths.clip):x=null,xn(t,l,o,i,v,r,u,a,c,f,e,x),d=!0}})),d||xn(t,l,o,i,s,r,u,a,c,f)}(e,u,c,l.dash,l.cap,a,o,i,r,f,s),h&&G.translate(-d,-d)}function xn(e,t,l,n,o,i,s,r,u,a,c,f){fn(e,t,l,n,o),(u||a||f)&&(G.save(),u&&G.clip(u),a&&G.clip(a)),f?3==(3&r)?(G.clip(f),c&&G.clip(c),vn(o,s),wn(e,i,t)):2&r?(vn(o,s),G.clip(f),wn(e,i,t)):1&r&&(G.save(),G.clip(f),c&&G.clip(c),vn(o,s),G.restore(),wn(e,i,t)):(vn(o,s),wn(e,i,t)),(u||a||f)&&G.restore()}function wn(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{G.strokeStyle=Kl=t,G.stroke(e)})):null!=t&&e&&G.stroke(t))}function vn(e,t){t instanceof Map?t.forEach(((e,t)=>{G.fillStyle=Xl=t,G.fill(e)})):null!=t&&e&&G.fill(t)}function bn(e,t,l,n,o,i,s,r,u,a){let c=s%2/2;1==$&&G.translate(c,c),fn(r,s,u,a,r),G.beginPath();let f,d,h,p,m=o+(0==n||3==n?-i:i);0==l?(d=o,p=m):(f=o,h=m);for(let n=0;n{if(!l.show)return;let o=ke[l.scale];if(null==o.min)return void(l._show&&(t=!1,l._show=!1,_n(!1)));l._show||(t=!1,l._show=!0,_n(!1));let i=l.side,s=i%2,{min:r,max:u}=o,[a,c]=function(e,t,l,n){let o,i=xe[e];if(n<=0)o=[0,0];else{let s=i._space=i.space(w,e,t,l,n);o=Vl(t,l,i._incrs=i.incrs(w,e,t,l,n,s),n,s)}return i._found=o}(n,r,u,0==s?It:Ht);if(0==c)return;let f=2==o.distr,d=l._splits=l.splits(w,n,r,u,a,c,f),h=2==o.distr?d.map((e=>rn[e])):d,p=2==o.distr?rn[d[1]]-rn[d[0]]:a,m=l._values=l.values(w,l.filter(w,h,n,c,p),n,c,p);l._rotate=2==i?l.rotate(w,m,n,c):0;let g=l._size;l._size=ie(l.size(w,m,n,e)),null!=g&&l._size!=g&&(t=!1)})),t}function kn(e){let t=!0;return Pl.forEach(((l,n)=>{let o=l(w,n,Tl,e);o!=Dl[n]&&(t=!1),Dl[n]=o})),t}function _n(e){ae.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==y?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}let Mn,Sn,En,Tn,zn,Pn,Dn,An,Cn,Wn,In,Hn,Yn=!1,Rn=!1,On=[];function jn(){Rn=!1;for(let e=0;e0){ae.forEach(((t,l)=>{if(1==y){let o=t.scale,i=Ze[o];if(null==i)return;let s=e[o];if(0==l){let e=s.range(w,s.min,s.max,o);s.min=e[0],s.max=e[1],Cl=N(s.min,n[0]),Il=N(s.max,n[0]),Il-Cl>1&&(n[0][Cl]s.max&&Il--),t.min=rn[Cl],t.max=rn[Il]}else t.show&&t.auto&&hn(s,i,t,n[l],t.sorted);t.idxs[0]=Cl,t.idxs[1]=Il}else if(l>0&&t.show&&t.auto){let[o,i]=t.facets,s=o.scale,r=i.scale,[u,a]=n[l],c=e[s],f=e[r];null!=c&&hn(c,Ze[s],o,u,o.sorted),null!=f&&hn(f,Ze[r],i,a,i.sorted),t.min=i.min,t.max=i.max}}));for(let t in e){let l=e[t],n=Ze[t];if(null==l.from&&(null==n||null==n.min)){let e=l.range(w,l.min==he?null:l.min,l.max==-he?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(w,n.min,n.max,t);l.min=e[0],l.max=e[1]}}}let t={},l=!1;for(let n in e){let o=e[n],i=ke[n];if(i.min!=o.min||i.max!=o.max){i.min=o.min,i.max=o.max;let e=i.distr;i._min=3==e?ce(i.min):4==e?de(i.min,i.asinh):i.min,i._max=3==e?ce(i.max):4==e?de(i.max,i.asinh):i.max,t[n]=l=!0}}if(l){ae.forEach(((e,l)=>{2==y?l>0&&t.y&&(e._paths=null):t[e.scale]&&(e._paths=null)}));for(let e in t)fl=!0,To("setScale",e);wl.show&&wl.left>=0&&(dl=ml=!0)}for(let e in Ze)Ze[e]=null}(),ul=!1),fl&&(function(){let e=!1,t=0;for(;!e;){t++;let l=yn(t),n=kn(t);e=3==t||l&&n,e||(xl(w.width,w.height),al=!0)}}(),fl=!1),al){if(P(q,u,Yt),P(q,s,Rt),P(q,o,It),P(q,i,Ht),P(X,u,Yt),P(X,s,Rt),P(X,o,It),P(X,i,Ht),P(Z,o,Ct),P(Z,i,Wt),j.width=oe(Ct*S),j.height=oe(Wt*S),xe.forEach((({_el:t,_show:l,_size:n,_pos:o,side:i})=>{if(null!=t)if(l){let l=i%2==1;P(t,l?"left":"top",o-(3===i||0===i?n:0)),P(t,l?"width":"height",n),P(t,l?"top":"left",l?Rt:Yt),P(t,l?"height":"width",l?Ht:It),z(t,e)}else T(t,e)})),Kl=Xl=$l=en=tn=ln=nn=on=Ql=null,sn=1,fo(!0),Yt!=Ut||Rt!=Bt||It!=Vt||Ht!=Zt){_n(!1);let e=It/Vt,t=Ht/Zt;if(wl.show&&!dl&&wl.left>=0){wl.left*=e,wl.top*=t,En&&W(En,oe(wl.left),0,It,Ht),Tn&&W(Tn,0,oe(wl.top),It,Ht);for(let l=1;l<_l.length;l++)Ml[l]*=e,Sl[l]*=t,W(_l[l],Me(Ml[l],1),Me(Sl[l],1),It,Ht)}if(Zn.show&&!hl&&Zn.left>=0&&Zn.width>0){Zn.left*=e,Zn.width*=e,Zn.top*=t,Zn.height*=t;for(let e in mo)P(qn,e,Zn[e])}Ut=Yt,Bt=Rt,Vt=It,Zt=Ht}To("setSize"),al=!1}Ct>0&&Wt>0&&(G.clearRect(0,0,j.width,j.height),To("drawClear"),Oe.forEach((e=>e())),To("draw")),Zn.show&&hl&&(Jn(Zn),hl=!1),wl.show&&dl&&(ao(null,!0,!1),dl=!1),tt.show&&tt.live&&ml&&(ro(),ml=!1),Y||(Y=!0,w.status=1,To("ready")),un=!1,Yn=!1}function Nn(e,t){let l=ke[e];if(null==l.from){if(0==Al){let n=l.range(w,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(Al>1&&null!=t.min&&null!=t.max&&t.max-t.min<1e-16)return;e==Pe&&2==l.distr&&Al>0&&(t.min=N(t.min,n[0]),t.max=N(t.max,n[0]),t.min==t.max&&t.max++),Ze[e]=t,ul=!0,Ln()}}w.batch=function(e,t=!1){Yn=!0,Rn=t,e(w),Fn(),t&&On.length>0&&queueMicrotask(jn)},w.redraw=(e,t)=>{fl=t||!1,!1!==e?Kn(Pe,Ge.min,Ge.max):Ln()},w.setScale=Nn;let Gn=!1;const Un=wl.drag;let Bn=Un.x,Vn=Un.y;wl.show&&(wl.x&&(Mn=A("u-cursor-x",X)),wl.y&&(Sn=A("u-cursor-y",X)),0==Ge.ori?(En=Mn,Tn=Sn):(En=Sn,Tn=Mn),In=wl.left,Hn=wl.top);const Zn=w.select=Le({show:!0,over:!0,left:0,width:0,top:0,height:0},l.select),qn=Zn.show?A("u-select",Zn.over?X:q):null;function Jn(e,t){if(Zn.show){for(let t in e)Zn[t]=e[t],t in mo&&P(qn,t,e[t]);!1!==t&&To("setSelect")}}function Kn(e,t,l){Nn(e,{min:t,max:l})}function Xn(t,l,n,o){null!=l.focus&&function(e){if(e!=eo){let t=null==e,l=1!=yl.alpha;ae.forEach(((n,o)=>{if(1==y||o>0){let i=t||0==o||o==e;n._focus=t?null:i,l&&function(e,t){ae[e].alpha=t,wl.show&&_l[e]&&(_l[e].style.opacity=t),lt&&ct[e]&&(ct[e].style.opacity=t)}(o,i?1:yl.alpha)}})),eo=e,l&&Ln()}}(t),null!=l.show&&ae.forEach(((n,o)=>{o>0&&(t==o||null==t)&&(n.show=l.show,function(t,l){let n=ae[t],o=lt?ct[t]:null;n.show?o&&z(o,e):(o&&T(o,e),_l.length>1&&W(_l[t],-10,-10,It,Ht))}(o,l.show),2==y?(Kn(n.facets[0].scale,null,null),Kn(n.facets[1].scale,null,null)):Kn(n.scale,null,null),Ln())})),!1!==n&&To("setSeries",t,l),o&&Co("setSeries",w,t,l)}let $n,Qn,eo;w.setSelect=Jn,w.setSeries=Xn,w.addBand=function(e,t){e.fill=ge(e.fill||null),e.dir=K(e.dir,-1),t=null==t?Se.length:t,Se.splice(t,0,e)},w.setBand=function(e,t){Le(Se[e],t)},w.delBand=function(e){null==e?Se.length=0:Se.splice(e,1)};const to={focus:!0};function lo(e,t,l){let n=ke[t];l&&(e=e/S-(1==n.ori?Rt:Yt));let o=It;1==n.ori&&(o=Ht,e=o-e),-1==n.dir&&(e=o-e);let i=n._min,s=i+(n._max-i)*(e/o),r=n.distr;return 3==r?ue(10,s):4==r?((e,t=1)=>ee.sinh(e)*t)(s,n.asinh):s}function no(e,t){P(qn,u,Zn.left=e),P(qn,o,Zn.width=t)}function oo(e,t){P(qn,s,Zn.top=e),P(qn,i,Zn.height=t)}lt&&kl&&Pt(g,st,(e=>{wl._lock||(vl(e),null!=eo&&Xn(null,to,!0,Po.setSeries))})),w.valToIdx=e=>N(e,n[0]),w.posToIdx=function(e,t){return N(lo(e,Pe,t),n[0],Cl,Il)},w.posToVal=lo,w.valToPos=(e,t,l)=>0==ke[t].ori?E(e,ke[t],l?el:It,l?qt:0):C(e,ke[t],l?sl:Ht,l?Qt:0),w.setCursor=(e,t,l)=>{In=e.left,Hn=e.top,ao(null,t,l)};let io=0==Ge.ori?no:oo,so=1==Ge.ori?no:oo;function ro(e,t){null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{et[t]=e})):void 0!==e.idx&&et.fill(e.idx),tt.idx=et[0]);for(let e=0;e0||1==y&&!dt)&&uo(e,et[e]);lt&&tt.live&&function(){if(lt&&tt.live)for(let e=2==y?1:0;eIl;$n=he;let s=0==Ge.ori?It:Ht,r=1==Ge.ori?It:Ht;if(In<0||0==Al||i){o=wl.idx=null;for(let e=0;e0&&_l.length>1&&W(_l[e],-10,-10,It,Ht);kl&&Xn(null,to,!0,null==e&&Po.setSeries),tt.live&&(et.fill(o),ml=!0)}else{let e,t,l;1==y&&(e=0==Ge.ori?In:Hn,t=lo(e,Pe),o=wl.idx=N(t,n[0],Cl,Il),l=Be(n[0][o],Ge,s,0));for(let e=2==y?1:0;e0&&i.show){let t,l,n=null==f?-10:Ve(f,1==y?ke[i.scale]:ke[i.facets[1].scale],r,0);if(kl&&null!=f){let t=1==Ge.ori?In:Hn,l=le(yl.dist(w,e,c,n,t));if(l<$n){let n=yl.bias;if(0!=n){let o=lo(t,i.scale),s=o>=0?1:-1;s==(f>=0?1:-1)&&(1==s?1==n?f>=o:f<=o:1==n?f<=o:f>=o)&&($n=l,Qn=e)}else $n=l,Qn=e}}if(0==Ge.ori?(t=d,l=n):(t=n,l=d),ml&&_l.length>1){H(_l[e],wl.points.fill(w,e),wl.points.stroke(w,e));let n,o,i,s,r=!0,u=wl.points.bbox;if(null!=u){r=!1;let t=u(w,e);i=t.left,s=t.top,n=t.width,o=t.height}else i=t,s=l,n=o=wl.points.size(w,e);R(_l[e],n,o,r),Ml[e]=i,Sl[e]=s,W(_l[e],Me(i,1),Me(s,1),It,Ht)}}}}if(Zn.show&&Gn)if(null!=e){let[t,l]=Po.scales,[n,o]=Po.match,[i,u]=e.cursor.sync.scales,a=e.cursor.drag;if(Bn=a._x,Vn=a._y,Bn||Vn){let a,c,f,d,h,{left:p,top:m,width:g,height:x}=e.select,w=e.scales[t].ori,v=e.posToVal,b=null!=t&&n(t,i),y=null!=l&&o(l,u);b&&Bn?(0==w?(a=p,c=g):(a=m,c=x),f=ke[t],d=Be(v(a,i),f,s,0),h=Be(v(a+c,i),f,s,0),io(se(d,h),le(h-d))):io(0,s),y&&Vn?(1==w?(a=p,c=g):(a=m,c=x),f=ke[l],d=Ve(v(a,u),f,r,0),h=Ve(v(a+c,u),f,r,0),so(se(d,h),le(h-d))):so(0,r)}else go()}else{let e=le(Cn-zn),t=le(Wn-Pn);if(1==Ge.ori){let l=e;e=t,t=l}Bn=Un.x&&e>=Un.dist,Vn=Un.y&&t>=Un.dist;let l,n,o=Un.uni;null!=o?Bn&&Vn&&(Bn=e>=o,Vn=t>=o,Bn||Vn||(t>e?Vn=!0:Bn=!0)):Un.x&&Un.y&&(Bn||Vn)&&(Bn=Vn=!0),Bn&&(0==Ge.ori?(l=Dn,n=In):(l=An,n=Hn),io(se(l,n),le(n-l)),Vn||so(0,r)),Vn&&(1==Ge.ori?(l=Dn,n=In):(l=An,n=Hn),so(se(l,n),le(n-l)),Bn||io(0,s)),Bn||Vn||(io(0,0),so(0,0))}if(Un._x=Bn,Un._y=Vn,null==e){if(l){if(null!=Do){let[e,t]=Po.scales;Po.values[0]=null!=e?lo(0==Ge.ori?In:Hn,e):null,Po.values[1]=null!=t?lo(1==Ge.ori?In:Hn,t):null}Co(d,w,In,Hn,It,Ht,o)}if(kl){let e=l&&Po.setSeries,t=yl.prox;null==eo?$n<=t&&Xn(Qn,to,!0,e):$n>t?Xn(null,to,!0,e):Qn!=eo&&Xn(Qn,to,!0,e)}}ml&&(tt.idx=o,ro()),!1!==t&&To("setCursor")}w.setLegend=ro;let co=null;function fo(e=!1){e?co=null:(co=X.getBoundingClientRect(),To("syncRect",co))}function ho(e,t,l,n,o,i,s){wl._lock||Gn&&null!=e&&0==e.movementX&&0==e.movementY||(po(e,t,l,n,o,i,0,!1,null!=e),null!=e?ao(null,!0,!0):ao(t,!0,!1))}function po(e,t,l,n,o,i,s,r,u){if(null==co&&fo(!1),vl(e),null!=e)l=e.clientX-co.left,n=e.clientY-co.top;else{if(l<0||n<0)return In=-10,void(Hn=-10);let[e,s]=Po.scales,r=t.cursor.sync,[u,a]=r.values,[c,f]=r.scales,[d,h]=Po.match,p=t.axes[0].side%2==1,m=0==Ge.ori?It:Ht,g=1==Ge.ori?It:Ht,x=p?i:o,w=p?o:i,v=p?n:l,b=p?l:n;if(l=null!=c?d(e,c)?I(u,ke[e],m,0):-10:m*(v/x),n=null!=f?h(s,f)?I(a,ke[s],g,0):-10:g*(b/w),1==Ge.ori){let e=l;l=n,n=e}}u&&((l<=1||l>=It-1)&&(l=_e(l,It)),(n<=1||n>=Ht-1)&&(n=_e(n,Ht))),r?(zn=l,Pn=n,[Dn,An]=wl.move(w,l,n)):(In=l,Hn=n)}Object.defineProperty(w,"rect",{get:()=>(null==co&&fo(!1),co)});const mo={width:0,height:0,left:0,top:0};function go(){Jn(mo,!1)}let xo,wo,vo,bo;function yo(e,t,l,n,o,i,s){Gn=!0,Bn=Vn=Un._x=Un._y=!1,po(e,t,l,n,o,i,0,!0,!1),null!=e&&(Pt(p,k,ko,!1),Co(h,w,Dn,An,It,Ht,null));let{left:r,top:u,width:a,height:c}=Zn;xo=r,wo=u,vo=a,bo=c,go()}function ko(e,t,l,n,o,i,s){Gn=Un._x=Un._y=!1,po(e,t,l,n,o,i,0,!1,!0);let{left:r,top:u,width:a,height:c}=Zn,f=a>0||c>0,d=xo!=r||wo!=u||vo!=a||bo!=c;if(f&&d&&Jn(Zn),Un.setScale&&f&&d){let e=r,t=a,l=u,n=c;if(1==Ge.ori&&(e=u,t=c,l=r,n=a),Bn&&Kn(Pe,lo(e,Pe),lo(e+t,Pe)),Vn)for(let e in ke){let t=ke[e];e!=Pe&&null==t.from&&t.min!=he&&Kn(e,lo(l+n,e),lo(l,e))}go()}else wl.lock&&(wl._lock=!wl._lock,wl._lock||ao(null,!0,!1));null!=e&&(Dt(p,k),Co(p,w,In,Hn,It,Ht,null))}function _o(e,t,l,n,o,i,s){wl._lock||(vl(e),cn(),go(),null!=e&&Co(x,w,In,Hn,It,Ht,null))}function Mo(){xe.forEach(ql),gl(w.width,w.height,!0)}L(v,_,Mo);const So={};So.mousedown=yo,So.mousemove=ho,So.mouseup=ko,So.dblclick=_o,So.setSeries=(e,t,l,n)=>{-1!=(l=(0,Po.match[2])(w,t,l))&&Xn(l,n,!0,!1)},wl.show&&(Pt(h,X,yo),Pt(d,X,ho),Pt(m,X,(e=>{vl(e),fo(!1)})),Pt(g,X,(function(e,t,l,n,o,i,s){if(wl._lock)return;vl(e);let r=Gn;if(Gn){let e,t,l=!0,n=!0,o=10;0==Ge.ori?(e=Bn,t=Vn):(e=Vn,t=Bn),e&&t&&(l=In<=o||In>=It-o,n=Hn<=o||Hn>=Ht-o),e&&l&&(In=In{e.call(null,w,t,l)}))}(l.plugins||[]).forEach((e=>{for(let t in e.hooks)Eo[t]=(Eo[t]||[]).concat(e.hooks[t])}));const zo=(e,t,l)=>l,Po=Le({key:null,setSeries:!1,filters:{pub:be,sub:be},scales:[Pe,ae[1]?ae[1].scale:null],match:[ye,ye,zo],values:[null,null]},wl.sync);2==Po.match.length&&Po.match.push(zo),wl.sync=Po;const Do=Po.key,Ao=rl(Do);function Co(e,t,l,n,o,i,s){Po.filters.pub(e,t,l,n,o,i,s)&&Ao.pub(e,t,l,n,o,i,s)}function Wo(){To("init",l,n),an(n||l.data,!1),Ze[Pe]?Nn(Pe,Ze[Pe]):cn(),hl=Zn.show&&(Zn.width>0||Zn.height>0),dl=ml=!0,gl(l.width,l.height)}return Ao.sub(w),w.pub=function(e,t,l,n,o,i,s){Po.filters.sub(e,t,l,n,o,i,s)&&So[e](null,t,l,n,o,i,s)},w.destroy=function(){Ao.unsub(w),Wl.delete(w),zt.clear(),F(v,_,Mo),O.remove(),st?.remove(),To("destroy")},ae.forEach(El),xe.forEach((function(e,t){if(e._show=e.show,e.show){let l=e.side%2,n=ke[e.scale];null==n&&(e.scale=l?ae[1].scale:Pe,n=ke[e.scale]);let o=n.time;e.size=ge(e.size),e.space=ge(e.space),e.rotate=ge(e.rotate),We(e.incrs)&&e.incrs.forEach((e=>{!Te.has(e)&&Te.set(e,ze(e))})),e.incrs=ge(e.incrs||(2==n.distr?nt:o?1==ne?gt:vt:ot)),e.splits=ge(e.splits||(o&&1==n.distr?Ke:3==n.distr?Nt:4==n.distr?Gt:Ft)),e.stroke=ge(e.stroke),e.grid.stroke=ge(e.grid.stroke),e.ticks.stroke=ge(e.ticks.stroke),e.border.stroke=ge(e.border.stroke);let i=e.values;e.values=We(i)&&!We(i[0])?ge(i):o?We(i)?_t(qe,kt(i,Je)):He(i)?function(e,t){let l=Xe(t);return(t,n,o,i,s)=>n.map((t=>l(e(t))))}(qe,i):i||$e:i||Lt,e.filter=ge(e.filter||(n.distr>=3&&10==n.log?Jt:3==n.distr&&2==n.log?Kt:we)),e.font=Zl(e.font),e.labelFont=Zl(e.labelFont),e._size=e.size(w,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Tl[t]=!0,e._el=A("u-axis",Z))}})),c?c instanceof HTMLElement?(c.appendChild(O),Wo()):c(w,Wo):Wo(),w}Jl.assign=Le,Jl.fmtNum=Q,Jl.rangeNum=J,Jl.rangeLog=U,Jl.rangeAsinh=B,Jl.orient=ul,Jl.pxRatio=S,Jl.join=function(e,t){if(function(e){let t=e[0][0],l=t.length;for(let n=1;n=n&&null==e[o];)o--;if(o<=n)return!0;const i=re(1,ne((o-n+1)/t));for(let t=e[n],l=n+i;l<=o;l+=i){const n=e[l];if(null!=n){if(n<=t)return!1;t=n}}return!0}(t[0])||(t=function(e){let t=e[0],l=t.length,n=Array(l);for(let e=0;et[e]-t[l]));let o=[];for(let t=0;te-t))],o=n[0].length,i=new Map;for(let e=0;eul(e,i,((u,a,c,f,d,h,p,m,g,x,w)=>{let v=u.pxRound,{left:b,width:y}=e.bbox,k=e=>v(h(e,f,x,m)),_=e=>v(p(e,d,w,g)),M=0==f.ori?wl:vl;const E={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},T=E.stroke,z=f.dir*(0==f.ori?1:-1);s=G(c,s,r,1),r=G(c,s,r,-1);let P=_(c[1==z?s:r]),D=k(a[1==z?s:r]),A=D,C=D;o&&-1==t&&(C=b,M(T,C,P)),M(T,D,P);for(let e=1==z?s:r;e>=s&&e<=r;e+=z){let l=c[e];if(null==l)continue;let n=k(a[e]),o=_(l);1==t?M(T,n,P):M(T,A,o),M(T,n,o),P=o,A=n}let W=A;o&&1==t&&(W=b+y,M(T,W,P));let[I,H]=al(e,i);if(null!=u.fill||0!=I){let t=E.fill=new Path2D(T),l=_(u.fillTo(e,i,u.min,u.max,I));M(t,W,l),M(t,C,l)}if(!u.spanGaps){let o=[];o.push(...hl(a,c,s,r,z,k,n));let d=u.width*S/2,h=l||1==t?d:-d,p=l||-1==t?-d:d;o.forEach((e=>{e[0]+=h,e[1]+=p})),E.gaps=o=u.gaps(e,i,s,r,o),E.clip=dl(o,f.ori,m,g,x,w)}return 0!=H&&(E.band=2==H?[fl(e,i,s,r,T,-1),fl(e,i,s,r,T,1)]:fl(e,i,s,r,T,H)),E}))},e.bars=function(e){const t=K((e=e||De).size,[.6,he,1]),l=e.align||0,n=e.gap||0;let o=e.radius;o=null==o?[0,0]:"number"==typeof o?[o,0]:o;const i=ge(o),s=1-t[0],r=K(t[1],he),u=K(t[2],1),a=K(e.disp,De),c=K(e.each,(e=>{})),{fill:f,stroke:d}=a;return(e,t,o,h)=>ul(e,t,((p,m,g,x,w,v,b,y,k,_,M)=>{let E,T,z=p.pxRound,P=l,D=n*S,A=r*S,C=u*S;0==x.ori?[E,T]=i(e,t):[T,E]=i(e,t);const W=x.dir*(0==x.ori?1:-1);let I,H,Y,R=0==x.ori?bl:yl,O=0==x.ori?c:(e,t,l,n,o,i,s)=>{c(e,t,l,o,n,s,i)},j=K(e.bands,Ae).find((e=>e.series[0]==t)),L=null!=j?j.dir:0,F=p.fillTo(e,t,p.min,p.max,L),N=z(b(F,w,M,k)),G=_,U=z(p.width*S),B=!1,V=null,Z=null,q=null,J=null;null==f||0!=U&&null==d||(B=!0,V=f.values(e,t,o,h),Z=new Map,new Set(V).forEach((e=>{null!=e&&Z.set(e,new Path2D)})),U>0&&(q=d.values(e,t,o,h),J=new Map,new Set(q).forEach((e=>{null!=e&&J.set(e,new Path2D)}))));let{x0:X,size:$}=a;if(null!=X&&null!=$){P=1,m=X.values(e,t,o,h),2==X.unit&&(m=m.map((t=>e.posToVal(y+t*_,x.key,!0))));let l=$.values(e,t,o,h);H=2==$.unit?l[0]*_:v(l[0],x,_,y)-v(0,x,_,y),G=Al(m,g,v,x,_,y,G),Y=G-H+D}else G=Al(m,g,v,x,_,y,G),Y=G*s+D,H=G-Y;Y<1&&(Y=0),U>=H/2&&(U=0),Y<5&&(z=xe);let Q=Y>0;H=z(me(G-Y-(Q?U:0),C,A)),I=(0==P?H/2:P==W?0:H)-P*W*((0==P?D/2:0)+(Q?U/2:0));const ee={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},te=B?null:new Path2D;let le=null;if(null!=j)le=e.data[j.series[1]];else{let{y0:l,y1:n}=a;null!=l&&null!=n&&(g=n.values(e,t,o,h),le=l.values(e,t,o,h))}let oe=E*H,ie=T*H;for(let l=1==W?o:h;l>=o&&l<=h;l+=W){let n=g[l];if(null==n)continue;if(null!=le){let e=le[l]??0;if(n-e==0)continue;N=b(e,w,M,k)}let o=v(2!=x.distr||null!=a?m[l]:l,x,_,y),i=b(K(n,F),w,M,k),s=z(o-I),r=z(re(i,N)),u=z(se(i,N)),c=r-u;if(null!=n){let o=n<0?ie:oe,i=n<0?oe:ie;B?(U>0&&null!=q[l]&&R(J.get(q[l]),s,u+ne(U/2),H,re(0,c-U),o,i),null!=V[l]&&R(Z.get(V[l]),s,u+ne(U/2),H,re(0,c-U),o,i)):R(te,s,u+ne(U/2),H,re(0,c-U),o,i),O(e,t,l,s-U/2,u,H+U,c)}}return U>0?ee.stroke=B?J:te:B||(ee._fill=0==p.width?p._fill:p._stroke??p._fill,ee.width=0),ee.fill=B?Z:te,ee}))},e.spline=function(e){return function(e,t){const l=K(t?.alignGaps,0);return(t,n,o,i)=>ul(t,n,((s,r,u,a,c,f,d,h,p,m,g)=>{let x,w,v,b=s.pxRound,y=e=>b(f(e,a,m,h)),k=e=>b(d(e,c,g,p));0==a.ori?(x=gl,v=wl,w=Ml):(x=xl,v=vl,w=Sl);const _=a.dir*(0==a.ori?1:-1);o=G(u,o,i,1),i=G(u,o,i,-1);let M=y(r[1==_?o:i]),S=M,E=[],T=[];for(let e=1==_?o:i;e>=o&&e<=i;e+=_)if(null!=u[e]){let t=y(r[e]);E.push(S=t),T.push(k(u[e]))}const z={stroke:e(E,T,x,v,w,b),fill:null,clip:null,band:null,gaps:null,flags:1},P=z.stroke;let[D,A]=al(t,n);if(null!=s.fill||0!=D){let e=z.fill=new Path2D(P),l=k(s.fillTo(t,n,s.min,s.max,D));v(e,S,l),v(e,M,l)}if(!s.spanGaps){let e=[];e.push(...hl(r,u,o,i,_,y,l)),z.gaps=e=s.gaps(t,n,o,i,e),z.clip=dl(e,a.ori,h,p,m,g)}return 0!=A&&(z.band=2==A?[fl(t,n,o,i,P,-1),fl(t,n,o,i,P,1)]:fl(t,n,o,i,P,A)),z}))}(Cl,e)}}var Kl=l(379),Xl=l.n(Kl),$l=l(795),Ql=l.n($l),en=l(569),tn=l.n(en),ln=l(565),nn=l.n(ln),on=l(216),sn=l.n(on),rn=l(589),un=l.n(rn),an=l(350),cn={};function fn(e){var t,l=HTMLWidgets.find("#"+e);return void 0!==l&&(t=l.getWidget()),t}function dn(e,t){let l=[],n=[],o=e[0].length,i=Array(o);for(let e=0;ei[t]+=+e)));for(let l=1;ln>l&&!t(n))),l]});return n=n.filter((e=>e.series[1]>-1)),{data:[e[0]].concat(l),bands:n}}cn.styleTagTransform=un(),cn.setAttributes=nn(),cn.insert=tn().bind(null,"head"),cn.domAPI=Ql(),cn.insertStyleElement=sn(),Xl()(an.Z,cn),an.Z&&an.Z.locals&&an.Z.locals;const hn=e=>(t,l)=>{new ResizeObserver((e=>{for(let l of e){let e=l.contentRect.height,n=l.contentRect.width;const o=t.root.querySelectorAll(".u-legend, .u-title");for(let t of o)e-=Math.floor(t.offsetHeight);t.setSize({width:n,height:e})}})).observe(e),e.appendChild(t.root),l()},pn=(e,t,l,n)=>{const o=5*devicePixelRatio;return Jl.orient(e,t,((l,n,i,s,r,u,a,c,f,d,h,p,m,g,x)=>{let w=e.data[t];e.ctx.fillStyle=l.stroke();let v=2*Math.PI;console.time("points");let b=new Path2D;for(let e=0;e=s.min&&t<=s.max&&l>=r.min&&l<=r.max){let e=u(t,s,d,c),n=a(l,r,h,f);b.moveTo(e+o/2,n),x(b,e,n,o/2,0,v)}}console.timeEnd("points"),e.ctx.fill(b)})),null};HTMLWidgets.widget({name:"uPlot",type:"output",factory:function(e,t,l){var n,o,i;return{renderValue:function(s){void 0!==n&&n.destroy(),(o=s.config.options).width=t,o.height=l,i=s.config.data,s.stacked?(o.hooks||(o.hooks={}),o.hooks.init=[e=>{[...e.root.querySelectorAll(".u-legend .u-series")].forEach(((t,l)=>{e.series[l]._hide&&(t.style.display="none")}))}],n=function(e,t,l,n,o,i,s,r){let{opts:u,data:a}=function(e,t,l,n){let o=function(e,t){return{scales:{x:{time:!0}},series:t}}(0,t),i=dn(n?n(l):l,(e=>!1));return o.bands=i.bands,o.cursor=o.cursor||{},o.cursor.dataIdx=(e,t,n,o)=>null===l[t][n]?null:n,o.series.forEach((e=>{e.value=(e,t,n,o)=>l[n][o],e.points=e.points||{},e.points.filter=(e,t,n,o)=>{if(n){let e=[];return l[t].forEach(((t,l)=>{null!==t&&e.push(l)})),e}}})),o.scales.y={range:(e,t,l)=>{let n=uPlot.rangeNum(t,l,.1,!0);return[n[0],n[1]]}},o.hooks={setSeries:[(e,t)=>{let n=dn(l,(t=>!e.series[t].show));e.delBand(null),n.bands.forEach((t=>e.addBand(t))),e.setData(n.data)}]},{opts:o,data:i.data}}(0,t,l,n);return u.title=e,u.width=o,u.height=i,u.hooks=Object.assign(u.hooks,s),console.log(u),new uPlot(u,a,r)}(o.title,o.series,i,null,t,l,o.hooks,hn(e))):n=new Jl(o,i,hn(e))},getWidget:function(){return n},resize:function(e,t){}}}}),HTMLWidgets.shinyMode&&(Shiny.addCustomMessageHandler("uplot-api",(function(e){var t=fn(e.id);void 0!==t&&t[e.name].apply(null,e.args)})),Shiny.addCustomMessageHandler("uplot-setData",(function(e){var t=fn(e.id);void 0!==t&&t.setData(e.data)})))})();var o=window;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 79e9465..e730aba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "css-loader": "^6.7.1", "style-loader": "^3.3.1", - "uplot": "^1.6.26", + "uplot": "^1.6.30", "webpack": "^5.73.0", "webpack-cli": "^4.10.0", "webpack-merge": "^5.8.0" @@ -1370,9 +1370,9 @@ } }, "node_modules/uplot": { - "version": "1.6.26", - "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.26.tgz", - "integrity": "sha512-qN0mveL6UsP40TnHzHAJkUQvpfA3y8zSLXtXKVlJo/sLfj2+vjan/Z3g81MCZjy/hEDUFNtnLftPmETDA4s7Rg==", + "version": "1.6.30", + "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.30.tgz", + "integrity": "sha512-48oVVRALM/128ttW19F2a2xobc2WfGdJ0VJFX00099CfqbCTuML7L2OrTKxNzeFP34eo1+yJbqFSoFAp2u28/Q==", "dev": true }, "node_modules/uri-js": { @@ -2543,9 +2543,9 @@ } }, "uplot": { - "version": "1.6.26", - "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.26.tgz", - "integrity": "sha512-qN0mveL6UsP40TnHzHAJkUQvpfA3y8zSLXtXKVlJo/sLfj2+vjan/Z3g81MCZjy/hEDUFNtnLftPmETDA4s7Rg==", + "version": "1.6.30", + "resolved": "https://registry.npmjs.org/uplot/-/uplot-1.6.30.tgz", + "integrity": "sha512-48oVVRALM/128ttW19F2a2xobc2WfGdJ0VJFX00099CfqbCTuML7L2OrTKxNzeFP34eo1+yJbqFSoFAp2u28/Q==", "dev": true }, "uri-js": { diff --git a/package.json b/package.json index 7b594ed..c58cacc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "uplot", "version": "1.0.0", - "description": "", + "description": "R interface to µPlot.js", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -24,7 +24,7 @@ "devDependencies": { "css-loader": "^6.7.1", "style-loader": "^3.3.1", - "uplot": "^1.6.26", + "uplot": "^1.6.30", "webpack": "^5.73.0", "webpack-cli": "^4.10.0", "webpack-merge": "^5.8.0"