p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
3 lines • 52.1 kB
JavaScript
import{a as ji,b as qi}from"./chunk-O7S4L63H.js";var Qs="uplot",Xs="u-hz",er="u-vt",tr="u-title",lr="u-wrap",nr="u-under",ir="u-over",or="u-axis",Zt="u-off",sr="u-select",rr="u-cursor-x",fr="u-cursor-y",ur="u-cursor-pt",cr="u-legend",ar="u-live",pr="u-inline",hr="u-series",mr="u-marker",$i="u-label",gr="u-value",Nl="width",Wl="height";var Ji="bottom",yl="left",Wn="right",ni="#000",Zi=ni+"0",Gn="mousemove",Qi="mousedown",In="mouseup",Xi="mouseenter",eo="mouseleave",to="dblclick",dr="resize",wr="scroll",lo="change",sn="dppxchange",ii="--",Al=typeof window<"u",jn=Al?document:null,kl=Al?window:null,Sr=Al?navigator:null,oe,tn;function qn(){let e=devicePixelRatio;oe!=e&&(oe=e,tn&&Jn(lo,tn,qn),tn=matchMedia(`(min-resolution: ${oe-.001}dppx) and (max-resolution: ${oe+.001}dppx)`),Qt(lo,tn,qn),kl.dispatchEvent(new CustomEvent(sn)))}function Xe(e,i){if(i!=null){let o=e.classList;!o.contains(i)&&o.add(i)}}function $n(e,i){let o=e.classList;o.contains(i)&&o.remove(i)}function de(e,i,o){e.style[i]=o+"px"}function gt(e,i,o,n){let s=jn.createElement(e);return i!=null&&Xe(s,i),o?.insertBefore(s,n),s}function ft(e,i){return gt("div",e,i)}var no=new WeakMap;function bt(e,i,o,n,s){let a="translate("+i+"px,"+o+"px)",u=no.get(e);a!=u&&(e.style.transform=a,no.set(e,a),i<0||o<0||i>n||o>s?Xe(e,Zt):$n(e,Zt))}var io=new WeakMap;function oo(e,i,o){let n=i+o,s=io.get(e);n!=s&&(io.set(e,n),e.style.background=i,e.style.borderColor=o)}var so=new WeakMap;function ro(e,i,o,n){let s=i+""+o,a=so.get(e);s!=a&&(so.set(e,s),e.style.height=o+"px",e.style.width=i+"px",e.style.marginLeft=n?-i/2+"px":0,e.style.marginTop=n?-o/2+"px":0)}var oi={passive:!0},_r=qi(ji({},oi),{capture:!0});function Qt(e,i,o,n){i.addEventListener(e,o,n?_r:oi)}function Jn(e,i,o,n){i.removeEventListener(e,o,oi)}Al&&qn();function dt(e,i,o,n){let s;o=o||0,n=n||i.length-1;let a=n<=2147483647;for(;n-o>1;)s=a?o+n>>1:et((o+n)/2),i[s]<e?o=s:n=s;return e-i[o]<=i[n]-e?o:n}function Fo(e){return(o,n,s)=>{let a=-1,u=-1;for(let h=n;h<=s;h++)if(e(o[h])){a=h;break}for(let h=s;h>=n;h--)if(e(o[h])){u=h;break}return[a,u]}}var Oo=e=>e!=null,Ho=e=>e!=null&&e>0,un=Fo(Oo),yr=Fo(Ho);function vr(e,i,o,n=0,s=!1){let a=s?yr:un,u=s?Ho:Oo;[i,o]=a(e,i,o);let h=e[i],m=e[i];if(i>-1)if(n==1)h=e[i],m=e[o];else if(n==-1)h=e[o],m=e[i];else for(let g=i;g<=o;g++){let y=e[g];u(y)&&(y<h?h=y:y>m&&(m=y))}return[h??ce,m??-ce]}function cn(e,i,o,n){let s=co(e),a=co(i);e==i&&(s==-1?(e*=o,i/=o):(e/=o,i*=o));let u=o==10?Pt:No,h=s==1?et:ut,m=a==1?ut:et,g=h(u(Ee(e))),y=m(u(Ee(i))),d=xl(o,g),w=xl(o,y);return o==10&&(g<0&&(d=ae(d,-g)),y<0&&(w=ae(w,-y))),n||o==2?(e=d*s,i=w*a):(e=Yo(e,d),i=an(i,w)),[e,i]}function si(e,i,o,n){let s=cn(e,i,o,n);return e==0&&(s[0]=0),i==0&&(s[1]=0),s}var ri=.1,fo={mode:3,pad:ri},Il={pad:0,soft:null,mode:0},kr={min:Il,max:Il};function rn(e,i,o,n){return pn(o)?uo(e,i,o):(Il.pad=o,Il.soft=n?0:null,Il.mode=n?3:0,uo(e,i,kr))}function ne(e,i){return e??i}function xr(e,i,o){for(i=ne(i,0),o=ne(o,e.length-1);i<=o;){if(e[i]!=null)return!0;i++}return!1}function uo(e,i,o){let n=o.min,s=o.max,a=ne(n.pad,0),u=ne(s.pad,0),h=ne(n.hard,-ce),m=ne(s.hard,ce),g=ne(n.soft,ce),y=ne(s.soft,-ce),d=ne(n.mode,0),w=ne(s.mode,0),L=i-e,D=Pt(L),O=Ye(Ee(e),Ee(i)),N=Pt(O),G=Ee(N-D);(L<1e-24||G>10)&&(L=0,(e==0||i==0)&&(L=1e-24,d==2&&g!=ce&&(a=0),w==2&&y!=-ce&&(u=0)));let k=L||O||1e3,H=Pt(k),x=xl(10,et(H)),q=k*(L==0?e==0?.1:1:a),P=ae(Yo(e-q,x/10),24),$=e>=g&&(d==1||d==3&&P<=g||d==2&&P>=g)?g:ce,U=Ye(h,P<$&&e>=$?$:wt($,P)),Q=k*(L==0?i==0?.1:1:u),B=ae(an(i+Q,x/10),24),T=i<=y&&(w==1||w==3&&B>=y||w==2&&B<=y)?y:-ce,j=wt(m,B>T&&i<=T?T:Ye(T,B));return U==j&&U==0&&(j=100),[U,j]}var Tr=new Intl.NumberFormat(Al?Sr.language:"en-US"),fi=e=>Tr.format(e),tt=Math,on=tt.PI,Ee=tt.abs,et=tt.floor,Ae=tt.round,ut=tt.ceil,wt=tt.min,Ye=tt.max,xl=tt.pow,co=tt.sign,Pt=tt.log10,No=tt.log2,br=(e,i=1)=>tt.sinh(e)*i,Yn=(e,i=1)=>tt.asinh(e/i),ce=1/0;function ao(e){return(Pt((e^e>>31)-(e>>31))|0)+1}function Zn(e,i,o){return wt(Ye(e,i),o)}function Wo(e){return typeof e=="function"}function X(e){return Wo(e)?e:()=>e}var Mr=()=>{},Go=e=>e,Io=(e,i)=>i,Ar=e=>null,po=e=>!0,ho=(e,i)=>e==i,Er=/\.\d*?(?=9{6,}|0{6,})/gm,Xt=e=>{if(Uo(e)||Ht.has(e))return e;let i=`${e}`,o=i.match(Er);if(o==null)return e;let n=o[0].length-1;if(i.indexOf("e-")!=-1){let[s,a]=i.split("e");return+`${Xt(s)}e${a}`}return ae(e,n)};function $t(e,i){return Xt(ae(Xt(e/i))*i)}function an(e,i){return Xt(ut(Xt(e/i))*i)}function Yo(e,i){return Xt(et(Xt(e/i))*i)}function ae(e,i=0){if(Uo(e))return e;let o=10**i,n=e*o*(1+Number.EPSILON);return Ae(n)/o}var Ht=new Map;function Bo(e){return((""+e).split(".")[1]||"").length}function Bl(e,i,o,n){let s=[],a=n.map(Bo);for(let u=i;u<o;u++){let h=Ee(u),m=ae(xl(e,u),h);for(let g=0;g<n.length;g++){let y=e==10?+`${n[g]}e${u}`:n[g]*m,d=(u>=0?0:h)+(u>=a[g]?0:a[g]),w=e==10?y:ae(y,d);s.push(w),Ht.set(w,d)}}return s}var Yl={},ui=[],Tl=[null,null],Ot=Array.isArray,Uo=Number.isInteger,Pr=e=>e===void 0;function mo(e){return typeof e=="string"}function pn(e){let i=!1;if(e!=null){let o=e.constructor;i=o==null||o==Object}return i}function Dr(e){return e!=null&&typeof e=="object"}var Lr=Object.getPrototypeOf(Uint8Array),Ko="__proto__";function bl(e,i=pn){let o;if(Ot(e)){let n=e.find(s=>s!=null);if(Ot(n)||i(n)){o=Array(e.length);for(let s=0;s<e.length;s++)o[s]=bl(e[s],i)}else o=e.slice()}else if(e instanceof Lr)o=e.slice();else if(i(e)){o={};for(let n in e)n!=Ko&&(o[n]=bl(e[n],i))}else o=e;return o}function Te(e){let i=arguments;for(let o=1;o<i.length;o++){let n=i[o];for(let s in n)s!=Ko&&(pn(e[s])?Te(e[s],bl(n[s])):e[s]=bl(n[s]))}return e}var Cr=0,Vr=1,Rr=2;function zr(e,i,o){for(let n=0,s,a=-1;n<i.length;n++){let u=i[n];if(u>a){for(s=u-1;s>=0&&e[s]==null;)e[s--]=null;for(s=u+1;s<o&&e[s]==null;)e[a=s++]=null}}}function Fr(e,i){if(Nr(e)){let u=e[0].slice();for(let h=1;h<e.length;h++)u.push(...e[h].slice(1));return Wr(u[0])||(u=Hr(u)),u}let o=new Set;for(let u=0;u<e.length;u++){let m=e[u][0],g=m.length;for(let y=0;y<g;y++)o.add(m[y])}let n=[Array.from(o).sort((u,h)=>u-h)],s=n[0].length,a=new Map;for(let u=0;u<s;u++)a.set(n[0][u],u);for(let u=0;u<e.length;u++){let h=e[u],m=h[0];for(let g=1;g<h.length;g++){let y=h[g],d=Array(s).fill(void 0),w=i?i[u][g]:Vr,L=[];for(let D=0;D<y.length;D++){let O=y[D],N=a.get(m[D]);O===null?w!=Cr&&(d[N]=O,w==Rr&&L.push(N)):d[N]=O}zr(d,L,s),n.push(d)}}return n}var Or=typeof queueMicrotask>"u"?e=>Promise.resolve().then(e):queueMicrotask;function Hr(e){let i=e[0],o=i.length,n=Array(o);for(let a=0;a<n.length;a++)n[a]=a;n.sort((a,u)=>i[a]-i[u]);let s=[];for(let a=0;a<e.length;a++){let u=e[a],h=Array(o);for(let m=0;m<o;m++)h[m]=u[n[m]];s.push(h)}return s}function Nr(e){let i=e[0][0],o=i.length;for(let n=1;n<e.length;n++){let s=e[n][0];if(s.length!=o)return!1;if(s!=i){for(let a=0;a<o;a++)if(s[a]!=i[a])return!1}}return!0}function Wr(e,i=100){let o=e.length;if(o<=1)return!0;let n=0,s=o-1;for(;n<=s&&e[n]==null;)n++;for(;s>=n&&e[s]==null;)s--;if(s<=n)return!0;let a=Ye(1,et((s-n+1)/i));for(let u=e[n],h=n+a;h<=s;h+=a){let m=e[h];if(m!=null){if(m<=u)return!1;u=m}}return!0}var jo=["January","February","March","April","May","June","July","August","September","October","November","December"],qo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function $o(e){return e.slice(0,3)}var Gr=qo.map($o),Ir=jo.map($o),Yr={MMMM:jo,MMM:Ir,WWWW:qo,WWW:Gr};function Hl(e){return(e<10?"0":"")+e}function Br(e){return(e<10?"00":e<100?"0":"")+e}var Ur={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,i)=>i.MMMM[e.getMonth()],MMM:(e,i)=>i.MMM[e.getMonth()],MM:e=>Hl(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Hl(e.getDate()),D:e=>e.getDate(),WWWW:(e,i)=>i.WWWW[e.getDay()],WWW:(e,i)=>i.WWW[e.getDay()],HH:e=>Hl(e.getHours()),H:e=>e.getHours(),h:e=>{let i=e.getHours();return i==0?12:i>12?i-12:i},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Hl(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Hl(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>Br(e.getMilliseconds())};function ci(e,i){i=i||Yr;let o=[],n=/\{([a-z]+)\}|[^{]+/gi,s;for(;s=n.exec(e);)o.push(s[0][0]=="{"?Ur[s[1]]:s[0]);return a=>{let u="";for(let h=0;h<o.length;h++)u+=typeof o[h]=="string"?o[h]:o[h](a,i);return u}}var Kr=new Intl.DateTimeFormat().resolvedOptions().timeZone;function jr(e,i){let o;return i=="UTC"||i=="Etc/UTC"?o=new Date(+e+e.getTimezoneOffset()*6e4):i==Kr?o=e:(o=new Date(e.toLocaleString("en-US",{timeZone:i})),o.setMilliseconds(e.getMilliseconds())),o}var Jo=e=>e%1==0,fn=[1,2,2.5,5],qr=Bl(10,-32,0,fn),Zo=Bl(10,0,32,fn),$r=Zo.filter(Jo),Jt=qr.concat(Zo),ai=`
`,Qo="{YYYY}",go=ai+Qo,Xo="{M}/{D}",Gl=ai+Xo,ln=Gl+"/{YY}",es="{aa}",Jr="{h}:{mm}",vl=Jr+es,wo=ai+vl,So=":{ss}",re=null;function ts(e){let i=e*1e3,o=i*60,n=o*60,s=n*24,a=s*30,u=s*365,m=(e==1?Bl(10,0,3,fn).filter(Jo):Bl(10,-3,0,fn)).concat([i,i*5,i*10,i*15,i*30,o,o*5,o*10,o*15,o*30,n,n*2,n*3,n*4,n*6,n*8,n*12,s,s*2,s*3,s*4,s*5,s*6,s*7,s*8,s*9,s*10,s*15,a,a*2,a*3,a*4,a*6,u,u*2,u*5,u*10,u*25,u*50,u*100]),g=[[u,Qo,re,re,re,re,re,re,1],[s*28,"{MMM}",go,re,re,re,re,re,1],[s,Xo,go,re,re,re,re,re,1],[n,"{h}"+es,ln,re,Gl,re,re,re,1],[o,vl,ln,re,Gl,re,re,re,1],[i,So,ln+" "+vl,re,Gl+" "+vl,re,wo,re,1],[e,So+".{fff}",ln+" "+vl,re,Gl+" "+vl,re,wo,re,1]];function y(d){return(w,L,D,O,N,G)=>{let k=[],H=N>=u,x=N>=a&&N<u,q=d(D),P=ae(q*e,3),$=Bn(q.getFullYear(),H?0:q.getMonth(),x||H?1:q.getDate()),U=ae($*e,3);if(x||H){let Q=x?N/a:0,B=H?N/u:0,T=P==U?P:ae(Bn($.getFullYear()+B,$.getMonth()+Q,1)*e,3),j=new Date(Ae(T/e)),C=j.getFullYear(),I=j.getMonth();for(let F=0;T<=O;F++){let ee=Bn(C+B*F,I+Q*F,1),z=ee-d(ae(ee*e,3));T=ae((+ee+z)*e,3),T<=O&&k.push(T)}}else{let Q=N>=s?s:N,B=et(D)-et(P),T=U+B+an(P-U,Q);k.push(T);let j=d(T),C=j.getHours()+j.getMinutes()/o+j.getSeconds()/n,I=N/n,F=w.axes[L]._space,ee=G/F;for(;T=ae(T+N,e==1?0:3),!(T>O);)if(I>1){let z=et(ae(C+I,6))%24,te=d(T).getHours()-z;te>1&&(te=-1),T-=te*n,C=(C+I)%24;let fe=k[k.length-1];ae((T-fe)/N,3)*ee>=.7&&k.push(T)}else k.push(T)}return k}}return[m,g,y]}var[Zr,Qr,Xr]=ts(1),[ef,tf,lf]=ts(.001);Bl(2,-53,53,[1]);function _o(e,i){return e.map(o=>o.map((n,s)=>s==0||s==8||n==null?n:i(s==1||o[8]==0?n:o[1]+n)))}function yo(e,i){return(o,n,s,a,u)=>{let h=i.find(D=>u>=D[0])||i[i.length-1],m,g,y,d,w,L;return n.map(D=>{let O=e(D),N=O.getFullYear(),G=O.getMonth(),k=O.getDate(),H=O.getHours(),x=O.getMinutes(),q=O.getSeconds(),P=N!=m&&h[2]||G!=g&&h[3]||k!=y&&h[4]||H!=d&&h[5]||x!=w&&h[6]||q!=L&&h[7]||h[1];return m=N,g=G,y=k,d=H,w=x,L=q,P(O)})}}function nf(e,i){let o=ci(i);return(n,s,a,u,h)=>s.map(m=>o(e(m)))}function Bn(e,i,o){return new Date(e,i,o)}function vo(e,i){return i(e)}var of="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function ko(e,i){return(o,n,s,a)=>a==null?ii:i(e(n))}function sf(e,i){let o=e.series[i];return o.width?o.stroke(e,i):o.points.width?o.points.stroke(e,i):null}function rf(e,i){return e.series[i].fill(e,i)}var ff={show:!0,live:!0,isolate:!1,mount:Mr,markers:{show:!0,width:2,stroke:sf,fill:rf,dash:"solid"},idx:null,idxs:null,values:[]};function uf(e,i){let o=e.cursor.points,n=ft(),s=o.size(e,i);de(n,Nl,s),de(n,Wl,s);let a=s/-2;de(n,"marginLeft",a),de(n,"marginTop",a);let u=o.width(e,i,s);return u&&de(n,"borderWidth",u),n}function cf(e,i){let o=e.series[i].points;return o._fill||o._stroke}function af(e,i){let o=e.series[i].points;return o._stroke||o._fill}function pf(e,i){return e.series[i].points.size}var Un=[0,0];function hf(e,i,o){return Un[0]=i,Un[1]=o,Un}function nn(e,i,o,n=!0){return s=>{s.button==0&&(!n||s.target==i)&&o(s)}}function Kn(e,i,o,n=!0){return s=>{(!n||s.target==i)&&o(s)}}var mf={show:!0,x:!0,y:!0,lock:!1,move:hf,points:{one:!1,show:uf,size:pf,width:0,stroke:af,fill:cf},bind:{mousedown:nn,mouseup:nn,click:nn,dblclick:nn,mousemove:Kn,mouseleave:Kn,mouseenter:Kn},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,i)=>{i.stopPropagation(),i.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,i,o,n,s)=>n-s,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},ls={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},pi=Te({},ls,{filter:Io}),ns=Te({},pi,{size:10}),is=Te({},ls,{show:!1}),hi='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"',os="bold "+hi,ss=1.5,xo={show:!0,scale:"x",stroke:ni,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:os,side:2,grid:pi,ticks:ns,border:is,font:hi,lineGap:ss,rotate:0},gf="Value",df="Time",To={show:!0,scale:"x",auto:!1,sorted:1,min:ce,max:-ce,idxs:[]};function wf(e,i,o,n,s){return i.map(a=>a==null?"":fi(a))}function Sf(e,i,o,n,s,a,u){let h=[],m=Ht.get(s)||0;o=u?o:ae(an(o,s),m);for(let g=o;g<=n;g=ae(g+s,m))h.push(Object.is(g,-0)?0:g);return h}function Qn(e,i,o,n,s,a,u){let h=[],m=e.scales[e.axes[i].scale].log,g=m==10?Pt:No,y=et(g(o));s=xl(m,y),m==10&&(s=Jt[dt(s,Jt)]);let d=o,w=s*m;m==10&&(w=Jt[dt(w,Jt)]);do h.push(d),d=d+s,m==10&&!Ht.has(d)&&(d=ae(d,Ht.get(s))),d>=w&&(s=d,w=s*m,m==10&&(w=Jt[dt(w,Jt)]));while(d<=n);return h}function _f(e,i,o,n,s,a,u){let m=e.scales[e.axes[i].scale].asinh,g=n>m?Qn(e,i,Ye(m,o),n,s):[m],y=n>=0&&o<=0?[0]:[];return(o<-m?Qn(e,i,Ye(m,-n),-o,s):[m]).reverse().map(w=>-w).concat(y,g)}var rs=/./,yf=/[12357]/,vf=/[125]/,bo=/1/,Xn=(e,i,o,n)=>e.map((s,a)=>i==4&&s==0||a%n==0&&o.test(s.toExponential()[s<0?1:0])?s:null);function kf(e,i,o,n,s){let a=e.axes[o],u=a.scale,h=e.scales[u],m=e.valToPos,g=a._space,y=m(10,u),d=m(9,u)-y>=g?rs:m(7,u)-y>=g?yf:m(5,u)-y>=g?vf:bo;if(d==bo){let w=Ee(m(1,u)-y);if(w<g)return Xn(i.slice().reverse(),h.distr,d,ut(g/w)).reverse()}return Xn(i,h.distr,d,1)}function xf(e,i,o,n,s){let a=e.axes[o],u=a.scale,h=a._space,m=e.valToPos,g=Ee(m(1,u)-m(2,u));return g<h?Xn(i.slice().reverse(),3,rs,ut(h/g)).reverse():i}function Tf(e,i,o,n){return n==null?ii:i==null?"":fi(i)}var Mo={show:!0,scale:"y",stroke:ni,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:os,side:3,grid:pi,ticks:ns,border:is,font:hi,lineGap:ss,rotate:0};function bf(e,i){let o=3+(e||1)*2;return ae(o*i,3)}function Mf(e,i){let{scale:o,idxs:n}=e.series[0],s=e._data[0],a=e.valToPos(s[n[0]],o,!0),u=e.valToPos(s[n[1]],o,!0),h=Ee(u-a),m=e.series[i],g=h/(m.points.space*oe);return n[1]-n[0]<=g}var Ao={scale:null,auto:!0,sorted:0,min:ce,max:-ce},fs=(e,i,o,n,s)=>s,Eo={show:!0,auto:!0,sorted:0,gaps:fs,alpha:1,facets:[Te({},Ao,{scale:"x"}),Te({},Ao,{scale:"y"})]},Po={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:fs,alpha:1,points:{show:Mf,filter:null},values:null,min:ce,max:-ce,idxs:[],path:null,clip:null};function Af(e,i,o,n,s){return o/10}var us={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Ef=Te({},us,{time:!1,ori:1}),Do={};function cs(e,i){let o=Do[e];return o||(o={key:e,plots:[],sub(n){o.plots.push(n)},unsub(n){o.plots=o.plots.filter(s=>s!=n)},pub(n,s,a,u,h,m,g){for(let y=0;y<o.plots.length;y++)o.plots[y]!=s&&o.plots[y].pub(n,s,a,u,h,m,g)}},e!=null&&(Do[e]=o)),o}var Ml=1,ei=2;function el(e,i,o){let n=e.mode,s=e.series[i],a=n==2?e._data[i]:e._data,u=e.scales,h=e.bbox,m=a[0],g=n==2?a[1]:a[i],y=n==2?u[s.facets[0].scale]:u[e.series[0].scale],d=n==2?u[s.facets[1].scale]:u[s.scale],w=h.left,L=h.top,D=h.width,O=h.height,N=e.valToPosH,G=e.valToPosV;return y.ori==0?o(s,m,g,y,d,N,G,w,L,D,O,mn,El,dn,ps,ms):o(s,m,g,y,d,G,N,L,w,O,D,gn,Pl,di,hs,gs)}function mi(e,i){let o=0,n=0,s=ne(e.bands,ui);for(let a=0;a<s.length;a++){let u=s[a];u.series[0]==i?o=u.dir:u.series[1]==i&&(u.dir==1?n|=1:n|=2)}return[o,n==1?-1:n==2?1:n==3?2:0]}function Pf(e,i,o,n,s){let a=e.mode,u=e.series[i],h=a==2?u.facets[1].scale:u.scale,m=e.scales[h];return s==-1?m.min:s==1?m.max:m.distr==3?m.dir==1?m.min:m.max:0}function Dt(e,i,o,n,s,a){return el(e,i,(u,h,m,g,y,d,w,L,D,O,N)=>{let G=u.pxRound,k=g.dir*(g.ori==0?1:-1),H=g.ori==0?El:Pl,x,q;k==1?(x=o,q=n):(x=n,q=o);let P=G(d(h[x],g,O,L)),$=G(w(m[x],y,N,D)),U=G(d(h[q],g,O,L)),Q=G(w(a==1?y.max:y.min,y,N,D)),B=new Path2D(s);return H(B,U,Q),H(B,P,Q),H(B,P,$),B})}function hn(e,i,o,n,s,a){let u=null;if(e.length>0){u=new Path2D;let h=i==0?dn:di,m=o;for(let d=0;d<e.length;d++){let w=e[d];if(w[1]>w[0]){let L=w[0]-m;L>0&&h(u,m,n,L,n+a),m=w[1]}}let g=o+s-m,y=10;g>0&&h(u,m,n-y/2,g,n+a+y)}return u}function Df(e,i,o){let n=e[e.length-1];n&&n[0]==i?n[1]=o:e.push([i,o])}function gi(e,i,o,n,s,a,u){let h=[],m=e.length;for(let g=s==1?o:n;g>=o&&g<=n;g+=s)if(i[g]===null){let d=g,w=g;if(s==1)for(;++g<=n&&i[g]===null;)w=g;else for(;--g>=o&&i[g]===null;)w=g;let L=a(e[d]),D=w==d?L:a(e[w]),O=d-s;L=u<=0&&O>=0&&O<m?a(e[O]):L;let G=w+s;D=u>=0&&G>=0&&G<m?a(e[G]):D,D>=L&&h.push([L,D])}return h}function Lo(e){return e==0?Go:e==1?Ae:i=>$t(i,e)}function as(e){let i=e==0?mn:gn,o=e==0?(s,a,u,h,m,g)=>{s.arcTo(a,u,h,m,g)}:(s,a,u,h,m,g)=>{s.arcTo(u,a,m,h,g)},n=e==0?(s,a,u,h,m)=>{s.rect(a,u,h,m)}:(s,a,u,h,m)=>{s.rect(u,a,m,h)};return(s,a,u,h,m,g=0,y=0)=>{g==0&&y==0?n(s,a,u,h,m):(g=wt(g,h/2,m/2),y=wt(y,h/2,m/2),i(s,a+g,u),o(s,a+h,u,a+h,u+m,g),o(s,a+h,u+m,a,u+m,y),o(s,a,u+m,a,u,y),o(s,a,u,a+h,u,g),s.closePath())}}var mn=(e,i,o)=>{e.moveTo(i,o)},gn=(e,i,o)=>{e.moveTo(o,i)},El=(e,i,o)=>{e.lineTo(i,o)},Pl=(e,i,o)=>{e.lineTo(o,i)},dn=as(0),di=as(1),ps=(e,i,o,n,s,a)=>{e.arc(i,o,n,s,a)},hs=(e,i,o,n,s,a)=>{e.arc(o,i,n,s,a)},ms=(e,i,o,n,s,a,u)=>{e.bezierCurveTo(i,o,n,s,a,u)},gs=(e,i,o,n,s,a,u)=>{e.bezierCurveTo(o,i,s,n,u,a)};function ds(e){return(i,o,n,s,a)=>el(i,o,(u,h,m,g,y,d,w,L,D,O,N)=>{let{pxRound:G,points:k}=u,H,x;g.ori==0?(H=mn,x=ps):(H=gn,x=hs);let q=ae(k.width*oe,3),P=(k.size-k.width)/2*oe,$=ae(P*2,3),U=new Path2D,Q=new Path2D,{left:B,top:T,width:j,height:C}=i.bbox;dn(Q,B-$,T-$,j+$*2,C+$*2);let I=F=>{if(m[F]!=null){let ee=G(d(h[F],g,O,L)),z=G(w(m[F],y,N,D));H(U,ee+P,z),x(U,ee,z,P,0,on*2)}};if(a)a.forEach(I);else for(let F=n;F<=s;F++)I(F);return{stroke:q>0?U:null,fill:U,clip:Q,flags:Ml|ei}})}function ws(e){return(i,o,n,s,a,u)=>{n!=s&&(a!=n&&u!=n&&e(i,o,n),a!=s&&u!=s&&e(i,o,s),e(i,o,u))}}var Lf=ws(El),Cf=ws(Pl);function Ss(e){let i=ne(e?.alignGaps,0);return(o,n,s,a)=>el(o,n,(u,h,m,g,y,d,w,L,D,O,N)=>{[s,a]=un(m,s,a);let G=u.pxRound,k=C=>G(d(C,g,O,L)),H=C=>G(w(C,y,N,D)),x,q;g.ori==0?(x=El,q=Lf):(x=Pl,q=Cf);let P=g.dir*(g.ori==0?1:-1),$={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Ml},U=$.stroke,Q=!1;if(a-s>=O*4){let C=V=>o.posToVal(V,g.key,!0),I=null,F=null,ee,z,Ue,we=k(h[P==1?s:a]),te=k(h[s]),fe=k(h[a]),J=C(P==1?te+1:fe-1);for(let V=P==1?s:a;V>=s&&V<=a;V+=P){let be=h[V],Se=(P==1?be<J:be>J)?we:k(be),se=m[V];Se==we?se!=null?(z=se,I==null?(x(U,Se,H(z)),ee=I=F=z):z<I?I=z:z>F&&(F=z)):se===null&&(Q=!0):(I!=null&&q(U,we,H(I),H(F),H(ee),H(z)),se!=null?(z=se,x(U,Se,H(z)),I=F=ee=z):(I=F=null,se===null&&(Q=!0)),we=Se,J=C(we+P))}I!=null&&I!=F&&Ue!=we&&q(U,we,H(I),H(F),H(ee),H(z))}else for(let C=P==1?s:a;C>=s&&C<=a;C+=P){let I=m[C];I===null?Q=!0:I!=null&&x(U,k(h[C]),H(I))}let[T,j]=mi(o,n);if(u.fill!=null||T!=0){let C=$.fill=new Path2D(U),I=u.fillTo(o,n,u.min,u.max,T),F=H(I),ee=k(h[s]),z=k(h[a]);P==-1&&([z,ee]=[ee,z]),x(C,z,F),x(C,ee,F)}if(!u.spanGaps){let C=[];Q&&C.push(...gi(h,m,s,a,P,k,i)),$.gaps=C=u.gaps(o,n,s,a,C),$.clip=hn(C,g.ori,L,D,O,N)}return j!=0&&($.band=j==2?[Dt(o,n,s,a,U,-1),Dt(o,n,s,a,U,1)]:Dt(o,n,s,a,U,j)),$})}function Vf(e){let i=ne(e.align,1),o=ne(e.ascDesc,!1),n=ne(e.alignGaps,0),s=ne(e.extend,!1);return(a,u,h,m)=>el(a,u,(g,y,d,w,L,D,O,N,G,k,H)=>{[h,m]=un(d,h,m);let x=g.pxRound,{left:q,width:P}=a.bbox,$=te=>x(D(te,w,k,N)),U=te=>x(O(te,L,H,G)),Q=w.ori==0?El:Pl,B={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Ml},T=B.stroke,j=w.dir*(w.ori==0?1:-1),C=U(d[j==1?h:m]),I=$(y[j==1?h:m]),F=I,ee=I;s&&i==-1&&(ee=q,Q(T,ee,C)),Q(T,I,C);for(let te=j==1?h:m;te>=h&&te<=m;te+=j){let fe=d[te];if(fe==null)continue;let J=$(y[te]),V=U(fe);i==1?Q(T,J,C):Q(T,F,V),Q(T,J,V),C=V,F=J}let z=F;s&&i==1&&(z=q+P,Q(T,z,C));let[Ue,we]=mi(a,u);if(g.fill!=null||Ue!=0){let te=B.fill=new Path2D(T),fe=g.fillTo(a,u,g.min,g.max,Ue),J=U(fe);Q(te,z,J),Q(te,ee,J)}if(!g.spanGaps){let te=[];te.push(...gi(y,d,h,m,j,$,n));let fe=g.width*oe/2,J=o||i==1?fe:-fe,V=o||i==-1?-fe:fe;te.forEach(be=>{be[0]+=J,be[1]+=V}),B.gaps=te=g.gaps(a,u,h,m,te),B.clip=hn(te,w.ori,N,G,k,H)}return we!=0&&(B.band=we==2?[Dt(a,u,h,m,T,-1),Dt(a,u,h,m,T,1)]:Dt(a,u,h,m,T,we)),B})}function Co(e,i,o,n,s,a,u=ce){if(e.length>1){let h=null;for(let m=0,g=1/0;m<e.length;m++)if(i[m]!==void 0){if(h!=null){let y=Ee(e[m]-e[h]);y<g&&(g=y,u=Ee(o(e[m],n,s,a)-o(e[h],n,s,a)))}h=m}}return u}function Rf(e){e=e||Yl;let i=ne(e.size,[.6,ce,1]),o=e.align||0,n=e.gap||0,s=e.radius;s=s==null?[0,0]:typeof s=="number"?[s,0]:s;let a=X(s),u=1-i[0],h=ne(i[1],ce),m=ne(i[2],1),g=ne(e.disp,Yl),y=ne(e.each,L=>{}),{fill:d,stroke:w}=g;return(L,D,O,N)=>el(L,D,(G,k,H,x,q,P,$,U,Q,B,T)=>{let j=G.pxRound,C=o,I=n*oe,F=h*oe,ee=m*oe,z,Ue;x.ori==0?[z,Ue]=a(L,D):[Ue,z]=a(L,D);let we=x.dir*(x.ori==0?1:-1),te=x.ori==0?dn:di,fe=x.ori==0?y:(A,pe,Me,il,Gt,_t,It)=>{y(A,pe,Me,Gt,il,It,_t)},J=ne(L.bands,ui).find(A=>A.series[0]==D),V=J!=null?J.dir:0,be=G.fillTo(L,D,G.min,G.max,V),He=j($(be,q,T,Q)),Se,se,ct,qe=B,ye=j(G.width*oe),St=!1,Mt=null,lt=null,Lt=null,tl=null;d!=null&&(ye==0||w!=null)&&(St=!0,Mt=d.values(L,D,O,N),lt=new Map,new Set(Mt).forEach(A=>{A!=null&<.set(A,new Path2D)}),ye>0&&(Lt=w.values(L,D,O,N),tl=new Map,new Set(Lt).forEach(A=>{A!=null&&tl.set(A,new Path2D)})));let{x0:ll,size:Dl}=g;if(ll!=null&&Dl!=null){C=1,k=ll.values(L,D,O,N),ll.unit==2&&(k=k.map(Me=>L.posToVal(U+Me*B,x.key,!0)));let A=Dl.values(L,D,O,N);Dl.unit==2?se=A[0]*B:se=P(A[0],x,B,U)-P(0,x,B,U),qe=Co(k,H,P,x,B,U,qe),ct=qe-se+I}else qe=Co(k,H,P,x,B,U,qe),ct=qe*u+I,se=qe-ct;ct<1&&(ct=0),ye>=se/2&&(ye=0),ct<5&&(j=Go);let Ul=ct>0,Nt=qe-ct-(Ul?ye:0);se=j(Zn(Nt,ee,F)),Se=(C==0?se/2:C==we?0:se)-C*we*((C==0?I/2:0)+(Ul?ye/2:0));let Ne={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},nl=St?null:new Path2D,At=null;if(J!=null)At=L.data[J.series[1]];else{let{y0:A,y1:pe}=g;A!=null&&pe!=null&&(H=pe.values(L,D,O,N),At=A.values(L,D,O,N))}let Wt=z*se,K=Ue*se;for(let A=we==1?O:N;A>=O&&A<=N;A+=we){let pe=H[A];if(pe==null)continue;if(At!=null){let Ke=At[A]??0;if(pe-Ke==0)continue;He=$(Ke,q,T,Q)}let Me=x.distr!=2||g!=null?k[A]:A,il=P(Me,x,B,U),Gt=$(ne(pe,be),q,T,Q),_t=j(il-Se),It=j(Ye(Gt,He)),$e=j(wt(Gt,He)),nt=It-$e;if(pe!=null){let Ke=pe<0?K:Wt,at=pe<0?Wt:K;St?(ye>0&&Lt[A]!=null&&te(tl.get(Lt[A]),_t,$e+et(ye/2),se,Ye(0,nt-ye),Ke,at),Mt[A]!=null&&te(lt.get(Mt[A]),_t,$e+et(ye/2),se,Ye(0,nt-ye),Ke,at)):te(nl,_t,$e+et(ye/2),se,Ye(0,nt-ye),Ke,at),fe(L,D,A,_t-ye/2,$e,se+ye,nt)}}return ye>0?Ne.stroke=St?tl:nl:St||(Ne._fill=G.width==0?G._fill:G._stroke??G._fill,Ne.width=0),Ne.fill=St?lt:nl,Ne})}function zf(e,i){let o=ne(i?.alignGaps,0);return(n,s,a,u)=>el(n,s,(h,m,g,y,d,w,L,D,O,N,G)=>{[a,u]=un(g,a,u);let k=h.pxRound,H=z=>k(w(z,y,N,D)),x=z=>k(L(z,d,G,O)),q,P,$;y.ori==0?(q=mn,$=El,P=ms):(q=gn,$=Pl,P=gs);let U=y.dir*(y.ori==0?1:-1),Q=H(m[U==1?a:u]),B=Q,T=[],j=[];for(let z=U==1?a:u;z>=a&&z<=u;z+=U)if(g[z]!=null){let we=m[z],te=H(we);T.push(B=te),j.push(x(g[z]))}let C={stroke:e(T,j,q,$,P,k),fill:null,clip:null,band:null,gaps:null,flags:Ml},I=C.stroke,[F,ee]=mi(n,s);if(h.fill!=null||F!=0){let z=C.fill=new Path2D(I),Ue=h.fillTo(n,s,h.min,h.max,F),we=x(Ue);$(z,B,we),$(z,Q,we)}if(!h.spanGaps){let z=[];z.push(...gi(m,g,a,u,U,H,o)),C.gaps=z=h.gaps(n,s,a,u,z),C.clip=hn(z,y.ori,D,O,N,G)}return ee!=0&&(C.band=ee==2?[Dt(n,s,a,u,I,-1),Dt(n,s,a,u,I,1)]:Dt(n,s,a,u,I,ee)),C})}function Ff(e){return zf(Of,e)}function Of(e,i,o,n,s,a){let u=e.length;if(u<2)return null;let h=new Path2D;if(o(h,e[0],i[0]),u==2)n(h,e[1],i[1]);else{let m=Array(u),g=Array(u-1),y=Array(u-1),d=Array(u-1);for(let w=0;w<u-1;w++)y[w]=i[w+1]-i[w],d[w]=e[w+1]-e[w],g[w]=y[w]/d[w];m[0]=g[0];for(let w=1;w<u-1;w++)g[w]===0||g[w-1]===0||g[w-1]>0!=g[w]>0?m[w]=0:(m[w]=3*(d[w-1]+d[w])/((2*d[w]+d[w-1])/g[w-1]+(d[w]+2*d[w-1])/g[w]),isFinite(m[w])||(m[w]=0));m[u-1]=g[u-2];for(let w=0;w<u-1;w++)s(h,e[w]+d[w]/3,i[w]+m[w]*d[w]/3,e[w+1]-d[w]/3,i[w+1]-m[w+1]*d[w]/3,e[w+1],i[w+1])}return h}var ti=new Set;function Vo(){for(let e of ti)e.syncRect(!0)}Al&&(Qt(dr,kl,Vo),Qt(wr,kl,Vo,!0),Qt(sn,kl,()=>{Be.pxRatio=oe}));var Hf=Ss(),Nf=ds();function Ro(e,i,o,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((a,u)=>li(a,u,i,o))}function Wf(e,i){return e.map((o,n)=>n==0?{}:Te({},i,o))}function li(e,i,o,n){return Te({},i==0?o:n,e)}function _s(e,i,o){return i==null?Tl:[i,o]}var Gf=_s;function If(e,i,o){return i==null?Tl:rn(i,o,ri,!0)}function ys(e,i,o,n){return i==null?Tl:cn(i,o,e.scales[n].log,!1)}var Yf=ys;function vs(e,i,o,n){return i==null?Tl:si(i,o,e.scales[n].log,!1)}var Bf=vs;function Uf(e,i,o,n,s){let a=Ye(ao(e),ao(i)),u=i-e,h=dt(s/n*u,o);do{let m=o[h],g=n*m/u;if(g>=s&&a+(m<5?Ht.get(m):0)<=17)return[m,g]}while(++h<o.length);return[0,0]}function zo(e){let i,o;return e=e.replace(/(\d+)px/,(n,s)=>(i=Ae((o=+s)*oe))+"px"),[e,i,o]}function Kf(e){e.show&&[e.font,e.labelFont].forEach(i=>{let o=ae(i[2]*oe,1);i[0]=i[0].replace(/[0-9.]+px/,o+"px"),i[1]=o})}function Be(e,i,o){let n={mode:ne(e.mode,1)},s=n.mode;function a(t,l,r,f){let c=l.valToPct(t);return f+r*(l.dir==-1?1-c:c)}function u(t,l,r,f){let c=l.valToPct(t);return f+r*(l.dir==-1?c:1-c)}function h(t,l,r,f){return l.ori==0?a(t,l,r,f):u(t,l,r,f)}n.valToPosH=a,n.valToPosV=u;let m=!1;n.status=0;let g=n.root=ft(Qs);if(e.id!=null&&(g.id=e.id),Xe(g,e.class),e.title){let t=ft(tr,g);t.textContent=e.title}let y=gt("canvas"),d=n.ctx=y.getContext("2d"),w=ft(lr,g);Qt("click",w,t=>{t.target===D&&(he!=gl||_e!=dl)&&Fe.click(n,t)},!0);let L=n.under=ft(nr,w);w.appendChild(y);let D=n.over=ft(ir,w);e=bl(e);let O=+ne(e.pxAlign,1),N=Lo(O);(e.plugins||[]).forEach(t=>{t.opts&&(e=t.opts(n,e)||e)});let G=e.ms||.001,k=n.series=s==1?Ro(e.series||[],To,Po,!1):Wf(e.series||[null],Eo),H=n.axes=Ro(e.axes||[],xo,Mo,!0),x=n.scales={},q=n.bands=e.bands||[];q.forEach(t=>{t.fill=X(t.fill||null),t.dir=ne(t.dir,-1)});let P=s==2?k[1].facets[0].scale:k[0].scale,$={axes:Os,series:Cs},U=(e.drawOrder||["axes","series"]).map(t=>$[t]);function Q(t){let l=t.distr==3?r=>Pt(r>0?r:t.clamp(n,r,t.min,t.max,t.key)):t.distr==4?r=>Yn(r,t.asinh):t.distr==100?r=>t.fwd(r):r=>r;return r=>{let f=l(r),{_min:c,_max:p}=t,S=p-c;return(f-c)/S}}function B(t){let l=x[t];if(l==null){let r=(e.scales||Yl)[t]||Yl;if(r.from!=null){B(r.from);let f=Te({},x[r.from],r,{key:t});f.valToPct=Q(f),x[t]=f}else{l=x[t]=Te({},t==P?us:Ef,r),l.key=t;let f=l.time,c=l.range,p=Ot(c);if((t!=P||s==2&&!f)&&(p&&(c[0]==null||c[1]==null)&&(c={min:c[0]==null?fo:{mode:1,hard:c[0],soft:c[0]},max:c[1]==null?fo:{mode:1,hard:c[1],soft:c[1]}},p=!1),!p&&pn(c))){let S=c;c=(_,v,b)=>v==null?Tl:rn(v,b,S)}l.range=X(c||(f?Gf:t==P?l.distr==3?Yf:l.distr==4?Bf:_s:l.distr==3?ys:l.distr==4?vs:If)),l.auto=X(p?!1:l.auto),l.clamp=X(l.clamp||Af),l._min=l._max=null,l.valToPct=Q(l)}}}B("x"),B("y"),s==1&&k.forEach(t=>{B(t.scale)}),H.forEach(t=>{B(t.scale)});for(let t in e.scales)B(t);let T=x[P],j=T.distr,C,I;T.ori==0?(Xe(g,Xs),C=a,I=u):(Xe(g,er),C=u,I=a);let F={};for(let t in x){let l=x[t];(l.min!=null||l.max!=null)&&(F[t]={min:l.min,max:l.max},l.min=l.max=null)}let ee=e.tzDate||(t=>new Date(Ae(t/G))),z=e.fmtDate||ci,Ue=G==1?Xr(ee):lf(ee),we=yo(ee,_o(G==1?Qr:tf,z)),te=ko(ee,vo(of,z)),fe=[],J=n.legend=Te({},ff,e.legend),V=n.cursor=Te({},mf,{drag:{y:s==2}},e.cursor),be=J.show,He=V.show,Se=J.markers;J.idxs=fe,Se.width=X(Se.width),Se.dash=X(Se.dash),Se.stroke=X(Se.stroke),Se.fill=X(Se.fill);let se,ct,qe,ye=[],St=[],Mt,lt=!1,Lt={};if(J.live){let t=k[1]?k[1].values:null;lt=t!=null,Mt=lt?t(n,1,0):{_:0};for(let l in Mt)Lt[l]=ii}if(be)if(se=gt("table",cr,g),qe=gt("tbody",null,se),J.mount(n,se),lt){ct=gt("thead",null,se,qe);let t=gt("tr",null,ct);gt("th",null,t);for(var tl in Mt)gt("th",$i,t).textContent=tl}else Xe(se,pr),J.live&&Xe(se,ar);let ll={show:!0},Dl={show:!1};function Ul(t,l){if(l==0&&(lt||!J.live||s==2))return Tl;let r=[],f=gt("tr",hr,qe,qe.childNodes[l]);Xe(f,t.class),t.show||Xe(f,Zt);let c=gt("th",null,f);if(Se.show){let _=ft(mr,c);if(l>0){let v=Se.width(n,l);v&&(_.style.border=v+"px "+Se.dash(n,l)+" "+Se.stroke(n,l)),_.style.background=Se.fill(n,l)}}let p=ft($i,c);t.label instanceof HTMLElement?p.appendChild(t.label):p.textContent=t.label,l>0&&(Se.show||(p.style.color=t.width>0?Se.stroke(n,l):Se.fill(n,l)),Ne("click",c,_=>{if(V._lock)return;Bt(_);let v=k.indexOf(t);if((_.ctrlKey||_.metaKey)!=J.isolate){let b=k.some((M,E)=>E>0&&E!=v&&M.show);k.forEach((M,E)=>{E>0&&vt(E,b?E==v?ll:Dl:ll,!0,xe.setSeries)})}else vt(v,{show:!t.show},!0,xe.setSeries)},!1),sl&&Ne(Xi,c,_=>{V._lock||(Bt(_),vt(k.indexOf(t),Sl,!0,xe.setSeries))},!1));for(var S in Mt){let _=gt("td",gr,f);_.textContent="--",r.push(_)}return[f,r]}let Nt=new Map;function Ne(t,l,r,f=!0){let c=Nt.get(l)||{},p=V.bind[t](n,l,r,f);p&&(Qt(t,l,c[t]=p),Nt.set(l,c))}function nl(t,l,r){let f=Nt.get(l)||{};for(let c in f)(t==null||c==t)&&(Jn(c,l,f[c]),delete f[c]);t==null&&Nt.delete(l)}let At=0,Wt=0,K=0,A=0,pe=0,Me=0,il=pe,Gt=Me,_t=K,It=A,$e=0,nt=0,Ke=0,at=0;n.bbox={};let wn=!1,Kl=!1,ol=!1,Yt=!1,jl=!1,it=!1;function Sn(t,l,r){(r||t!=n.width||l!=n.height)&&wi(t,l),al(!1),ol=!0,Kl=!0,pl()}function wi(t,l){n.width=At=K=t,n.height=Wt=A=l,pe=Me=0,bs(),Ms();let r=n.bbox;$e=r.left=$t(pe*oe,.5),nt=r.top=$t(Me*oe,.5),Ke=r.width=$t(K*oe,.5),at=r.height=$t(A*oe,.5)}let ks=3;function xs(){let t=!1,l=0;for(;!t;){l++;let r=zs(l),f=Fs(l);t=l==ks||r&&f,t||(wi(n.width,n.height),Kl=!0)}}function Ts({width:t,height:l}){Sn(t,l)}n.setSize=Ts;function bs(){let t=!1,l=!1,r=!1,f=!1;H.forEach((c,p)=>{if(c.show&&c._show){let{side:S,_size:_}=c,v=S%2,b=c.label!=null?c.labelSize:0,M=_+b;M>0&&(v?(K-=M,S==3?(pe+=M,f=!0):r=!0):(A-=M,S==0?(Me+=M,t=!0):l=!0))}}),Ut[0]=t,Ut[1]=r,Ut[2]=l,Ut[3]=f,K-=Ct[1]+Ct[3],pe+=Ct[3],A-=Ct[2]+Ct[0],Me+=Ct[0]}function Ms(){let t=pe+K,l=Me+A,r=pe,f=Me;function c(p,S){switch(p){case 1:return t+=S,t-S;case 2:return l+=S,l-S;case 3:return r-=S,r+S;case 0:return f-=S,f+S}}H.forEach((p,S)=>{if(p.show&&p._show){let _=p.side;p._pos=c(_,p._size),p.label!=null&&(p._lpos=c(_,p.labelSize))}})}if(V.dataIdx==null){let t=V.hover,l=t.skip=new Set(t.skip??[]);l.add(void 0);let r=t.prox=X(t.prox),f=t.bias??=0;V.dataIdx=(c,p,S,_)=>{if(p==0)return S;let v=S,b=r(c,p,S,_)??ce,M=b>=0&&b<ce,E=T.ori==0?K:A,Y=V.left,ie=i[0],le=i[p];if(l.has(le[S])){v=null;let Z=null,W=null,R;if(f==0||f==-1)for(R=S;Z==null&&R-- >0;)l.has(le[R])||(Z=R);if(f==0||f==1)for(R=S;W==null&&R++<le.length;)l.has(le[R])||(W=R);if(Z!=null||W!=null)if(M){let ge=Z==null?-1/0:C(ie[Z],T,E,0),ve=W==null?1/0:C(ie[W],T,E,0),Re=Y-ge,ue=ve-Y;Re<=ue?Re<=b&&(v=Z):ue<=b&&(v=W)}else v=W==null?Z:Z==null?W:S-Z<=W-S?Z:W}else M&&Ee(Y-C(ie[S],T,E,0))>b&&(v=null);return v}}let Bt=t=>{V.event=t};V.idxs=fe,V._lock=!1;let Oe=V.points;Oe.show=X(Oe.show),Oe.size=X(Oe.size),Oe.stroke=X(Oe.stroke),Oe.width=X(Oe.width),Oe.fill=X(Oe.fill);let yt=n.focus=Te({},e.focus||{alpha:.3},V.focus),sl=yt.prox>=0,rl=sl&&Oe.one,ot=[],fl=[],ul=[];function Si(t,l){let r=Oe.show(n,l);if(r instanceof HTMLElement)return Xe(r,ur),Xe(r,t.class),bt(r,-10,-10,K,A),D.insertBefore(r,ot[l]),r}function _i(t,l){if(s==1||l>0){let r=s==1&&x[t.scale].time,f=t.value;t.value=r?mo(f)?ko(ee,vo(f,z)):f||te:f||Tf,t.label=t.label||(r?df:gf)}if(rl||l>0){t.width=t.width==null?1:t.width,t.paths=t.paths||Hf||Ar,t.fillTo=X(t.fillTo||Pf),t.pxAlign=+ne(t.pxAlign,O),t.pxRound=Lo(t.pxAlign),t.stroke=X(t.stroke||null),t.fill=X(t.fill||null),t._stroke=t._fill=t._paths=t._focus=null;let r=bf(Ye(1,t.width),1),f=t.points=Te({},{size:r,width:Ye(1,r*.2),stroke:t.stroke,space:r*2,paths:Nf,_stroke:null,_fill:null},t.points);f.show=X(f.show),f.filter=X(f.filter),f.fill=X(f.fill),f.stroke=X(f.stroke),f.paths=X(f.paths),f.pxAlign=t.pxAlign}if(be){let r=Ul(t,l);ye.splice(l,0,r[0]),St.splice(l,0,r[1]),J.values.push(null)}if(He){fe.splice(l,0,null);let r=null;rl?l==0&&(r=Si(t,l)):l>0&&(r=Si(t,l)),ot.splice(l,0,r),fl.splice(l,0,0),ul.splice(l,0,0)}Ve("addSeries",l)}function As(t,l){l=l??k.length,t=s==1?li(t,l,To,Po):li(t,l,{},Eo),k.splice(l,0,t),_i(k[l],l)}n.addSeries=As;function Es(t){if(k.splice(t,1),be){J.values.splice(t,1),St.splice(t,1);let l=ye.splice(t,1)[0];nl(null,l.firstChild),l.remove()}He&&(fe.splice(t,1),ot.splice(t,1)[0].remove(),fl.splice(t,1),ul.splice(t,1)),Ve("delSeries",t)}n.delSeries=Es;let Ut=[!1,!1,!1,!1];function Ps(t,l){if(t._show=t.show,t.show){let r=t.side%2,f=x[t.scale];f==null&&(t.scale=r?k[1].scale:P,f=x[t.scale]);let c=f.time;t.size=X(t.size),t.space=X(t.space),t.rotate=X(t.rotate),Ot(t.incrs)&&t.incrs.forEach(S=>{!Ht.has(S)&&Ht.set(S,Bo(S))}),t.incrs=X(t.incrs||(f.distr==2?$r:c?G==1?Zr:ef:Jt)),t.splits=X(t.splits||(c&&f.distr==1?Ue:f.distr==3?Qn:f.distr==4?_f:Sf)),t.stroke=X(t.stroke),t.grid.stroke=X(t.grid.stroke),t.ticks.stroke=X(t.ticks.stroke),t.border.stroke=X(t.border.stroke);let p=t.values;t.values=Ot(p)&&!Ot(p[0])?X(p):c?Ot(p)?yo(ee,_o(p,z)):mo(p)?nf(ee,p):p||we:p||wf,t.filter=X(t.filter||(f.distr>=3&&f.log==10?kf:f.distr==3&&f.log==2?xf:Io)),t.font=zo(t.font),t.labelFont=zo(t.labelFont),t._size=t.size(n,null,l,0),t._space=t._rotate=t._incrs=t._found=t._splits=t._values=null,t._size>0&&(Ut[l]=!0,t._el=ft(or,w))}}function Ll(t,l,r,f){let[c,p,S,_]=r,v=l%2,b=0;return v==0&&(_||p)&&(b=l==0&&!c||l==2&&!S?Ae(xo.size/3):0),v==1&&(c||S)&&(b=l==1&&!p||l==3&&!_?Ae(Mo.size/2):0),b}let yi=n.padding=(e.padding||[Ll,Ll,Ll,Ll]).map(t=>X(ne(t,Ll))),Ct=n._padding=yi.map((t,l)=>t(n,l,Ut,0)),ze,Pe=null,De=null,ql=s==1?k[0].idxs:null,pt=null,Cl=!1;function vi(t,l){if(i=t??[],n.data=n._data=i,s==2){ze=0;for(let r=1;r<k.length;r++)ze+=i[r][0].length}else{i.length==0&&(n.data=n._data=i=[[]]),pt=i[0],ze=pt.length;let r=i;if(j==2){r=i.slice();let f=r[0]=Array(ze);for(let c=0;c<ze;c++)f[c]=c}n._data=i=r}if(al(!0),Ve("setData"),j==2&&(ol=!0),l!==!1){let r=T;r.auto(n,Cl)?_n():Rt(P,r.min,r.max),Yt=Yt||V.left>=0,it=!0,pl()}}n.setData=vi;function _n(){Cl=!0;let t,l;s==1&&(ze>0?(Pe=ql[0]=0,De=ql[1]=ze-1,t=i[0][Pe],l=i[0][De],j==2?(t=Pe,l=De):t==l&&(j==3?[t,l]=cn(t,t,T.log,!1):j==4?[t,l]=si(t,t,T.log,!1):T.time?l=t+Ae(86400/G):[t,l]=rn(t,l,ri,!0))):(Pe=ql[0]=t=null,De=ql[1]=l=null)),Rt(P,t,l)}let $l,cl,yn,vn,kn,xn,Tn,bn,Mn,je;function ki(t,l,r,f,c,p){t??=Zi,r??=ui,f??="butt",c??=Zi,p??="round",t!=$l&&(d.strokeStyle=$l=t),c!=cl&&(d.fillStyle=cl=c),l!=yn&&(d.lineWidth=yn=l),p!=kn&&(d.lineJoin=kn=p),f!=xn&&(d.lineCap=xn=f),r!=vn&&d.setLineDash(vn=r)}function xi(t,l,r,f){l!=cl&&(d.fillStyle=cl=l),t!=Tn&&(d.font=Tn=t),r!=bn&&(d.textAlign=bn=r),f!=Mn&&(d.textBaseline=Mn=f)}function An(t,l,r,f,c=0){if(f.length>0&&t.auto(n,Cl)&&(l==null||l.min==null)){let p=ne(Pe,0),S=ne(De,f.length-1),_=r.min==null?vr(f,p,S,c,t.distr==3):[r.min,r.max];t.min=wt(t.min,r.min=_[0]),t.max=Ye(t.max,r.max=_[1])}}let Ti={min:null,max:null};function Ds(){for(let f in x){let c=x[f];F[f]==null&&(c.min==null||F[P]!=null&&c.auto(n,Cl))&&(F[f]=Ti)}for(let f in x){let c=x[f];F[f]==null&&c.from!=null&&F[c.from]!=null&&(F[f]=Ti)}F[P]!=null&&al(!0);let t={};for(let f in F){let c=F[f];if(c!=null){let p=t[f]=bl(x[f],Dr);if(c.min!=null)Te(p,c);else if(f!=P||s==2)if(ze==0&&p.from==null){let S=p.range(n,null,null,f);p.min=S[0],p.max=S[1]}else p.min=ce,p.max=-ce}}if(ze>0){k.forEach((f,c)=>{if(s==1){let p=f.scale,S=F[p];if(S==null)return;let _=t[p];if(c==0){let v=_.range(n,_.min,_.max,p);_.min=v[0],_.max=v[1],Pe=dt(_.min,i[0]),De=dt(_.max,i[0]),De-Pe>1&&(i[0][Pe]<_.min&&Pe++,i[0][De]>_.max&&De--),f.min=pt[Pe],f.max=pt[De]}else f.show&&f.auto&&An(_,S,f,i[c],f.sorted);f.idxs[0]=Pe,f.idxs[1]=De}else if(c>0&&f.show&&f.auto){let[p,S]=f.facets,_=p.scale,v=S.scale,[b,M]=i[c],E=t[_],Y=t[v];E!=null&&An(E,F[_],p,b,p.sorted),Y!=null&&An(Y,F[v],S,M,S.sorted),f.min=S.min,f.max=S.max}});for(let f in t){let c=t[f],p=F[f];if(c.from==null&&(p==null||p.min==null)){let S=c.range(n,c.min==ce?null:c.min,c.max==-ce?null:c.max,f);c.min=S[0],c.max=S[1]}}}for(let f in t){let c=t[f];if(c.from!=null){let p=t[c.from];if(p.min==null)c.min=c.max=null;else{let S=c.range(n,p.min,p.max,f);c.min=S[0],c.max=S[1]}}}let l={},r=!1;for(let f in t){let c=t[f],p=x[f];if(p.min!=c.min||p.max!=c.max){p.min=c.min,p.max=c.max;let S=p.distr;p._min=S==3?Pt(p.min):S==4?Yn(p.min,p.asinh):S==100?p.fwd(p.min):p.min,p._max=S==3?Pt(p.max):S==4?Yn(p.max,p.asinh):S==100?p.fwd(p.max):p.max,l[f]=r=!0}}if(r){k.forEach((f,c)=>{s==2?c>0&&l.y&&(f._paths=null):l[f.scale]&&(f._paths=null)});for(let f in l)ol=!0,Ve("setScale",f);He&&V.left>=0&&(Yt=it=!0)}for(let f in F)F[f]=null}function Ls(t){let l=Zn(Pe-1,0,ze-1),r=Zn(De+1,0,ze-1);for(;t[l]==null&&l>0;)l--;for(;t[r]==null&&r<ze-1;)r++;return[l,r]}function Cs(){if(ze>0){let t=k.some(l=>l._focus)&&je!=yt.alpha;t&&(d.globalAlpha=je=yt.alpha),k.forEach((l,r)=>{if(r>0&&l.show&&(bi(r,!1),bi(r,!0),l._paths==null)){let f=je;je!=l.alpha&&(d.globalAlpha=je=l.alpha);let c=s==2?[0,i[r][0].length-1]:Ls(i[r]);l._paths=l.paths(n,r,c[0],c[1]),je!=f&&(d.globalAlpha=je=f)}}),k.forEach((l,r)=>{if(r>0&&l.show){let f=je;je!=l.alpha&&(d.globalAlpha=je=l.alpha),l._paths!=null&&Mi(r,!1);{let c=l._paths!=null?l._paths.gaps:null,p=l.points.show(n,r,Pe,De,c),S=l.points.filter(n,r,p,c);(p||S)&&(l.points._paths=l.points.paths(n,r,Pe,De,S),Mi(r,!0))}je!=f&&(d.globalAlpha=je=f),Ve("drawSeries",r)}}),t&&(d.globalAlpha=je=1)}}function bi(t,l){let r=l?k[t].points:k[t];r._stroke=r.stroke(n,t),r._fill=r.fill(n,t)}function Mi(t,l){let r=l?k[t].points:k[t],{stroke:f,fill:c,clip:p,flags:S,_stroke:_=r._stroke,_fill:v=r._fill,_width:b=r.width}=r._paths;b=ae(b*oe,3);let M=null,E=b%2/2;l&&v==null&&(v=b>0?"#fff":_);let Y=r.pxAlign==1&&E>0;if(Y&&d.translate(E,E),!l){let ie=$e-b/2,le=nt-b/2,Z=Ke+b,W=at+b;M=new Path2D,M.rect(ie,le,Z,W)}l?En(_,b,r.dash,r.cap,v,f,c,S,p):Vs(t,_,b,r.dash,r.cap,v,f,c,S,M,p),Y&&d.translate(-E,-E)}function Vs(t,l,r,f,c,p,S,_,v,b,M){let E=!1;v!=0&&q.forEach((Y,ie)=>{if(Y.series[0]==t){let le=k[Y.series[1]],Z=i[Y.series[1]],W=(le._paths||Yl).band;Ot(W)&&(W=Y.dir==1?W[0]:W[1]);let R,ge=null;le.show&&W&&xr(Z,Pe,De)?(ge=Y.fill(n,ie)||p,R=le._paths.clip):W=null,En(l,r,f,c,ge,S,_,v,b,M,R,W),E=!0}}),E||En(l,r,f,c,p,S,_,v,b,M)}let Ai=Ml|ei;function En(t,l,r,f,c,p,S,_,v,b,M,E){ki(t,l,r,f,c),(v||b||E)&&(d.save(),v&&d.clip(v),b&&d.clip(b)),E?(_&Ai)==Ai?(d.clip(E),M&&d.clip(M),Zl(c,S),Jl(t,p,l)):_&ei?(Zl(c,S),d.clip(E),Jl(t,p,l)):_&Ml&&(d.save(),d.clip(E),M&&d.clip(M),Zl(c,S),d.restore(),Jl(t,p,l)):(Zl(c,S),Jl(t,p,l)),(v||b||E)&&d.restore()}function Jl(t,l,r){r>0&&(l instanceof Map?l.forEach((f,c)=>{d.strokeStyle=$l=c,d.stroke(f)}):l!=null&&t&&d.stroke(l))}function Zl(t,l){l instanceof Map?l.forEach((r,f)=>{d.fillStyle=cl=f,d.fill(r)}):l!=null&&t&&d.fill(l)}function Rs(t,l,r,f){let c=H[t],p;if(f<=0)p=[0,0];else{let S=c._space=c.space(n,t,l,r,f),_=c._incrs=c.incrs(n,t,l,r,f,S);p=Uf(l,r,_,f,S)}return c._found=p}function Pn(t,l,r,f,c,p,S,_,v,b){let M=S%2/2;O==1&&d.translate(M,M),ki(_,S,v,b,_),d.beginPath();let E,Y,ie,le,Z=c+(f==0||f==3?-p:p);r==0?(Y=c,le=Z):(E=c,ie=Z);for(let W=0;W<t.length;W++)l[W]!=null&&(r==0?E=ie=t[W]:Y=le=t[W],d.moveTo(E,Y),d.lineTo(ie,le));d.stroke(),O==1&&d.translate(-M,-M)}function zs(t){let l=!0;return H.forEach((r,f)=>{if(!r.show)return;let c=x[r.scale];if(c.min==null){r._show&&(l=!1,r._show=!1,al(!1));return}else r._show||(l=!1,r._show=!0,al(!1));let p=r.side,S=p%2,{min:_,max:v}=c,[b,M]=Rs(f,_,v,S==0?K:A);if(M==0)return;let E=c.distr==2,Y=r._splits=r.splits(n,f,_,v,b,M,E),ie=c.distr==2?Y.map(R=>pt[R]):Y,le=c.distr==2?pt[Y[1]]-pt[Y[0]]:b,Z=r._values=r.values(n,r.filter(n,ie,f,M,le),f,M,le);r._rotate=p==2?r.rotate(n,Z,f,M):0;let W=r._size;r._size=ut(r.size(n,Z,f,t)),W!=null&&r._size!=W&&(l=!1)}),l}function Fs(t){let l=!0;return yi.forEach((r,f)=>{let c=r(n,f,Ut,t);c!=Ct[f]&&(l=!1),Ct[f]=c}),l}function Os(){for(let t=0;t<H.length;t++){let l=H[t];if(!l.show||!l._show)continue;let r=l.side,f=r%2,c,p,S=l.stroke(n,t),_=r==0||r==3?-1:1,[v,b]=l._found;if(l.label!=null){let Ge=l.labelGap*_,Qe=Ae((l._lpos+Ge)*oe);xi(l.labelFont[0],S,"center",r==2?"top":Ji),d.save(),f==1?(c=p=0,d.translate(Qe,Ae(nt+at/2)),d.rotate((r==3?-on:on)/2)):(c=Ae($e+Ke/2),p=Qe);let qt=Wo(l.label)?l.label(n,t,v,b):l.label;d.fillText(qt,c,p),d.restore()}if(b==0)continue;let M=x[l.scale],E=f==0?Ke:at,Y=f==0?$e:nt,ie=l._splits,le=M.distr==2?ie.map(Ge=>pt[Ge]):ie,Z=M.distr==2?pt[ie[1]]-pt[ie[0]]:v,W=l.ticks,R=l.border,ge=W.show?W.size:0,ve=Ae(ge*oe),Re=Ae((l.alignTo==2?l._size-ge-l.gap:l.gap)*oe),ue=l._rotate*-on/180,ke=N(l._pos*oe),Je=(ve+Re)*_,We=ke+Je;p=f==0?We:0,c=f==1?We:0;let st=l.font[0],ht=l.align==1?yl:l.align==2?Wn:ue>0?yl:ue<0?Wn:f==0?"center":r==3?Wn:yl,xt=ue||f==1?"middle":r==2?"top":Ji;xi(st,S,ht,xt);let Ze=l.font[1]*l.lineGap,rt=ie.map(Ge=>N(h(Ge,M,E,Y))),mt=l._values;for(let Ge=0;Ge<mt.length;Ge++){let Qe=mt[Ge];if(Qe!=null){f==0?c=rt[Ge]:p=rt[Ge],Qe=""+Qe;let qt=Qe.indexOf(`
`)==-1?[Qe]:Qe.split(/\n/gm);for(let Ie=0;Ie<qt.length;Ie++){let Ki=qt[Ie];ue?(d.save(),d.translate(c,p+Ie*Ze),d.rotate(ue),d.fillText(Ki,0,0),d.restore()):d.fillText(Ki,c,p+Ie*Ze)}}}W.show&&Pn(rt,W.filter(n,le,t,b,Z),f,r,ke,ve,ae(W.width*oe,3),W.stroke(n,t),W.dash,W.cap);let Tt=l.grid;Tt.show&&Pn(rt,Tt.filter(n,le,t,b,Z),f,f==0?2:1,f==0?nt:$e,f==0?at:Ke,ae(Tt.width*oe,3),Tt.stroke(n,t),Tt.dash,Tt.cap),R.show&&Pn([ke],[1],f==0?1:0,f==0?1:2,f==1?nt:$e,f==1?at:Ke,ae(R.width*oe,3),R.stroke(n,t),R.dash,R.cap)}Ve("drawAxes")}function al(t){k.forEach((l,r)=>{r>0&&(l._paths=null,t&&(s==1?(l.min=null,l.max=null):l.facets.forEach(f=>{f.min=null,f.max=null})))})}let Ql=!1,Dn=!1,Vl=[];function Hs(){Dn=!1;for(let t=0;t<Vl.length;t++)Ve(...Vl[t]);Vl.length=0}function pl(){Ql||(Or(Ei),Ql=!0)}function Ns(t,l=!1){Ql=!0,Dn=l,t(n),Ei(),l&&Vl.length>0&&queueMicrotask(Hs)}n.batch=Ns;function Ei(){if(wn&&(Ds(),wn=!1),ol&&(xs(),ol=!1),Kl){if(de(L,yl,pe),de(L,"top",Me),de(L,Nl,K),de(L,Wl,A),de(D,yl,pe),de(D,"top",Me),de(D,Nl,K),de(D,Wl,A),de(w,Nl,At),de(w,Wl,Wt),y.width=Ae(At*oe),y.height=Ae(Wt*oe),H.forEach(({_el:t,_show:l,_size:r,_pos:f,side:c})=>{if(t!=null)if(l){let p=c===3||c===0?r:0,S=c%2==1;de(t,S?"left":"top",f-p),de(t,S?"width":"height",r),de(t,S?"top":"left",S?Me:pe),de(t,S?"height":"width",S?A:K),$n(t,Zt)}else Xe(t,Zt)}),$l=cl=yn=kn=xn=Tn=bn=Mn=vn=null,je=1,Fl(!0),pe!=il||Me!=Gt||K!=_t||A!=It){al(!1);let t=K/_t,l=A/It;if(He&&!Yt&&V.left>=0){V.left*=t,V.top*=l,hl&&bt(hl,Ae(V.left),0,K,A),ml&&bt(ml,0,Ae(V.top),K,A);for(let r=0;r<ot.length;r++){let f=ot[r];f!=null&&(fl[r]*=t,ul[r]*=l,bt(f,ut(fl[r]),ut(ul[r]),K,A))}}if(me.show&&!jl&&me.left>=0&&me.width>0){me.left*=t,me.width*=t,me.top*=l,me.height*=l;for(let r in Fn)de(wl,r,me[r])}il=pe,Gt=Me,_t=K,It=A}Ve("setSize"),Kl=!1}At>0&&Wt>0&&(d.clearRect(0,0,y.width,y.height),Ve("drawClear"),U.forEach(t=>t()),Ve("draw")),me.show&&jl&&(Xl(me),jl=!1),He&&Yt&&(jt(null,!0,!1),Yt=!1),J.show&&J.live&&it&&(Rn(),it=!1),m||(m=!0,n.status=1,Ve("ready")),Cl=!1,Ql=!1}n.redraw=(t,l)=>{ol=l||!1,t!==!1?Rt(P,T.min,T.max):pl()};function Ln(t,l){let r=x[t];if(r.from==null){if(ze==0){let f=r.range(n,l.min,l.max,t);l.min=f[0],l.max=f[1]}if(l.min>l.max){let f=l.min;l.min=l.max,l.max=f}if(ze>1&&l.min!=null&&l.max!=null&&l.max-l.min<1e-16)return;t==P&&r.distr==2&&ze>0&&(l.min=dt(l.min,i[0]),l.max=dt(l.max,i[0]),l.min==l.max&&l.max++),F[t]=l,wn=!0,pl()}}n.setScale=Ln;let Cn,Vn,hl,ml,Pi,Di,gl,dl,Li,Ci,he,_e,Vt=!1,Fe=V.drag,Le=Fe.x,Ce=Fe.y;He&&(V.x&&(Cn=ft(rr,D)),V.y&&(Vn=ft(fr,D)),T.ori==0?(hl=Cn,ml=Vn):(hl=Vn,ml=Cn),he=V.left,_e=V.top);let me=n.select=Te({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),wl=me.show?ft(sr,me.over?D:L):null;function Xl(t,l){if(me.show){for(let r in t)me[r]=t[r],r in Fn&&de(wl,r,t[r]);l!==!1&&Ve("setSelect")}}n.setSelect=Xl;function Ws(t){if(k[t].show)be&&$n(ye[t],Zt);else if(be&&Xe(ye[t],Zt),He){let r=rl?ot[0]:ot[t];r!=null&&bt(r,-10,-10,K,A)}}function Rt(t,l,r){Ln(t,{min:l,max:r})}function vt(t,l,r,f){l.focus!=null&&Us(t),l.show!=null&&k.forEach((c,p)=>{p>0&&(t==p||t==null)&&(c.show=l.show,Ws(p),s==2?(Rt(c.facets[0].scale,null,null),Rt(c.facets[1].scale,null,null)):Rt(c.scale,null,null),pl())}),r!==!1&&Ve("setSeries",t,l),f&&Ol("setSeries",n,t,l)}n.setSeries=vt;function Gs(t,l){Te(q[t],l)}function Is(t,l){t.fill=X(t.fill||null),t.dir=ne(t.dir,-1),l=l??q.length,q.splice(l,0,t)}function Ys(t){t==null?q.length=0:q.splice(t,1)}n.addBand=Is,n.setBand=Gs,n.delBand=Ys;function Bs(t,l){k[t].alpha=l,He&&ot[t]!=null&&(ot[t].style.opacity=l),be&&ye[t]&&(ye[t].style.opacity=l)}let Et,zt,Kt,Sl={focus:!0};function Us(t){if(t!=Kt){let l=t==null,r=yt.alpha!=1;k.forEach((f,c)=>{if(s==1||c>0){let p=l||c==0||c==t;f._focus=l?null:p,r&&Bs(c,p?1:yt.alpha)}}),Kt=t,r&&pl()}}be&&sl&&Ne(eo,se,t=>{V._lock||(Bt(t),Kt!=null&&vt(null,Sl,!0,xe.setSeries))});function kt(t,l,r){let f=x[l];r&&(t=t/oe-(f.ori==1?Me:pe));let c=K;f.ori==1&&(c=A,t=c-t),f.dir==-1&&(t=c-t);let p=f._min,S=f._max,_=t/c,v=p+(S-p)*_,b=f.distr;return b==3?xl(10,v):b==4?br(v,f.asinh):b==100?f.bwd(v):v}function Ks(t,l){let r=kt(t,P,l);return dt(r,i[0],Pe,De)}n.valToIdx=t=>dt(t,i[0]),n.posToIdx=Ks,n.posToVal=kt,n.valToPos=(t,l,r)=>x[l].ori==0?a(t,x[l],r?Ke:K,r?$e:0):u(t,x[l],r?at:A,r?nt:0),n.setCursor=(t,l,r)=>{he=t.left,_e=t.top,jt(null,l,r)};function Vi(t,l){de(wl,yl,me.left=t),de(wl,Nl,me.width=l)}function Ri(t,l){de(wl,"top",me.top=t),de(wl,Wl,me.height=l)}let Rl=T.ori==0?Vi:Ri,zl=T.ori==1?Vi:Ri;function js(){if(be&&J.live)for(let t=s==2?1:0;t<k.length;t++){if(t==0&<)continue;let l=J.values[t],r=0;for(let f in l)St[t][r++].firstChild.nodeValue=l[f]}}function Rn(t,l){if(t!=null&&(t.idxs?t.idxs.forEach((r,f)=>{fe[f]=r}):Pr(t.idx)||fe.fill(t.idx),J.idx=fe[0]),be&&J.live){for(let r=0;r<k.length;r++)(r>0||s==1&&!lt)&&qs(r,fe[r]);js()}it=!1,l!==!1&&Ve("setLegend")}n.setLegend=Rn;function qs(t,l){let r=k[t],f=t==0&&j==2?pt:i[t],c;lt?c=r.values(n,t,l)??Lt:(c=r.value(n,l==null?null:f[l],t,l),c=c==null?Lt:{_:c}),J.values[t]=c}function jt(t,l,r){Li=he,Ci=_e,[he,_e]=V.move(n,he,_e),V.left=he,V.top=_e,He&&(hl&&bt(hl,Ae(he),0,K,A),ml&&bt(ml,0,Ae(_e),K,A));let f,c=Pe>De;Et=ce,zt=null;let p=T.ori==0?K:A,S=T.ori==1?K:A;if(he<0||ze==0||c){f=V.idx=null;for(let _=0;_<k.length;_++){let v=ot[_];v!=null&&bt(v,-10,-10,K,A)}sl&&vt(null,Sl,!0,t==null&&xe.setSeries),J.live&&(fe.fill(f),it=!0)}else{let _,v,b;s==1&&(_=T.ori==0?he:_e,v=kt(_,P),f=V.idx=dt(v,i[0],Pe,De),b=C(i[0][f],T,p,0));let M=-10,E=-10,Y=0,ie=0,le=!0,Z="",W="";for(let R=s==2?1:0;R<k.length;R++){let ge=k[R],ve=fe[R],Re=ve==null?null:s==1?i[R][ve]:i[R][1][ve],ue=V.dataIdx(n,R,f,v),ke=ue==null?null:s==1?i[R][ue]:i[R][1][ue];if(it=it||ke!=Re||ue!=ve,fe[R]=ue,R>0&&ge.show){let Je=ue==null?-10:ue==f?b:C(s==1?i[0][ue]:i[R][0][ue],T,p,0),We=ke==null?-10:I(ke,s==1?x[ge.scale]:x[ge.facets[1].scale],S,0);if(sl&&ke!=null){let st=T.ori==1?he:_e,ht=Ee(yt.dist(n,R,ue,We,st));if(ht<Et){let xt=yt.bias;if(xt!=0){let Ze=kt(st,ge.scale),rt=ke>=0?1:-1,mt=Ze>=0?1:-1;mt==rt&&(mt==1?xt==1?ke>=Ze:ke<=Ze:xt==1?ke<=Ze:ke>=Ze)&&(Et=ht,zt=R)}else Et=ht,zt=R}}if(it||rl){let st,ht;T.ori==0?(st=Je,ht=We):(st=We,ht=Je);let xt,Ze,rt,mt,Tt,Ge,Qe=!0,qt=Oe.bbox;if(qt!=null){Qe=!1;let Ie=qt(n,R);rt=Ie.left,mt=Ie.top,xt=Ie.width,Ze=Ie.height}else rt=st,mt=ht,xt=Ze=Oe.size(n,R);if(Ge=Oe.fill(n,R),Tt=Oe.stroke(n,R),rl)R==zt&&Et<=yt.prox&&(M=rt,E=mt,Y=xt,ie=Ze,le=Qe,Z=Ge,W=Tt);else{let Ie=ot[R];Ie!=null&&(fl[R]=rt,ul[R]=mt,ro(Ie,xt,Ze,Qe),oo(Ie,Ge,Tt),bt(Ie,ut(rt),ut(mt),K,A))}}}}if(rl){let R=yt.prox,ge=Kt==null?Et<=R:Et>R||zt!=Kt;if(it||ge){let ve=ot[0];ve!=null&&(fl[0]=M,ul[0]=E,ro(ve,Y,ie,le),oo(ve,Z,W),bt(ve,ut(M),ut(E),K,A))}}}if(me.show&&Vt)if(t!=null){let[_,v]=xe.scales,[b,M]=xe.match,[E,Y]=t.cursor.sync.scales,ie=t.cursor.drag;if(Le=ie._x,Ce=ie._y,Le||Ce){let{left:le,top:Z,width:W,height:R}=t.select,ge=t.scales[E].ori,ve=t.posToVal,Re,ue,ke,Je,We,st=_!=null&&b(_,E),ht=v!=null&&M(v,Y);st&&Le?(ge==0?(Re=le,ue=W):(Re=Z,ue=R),ke=x[_],Je=C(ve(Re,E),ke,p,0),We=C(ve(Re+ue,E),ke,p,0),Rl(wt(Je,We),Ee(We-Je))):Rl(0,p),ht&&Ce?(ge==1?(Re=le,ue=W):(Re=Z,ue=R),ke=x[v],Je=I(ve(Re,Y),ke,S,0),We=I(ve(Re+ue,Y),ke,S,0),zl(wt(Je,We),Ee(We-Je))):zl(0,S)}else On()}else{let _=Ee(Li-Pi),v=Ee(Ci-Di);if(T.ori==1){let Y=_;_=v,v=Y}Le=Fe.x&&_>=Fe.dist,Ce=Fe.y&&v>=Fe.dist;let b=Fe.uni;b!=null?Le&&Ce&&(Le=_>=b,Ce=v>=b,!Le&&!Ce&&(v>_?Ce=!0:Le=!0)):Fe.x&&Fe.y&&(Le||Ce)&&(Le=Ce=!0);let M,E;Le&&(T.ori==0?(M=gl,E=he):(M=dl,E=_e),Rl(wt(M,E),Ee(E-M)),Ce||zl(0,S)),Ce&&(T.ori==1?(M=gl,E=he):(M=dl,E=_e),zl(wt(M,E),Ee(E-M)),Le||Rl(0,p)),!Le&&!Ce&&(Rl(0,0),zl(0,0))}if(Fe._x=Le,Fe._y=Ce,t==null){if(r){if(Ui!=null){let[_,v]=xe.scales;xe.values[0]=_!=null?kt(T.ori==0?he:_e,_):null,xe.values[1]=v!=null?kt(T.ori==1?he:_e,v):null}Ol(Gn,n,he,_e,K,A,f)}if(sl){let _=r&&xe.setSeries,v=yt.prox;Kt==null?Et<=v&&vt(zt,Sl,!0,_):Et>v?vt(null,Sl,!0,_):zt!=Kt&&vt(zt,Sl,!0,_)}}it&&(J.idx=f,Rn()),l!==!1&&Ve("setCursor")}let Ft=null;Object.defineProperty(n,"rect",{get(){return Ft==null&&Fl(!1),Ft}});function Fl(t=!1){t?Ft=null:(Ft=D.getBoundingClientRect(),Ve("syncRect",Ft))}function zi(t,l,r,f,c,p,S){V._lock||Vt&&t!=null&&t.movementX==0&&t.movementY==0||(zn(t,l,r,f,c,p,S,!1,t!=null),t!=null?jt(null,!0,!0):jt(l,!0,!1))}function zn(t,l,r,f,c,p,S,_,v){if(Ft==null&&Fl(!1),Bt(t),t!=null)r=t.clientX-Ft.left,f=t.clientY-Ft.top;else{if(r<0||f<0){he=-10,_e=-10;return}let[b,M]=xe.scales,E=l.cursor.sync,[Y,ie]=E.values,[le,Z]=E.scales,[W,R]=xe.match,ge=l.axes[0].side%2==1,ve=T.ori==0?K:A,Re=T.ori==1?K:A,ue=ge?p:c,ke=ge?c:p,Je=ge?f:r,We=ge?r:f;if(le!=null?r=W(b,le)?h(Y,x[b],ve,0):-10:r=ve*(Je/ue),Z!=null?f=R(M,Z)?h(ie,x[M],Re,0):-10:f=Re*(We/ke),T.ori==1){let st=r;r=f,f=st}}v&&(l==null||l.cursor.event.type==Gn)&&((r<=1||r>=K-1)&&(r=$t(r,K)),(f<=1||f>=A-1)&&(f=$t(f,A))),_?(Pi=r,Di=f,[gl,dl]=V.move(n,r,f)):(he=r,_e=f)}let Fn={width:0,height:0,left:0,top:0};function On(){Xl(Fn,!1)}let Fi,Oi,Hi,Ni;function Wi(t,l,r,f,c,p,S){Vt=!0,Le=Ce=Fe._x=Fe._y=!1,zn(t,l,r,f,c,p,S,!0,!1),t!=null&&(Ne(In,jn,Gi,!1),Ol(Qi,n,gl,dl,K,A,null));let{left:_,top:v,width:b,height:M}=me;Fi=_,Oi=v,Hi=b,Ni=M}function Gi(t,l,r,f,c,p,S){Vt=Fe._x=Fe._y=!1,zn(t,l,r,f,c,p,S,!1,!0);let{left:_,top:v,width:b,height:M}=me,E=b>0||M>0,Y=Fi!=_||Oi!=v||Hi!=b||Ni!=M;if(E&&Y&&Xl(me),Fe.setScale&&E&&Y){let ie=_,le=b,Z=v,W=M;if(T.ori==1&&(ie=v,le=M,Z=_,W=b),Le&&Rt(P,kt(ie,P),kt(ie+le,P)),Ce)for(let R in x){let ge=x[R];R!=P&&ge.fro