PageSourceSearch

https://www.fxempire.es/homepage/_next/static/chunks/22d3093e.f95e3fa50e70f512.js

js fxempire.es collected 2026-09-26 13:59:48 UTC 152,295 bytes, 6 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2327],{59287:function(a,b,c){c.d(b,{B8:function(){return r},C2:function(){return cR},Mr:function(){return v},TD:function(){return o},eh:function(){return c_},f6:function(){return c9},lR:function(){return dC},lh:function(){return w},vW:function(){return c7}});var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=c(15900);/*!
2 * @license
3 * TradingView Lightweight Charts™ v5.0.5
4 * Copyright (c) 2025 TradingView, Inc.
5 * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
6 */ let z={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};function A(a,b){let c={0:[],1:[a.lineWidth,a.lineWidth],2:[2*a.lineWidth,2*a.lineWidth],3:[6*a.lineWidth,6*a.lineWidth],4:[a.lineWidth,4*a.lineWidth]}[b];a.setLineDash(c)}function B(a,b,c,d){a.beginPath();let e=a.lineWidth%2?.5:0;a.moveTo(c,b+e),a.lineTo(d,b+e),a.stroke()}function C(a,b){if(!a)throw Error("Assertion failed"+(b?": "+b:""))}function D(a){if(void 0===a)throw Error("Value is undefined");return a}function E(a){if(null===a)throw Error("Value is null");return a}function F(a){return E(D(a))}(d=n||(n={}))[d.Simple=0]="Simple",d[d.WithSteps=1]="WithSteps",d[d.Curved=2]="Curved",(e=o||(o={}))[e.Solid=0]="Solid",e[e.Dotted=1]="Dotted",e[e.Dashed=2]="Dashed",e[e.LargeDashed=3]="LargeDashed",e[e.SparseDotted=4]="SparseDotted";class G{constructor(){this.t=[]}i(a,b,c){this.t.push({h:a,l:b,o:!0===c})}_(a){let b=this.t.findIndex(b=>a===b.h);b> -1&&this.t.splice(b,1)}u(a){this.t=this.t.filter(b=>b.l!==a)}p(a,b,c){let d=[...this.t];this.t=this.t.filter(a=>!a.o),d.forEach(d=>d.h(a,b,c))}v(){return this.t.length>0}m(){this.t=[]}}function H(a,...b){for(let c of b)for(let d in c)void 0!==c[d]&&Object.prototype.hasOwnProperty.call(c,d)&&!["__proto__","constructor","prototype"].includes(d)&&("object"!=typeof c[d]|| void 0===a[d]||Array.isArray(c[d])?a[d]=c[d]:H(a[d],c[d]));return a}function I(a){return"number"==typeof a&&isFinite(a)}function J(a){return"number"==typeof a&&a%1==0}function K(a){return"string"==typeof a}function L(a){return"boolean"==typeof a}function M(a){let b=a;if(!b||"object"!=typeof b)return b;let c,d,e;for(d in c=Array.isArray(b)?[]:{},b)b.hasOwnProperty(d)&&(e=b[d],c[d]=e&&"object"==typeof e?M(e):e);return c}function N(a){return null!==a}function O(a){return null===a?void 0:a}let P="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function Q(a,b,c){return void 0===b&&(b=P),`${c=void 0!==c?`${c} `:""}${a}px ${b}`}function R(a){return a<0?0:a>255?255:Math.round(a)||0}function S(a){return .199*a[0]+.687*a[1]+.114*a[2]}class T{constructor(){this.it=[]}st(a){this.it=a}nt(a,b,c){this.it.forEach(d=>{d.nt(a,b,c)})}}class U{nt(a,b,c){a.useBitmapCoordinateSpace(a=>this.et(a,b,c))}}class V extends U{constructor(){super(...arguments),this.rt=null}ht(a){this.rt=a}et({context:a,horizontalPixelRatio:b,verticalPixelRatio:c}){if(null===this.rt||null===this.rt.lt)return;let d=this.rt.lt,e=this.rt,f=Math.max(1,Math.floor(b))%2/2,g=g=>{a.beginPath();for(let h=d.to-1;h>=d.from;--h){let i=e.ot[h],j=Math.round(i._t*b)+f,k=i.ut*c,l=g*c+f;a.moveTo(j,k),a.arc(j,k,l,0,2*Math.PI)}a.fill()};e.ct>0&&(a.fillStyle=e.dt,g(e.ft+e.ct)),a.fillStyle=e.vt,g(e.ft)}}function W(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}let X={from:0,to:1};class Y{constructor(a,b,c){this.Mt=new T,this.bt=[],this.xt=[],this.St=!0,this.O=a,this.Ct=b,this.yt=c,this.Mt.st(this.bt)}Pt(a){this.kt(),this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Mt}kt(){let a=this.yt.Dt();a.length!==this.bt.length&&(this.xt=a.map(W),this.bt=this.xt.map(a=>{let b=new V;return b.ht(a),b}),this.Mt.st(this.bt))}Rt(){let a=2===this.Ct.N().mode||!this.Ct.Vt(),b=this.yt.It(),c=this.Ct.Bt(),d=this.O.At();this.kt(),b.forEach((b,e)=>{let f=this.xt[e],g=b.Et(c),h=b.zt();!a&&null!==g&&b.Vt()&&null!==h?(f.vt=g.Lt,f.ft=g.ft,f.ct=g.Ot,f.ot[0].gt=g.gt,f.ot[0].ut=b.Wt().Nt(g.gt,h.Ft),f.dt=g.Ht??this.O.Ut(f.ot[0].ut/b.Wt().$t()),f.ot[0].wt=c,f.ot[0]._t=d.qt(c),f.lt=X):f.lt=null})}}class Z{constructor(a,b){this.St=!0,this.Xt={jt:{ct:1,Kt:0,R:"",Vt:!1},Zt:{ct:1,Kt:0,R:"",Vt:!1},_t:0,ut:0}
6,this.Gt=new class extends U{constructor(a){super(),this.Yt=a}et({context:a,bitmapSize:b,horizontalPixelRatio:c,verticalPixelRatio:d}){if(null===this.Yt)return;let e=this.Yt.jt.Vt,f=this.Yt.Zt.Vt;if(!e&&!f)return;let g=Math.round(this.Yt._t*c),h=Math.round(this.Yt.ut*d);a.lineCap="butt",e&&g>=0&&(a.lineWidth=Math.floor(this.Yt.jt.ct*c),a.strokeStyle=this.Yt.jt.R,a.fillStyle=this.Yt.jt.R,A(a,this.Yt.jt.Kt),function(a,b,c,d){a.beginPath();let e=a.lineWidth%2?.5:0;a.moveTo(b+e,0),a.lineTo(b+e,d),a.stroke()}(a,g,0,b.height)),f&&h>=0&&(a.lineWidth=Math.floor(this.Yt.Zt.ct*d),a.strokeStyle=this.Yt.Zt.R,a.fillStyle=this.Yt.Zt.R,A(a,this.Yt.Zt.Kt),B(a,h,0,b.width))}}(this.Xt),this.Jt=a,this.yt=b}Pt(){this.St=!0}Tt(a){return this.St&&(this.Rt(),this.St=!1),this.Gt}Rt(){let a=this.Jt.Vt(),b=this.yt.Qt().N().crosshair,c=this.Xt;if(2===b.mode)return c.Zt.Vt=!1,void(c.jt.Vt=!1);c.Zt.Vt=a&&this.Jt.ti(this.yt),c.jt.Vt=a&&this.Jt.ii(),c.Zt.ct=b.horzLine.width,c.Zt.Kt=b.horzLine.style,c.Zt.R=b.horzLine.color,c.jt.ct=b.vertLine.width,c.jt.Kt=b.vertLine.style,c.jt.R=b.vertLine.color,c._t=this.Jt.si(),c.ut=this.Jt.ni()}}function $(a,b,c,d,e,f){a.fillRect(b+f,c,d-2*f,f),a.fillRect(b+f,c+e-f,d-2*f,f),a.fillRect(b,c,f,e),a.fillRect(b+d-f,c,f,e)}function _(a,b,c,d,e,f){a.save(),a.globalCompositeOperation="copy",a.fillStyle=f,a.fillRect(b,c,d,e),a.restore()}function aa(a,b,c,d,e,f){a.beginPath(),a.roundRect?a.roundRect(b,c,d,e,f):(a.lineTo(b+d-f[1],c),0!==f[1]&&a.arcTo(b+d,c,b+d,c+f[1],f[1]),a.lineTo(b+d,c+e-f[2]),0!==f[2]&&a.arcTo(b+d,c+e,b+d-f[2],c+e,f[2]),a.lineTo(b+f[3],c+e),0!==f[3]&&a.arcTo(b,c+e,b,c+e-f[3],f[3]),a.lineTo(b,c+f[0]),0!==f[0]&&a.arcTo(b,c,b+f[0],c,f[0]))}function ab(a,b,c,d,e,f,g=0,h=[0,0,0,0],i=""){var j;if(a.save(),!g||!i||i===f)return aa(a,b,c,d,e,h),a.fillStyle=f,a.fill(),void a.restore(
6);let k=g/2;aa(a,b+k,c+k,d-g,e-g,(j=-k,h.map(a=>0===a?a:a+j))),"transparent"!==f&&(a.fillStyle=f,a.fill()),"transparent"!==i&&(a.lineWidth=g,a.strokeStyle=i,a.closePath(),a.stroke()),a.restore()}function ac(a,b,c,d,e,f,g){a.save(),a.globalCompositeOperation="copy";let h=a.createLinearGradient(0,0,0,e);h.addColorStop(0,f),h.addColorStop(1,g),a.fillStyle=h,a.fillRect(b,c,d,e),a.restore()}class ad{constructor(a,b){this.ht(a,b)}ht(a,b){this.Yt=a,this.ei=b}$t(a,b){return this.Yt.Vt?a.P+a.A+a.V:0}nt(a,b,c,d){if(!this.Yt.Vt||0===this.Yt.ri.length)return;let e=this.Yt.R,f=this.ei.X,g=a.useBitmapCoordinateSpace(a=>{let g=a.context;g.font=b.k;let h=this.hi(a,b,c,d),i=h.ai;return h.li?ab(g,i.oi,i._i,i.ui,i.ci,f,i.di,[i.ft,0,0,i.ft],f):ab(g,i.fi,i._i,i.ui,i.ci,f,i.di,[0,i.ft,i.ft,0],f),this.Yt.pi&&(g.fillStyle=e,g.fillRect(i.fi,i.mi,i.wi-i.fi,i.gi)),this.Yt.Mi&&(g.fillStyle=b.D,g.fillRect(h.li?i.bi-i.di:0,i._i,i.di,i.xi-i._i)),h});a.useMediaCoordinateSpace(({context:a})=>{let c=g.Si;a.font=b.k,a.textAlign=g.li?"right":"left",a.textBaseline="middle",a.fillStyle=e,a.fillText(this.Yt.ri,c.Ci,(c._i+c.xi)/2+c.yi)})}hi(a,b,c,d){let{context:e,bitmapSize:f,mediaSize:g,horizontalPixelRatio:h,verticalPixelRatio:i}=a,j=this.Yt.pi||!this.Yt.Pi?b.C:0,k=this.Yt.ki?b.S:0,l=b.A+this.ei.Ti,m=b.V+this.ei.Ri,n=b.I,o=b.B,p=this.Yt.ri,q=b.P,r=c.Di(e,p),s=Math.ceil(c.Vi(e,p)),t=q+l+m,u=b.S+n+o+s+j,v=Math.max(1,Math.floor(i)),w=Math.round(t*i);w%2!=v%2&&(w+=1);let x=k>0?Math.max(1,Math.floor(k*h)):0,y=Math.round(u*h),z=Math.round(j*h),A=this.ei.Ii??this.ei.Bi,B=Math.round(A*i)-Math.floor(.5*i),C=Math.floor(B+v/2-w/2),D=C+w,E="right"===d,F=E?g.width-k:k,G=E?f.width-x:x,H,I,J;return E?(H=G-y,I=G-z,J=F-j-n-k):(H=G+y,I=G+z,J=F+j+n),{li:E,ai:{_i:C,mi:B,xi:D,ui:y,ci:w,ft:2*h,di:x,oi:H,fi:G,wi:I,gi:v,bi:f.width},Si:{_i:C/i,xi:D/i,Ci:J,yi:r}}}}class ae{constructor(a){this.Ai={Bi:0,X:"#000",Ri:0,Ti:0},this.Ei={ri:"",Vt:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",Mi:!1,ki:!1},this.zi={ri:"",Vt:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",Mi:!0,ki:!0},this.St=!0,this.Li=new(a||ad)(this.Ei,this.Ai),this.Oi=new(a||ad)(this.zi,this.Ai)}ri(){return this.Ni(),this.Ei.ri}Bi(){return this.Ni(),this.Ai.Bi}Pt(){this.St=!0}$t(a,b=!1){return Math.max(this.Li.$t(a,b),this.Oi.$t(a,b))}Wi(){return this.Ai.Ii||0}Fi(a){this.Ai.Ii=a}Hi(){return this.Ni(),this.Ei.Vt||this.zi.Vt}Ui(){return this.Ni(),this.Ei.Vt}Tt(a){return this.Ni(),this.Ei.pi=this.Ei.pi&&a.N().ticksVisible,this.zi.pi=this.zi.pi&&a.N().ticksVisible,this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Li}$i(){return this.Ni(),this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Oi}Ni(){this.St&&(this.Ei.pi=!0,this.zi.pi=!1,this.qi(this.Ei,this.zi,this.Ai))}}class af extends ae{constructor(a,b,c){super(),this.Jt=a,this.Yi=b,this.ji=c}qi(a,b,c){if(a.Vt=!1,2===this.Jt.N().mode)return;let d=this.Jt.N().horzLine;if(!d.labelVisible)return;let e=this.Yi.zt();if(!this.Jt.Vt()||this.Yi.Zi()||null===e)return;let f=this.Yi.Ki().K(d.labelBackgroundColor);c.X=f.X,a.R=f.G;let g=2/12*this.Yi.P();c.Ti=g,c.Ri=g;let h=this.ji(this.Yi);
6c.Bi=h.Bi,a.ri=this.Yi.Xi(h.gt,e),a.Vt=!0}}let ag=/[1-9]/g;class ah{constructor(){this.Yt=null}ht(a){this.Yt=a}nt(a,b){if(null===this.Yt|| !1===this.Yt.Vt||0===this.Yt.ri.length)return;let c=a.useMediaCoordinateSpace(({context:a})=>(a.font=b.k,Math.round(b.Gi.Vi(a,E(this.Yt).ri,ag))));if(c<=0)return;let d=b.Ji,e=c+2*d,f=e/2,g=this.Yt.Qi,h=this.Yt.Bi,i=Math.floor(h-f)+.5;i<0?(h+=Math.abs(0-i),i=Math.floor(h-f)+.5):i+e>g&&(h-=Math.abs(g-(i+e)),i=Math.floor(h-f)+.5);let j=i+e,k=Math.ceil(0+b.S+b.C+b.A+b.P+b.V);a.useBitmapCoordinateSpace(({context:a,horizontalPixelRatio:c,verticalPixelRatio:d})=>{let e=E(this.Yt);a.fillStyle=e.X;let f=Math.round(i*c),g=Math.round(0*d),h=Math.round(j*c),l=Math.round(k*d),m=Math.round(2*c);if(a.beginPath(),a.moveTo(f,g),a.lineTo(f,l-m),a.arcTo(f,l,f+m,l,m),a.lineTo(h-m,l),a.arcTo(h,l,h,l-m,m),a.lineTo(h,g),a.fill(),e.pi){let n=Math.round(e.Bi*c),o=g,p=Math.round((o+b.C)*d);a.fillStyle=e.R;let q=Math.max(1,Math.floor(c)),r=Math.floor(.5*c);a.fillRect(n-r,o,q,p-o)}}),a.useMediaCoordinateSpace(({context:a})=>{let c=E(this.Yt),e=0+b.S+b.C+b.A+b.P/2;a.font=b.k,a.textAlign="left",a.textBaseline="middle",a.fillStyle=c.R;let f=b.Gi.Di(a,"Apr0");a.translate(i+d,e+f),a.fillText(c.ri,0,0)})}}class ai{constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(a){this.rs=a}Wt(){return this.es}_s(a){this.es=a}us(a){return[]}cs(){return[]}Vt(){return!0}}function aj(a){return"left"===a||"right"===a}(f=p||(p={}))[f.Normal=0]="Normal",f[f.Magnet=1]="Magnet",f[f.Hidden=2]="Hidden",f[f.MagnetOHLC=3]="MagnetOHLC";class ak{constructor(a){this.Xs=new Map,this.Gs=[],this.Js=a}Qs(a,b){var c,d;let e=(c=this.Xs.get(a),d=b,void 0===c?d:{tn:Math.max(c.tn,d.tn),sn:c.sn||d.sn});this.Xs.set(a,e)}nn(){return this.Js}en(a){let b=this.Xs.get(a);return void 0===b?{tn:this.Js}:{tn:Math.max(this.Js,b.tn),sn:b.sn}}rn(){this.hn(),this.Gs=[{an:0}]}ln(a){this.hn(),this.Gs=[{an:1,Ft:a}]}_n(a){this.un(),this.Gs.push({an:5,Ft:a})}hn(){this.un(),this.Gs.push({an:6})}cn(){this.hn(),this.Gs=[{an:4}]}dn(a){this.hn(),this.Gs.push({an:2,Ft:a})}fn(a){this.hn(),this.Gs.push({an:3,Ft:a})}pn(){return this.Gs}vn(a){for(let b of a.Gs)this.mn(b);this.Js=Math.max(this.Js,a.Js),a.Xs.forEach((a,b)=>{this.Qs(b,a)})}static wn(){return new ak(2)}static gn(){return new ak(3)}mn(a){switch(a.an){case 0:this.rn();break;case 1:this.ln(a.Ft);break;case 2:this.dn(a.Ft);break;case 3:this.fn(a.Ft);break;case 4:this.cn();break;case 5:this._n(a.Ft);break;case 6:this.un()}}un(){let a=this.Gs.findIndex(a=>5===a.an);-1!==a&&this.Gs.splice(a,1)}}function al(a,b){if(!I(a))return"n/a";if(!J(b)||b<0||b>16)throw TypeError("invalid length");return 0===b?a.toString():("0000000000000000"+a.toString()).slice(-b)}class am{constructor(a,b){if(b||(b=1),I(a)&&J(a)||(a=100),a<0)throw TypeError("invalid base");this.Yi=a,this.Mn=b,this.bn()}format(a){let b=a<0?"−":"";return a=Math.abs(a),b+this.xn(a)}bn(){if(this.Sn=0,this.Yi>0&&this.Mn>0){let a=this.Yi;for(;a>1;)a/=10,this.Sn++}}xn(a){let b=this.Yi/this.Mn,c=Math.floor(a),d="",e=void 0!==this.Sn?this.Sn:NaN;if(b>1){let f=+(Math.round(a*b)-c*b).toFixed(this.Sn);f>=b&&(f-=b,c+=1),d="."+al(+f.toFixed(this.Sn)*this.Mn,e)}else c=Math.round(c*b)/b,e>0&&(d="."+al(0,e));return c.toFixed(0)+d}}class an extends am{constructor(a=100){super(a)}format(a){return`${super.format(a)}%`}}class ao{constructor(a){this.Cn=a}format(a){let b="";return a<0&&(b="-",a=-a),a<995?b+this.yn(a):a<999995?b+this.yn(a/1e3)+"K":a<999999995?(a=1e3*Math.round(a/1e3),b+this.yn(a/1e6)+"M"):(a=1e6*Math.round(a/1e6),b+this.yn(a/1e9)+"B")}yn(a){let b,c=Math.pow(10,this.Cn);return((a=Math.round(a*c)/c)>=1e-15&&a<1?a.toFixed(this.Cn).replace(/\.?0+$/,""):String(a)).replace(/(\.[1-9]*)0+$/,(a,b)=>b)}}let ap=/[2-9]/g;class aq{constructor(a=50){this.Pn=0,this.kn=1,this.Tn=1,this.Rn={},this.Dn=new Map,this.Vn=a}In(){this.Pn=0,this.Dn.clear(),this.kn=1,this.Tn=1,this.Rn={}}Vi(a,b,c){return this.Bn(a,b,c).width}Di(a,b,c){let d=this.Bn(a,b,c);return((d.actualBoundingBoxAscent||0)-(d.actualBoundingBoxDescent||0))/2}Bn(a,b,c){let d=String(b).replace(c||ap,"0");if(this.Dn.has(d))return D(this.Dn.get(d)).An;if(this.Pn===this.Vn){let e=this.Rn[this.Tn];delete this.Rn[this.Tn],this.Dn.delete(e),this.Tn++,this.Pn--}a.save(),a.textBaseline="middle";let f=a.measureText(d);
6return a.restore(),0===f.width&&b.length||(this.Dn.set(d,{An:f,En:this.kn}),this.Rn[this.kn]=d,this.Pn++,this.kn++),f}}class ar{constructor(a,b,c){this.Wn=a,this.On=new aq(50),this.Fn=b,this.O=c,this.W=-1,this.Gt=new class{constructor(a){this.zn=null,this.M=null,this.Ln="right",this.On=a}Nn(a,b,c){this.zn=a,this.M=b,this.Ln=c}nt(a){null!==this.M&&null!==this.zn&&this.zn.nt(a,this.M,this.On,this.Ln)}}(this.On)}Tt(){let a=this.O.Hn(this.Fn);if(null===a)return null;let b=a.Un(this.Fn)?a.$n():this.Fn.Wt();if(null===b)return null;let c=a.qn(b);if("overlay"===c)return null;let d=this.O.Yn();return d.P!==this.W&&(this.W=d.P,this.On.In()),this.Gt.Nn(this.Wn.$i(),d,c),this.Gt}}class as{constructor(a){this.Xn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Kt:0,Vt:!1},this.Gn=new class extends U{constructor(){super(...arguments),this.Yt=null}ht(a){this.Yt=a}jn(a,b){if(!this.Yt?.Vt)return null;let{ut:c,ct:d,Zn:e}=this.Yt;return b>=c-d-7&&b<=c+d+7?{Kn:this.Yt,Zn:e}:null}et({context:a,bitmapSize:b,horizontalPixelRatio:c,verticalPixelRatio:d}){if(null===this.Yt|| !1===this.Yt.Vt)return;let e=Math.round(this.Yt.ut*d);e<0||e>b.height||(a.lineCap="butt",a.strokeStyle=this.Yt.R,a.lineWidth=Math.floor(this.Yt.ct*c),A(a,this.Yt.Kt),B(a,e,0,b.width))}},this.St=!0,this.Jn=a,this.Qn=a.Qt(),this.Gn.ht(this.Xn)}Pt(){this.St=!0}Tt(){return this.Jn.Vt()?(this.St&&(this.te(),this.St=!1),this.Gn):null}}let at=[{le:0,oe:.25,_e:4,ue:10,ce:.25,de:0,fe:.4,pe:.8},{le:.25,oe:.525,_e:10,ue:14,ce:0,de:0,fe:.8,pe:0},{le:.525,oe:1,_e:14,ue:14,ce:0,de:0,fe:0,pe:0}];function au(a,b,c,d){let e=Number.isFinite(b),f=Number.isFinite(c);return e&&f?a(b,c):e||f?e?b:c:d}class av{constructor(a,b){this.We=a,this.Fe=b}He(a){return null!==a&&this.We===a.We&&this.Fe===a.Fe}Ue(){return new av(this.We,this.Fe)}$e(){return this.We}qe(){return this.Fe}Ye(){return this.Fe-this.We}Zi(){return this.Fe===this.We||Number.isNaN(this.Fe)||Number.isNaN(this.We)}vn(a){return null===a?this:new av(au(Math.min,this.$e(),a.$e(),-1/0),au(Math.max,this.qe(),a.qe(),1/0))}je(a){if(!I(a)||0==this.Fe-this.We)return;let b=.5*(this.Fe+this.We),c=this.Fe-b,d=this.We-b;c*=a,d*=a,this.Fe=b+c,this.We=b+d}Ze(a){I(a)&&(this.Fe+=a,this.We+=a)}Ke(){return{minValue:this.We,maxValue:this.Fe}}static Xe(a){return null===a?null:new av(a.minValue,a.maxValue)}}class aw{constructor(a,b){this.Ge=a,this.Je=b||null}Qe(){return this.Ge}tr(){return this.Je}Ke(){return{priceRange:null===this.Ge?null:this.Ge.Ke(),margins:this.Je||void 0}}static Xe(a){return null===a?null:new aw(av.Xe(a.priceRange),a.margins)}}class ax{constructor(a,b){this.ge=a,this.ys=b,this.er=new class extends as{constructor(a,b){super(a),this.ir=b}te(){let a=this.Xn;a.Vt=!1;let b=this.ir.N();if(!this.Jn.Vt()||!b.lineVisible)return;let c=this.ir.sr();null!==c&&(a.Vt=!0,a.ut=c,a.R=b.color,a.ct=b.lineWidth,a.Kt=b.lineStyle,a.Zn=this.ir.N().id)}}(a,this),this.Wn=new class extends ae{constructor(a,b){super(),this.ge=a,this.ir=b}qi(a,b,c){a.Vt=!1,b.Vt=!1;let d=this.ir.N(),e=d.axisLabelVisible,f=""!==d.title,g=this.ge;if(!e||!g.Vt())return;let h=this.ir.sr();if(null===h)return;f&&(b.ri=d.title,b.Vt=!0),b.Ht=g.Qt().Ut(h/g.Wt().$t()),a.ri=this.nr(d.price),a.Vt=!0;let i=this.ge.Qt().Ki().K(d.axisLabelColor||d.color);c.X=i.X;let j=d.axisLabelTextColor||i.G;a.R=j,b.R=j,c.Bi=h}nr(a){let b=this.ge.zt();return null===b?"":this.ge.Wt().Xi(a,b.Ft)}}(a,this),this.rr=new ar(this.Wn,a,a.Qt())}hr(a){H(this.ys,a),this.Pt(),this.ge.Qt().ar()}N(){return this.ys}lr(){return this.er}_r(){return this.rr}ur(){return this.Wn}Pt(){this.er.Pt(),this.Wn.Pt()}sr(){let a=this.ge,b=a.Wt();if(a.Qt().At().Zi()||b.Zi())return null;let c=a.zt();return null===c?null:b.Nt(this.ys.price,c.Ft)}}class ay extends ai{constructor(a){super(),this.ts=a}Qt(){return this.ts}}class az{constructor(a){this.Pr=(a,b)=>void 0!==b?b.Ft:this.ge.Ks().kr(a),this.ge=a,this.Tr=({Bar:(a,b,c,d)=>{let e=b.upColor,f=b.downColor,g=E(a(c,d)),h=F(g.Ft[0])<=F(g.Ft[3]);return{cr:g.R??(h?e:f)}},Candlestick:(a,b,c,d)=>{let e=b.upColor,f=b.downColor,g=b.borderUpColor,h=b.borderDownColor,i=b.wickUpColor,j=b.wickDownColor,k=E(a(c,d)),l=F(k.Ft[0])<=F(k.Ft[3]);return{cr:k.R??(l?e:f),dr:k.Ht??(l?g:h),pr:k.vr??(l?i:j)}},Custom:(a,b,c,d)=>({cr:E(a(c,d)).R??b.color}),Area:(a,b,c,d)=>{let e=E(a(c,d));return{cr:e.vt??b.lineColor,vt:e.vt??b.lineColor,mr:e.mr??b.topColor,wr:e.wr??b.bottomColor}},Baseline:(a,b,c,d)=>{let e=E(a(c,d));return{cr:e.Ft[3]>=b.baseValue.price?b.topLineColor:b.bottomLineColor,gr:e.gr??b.topLineColor,Mr:e.Mr??b.bottomLineColor,br:e.br??b.topFillColor1,Sr:e.Sr??b.topFillColor2,Cr:e.Cr??b.bottomFillColor1,yr:e.yr??b.bottomFillColor2}},Line:(a,b,c,d)=>{let e=E(a(c,d));return{cr:e.R??b.color,vt:e.R??b.color}},Histogram:(a,b,c,d)=>({cr:E(a(c,d)).R??b.color})})[a.Rr()]}Dr(a,b){return this.Tr(this.Pr,this.ge.N(),a,b)}}function aA(a,b,c,d,e=0,f=b.length){let g=f-e;for(;0<g;){let h=g>>1,i=e+h;d(b[i],c)===a?(e=i+1,g-=h+1):g=h}return e}let aB=aA.bind(null,!0),aC=aA.bind(null,!1);(g=q||(q={}))[g.NearestLeft=-1]="NearestLeft",g[g.None=0]="None",g[g.NearestRight=1]="NearestRight";let aD=30;function aE(a,b){return null===a?b:null===b?a:{Jr:Math.min(a.Jr,b.Jr),Qr:Math.max(a.Qr,b.Qr)}}class aF{constructor(a){this.th=a}nt(a,b,c){this.th.draw(a)}
6ih(a,b,c){this.th.drawBackground?.(a)}}class aG{constructor(a){this.Dn=null,this.sh=a}Tt(){let a=this.sh.renderer();if(null===a)return null;if(this.Dn?.nh===a)return this.Dn.eh;let b=new aF(a);return this.Dn={nh:a,eh:b},b}rh(){return this.sh.zOrder?.()??"normal"}}class aH{constructor(a){this.hh=null,this.ah=a}oh(){return this.ah}Ns(){this.ah.updateAllViews?.()}Ws(){let a=this.ah.paneViews?.()??[];if(this.hh?.nh===a)return this.hh.eh;let b=a.map(a=>new aG(a));return this.hh={nh:a,eh:b},b}jn(a,b){return this.ah.hitTest?.(a,b)??null}}let aI=class extends aH{us(){return[]}};class aJ{constructor(a){this.th=a}nt(a,b,c){this.th.draw(a)}ih(a,b,c){this.th.drawBackground?.(a)}}class aK{constructor(a){this.Dn=null,this.sh=a}Tt(){let a=this.sh.renderer();if(null===a)return null;if(this.Dn?.nh===a)return this.Dn.eh;let b=new aJ(a);return this.Dn={nh:a,eh:b},b}rh(){return this.sh.zOrder?.()??"normal"}}function aL(a){return{ri:a.text(),Bi:a.coordinate(),Ii:a.fixedCoordinate?.(),R:a.textColor(),X:a.backColor(),Vt:a.visible?.()?? !0,pi:a.tickVisible?.()?? !0}}class aM{constructor(a,b){this.Gt=new ah,this._h=a,this.uh=b}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...aL(this._h)}),this.Gt}}class aN extends ae{constructor(a,b){super(),this._h=a,this.Yi=b}qi(a,b,c){let d=aL(this._h);c.X=d.X,a.R=d.R;let e=2/12*this.Yi.P();c.Ti=e,c.Ri=e,c.Bi=d.Bi,c.Ii=d.Ii,a.ri=d.ri,a.Vt=d.Vt,a.pi=d.pi}}class aO extends aH{constructor(a,b){super(a),this.dh=null,this.fh=null,this.ph=null,this.mh=null,this.ge=b}cs(){let a=this.ah.timeAxisViews?.()??[];if(this.dh?.nh===a)return this.dh.eh;let b=this.ge.Qt().At(),c=a.map(a=>new aM(a,b));return this.dh={nh:a,eh:c},c}Fs(){let a=this.ah.priceAxisViews?.()??[];if(this.fh?.nh===a)return this.fh.eh;let b=this.ge.Wt(),c=a.map(a=>new aN(a,b));return this.fh={nh:a,eh:c},c}wh(){let a=this.ah.priceAxisPaneViews?.()??[];if(this.ph?.nh===a)return this.ph.eh;let b=a.map(a=>new aK(a));return this.ph={nh:a,eh:b},b}gh(){let a=this.ah.timeAxisPaneViews?.()??[];if(this.mh?.nh===a)return this.mh.eh;let b=a.map(a=>new aK(a));return this.mh={nh:a,eh:b},b}Mh(a,b){return this.ah.autoscaleInfo?.(a,b)??null}}function aP(a,b,c,d){a.forEach(a=>{b(a).forEach(a=>{a.rh()===c&&d.push(a)})})}function aQ(a){return a.Ws()}function aR(a){return a.wh()}function aS(a){return a.gh()}class aT extends ay{constructor(a,b,c,d,e){super(a),this.Yt=new class{constructor(){this.Vr=[],this.Ir=new Map,this.Br=new Map,this.Ar=[]}Er(){return this.zr()>0?this.Vr[this.Vr.length-1]:null}Lr(){return this.zr()>0?this.Or(0):null}Zs(){return this.zr()>0?this.Or(this.Vr.length-1):null}zr(){return this.Vr.length}Zi(){return 0===this.zr()}Te(a){return null!==this.Nr(a,0)}kr(a){return this.Wr(a)}Wr(a,b=0){let c=this.Nr(a,b);return null===c?null:{...this.Fr(c),Re:this.Or(c)}}Hr(){return this.Vr}Ur(a,b,c){if(this.Zi())return null;let d=null;for(let e of c)d=aE(d,this.$r(a,b,e));return d}ht(a){this.Br.clear(),this.Ir.clear(),this.Vr=a,this.Ar=a.map(a=>a.Re)}qr(){return this.Ar}Or(a){return this.Vr[a].Re}Fr(a){return this.Vr[a]}Nr(a,b){let c=this.Yr(a);if(null===c&&0!==b)switch(b){case -1:return this.jr(a);case 1:return this.Zr(a);default:throw TypeError("Unknown search mode")}return c}jr(a){let b=this.Kr(a);return b>0&&(b-=1),b!==this.Vr.length&&this.Or(b)<a?b:null}Zr(a){let b=this.Xr(a);return b!==this.Vr.length&&a<this.Or(b)?b:null}Yr(a){let b=this.Kr(a);return b===this.Vr.length||a<this.Vr[b].Re?null:b}Kr(a){return aB(this.Vr,a,(a,b)=>a.Re<b)}Xr(a){return aC(this.Vr,a,(a,b)=>a.Re>b)}Gr(a,b,c){let d=null;for(let e=a;e<b;e++){let f=this.Vr[e].Ft[c];Number.isNaN(f)||(null===d?d={Jr:f,Qr:f}:(f<d.Jr&&(d.Jr=f),f>d.Qr&&(d.Qr=f)))}return d}$r(a,b,c){if(this.Zi())return null;let d=null,e=E(this.Lr()),f=E(this.Zs()),g=Math.max(a,e),h=Math.min(b,f),i=Math.ceil(g/aD)*aD,j=Math.max(i,Math.floor(h/aD)*aD);{let k=this.Kr(g),l=this.Xr(Math.min(h,i,b));d=aE(d,this.Gr(k,l,c))}let m=this.Ir.get(c);void 0===m&&(m=new Map,this.Ir.set(c,m));for(let n=Math.max(i+1,g);n<j;n+=aD){let o=Math.floor(n/aD),p=m.get(o);if(void 0===p){let q=this.Kr(o*aD),r=this.Xr((o+1)*aD-1);p=this.Gr(q,r,c),m.set(o,p)}d=aE(d,p)}{let s=this.Kr(j),t=this.Xr(h);d=aE(d,this.Gr(s,t,c))}return d}}
6,this.er=new class extends as{constructor(a){super(a)}te(){let a=this.Xn;a.Vt=!1;let b=this.Jn.N();if(!b.priceLineVisible||!this.Jn.Vt())return;let c=this.Jn.Pe(0===b.priceLineSource);c.ke||(a.Vt=!0,a.ut=c.Bi,a.R=this.Jn.Be(c.R),a.ct=b.priceLineWidth,a.Kt=b.priceLineStyle)}}(this),this.bh=[],this.xh=new class extends as{constructor(a){super(a)}te(){this.Xn.Vt=!1;let a=this.Jn.Wt(),b=a.ie().ie;if(2!==b&&3!==b)return;let c=this.Jn.N();if(!c.baseLineVisible||!this.Jn.Vt())return;let d=this.Jn.zt();null!==d&&(this.Xn.Vt=!0,this.Xn.ut=a.Nt(d.Ft,d.Ft),this.Xn.R=c.baseLineColor,this.Xn.ct=c.baseLineWidth,this.Xn.Kt=c.baseLineStyle)}}(this),this.Sh=null,this.Ch=null,this.yh=null,this.Ph=[],this.ys=c,this.kh=b;let f=new class extends ae{constructor(a){super(),this.Jt=a}qi(a,b,c){a.Vt=!1,b.Vt=!1;let d=this.Jt;if(!d.Vt())return;let e=d.N(),f=e.lastValueVisible,g=""!==d.Ae(),h=0===e.seriesLastValueMode,i=d.Pe(!1);if(i.ke)return;f&&(a.ri=this.Ee(i,f,h),a.Vt=0!==a.ri.length),(g||h)&&(b.ri=this.ze(i,f,g,h),b.Vt=b.ri.length>0);let j=d.Be(i.R),k=this.Jt.Qt().Ki().K(j);c.X=k.X,c.Bi=i.Bi,b.Ht=d.Qt().Ut(i.Bi/d.Wt().$t()),a.Ht=j,a.R=k.G,b.R=k.G}ze(a,b,c,d){let e="",f=this.Jt.Ae();return c&&0!==f.length&&(e+=`${f} `),b&&d&&(e+=this.Jt.Wt().Le()?a.Oe:a.Ne),e.trim()}Ee(a,b,c){return b?c?this.Jt.Wt().Le()?a.Ne:a.Oe:a.ri:""}}(this);this.vs=[f],this.rr=new ar(f,this,a),["Area","Line","Baseline"].includes(this.kh)&&(this.Sh=new class{constructor(a){this.Gt=new class extends U{constructor(){super(...arguments),this.Yt=null}ht(a){this.Yt=a}se(){return this.Yt}et({context:a,horizontalPixelRatio:b,verticalPixelRatio:c}){let d=this.Yt;if(null===d)return;let e=Math.max(1,Math.floor(b)),f=e%2/2,g=Math.round(d.ne.x*b)+f,h=d.ne.y*c;a.fillStyle=d.ee,a.beginPath();let i=Math.max(2,1.5*d.re)*b;a.arc(g,h,i,0,2*Math.PI,!1),a.fill(),a.fillStyle=d.he,a.beginPath(),a.arc(g,h,d.ft*b,0,2*Math.PI,!1),a.fill(),a.lineWidth=e,a.strokeStyle=d.ae,a.beginPath(),a.arc(g,h,d.ft*b+e/2,0,2*Math.PI,!1),a.stroke()}},this.St=!0,this.ve=!0,this.me=performance.now(),this.we=this.me-1,this.ge=a}Me(){this.we=this.me-1,this.Pt()}be(){if(this.Pt(),2===this.ge.N().lastPriceAnimation){let a=performance.now(),b=this.we-a;if(b>0)return void(b<650&&(this.we+=2600));this.me=a,this.we=a+2600}}Pt(){this.St=!0}xe(){this.ve=!0}Vt(){return 0!==this.ge.N().lastPriceAnimation}Se(){switch(this.ge.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.we}}Tt(){return this.St?(this.Rt(),this.St=!1,this.ve=!1):this.ve&&(this.Ce(),this.ve=!1),this.Gt}Rt(){this.Gt.ht(null);let a=this.ge.Qt().At(),b=a.ye(),c=this.ge.zt();if(null===b||null===c)return;let d=this.ge.Pe(!0);if(d.ke||!b.Te(d.Re))return;let e={x:a.qt(d.Re),y:this.ge.Wt().Nt(d.gt,c.Ft)},f=d.R,g=this.ge.N().lineWidth,h=this.De(this.Ve(),f);this.Gt.ht({ee:f,re:g,he:h.he,ae:h.ae,ft:h.ft,ne:e})}Ce(){let a=this.Gt.se();if(null!==a){let b=this.De(this.Ve(),a.ee);a.he=b.he,a.ae=b.ae,a.ft=b.ft}}Ve(){return this.Se()?performance.now()-this.me:2599}Ie(a,b,c,d){return this.ge.Qt().Ki().j(a,c+(d-c)*b)}De(a,b){var c,d,e;let f=a%2600/2600,g;for(let h of at)if(f>=h.le&&f<=h.oe){g=h;break}C(void 0!==g,"Last price animation internal logic error");let i=(f-g.le)/(g.oe-g.le);return{he:this.Ie(b,i,g.ce,g.de),ae:this.Ie(b,i,g.fe,g.pe),ft:(c=i,d=g._e,e=g.ue,d+(e-d)*c)}}}(this)),this.Th(),this.sh=d(this,this.Qt(),e)}m(){null!==this.yh&&clearTimeout(this.yh)}Be(a){return this.ys.priceLineColor||a}Pe(a){let b={ke:!0},c=this.Wt();if(this.Qt().At().Zi()||c.Zi()||this.Yt.Zi())return b;let d=this.Qt().At().ye(),e=this.zt();if(null===d||null===e)return b;let f,g;if(a){let h=this.Yt.Er();if(null===h)return b;f=h,g=h.Re}else{let i=this.Yt.Wr(d.bi(),-1);if(null===i||null===(f=this.Yt.kr(i.Re)))return b;g=i.Re}let j=f.Ft[3],k=this.Rh().Dr(g,{Ft:f}),l=c.Nt(j,e.Ft);return{ke:!1,gt:j,ri:c.Xi(j,e.Ft),Oe:c.Dh(j),Ne:c.Vh(j,e.Ft),R:k.cr,Bi:l,Re:g}}Rh(){return null!==this.Ch||(this.Ch=new az(this)),this.Ch}N(){return this.ys}hr(a){let b=a.priceScaleId;void 0!==b&&b!==this.ys.priceScaleId&&this.Qt().Ih(this,b),H(this.ys,a),void 0!==a.priceFormat&&(this.Th(),this.Qt().Bh()),this.Qt().Ah(this),this.Qt().Eh(),this.sh.Pt("options")}ht(a,b){this.Yt.ht(a),this.sh.Pt("data"),null!==this.Sh&&(b&&b.zh?this.Sh.be():0===a.length&&this.Sh.Me());let c=this.Qt().Hn(this);this.Qt().Lh(c),this.Qt().Ah(this),this.Qt().Eh(),this.Qt().ar()}Oh(a){let b=new ax(this,a);return this.bh.push(b),this.Qt().Ah(this),b}Nh(a){let b=this.bh.indexOf(a);-1!==b&&this.bh.splice(b,1),this.Qt().Ah(this)}Wh(){return this.bh}Rr(){return this.kh}zt(){let a=this.Fh();return null===a?null:{Ft:a.Ft[3],Hh:a.wt}}Fh(){let a=this.Qt().At().ye();if(null===a)return null;let b=a.Uh();return this.Yt.Wr(b,1)}Ks(){return this.Yt}$h(a){let b=this.Yt.kr(a);return null===b?null:"Bar"===this.kh||"Candlestick"===this.kh||"Custom"===this.kh?{qh:b.Ft[0],Yh:b.Ft[1],jh:b.Ft[2],Zh:b.Ft[3]}:b.Ft[3]}Kh(a){let b=[];aP(this.Ph,aQ,"top",b);let c=this.Sh;return null!==c&&c.Vt()&&(null===this.yh&&c.Se()&&(this.yh=setTimeout(()=>{this.yh=null,this.Qt().Xh()},0)),c.xe(),b.unshift(c)),b}Ws(){let a=[];this.Gh()||a.push(this.xh),a.push(this.sh,this.er);let b=this.bh.map(a=>a.lr());return a.push(...b),aP(this.Ph,aQ,"normal",a),a}Jh(){return this.Qh(aQ,"bottom")}ta(a){return this.Qh(aR,a)}ia(a){return this.Qh(aS,a)}sa(a,b){return this.Ph.map(c=>c.jn(a,b)).filter(a=>null!==a)}us(){return[this.rr,...this.bh.map(a=>
6a._r())]}Fs(a,b){if(b!==this.es&&!this.Gh())return[];let c=[...this.vs];for(let d of this.bh)c.push(d.ur());return this.Ph.forEach(a=>{c.push(...a.Fs())}),c}cs(){let a=[];return this.Ph.forEach(b=>{a.push(...b.cs())}),a}Mh(a,b){if(void 0!==this.ys.autoscaleInfoProvider){let c=this.ys.autoscaleInfoProvider(()=>{let c=this.na(a,b);return null===c?null:c.Ke()});return aw.Xe(c)}return this.na(a,b)}ea(){return this.ys.priceFormat.minMove}ra(){return this.ha}Ns(){for(let a of(this.sh.Pt(),this.vs))a.Pt();for(let b of this.bh)b.Pt();this.er.Pt(),this.xh.Pt(),this.Sh?.Pt(),this.Ph.forEach(a=>a.Ns())}Wt(){return E(super.Wt())}Et(a){if(!(("Line"===this.kh||"Area"===this.kh||"Baseline"===this.kh)&&this.ys.crosshairMarkerVisible))return null;let b=this.Yt.kr(a);return null===b?null:{gt:b.Ft[3],ft:this.aa(),Ht:this.la(),Ot:this.oa(),Lt:this._a(a)}}Ae(){return this.ys.title}Vt(){return this.ys.visible}ua(a){this.Ph.push(new aO(a,this))}ca(a){this.Ph=this.Ph.filter(b=>b.oh()!==a)}da(){if("Custom"===this.kh)return a=>this.sh.fa(a)}pa(){if("Custom"===this.kh)return a=>this.sh.va(a)}ma(){return this.Yt.qr()}Gh(){return!aj(this.Wt().wa())}na(a,b){if(!J(a)||!J(b)||this.Yt.Zi())return null;let c="Line"===this.kh||"Area"===this.kh||"Baseline"===this.kh||"Histogram"===this.kh?[3]:[2,1],d=this.Yt.Ur(a,b,c),e=null!==d?new av(d.Jr,d.Qr):null,f=null;if("Histogram"===this.Rr()){let g=this.ys.base,h=new av(g,g);e=null!==e?e.vn(h):h}return this.Ph.forEach(c=>{let d=c.Mh(a,b);if(d?.priceRange){let g=new av(d.priceRange.minValue,d.priceRange.maxValue);e=null!==e?e.vn(g):g}d?.margins&&(f=d.margins)}),new aw(e,f)}aa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerRadius}return 0}la(){switch(this.kh){case"Line":case"Area":case"Baseline":{let a=this.ys.crosshairMarkerBorderColor;if(0!==a.length)return a}}return null}oa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerBorderWidth}return 0}_a(a){switch(this.kh){case"Line":case"Area":case"Baseline":{let b=this.ys.crosshairMarkerBackgroundColor;if(0!==b.length)return b}}return this.Rh().Dr(a).cr}Th(){switch(this.ys.priceFormat.type){case"custom":this.ha={format:this.ys.priceFormat.formatter};break;case"volume":this.ha=new ao(this.ys.priceFormat.precision);break;case"percent":this.ha=new an(this.ys.priceFormat.precision);break;default:{let a=Math.pow(10,this.ys.priceFormat.precision);this.ha=new am(a,this.ys.priceFormat.minMove*a)}}null!==this.es&&this.es.ga()}Qh(a,b){let c=[];return aP(this.Ph,a,b,c),c}}let aU=[3],aV=[0,1,2,3],aW={Ia:4,Ba:1e-4};function aX(a,b){let c=100*(a-b)/b;return b<0?-c:c}function aY(a,b){let c=aX(a.$e(),b),d=aX(a.qe(),b);return new av(c,d)}function aZ(a,b){let c=100*(a-b)/b+100;return b<0?-c:c}function a$(a,b){let c=aZ(a.$e(),b),d=aZ(a.qe(),b);return new av(c,d)}function a_(a,b){let c=Math.abs(a);if(c<1e-15)return 0;let d=Math.log10(c+b.Ba)+b.Ia;return a<0?-d:d}function a0(a,b){let c=Math.abs(a);if(c<1e-15)return 0;let d=Math.pow(10,c-b.Ia)-b.Ba;return a<0?-d:d}function a1(a,b){if(null===a)return null;let c=a_(a.$e(),b),d=a_(a.qe(),b);return new av(c,d)}function a2(a,b){if(null===a)return null;let c=a0(a.$e(),b),d=a0(a.qe(),b);return new av(c,d)}function a3(a){if(null===a)return aW;let b=Math.abs(a.qe()-a.$e());if(b>=1||b<1e-15)return aW;let c=Math.ceil(Math.abs(Math.log10(b))),d=aW.Ia+c;return{Ia:d,Ba:1/Math.pow(10,d)}}function a4(a,b,c){return Math.min(Math.max(a,b),c)}function a5(a){let b=Math.ceil(a);return b%2==0?b-1:b}class a6{constructor(a,b){if(this.Aa=a,this.Ea=b,function(a){if(a<0)return!1;for(let b=a;b>1;b/=10)if(b%10!=0)return!1;return!0}(this.Aa))this.za=[2,2.5,2];else{this.za=[];for(let c=this.Aa;1!==c;){if(c%2==0)this.za.push(2),c/=2;else{if(c%5!=0)throw Error("unexpected base");this.za.push(2,2.5),c/=5}if(this.za.length>100)throw Error("something wrong with base")}}}La(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;let s=0===this.Aa?0:1/this.Aa,t=Math.pow(10,Math.max(0,Math.ceil(Math.log10(a-b)))),u=0,v=this.Ea[0];for(;;){let w=(g=t,i=1e-14,(h=s)-g<=1e-14&&t>s+1e-14),x=(j=t,l=1e-14,(k=c*v)-j<=1e-14),y=(n=1,o=1e-14,1-(m=t)<=1e-14);if(!(w&&x&&y))break;t/=v,v=this.Ea[++u%this.Ea.length]}if(t<=s+1e-14&&(t=s),t=Math.max(1,t),this.za.length>0&&(f=1e-14,Math.abs(t-(e=1))<f))for(u=0,v=this.za[0];p=t,(q=c*v)-p<=1e-14&&t>s+1e-14;)t/=v,v=this.za[++u%this.za.length];return t}}class a7{constructor(a,b,c,d){this.Oa=[],this.Yi=a,this.Aa=b,this.Na=c,this.Wa=d}La(a,b){if(a<b)throw Error("high < low");let c=this.Yi.$t(),d=(a-b)*this.Fa()/c,e=new a6(this.Aa,[2,2.5,2]),f=new a6(this.Aa,[2,2,2.5]),g=new a6(this.Aa,[2.5,2,2]),h=[];return h.push(e.La(a,b,d),f.La(a,b,d),g.La(a,b,d)),function(a){if
6(a.length<1)throw Error("array is empty");let b=a[0];for(let c=1;c<a.length;++c)a[c]<b&&(b=a[c]);return b}(h)}Ha(){let a=this.Yi,b=a.zt();if(null===b)return void(this.Oa=[]);let c=a.$t(),d=this.Na(c-1,b),e=this.Na(0,b),f=this.Yi.N().entireTextOnly?this.Ua()/2:0,g=f,h=c-1-f,i=Math.max(d,e),j=Math.min(d,e);if(i===j)return void(this.Oa=[]);let k=this.La(i,j),l=i%k;l+=l<0?k:0;let m=i>=j?1:-1,n=null,o=0;for(let p=i-l;p>j;p-=k){let q=this.Wa(p,b,!0);null!==n&&Math.abs(q-n)<this.Fa()||q<g||q>h||(o<this.Oa.length?(this.Oa[o].Pa=q,this.Oa[o].$a=a.qa(p)):this.Oa.push({Pa:q,$a:a.qa(p)}),o++,n=q,a.Ya()&&(k=this.La(p*m,j)))}this.Oa.length=o}Va(){return this.Oa}Ua(){return this.Yi.P()}Fa(){return Math.ceil(2.5*this.Ua())}}function a8(a){return a.slice().sort((a,b)=>E(a.hs())-E(b.hs()))}(h=r||(r={}))[h.Normal=0]="Normal",h[h.Logarithmic=1]="Logarithmic",h[h.Percentage=2]="Percentage",h[h.IndexedTo100=3]="IndexedTo100";let a9=new an,ba=new am(100,1);class bb{constructor(a,b,c,d,e){this.ja=0,this.Za=null,this.Ge=null,this.Ka=null,this.Xa={Ga:!1,Ja:null},this.Qa=0,this.tl=0,this.il=new G,this.sl=new G,this.nl=[],this.el=null,this.rl=null,this.hl=null,this.al=null,this.ha=ba,this.ll=a3(null),this.ol=a,this.ys=b,this._l=c,this.ul=d,this.cl=e,this.dl=new a7(this,100,this.fl.bind(this),this.pl.bind(this))}wa(){return this.ol}N(){return this.ys}hr(a){if(H(this.ys,a),this.ga(),void 0!==a.mode&&this.vl({ie:a.mode}),void 0!==a.scaleMargins){let b=D(a.scaleMargins.top),c=D(a.scaleMargins.bottom);if(b<0||b>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${b}`);if(c<0||c>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${c}`);if(b+c>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${b+c}`);this.ml(),this.rl=null}}wl(){return this.ys.autoScale}Ya(){return 1===this.ys.mode}Le(){return 2===this.ys.mode}gl(){return 3===this.ys.mode}ie(){return{sn:this.ys.autoScale,Ml:this.ys.invertScale,ie:this.ys.mode}}vl(a){let b=this.ie(),c=null;void 0!==a.sn&&(this.ys.autoScale=a.sn),void 0!==a.ie&&(this.ys.mode=a.ie,2!==a.ie&&3!==a.ie||(this.ys.autoScale=!0),this.Xa.Ga=!1),1===b.ie&&a.ie!==b.ie&&(function(a,b){if(null===a)return!1;let c=a0(a.$e(),b),d=a0(a.qe(),b);return isFinite(c)&&isFinite(d)}(this.Ge,this.ll)?null!==(c=a2(this.Ge,this.ll))&&this.bl(c):this.ys.autoScale=!0),1===a.ie&&a.ie!==b.ie&&null!==(c=a1(this.Ge,this.ll))&&this.bl(c);let d=b.ie!==this.ys.mode;d&&(2===b.ie||this.Le())&&this.ga(),d&&(3===b.ie||this.gl())&&this.ga(),void 0!==a.Ml&&b.Ml!==a.Ml&&(this.ys.invertScale=a.Ml,this.xl()),this.sl.p(b,this.ie())}Sl(){return this.sl}P(){return this._l.fontSize}$t(){return this.ja}Cl(a){this.ja!==a&&(this.ja=a,this.ml(),this.rl=null)}yl(){if(this.Za)return this.Za;let a=this.$t()-this.Pl()-this.kl();return this.Za=a,a}Qe(){return this.Tl(),this.Ge}bl(a,b){let c=this.Ge;(b||null===c&&null!==a||null!==c&&!c.He(a))&&(this.rl=null,this.Ge=a)}Zi(){return this.Tl(),0===this.ja||!this.Ge||this.Ge.Zi()}Rl(a){return this.Ml()?a:this.$t()-1-a}Nt(a,b){return this.Le()?a=aX(a,b):this.gl()&&(a=aZ(a,b)),this.pl(a,b)}Dl(a,b,c){this.Tl();let d=this.kl(),e=E(this.Qe()),f=e.$e(),g=e.qe(),h=this.yl()-1,i=this.Ml(),j=h/(g-f),k=void 0===c?0:c.from,l=void 0===c?a.length:c.to,m=this.Vl();for(let n=k;n<l;n++){let o=a[n],p=o.gt;if(isNaN(p))continue;let q=p;null!==m&&(q=m(o.gt,b));let r=d+j*(q-f),s=i?r:this.ja-1-r;o.ut=s}}Il(a,b,c){this.Tl();let d=this.kl(),e=E(this.Qe()),f=e.$e(),g=e.qe(),h=this.yl()-1,i=this.Ml(),j=h/(g-f),k=void 0===c?0:c.from,l=void 0===c?a.length:c.to,m=this.Vl();for(let n=k;n<l;n++){let o=a[n],p=o.qh,q=o.Yh,r=o.jh,s=o.Zh;null!==m&&(p=m(o.qh,b),q=m(o.Yh,b),r=m(o.jh,b),s=m(o.Zh,b));let t=d+j*(p-f),u=i?t:this.ja-1-t;o.Bl=u,t=d+j*(q-f),u=i?t:this.ja-1-t,o.Al=u,t=d+j*(r-f),u=i?t:this.ja-1-t,o.El=u,t=d+j*(s-f),u=i?t:this.ja-1-t,o.zl=u}}Ts(a,b){let c=this.fl(a,b);return this.Ll(c,b)}Ll(a,b){var c,d,e,f;let g=a;return this.Le()?g=(c=g,(d=b)<0&&(c=-c),c/100*d+d):this.gl()&&(g=(e=g,e-=100,(f=b)<0&&(e=-e),e/100*f+f)),g}ba(){return this.nl}Dt(){if(this.el)return this.el;let a=[];for(let b=0;b<this.nl.length;b++){let c=this.nl[b];null===c.hs()&&c.ls(b+1),a.push(c)}return a=a8(a),this.el=a,this.el}
6Ol(a){-1===this.nl.indexOf(a)&&(this.nl.push(a),this.ga(),this.Nl())}Wl(a){let b=this.nl.indexOf(a);if(-1===b)throw Error("source is not attached to scale");this.nl.splice(b,1),0===this.nl.length&&(this.vl({sn:!0}),this.bl(null)),this.ga(),this.Nl()}zt(){let a=null;for(let b of this.nl){let c=b.zt();null!==c&&(null===a||c.Hh<a.Hh)&&(a=c)}return null===a?null:a.Ft}Ml(){return this.ys.invertScale}Va(){let a=null===this.zt();if(null!==this.rl&&(a||this.rl.Fl===a))return this.rl.Va;this.dl.Ha();let b=this.dl.Va();return this.rl={Va:b,Fl:a},this.il.p(),b}Hl(){return this.il}Ul(a){this.Le()||this.gl()||null===this.hl&&null===this.Ka&&(this.Zi()||(this.hl=this.ja-a,this.Ka=E(this.Qe()).Ue()))}$l(a){if(this.Le()||this.gl()||null===this.hl)return;this.vl({sn:!1}),(a=this.ja-a)<0&&(a=0);let b=(this.hl+.2*(this.ja-1))/(a+.2*(this.ja-1)),c=E(this.Ka).Ue();b=Math.max(b,.1),c.je(b),this.bl(c)}ql(){this.Le()||this.gl()||(this.hl=null,this.Ka=null)}Yl(a){this.wl()||null===this.al&&null===this.Ka&&(this.Zi()||(this.al=a,this.Ka=E(this.Qe()).Ue()))}jl(a){if(this.wl()||null===this.al)return;let b=E(this.Qe()).Ye()/(this.yl()-1),c=a-this.al;this.Ml()&&(c*=-1);let d=c*b,e=E(this.Ka).Ue();e.Ze(d),this.bl(e,!0),this.rl=null}Zl(){this.wl()||null!==this.al&&(this.al=null,this.Ka=null)}ra(){return this.ha||this.ga(),this.ha}Xi(a,b){switch(this.ys.mode){case 2:return this.Kl(aX(a,b));case 3:return this.ra().format(aZ(a,b));default:return this.nr(a)}}qa(a){switch(this.ys.mode){case 2:return this.Kl(a);case 3:return this.ra().format(a);default:return this.nr(a)}}Dh(a){return this.nr(a,E(this.Xl()).ra())}Vh(a,b){return a=aX(a,b),this.Kl(a,a9)}Gl(){return this.nl}Jl(a){this.Xa={Ja:a,Ga:!1}}Ns(){this.nl.forEach(a=>a.Ns())}ga(){this.rl=null;let a=this.Xl(),b=100;null!==a&&(b=Math.round(1/a.ea())),this.ha=ba,this.Le()?(this.ha=a9,b=100):this.gl()?(this.ha=new am(100,1),b=100):null!==a&&(this.ha=a.ra()),this.dl=new a7(this,b,this.fl.bind(this),this.pl.bind(this)),this.dl.Ha()}Nl(){this.el=null}Ki(){return this.cl}Xl(){return this.nl[0]||null}Pl(){return this.Ml()?this.ys.scaleMargins.bottom*this.$t()+this.tl:this.ys.scaleMargins.top*this.$t()+this.Qa}kl(){return this.Ml()?this.ys.scaleMargins.top*this.$t()+this.Qa:this.ys.scaleMargins.bottom*this.$t()+this.tl}Tl(){this.Xa.Ga||(this.Xa.Ga=!0,this.Ql())}ml(){this.Za=null}pl(a,b){if(this.Tl(),this.Zi())return 0;a=this.Ya()&&a?a_(a,this.ll):a;let c=E(this.Qe()),d=this.kl()+(this.yl()-1)*(a-c.$e())/c.Ye();return this.Rl(d)}fl(a,b){if(this.Tl(),this.Zi())return 0;let c=this.Rl(a),d=E(this.Qe()),e=d.$e()+d.Ye()*((c-this.kl())/(this.yl()-1));return this.Ya()?a0(e,this.ll):e}xl(){this.rl=null,this.dl.Ha()}Ql(){var a,b;let c=this.Xa.Ja;if(null===c)return;let d=null,e=this.Gl(),f=0,g=0;for(let h of e){if(!h.Vt())continue;let i=h.zt();if(null===i)continue;let j=h.Mh(c.Uh(),c.bi()),k=j&&j.Qe();if(null!==k){switch(this.ys.mode){case 1:k=a1(k,this.ll);break;case 2:k=aY(k,i.Ft);break;case 3:k=a$(k,i.Ft)}if(d=null===d?k:d.vn(E(k)),null!==j){let l=j.tr();null!==l&&(f=Math.max(f,l.above),g=Math.max(g,l.below))}}}if(f===this.Qa&&g===this.tl||(this.Qa=f,this.tl=g,this.rl=null,this.ml()),null!==d){if(d.$e()===d.qe()){let m=this.Xl(),n=5*(null===m||this.Le()||this.gl()?1:m.ea());this.Ya()&&(d=a2(d,this.ll)),d=new av(d.$e()-n,d.qe()+n),this.Ya()&&(d=a1(d,this.ll))}if(this.Ya()){let o=a2(d,this.ll),p=a3(o);if(a=p,b=this.ll,a.Ia!==b.Ia||a.Ba!==b.Ba){let q=null!==this.Ka?a2(this.Ka,this.ll):null;this.ll=p,d=a1(o,p),null!==q&&(this.Ka=a1(q,p))}}this.bl(d)}else null===this.Ge&&(this.bl(new av(-.5,.5)),this.ll=a3(null));this.Xa.Ga=!0}Vl(){return this.Le()?aX:this.gl()?aZ:this.Ya()?a=>a_(a,this.ll):null}io(a,b,c){return void 0===b?(void 0===c&&(c=this.ra()),c.format(a)):b(a)}nr(a,b){return this.io(a,this.ul.priceFormatter,b)}Kl(a,b){return this.io(a,this.ul.percentageFormatter,b)}}function bc(a){return a instanceof aT}class bd{constructor(a,b){this.nl=[],this.so=new Map,this.ja=0,this.no=0,this.eo=1e3,this.el=null,this.ro=new G,this.Ph=[],this.uh=a,this.ts=b,this.ho=new class{constructor(a){this.sh=new class{constructor(a){this.Gt=new class extends U{constructor(){super(...arguments),this.Yt=null}ht(a){this.Yt=a}et({context:a,bitmapSize:b,horizontalPixelRatio:c,verticalPixelRatio:d}){if(null===this.Yt)return;let e=Math.max(1,Math.floor(c));a.lineWidth=e,function(a,b){a.save(),a.lineWidth%2&&a.translate(.5,.5),b(),a.restore(
6)}(a,()=>{let f=E(this.Yt);if(f.xa){for(let g of(a.strokeStyle=f.Sa,A(a,f.Ca),a.beginPath(),f.ya)){let h=Math.round(g.Pa*c);a.moveTo(h,-e),a.lineTo(h,b.height+e)}a.stroke()}if(f.ka){for(let i of(a.strokeStyle=f.Ta,A(a,f.Ra),a.beginPath(),f.Da)){let j=Math.round(i.Pa*d);a.moveTo(-e,j),a.lineTo(b.width+e,j)}a.stroke()}})}},this.St=!0,this.yt=a}Pt(){this.St=!0}Tt(){if(this.St){let a=this.yt.Qt().N().grid,b={ka:a.horzLines.visible,xa:a.vertLines.visible,Ta:a.horzLines.color,Sa:a.vertLines.color,Ra:a.horzLines.style,Ca:a.vertLines.style,Da:this.yt.ks().Va(),ya:(this.yt.Qt().At().Va()||[]).map(a=>({Pa:a.coord}))};this.Gt.ht(b),this.St=!1}return this.Gt}}(a)}lr(){return this.sh}}(this);let c=b.N();this.ao=this.lo("left",c.leftPriceScale),this.oo=this.lo("right",c.rightPriceScale),this.ao.Sl().i(this._o.bind(this,this.ao),this),this.oo.Sl().i(this._o.bind(this,this.oo),this),this.uo(c)}uo(a){if(a.leftPriceScale&&this.ao.hr(a.leftPriceScale),a.rightPriceScale&&this.oo.hr(a.rightPriceScale),a.localization&&(this.ao.ga(),this.oo.ga()),a.overlayPriceScales){let b=Array.from(this.so.values());for(let c of b){let d=E(c[0].Wt());d.hr(a.overlayPriceScales),a.localization&&d.ga()}}}co(a){switch(a){case"left":return this.ao;case"right":return this.oo}return this.so.has(a)?D(this.so.get(a))[0].Wt():null}m(){this.Qt().do().u(this),this.ao.Sl().u(this),this.oo.Sl().u(this),this.nl.forEach(a=>{a.m&&a.m()}),this.Ph=this.Ph.filter(a=>{let b=a.oh();return b.detached&&b.detached(),!1}),this.ro.p()}fo(){return this.eo}po(a){this.eo=a}Qt(){return this.ts}Qi(){return this.no}$t(){return this.ja}vo(a){this.no=a,this.mo()}Cl(a){this.ja=a,this.ao.Cl(a),this.oo.Cl(a),this.nl.forEach(b=>{if(this.Un(b)){let c=b.Wt();null!==c&&c.Cl(a)}}),this.mo()}wo(){return this.nl.filter(bc)}ba(){return this.nl}Un(a){let b=a.Wt();return null===b||this.ao!==b&&this.oo!==b}Ol(a,b,c){let d=void 0!==c?c:this.bo().Mo+1;this.xo(a,b,d)}Wl(a){let b=this.nl.indexOf(a);C(-1!==b,"removeDataSource: invalid data source"),this.nl.splice(b,1);let c=E(a.Wt()).wa();if(this.so.has(c)){let d=D(this.so.get(c)),e=d.indexOf(a);-1!==e&&(d.splice(e,1),0===d.length&&this.so.delete(c))}let f=a.Wt();f&&f.ba().indexOf(a)>=0&&f.Wl(a),null!==f&&(f.Nl(),this.So(f)),this.el=null}qn(a){return a===this.ao?"left":a===this.oo?"right":"overlay"}Co(){return this.ao}yo(){return this.oo}Po(a,b){a.Ul(b)}ko(a,b){a.$l(b),this.mo()}To(a){a.ql()}Ro(a,b){a.Yl(b)}Do(a,b){a.jl(b),this.mo()}Vo(a){a.Zl()}mo(){this.nl.forEach(a=>{a.Ns()})}ks(){let a=null;return this.ts.N().rightPriceScale.visible&&0!==this.oo.ba().length?a=this.oo:this.ts.N().leftPriceScale.visible&&0!==this.ao.ba().length?a=this.ao:0!==this.nl.length&&(a=this.nl[0].Wt()),null===a&&(a=this.oo),a}$n(){let a=null;return this.ts.N().rightPriceScale.visible?a=this.oo:this.ts.N().leftPriceScale.visible&&(a=this.ao),a}So(a){null!==a&&a.wl()&&this.Io(a)}Bo(a){let b=this.uh.ye();a.vl({sn:!0}),null!==b&&a.Jl(b),this.mo()}Ao(){this.Io(this.ao),this.Io(this.oo)}Eo(){this.So(this.ao),this.So(this.oo),this.nl.forEach(a=>{this.Un(a)&&this.So(a.Wt())}),this.mo(),this.ts.ar()}Dt(){return null===this.el&&(this.el=a8(this.nl)),this.el}It(){return this.Dt().filter(bc)}zo(){return this.ro}Lo(){return this.ho}ua(a){this.Ph.push(new aI(a))}ca(a){this.Ph=this.Ph.filter(b=>b.oh()!==a),a.detached&&a.detached(),this.ts.ar()}Oo(){return this.Ph}sa(a,b){return this.Ph.map(c=>c.jn(a,b)).filter(a=>null!==a)}Io(a){let b=a.Gl();if(b&&b.length>0&&!this.uh.Zi()){let c=this.uh.ye();null!==c&&a.Jl(c)}a.Ns()}bo(){let a=this.Dt();if(0===a.length)return{No:0,Mo:0};let b=0,c=0;for(let d=0;d<a.length;d++){let e=a[d].hs();null!==e&&(e<b&&(b=e),e>c&&(c=e))}return{No:b,Mo:c}}xo(a,b,c){let d=this.co(b);if(null===d&&(d=this.lo(b,this.ts.N().overlayPriceScales)),this.nl.push(a),!aj(b)){let e=this.so.get(b)||[];e.push(a),this.so.set(b,e)}d.Ol(a),a._s(d),a.ls(c),this.So(d),this.el=null}_o(a,b,c){b.ie!==c.ie&&this.Io(a)}lo(a,b){let c={visible:!0,autoScale:!0,...M(b)},d=new bb(a,c,this.ts.N().layout,this.ts.N().localization,this.ts.Ki());return d.Cl(this.$t()),d}}function be(a){return{Wo:a.Wo,Fo:{Zn:a.Ho.externalId},Uo:a.Ho.cursorStyle}}function bf(a,b,c,d){for(let e of a){let f=e.Tt(d);if(null!==f&&f.jn){let g=f.jn(b,c);if(null!==g)return{$o:e,Fo:g}}}return null}function bg(a){return void 0!==a.Ws}function bh(a,b,c){let d=[a,...a.Dt()],e=function(a,b,c){var d,e;let f,g;for(let h of a){let i=h.sa?.(b,c)??[];for(let j of i)d=j.zOrder,(e=f?.zOrder)&&("top"!==d||"top"===e)&&("normal"!==d||"bottom"!==e)||(f=j,g=h)}return f&&g?{Ho:f,Wo:g}:null}(d,b,c);if("top"===e?.Ho.zOrder)return be(e);for(let f of d){if(e&&e.Wo===f&&"bottom"!==e.Ho.zOrder&&!e.Ho.isBackgroun
6d)return be(e);if(bg(f)){let g=bf(f.Ws(a),b,c,a);if(null!==g)return{Wo:f,$o:g.$o,Fo:g.Fo}}if(e&&e.Wo===f&&"bottom"!==e.Ho.zOrder&&e.Ho.isBackground)return be(e)}return e?.Ho?be(e):null}class bi{constructor(a,b,c=50){this.Pn=0,this.kn=1,this.Tn=1,this.Dn=new Map,this.Rn=new Map,this.qo=a,this.Yo=b,this.Vn=c}jo(a){let b=a.time,c=this.Yo.cacheKey(b),d=this.Dn.get(c);if(void 0!==d)return d.Zo;if(this.Pn===this.Vn){let e=this.Rn.get(this.Tn);this.Rn.delete(this.Tn),this.Dn.delete(D(e)),this.Tn++,this.Pn--}let f=this.qo(a);return this.Dn.set(c,{Zo:f,En:this.kn}),this.Rn.set(this.kn,c),this.Pn++,this.kn++,f}}class bj{constructor(a,b){C(a<=b,"right should be >= left"),this.Ko=a,this.Xo=b}Uh(){return this.Ko}bi(){return this.Xo}Go(){return this.Xo-this.Ko+1}Te(a){return this.Ko<=a&&a<=this.Xo}He(a){return this.Ko===a.Uh()&&this.Xo===a.bi()}}function bk(a,b){return null===a||null===b?a===b:a.He(b)}class bl{constructor(a){this.l_=a}o_(){return null===this.l_?null:new bj(Math.floor(this.l_.Uh()),Math.ceil(this.l_.bi()))}__(){return this.l_}static u_(){return new bl(null)}}function bm(a,b){return a.weight>b.weight?a:b}function bn(a){return!I(a)&&!K(a)}(i=s||(s={}))[i.OnTouchEnd=0]="OnTouchEnd",i[i.OnNextTap=1]="OnNextTap";(j=t||(t={}))[j.Disabled=0]="Disabled",j[j.Continuous=1]="Continuous",j[j.OnDataUpdate=2]="OnDataUpdate",(k=u||(u={}))[k.LastBar=0]="LastBar",k[k.LastVisible=1]="LastVisible",(l=v||(v={})).Solid="solid",l.VerticalGradient="gradient",(m=w||(w={}))[m.Year=0]="Year",m[m.Month=1]="Month",m[m.DayOfMonth=2]="DayOfMonth",m[m.Time=3]="Time",m[m.TimeWithSeconds=4]="TimeWithSeconds";let bo=a=>a.getUTCFullYear();class bp{constructor(a="yyyy-MM-dd",b="default"){this.yc=a,this.Pc=b}jo(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;return b=a,c=this.yc,d=this.Pc,c.replace(/yyyy/g,al(bo(b),4)).replace(/yy/g,al(bo(b)%100,2)).replace(/MMMM/g,(g=b,h=d,new Date(g.getUTCFullYear(),g.getUTCMonth(),1).toLocaleString(h,{month:"long"}))).replace(/MMM/g,(i=b,j=d,new Date(i.getUTCFullYear(),i.getUTCMonth(),1).toLocaleString(j,{month:"short"}))).replace(/MM/g,al((k=b).getUTCMonth()+1,2)).replace(/dd/g,al((m=b).getUTCDate(),2))}}class bq{constructor(a={}){let b={Tc:"yyyy-MM-dd",Rc:"%h:%m:%s",Dc:" ",Vc:"default",...a};this.Ic=new bp(b.Tc,b.Vc),this.Bc=new class{constructor(a){this.kc=a||"%h:%m:%s"}jo(a){return this.kc.replace("%h",al(a.getUTCHours(),2)).replace("%m",al(a.getUTCMinutes(),2)).replace("%s",al(a.getUTCSeconds(),2))}}(b.Rc),this.Ac=b.Dc}jo(a){return`${this.Ic.jo(a)}${this.Ac}${this.Bc.jo(a)}`}}function br(a){return 60*a*6e4}function bs(a){return 60*a*1e3}let bt=[{Ec:1e3,zc:10},{Ec:bs(1),zc:20},{Ec:bs(5),zc:21},{Ec:bs(30),zc:22},{Ec:br(1),zc:30},{Ec:br(3),zc:31},{Ec:br(6),zc:32},{Ec:br(12),zc:33}];function bu(a,b){if(a.getUTCFullYear()!==b.getUTCFullYear())return 70;if(a.getUTCMonth()!==b.getUTCMonth())return 60;if(a.getUTCDate()!==b.getUTCDate())return 50;for(let c=bt.length-1;c>=0;--c)if(Math.floor(b.getTime()/bt[c].Ec)!==Math.floor(a.getTime()/bt[c].Ec))return bt[c].zc;return 0}function bv(a){let b=a;if(K(a)&&(b=bx(a)),!bn(b))throw Error("time must be of type BusinessDay");let c=new Date(Date.UTC(b.year,b.month-1,b.day,0,0,0,0));return{Lc:Math.round(c.getTime()/1e3),Oc:b}}function bw(a){var b;if(!I(b=a))throw Error("time must be of type isUTCTimestamp");return{Lc:a}}function bx(a){let b=new Date(a);if(isNaN(b.getTime()))throw Error(`Invalid date string=${a}, expected format=yyyy-mm-dd`);return{day:b.getUTCDate(),month:b.getUTCMonth()+1,year:b.getUTCFullYear()}}function by(a){K(a.time)&&(a.time=bx(a.time))}class bz{options(){return this.ys}setOptions(a){this.ys=a,this.updateFormatter(a.localization)}preprocessData(a){Array.isArray(a)?function(a){a.forEach(by)}(a):by(a)}createConverterToInternalObj(a){var b;return E(0===(b=a).length?null:bn(b[0].time)||K(b[0].time)?bv:bw)}key(a){return"object"==typeof a&&"Lc"in a?a.Lc:this.key(this.convertHorzItemToInternal(a))}cacheKey(a){let b=a;return void 0===b.Oc?new Date(1e3*b.Lc).getTime():new Date(Date.UTC(b.Oc.year,b.Oc.month-1,b.Oc.day)).getTime()}convertHorzItemToInternal(a){var b,c;return I(c=b=a)?bw(b):bn(b)?bv(b):bv(bx(b))}updateFormatter(a){if(!this.ys)return;let b=a.dateFormat;this.ys.timeScale.timeVisible?this.Nc=new bq({Tc:b,Rc:this.ys.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Dc:"   ",Vc:a.locale}):this.Nc=new bp(b,a.locale)}formatHorzItem(a){return this.Nc.jo(new Date(1e3*a.Lc))}formatTickmark(a,b){let c=function(a,b,c){switch(a){case 0:case 10:return b?c?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return b?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(a.weight,this.ys.timeScale.timeVisible,this.ys.timeScale.secondsVisible),d=this.ys.timeScale;if(void 0!==d.tickMarkFormatter){let e=d.tickMarkFormatter(a.originalTime,c,b.locale);if(null!==e)return e}return function(a,b,c){let d={};switch(b){case 0:d.year="numeric";break;case 1:d.month="short";break;case 2:d.day="numeric";break;case 3:d.hour12=!1,d.hour="2-digit",d.minute="2-digit";break;case 4:d.hour12=!1,d.hour="2-digit",d.minute="2-digit",d.second="2-digit"}let e=new Date(void 0===a.Oc?1e3*a.Lc:Date.UTC(a.Oc.year,a.Oc.month-1,a.Oc.day));return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()).toLocaleStr
6ing(c,d)}(a.time,c,b.locale)}maxTickMarkWeight(a){let b=a.reduce(bm,a[0]).weight;return b>30&&b<50&&(b=30),b}fillWeightsForPoints(a,b){!function(a,b=0){if(0===a.length)return;let c=0===b?null:a[b-1].time.Lc,d=null!==c?new Date(1e3*c):null,e=0;for(let f=b;f<a.length;++f){let g=a[f],h=new Date(1e3*g.time.Lc);null!==d&&(g.timeWeight=bu(h,d)),e+=g.time.Lc-(c||g.time.Lc),c=g.time.Lc,d=h}if(0===b&&a.length>1){let i=Math.ceil(e/(a.length-1)),j=new Date(1e3*(a[0].time.Lc-i));a[0].timeWeight=bu(new Date(1e3*a[0].time.Lc),j)}}(a,b)}static Wc(a){return H({localization:{dateFormat:"dd MMM 'yy"}},a??{})}}let bA="undefined"!=typeof window;function bB(){return!!bA&&window.navigator.userAgent.toLowerCase().indexOf("firefox")> -1}function bC(){return!!bA&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function bD(a){return a+a%2}class bE{constructor(a,b,c){this.Fc=0,this.Hc=null,this.Uc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.$c=0,this.qc=null,this.Yc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.jc=null,this.Zc=!1,this.Kc=null,this.Xc=null,this.Gc=!1,this.Jc=!1,this.Qc=!1,this.td=null,this.sd=null,this.nd=null,this.ed=null,this.rd=null,this.hd=null,this.ad=null,this.ld=0,this.od=!1,this._d=!1,this.ud=!1,this.dd=0,this.fd=null,this.pd=!bC(),this.vd=a=>{this.md(a)},this.wd=a=>{if(this.gd(a)){let b=this.Md(a);if(++this.$c,this.qc&&this.$c>1){let{bd:c}=this.xd(bH(a),this.Yc);c<30&&!this.Qc&&this.Sd(b,this.yd.Cd),this.Pd()}}else{let d=this.Md(a);if(++this.Fc,this.Hc&&this.Fc>1){let{bd:e}=this.xd(bH(a),this.Uc);e<5&&!this.Jc&&this.kd(d,this.yd.Td),this.Rd()}}},this.Dd=a,this.yd=b,this.ys=c,this.Vd()}m(){null!==this.td&&(this.td(),this.td=null),null!==this.sd&&(this.sd(),this.sd=null),null!==this.ed&&(this.ed(),this.ed=null),null!==this.rd&&(this.rd(),this.rd=null),null!==this.hd&&(this.hd(),this.hd=null),null!==this.nd&&(this.nd(),this.nd=null),this.Id(),this.Rd()}Bd(a){this.ed&&this.ed();let b=this.Ad.bind(this);if(this.ed=()=>{this.Dd.removeEventListener("mousemove",b)},this.Dd.addEventListener("mousemove",b),this.gd(a))return;let c=this.Md(a);this.kd(c,this.yd.Ed),this.pd=!0}Rd(){null!==this.Hc&&clearTimeout(this.Hc),this.Fc=0,this.Hc=null,this.Uc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Pd(){null!==this.qc&&clearTimeout(this.qc),this.$c=0,this.qc=null,this.Yc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Ad(a){if(this.ud||null!==this.Xc||this.gd(a))return;let b=this.Md(a);this.kd(b,this.yd.zd),this.pd=!0}Ld(a){let b=bJ(a.changedTouches,E(this.fd));if(null===b||(this.dd=bI(a),null!==this.ad)||this._d)return;this.od=!0;let c=this.xd(bH(b),E(this.Xc)),{Od:d,Nd:e,bd:f}=c;if(this.Gc||!(f<5)){if(!this.Gc){let g=.5*d,h=e>=g&&!this.ys.Wd(),i=g>e&&!this.ys.Fd();h||i||(this._d=!0),this.Gc=!0,this.Qc=!0,this.Id(),this.Pd()}if(!this._d){let j=this.Md(a,b);this.Sd(j,this.yd.Hd),bG(a)}}}Ud(a){if(0!==a.button)return;let b=this.xd(bH(a),E(this.Kc)),{bd:c}=b;if(c>=5&&(this.Jc=!0,this.Rd()),this.Jc){let d=this.Md(a);this.kd(d,this.yd.$d)}}xd(a,b){let c=Math.abs(b._t-a._t),d=Math.abs(b.ut-a.ut);return{Od:c,Nd:d,bd:c+d}}qd(a){let b=bJ(a.changedTouches,E(this.fd));if(null===b&&0===a.touches.length&&(b=a.changedTouches[0]),null===b)return;this.fd=null,this.dd=bI(a),this.Id(),this.Xc=null,this.hd&&(this.hd(),this.hd=null);let c=this.Md(a,b);if(this.Sd(c,this.yd.Yd),++this.$c,this.qc&&this.$c>1){let{bd:d}=this.xd(bH(b),this.Yc);d<30&&!this.Qc&&this.Sd(c,this.yd.Cd),this.Pd()}else this.Qc||(this.Sd(c,this.yd.jd),this.yd.jd&&bG(a));0===this.$c&&bG(a),0===a.touches.length&&this.Zc&&(this.Zc=!1,bG(a))}md(a){if(0!==a.button)return;let b=this.Md(a);if(this.Kc=null,this.ud=!1,this.rd&&(this.rd(),this.rd=null),bB()&&this.Dd.ownerDocument.documentElement.removeEventListener("mouseleave",this.vd),!this.gd(a)){if(this.kd(b,this.yd.Zd),++this.Fc,this.Hc&&this.Fc>1){let{bd:c}=this.xd(bH(a),this.Uc);c<5&&!this.Jc&&this.kd(b,this.yd.Td),this.Rd()}else this.Jc||this.kd(b,this.yd.Kd)}}Id(){null!==this.jc&&(clearTimeout(this.jc),this.jc=null)}Xd(a){if(null!==this.fd)return;let b=a.changedTouches[0];this.fd=b.identifier,this.dd=bI(a);let c=this.Dd.ownerDocument.documentElement;this.Qc=!1,this.Gc=!1,this._d=!1,this.Xc=bH(b),this.hd&&(this.hd(),this.hd=null);{let d=this.Ld.bind(this),e=this.qd.bind(this);this.hd=()=>{c.removeEventListener("touchmove",d),c.removeEventListener("touchend",e)},c.addEventListener("touchmove",d,{passive:!1}),c.addEventListener("touchend",e,{passive:!1}),this.Id(),this.jc=setTimeout(this.Gd.bind(this,a),240)}let f=this.Md(a,b);this.Sd(f,this.yd.Jd),this.qc||(this.$c=0,this.qc=setTimeout(this.Pd.bind(this),500),this.Yc=bH(b))}Qd(a){if(0!==a.button)return;let b=this.Dd.ownerDocument.documentElement;bB()&&b.addEventListener("mouseleave",this.vd),this.Jc=!1,this.Kc=bH(a),this.rd&&(this.rd(),this.rd=null);
6{let c=this.Ud.bind(this),d=this.md.bind(this);this.rd=()=>{b.removeEventListener("mousemove",c),b.removeEventListener("mouseup",d)},b.addEventListener("mousemove",c),b.addEventListener("mouseup",d)}if(this.ud=!0,this.gd(a))return;let e=this.Md(a);this.kd(e,this.yd.tf),this.Hc||(this.Fc=0,this.Hc=setTimeout(this.Rd.bind(this),500),this.Uc=bH(a))}Vd(){var a;this.Dd.addEventListener("mouseenter",this.Bd.bind(this)),this.Dd.addEventListener("touchcancel",this.Id.bind(this));{let b=this.Dd.ownerDocument,c=a=>{this.yd.if&&(a.composed&&this.Dd.contains(a.composedPath()[0])||a.target&&this.Dd.contains(a.target)||this.yd.if())};this.sd=()=>{b.removeEventListener("touchstart",c)},this.td=()=>{b.removeEventListener("mousedown",c)},b.addEventListener("mousedown",c),b.addEventListener("touchstart",c,{passive:!0})}bC()&&(this.nd=()=>{this.Dd.removeEventListener("dblclick",this.wd)},this.Dd.addEventListener("dblclick",this.wd)),this.Dd.addEventListener("mouseleave",this.sf.bind(this)),this.Dd.addEventListener("touchstart",this.Xd.bind(this),{passive:!0}),a=this.Dd,bA&& void 0!==window.chrome&&a.addEventListener("mousedown",a=>{if(1===a.button)return a.preventDefault(),!1}),this.Dd.addEventListener("mousedown",this.Qd.bind(this)),this.nf(),this.Dd.addEventListener("touchmove",()=>{},{passive:!1})}nf(){void 0===this.yd.ef&& void 0===this.yd.rf&& void 0===this.yd.hf||(this.Dd.addEventListener("touchstart",a=>this.af(a.touches),{passive:!0}),this.Dd.addEventListener("touchmove",a=>{if(2===a.touches.length&&null!==this.ad&& void 0!==this.yd.rf){let b=bF(a.touches[0],a.touches[1])/this.ld;this.yd.rf(this.ad,b),bG(a)}},{passive:!1}),this.Dd.addEventListener("touchend",a=>{this.af(a.touches)}))}af(a){1===a.length&&(this.od=!1),2!==a.length||this.od||this.Zc?this.lf():this._f(a)}_f(a){let b=this.Dd.getBoundingClientRect()||{left:0,top:0};this.ad={_t:(a[0].clientX-b.left+(a[1].clientX-b.left))/2,ut:(a[0].clientY-b.top+(a[1].clientY-b.top))/2},this.ld=bF(a[0],a[1]),void 0!==this.yd.ef&&this.yd.ef(),this.Id()}lf(){null!==this.ad&&(this.ad=null,void 0!==this.yd.hf&&this.yd.hf())}sf(a){if(this.ed&&this.ed(),this.gd(a)||!this.pd)return;let b=this.Md(a);this.kd(b,this.yd.uf),this.pd=!bC()}Gd(a){let b=bJ(a.touches,E(this.fd));if(null===b)return;let c=this.Md(a,b);this.Sd(c,this.yd.cf),this.Qc=!0,this.Zc=!0}gd(a){return a.sourceCapabilities&& void 0!==a.sourceCapabilities.firesTouchEvents?a.sourceCapabilities.firesTouchEvents:bI(a)<this.dd+500}Sd(a,b){b&&b.call(this.yd,a)}kd(a,b){b&&b.call(this.yd,a)}Md(a,b){let c=b||a,d=this.Dd.getBoundingClientRect()||{left:0,top:0};return{clientX:c.clientX,clientY:c.clientY,pageX:c.pageX,pageY:c.pageY,screenX:c.screenX,screenY:c.screenY,localX:c.clientX-d.left,localY:c.clientY-d.top,ctrlKey:a.ctrlKey,altKey:a.altKey,shiftKey:a.shiftKey,metaKey:a.metaKey,df:!a.type.startsWith("mouse")&&"contextmenu"!==a.type&&"click"!==a.type,ff:a.type,pf:c.target,$o:a.view,vf:()=>{"touchstart"!==a.type&&bG(a)}}}}function bF(a,b){let c=a.clientX-b.clientX,d=a.clientY-b.clientY;return Math.sqrt(c*c+d*d)}function bG(a){a.cancelable&&a.preventDefault()}function bH(a){return{_t:a.pageX,ut:a.pageY}}function bI(a){return a.timeStamp||performance.now()}function bJ(a,b){for(let c=0;c<a.length;++c)if(a[c].identifier===b)return a[c];return null}class bK{constructor(a,b,c){this.mf=null,this.wf=null,this.gf=!0,this.Mf=null,this.bf=a,this.xf=a.Sf()[b],this.Cf=a.Sf()[c],this.yf=document.createElement("tr"),this.yf.style.height="1px",this.Pf=document.createElement("td"),this.Pf.style.position="relative",this.Pf.style.padding="0",this.Pf.style.margin="0",this.Pf.setAttribute("colspan","3"),this.kf(),this.yf.appendChild(this.Pf),this.gf=this.bf.N().layout.panes.enableResize,this.gf?this.Tf():(this.mf=null,this.wf=null)}m(){null!==this.wf&&this.wf.m()}Rf(){return this.yf}Df(){return(0,y.dp)({width:this.xf.Df().width,height:1})}Vf(){return(0,y.dp)({width:this.xf.Vf().width,height:1*window.devicePixelRatio})}If(a,b,c){let d=this.Vf();a.fillStyle=this.bf.N().layout.panes.separatorColor,a.fillRect(b,c,d.width,d.height)}Pt(){this.kf(),this.bf.N().layout.panes.enableResize!==this.gf&&(this.gf=this.bf.N().layout.panes.enableResize,this.gf?this.Tf():(null!==this.mf&&(this.Pf.removeChild(this.mf.Bf),this.Pf.removeChild(this.mf.Af),this.mf=null),null!==this.wf&&(this.wf.m(),this.wf=null)))}Tf(){let a=document.createElement("div"),b=a.style;b.position="fixed",b.display="none",b.zIndex="49",b.top="0",b.left="0",b.width="100%",b.height="100%",b.curs
6or="row-resize",this.Pf.appendChild(a);let c=document.createElement("div"),d=c.style;d.position="absolute",d.zIndex="50",d.top="-4px",d.height="9px",d.width="100%",d.backgroundColor="",d.cursor="row-resize",this.Pf.appendChild(c);let e={Ed:this.Ef.bind(this),uf:this.zf.bind(this),tf:this.Lf.bind(this),Jd:this.Lf.bind(this),$d:this.Of.bind(this),Hd:this.Of.bind(this),Zd:this.Nf.bind(this),Yd:this.Nf.bind(this)};this.wf=new bE(c,e,{Wd:()=>!1,Fd:()=>!0}),this.mf={Af:c,Bf:a}}kf(){this.Pf.style.background=this.bf.N().layout.panes.separatorColor}Ef(a){null!==this.mf&&(this.mf.Af.style.backgroundColor=this.bf.N().layout.panes.separatorHoverColor)}zf(a){null!==this.mf&&null===this.Mf&&(this.mf.Af.style.backgroundColor="")}Lf(a){if(null===this.mf)return;let b=this.xf.Wf().fo()+this.Cf.Wf().fo(),c=b/(this.xf.Df().height+this.Cf.Df().height),d=30*c;b<=2*d||(this.Mf={Ff:a.pageY,Hf:this.xf.Wf().fo(),Uf:b-d,$f:b,qf:c,Yf:d},this.mf.Bf.style.display="block")}Of(a){let b=this.Mf;if(null===b)return;let c=(a.pageY-b.Ff)*b.qf,d=a4(b.Hf+c,b.Yf,b.Uf);this.xf.Wf().po(d),this.Cf.Wf().po(b.$f-d),this.bf.Qt().Bh()}Nf(a){null!==this.Mf&&null!==this.mf&&(this.Mf=null,this.mf.Bf.style.display="none")}}function bL(a,b){return a.jf-b.jf}function bM(a,b,c){let d=(a.jf-b.jf)/(a.wt-b.wt);return Math.sign(d)*Math.min(Math.abs(d),c)}class bN{constructor(a,b,c,d){this.Zf=null,this.Kf=null,this.Xf=null,this.Gf=null,this.Jf=null,this.Qf=0,this.tp=0,this.ip=a,this.sp=b,this.np=c,this.Mn=d}ep(a,b){if(null!==this.Zf){if(this.Zf.wt===b)return void(this.Zf.jf=a);if(Math.abs(this.Zf.jf-a)<this.Mn)return}this.Gf=this.Xf,this.Xf=this.Kf,this.Kf=this.Zf,this.Zf={wt:b,jf:a}}le(a,b){if(null===this.Zf||null===this.Kf||b-this.Zf.wt>50)return;let c=0,d=bM(this.Zf,this.Kf,this.sp),e=bL(this.Zf,this.Kf),f=[d],g=[e];if(c+=e,null!==this.Xf){let h=bM(this.Kf,this.Xf,this.sp);if(Math.sign(h)===Math.sign(d)){let i=bL(this.Kf,this.Xf);if(f.push(h),g.push(i),c+=i,null!==this.Gf){let j=bM(this.Xf,this.Gf,this.sp);if(Math.sign(j)===Math.sign(d)){let k=bL(this.Xf,this.Gf);f.push(j),g.push(k),c+=k}}}}let l=0;for(let m=0;m<f.length;++m)l+=g[m]/c*f[m];Math.abs(l)<this.ip||(this.Jf={jf:a,wt:b},this.tp=l,this.Qf=function(a,b){let c=Math.log(b);return Math.log(-(1*c/a))/c}(Math.abs(l),this.np))}cu(a){let b=E(this.Jf),c=a-b.wt;return b.jf+this.tp*(Math.pow(this.np,c)-1)/Math.log(this.np)}uu(a){return null===this.Jf||this.rp(a)===this.Qf}rp(a){let b=a-E(this.Jf).wt;return Math.min(b,this.Qf)}}class bO{constructor(a,b){this.hp=void 0,this.ap=void 0,this.lp=void 0,this.ps=!1,this.op=a,this._p=b,this.up()}Pt(){this.up()}cp(){this.hp&&this.op.removeChild(this.hp),this.ap&&this.op.removeChild(this.ap),this.hp=void 0,this.ap=void 0}dp(){return this.ps!==this.fp()||this.lp!==this.pp()}pp(){return this._p.Qt().Ki().J(this._p.N().layout.textColor)>160?"dark":"light"}fp(){return this._p.N().layout.attributionLogo}vp(){let a=new URL(location.href);return a.hostname?"&utm_source="+a.hostname+a.pathname:""}up(){this.dp()&&(this.cp(),this.ps=this.fp(),this.ps&&(this.lp=this.pp(),this.ap=document.createElement("style"),this.ap.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.hp=document.createElement("a"),this.hp.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.vp()}`,this.hp.title="Charting by TradingView",this.hp.id="tv-attr-logo",this.hp.target="_blank",this.hp.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.hp.toggleAttribute("data-dark","dark"===this.lp),this.op.appendChild(this.ap),this.op.appendChild(this.hp)))}}function bP(a,b){let c=E(a.ownerDocument).createElement("canvas");a.appendChild(c);let d=(0,y.qW)(c,{type:"device-pixel-content-box",options:{allowResizeObserver:!0},transform:(a,b)=>({width:Math.max(a.width,b.width),height:Math.max(a.height,b.height)})});return d.resizeCanvasElement(b),d}function bQ(a){a.width=1,a.height=1,a.getContext("2d")?.clearRect(0,0,1,1)}function bR(a,b,c,d){a.ih&&a.ih(b,c,d)}function bS(a,b,c,d){a.nt(b,c,d)}function bT(a,b,c,d){let e=a(c,d);for(let f of e){let g=f.Tt(d);null!==g&&b(g)}}function bU(a,b){return c=>{var d;return void 0===(d=c).Wt?[]:(c.Wt()?.wa()??"")!==b?[]:c.ta?.(a)??[]}}function bV(a,b,c,d){if(!a.length)return;let e=0,f=a[0].$t(d,!0),g=1===b?c/2-(a[0].Wi()-f/2):a[0].Wi()-f/2-c/2;g=Math.max(0,g);for(let h=1;h<a.length;h++){let i=a[h],j=a[h-1],k=j.$t(d,!1),l=i.Wi(),m=j.Wi();if(1===b?l>m-k:l<m+k){let n=m-k*b;i.Fi(n);let o=n-b*k/2;if((1===b?o<0:o>c)&&g>0){let p=1===b?-1-o:o-c,q=Math.min(p,g);for(let r=e;r<a.length;r++)a[r].Fi(a[r].Wi()+b*q);g-=q}}else e=h,g=1===b?m-k-l:l-(m+k)}}class bW{constructor(a,b,c,d){this.Yi=null,this.mp=null,this.wp=!1,this.gp=new aq(200),this.Mp=null,this.bp=0,this.xp=!1,this.Sp=()=>{this.xp||this.yt.Cp().Qt().ar()},this.yp=()=>{this.xp||this.yt.Cp().Qt().ar()},this.yt=a,this.ys=b,this._l=b.layout,this.Au=c,this.Pp="left"===d,this.kp=bU("normal",d),this.Tp=bU("top",d),this.Rp=bU("bottom",d),this.Pf=document.createElement("div"),this.Pf.style.height="100%",this.Pf.style.overflow="hidden",this.Pf.style.width="25px",this.Pf.style.left="0",this.Pf.style.position="relative",this.Dp=bP(this.Pf,(0,y.dp)({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);let e=this.Dp.canvasElement;e.style.position="absolute",e.style.zIndex="1",e.style.left="0",e.style.top="0",this.Vp=bP(this.Pf,(0,y.dp)({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);let f=this.Vp.canvasElement;f.style.position="absolute",f.style.zIndex="2",f.style.left="0",f.style.top="0";let g={tf:this.Lf.bind(this),Jd:this.Lf.bind(this),$d:this.Of.bind(this),Hd:this.Of.bind(this),if:this.Ip.bind(this),Zd:this.Nf.bind(this),Yd:this.Nf.bind(this),Td:this.Bp.bind(this),Cd:this.Bp.bind(this),Ed:this.Ap.bind(this),uf:this.zf.bind(this)};this.wf=new bE(this.Vp.canvasElement,g,{Wd:()=>!this.ys.handleScroll.vertTouchDrag,Fd:()=>!0})}m(){this.wf.m(),this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),bQ(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),bQ(this.Dp.canvasElement),this.Dp.dispose(),null!==this.Yi&&this.Yi.Hl().u(this),this.Yi=null}Rf(){return this.Pf}P(){return this._l.fontSize}Ep(){let a=this.Au.N();return this.Mp!==a.k&&(this.gp.In(),this.Mp=a.k),a}zp(){var a;if(null===this.Yi)return 0;let b=0,c=this.Ep(),d=E(this.Dp.canvasElement.getContext("2d",{colorSpace:this.yt.Cp().N().layout.colorSpace}));d.save();let e=this.Yi.Va();d.font=this.Lp(),e.length>0&&(b=Math.max(this.gp.Vi(d,e[0].$a),this.gp.Vi(d,e[e.length-1].$a)));let f=this.Op();for(let g=f.length;g--;){let h=this.gp.Vi(d,f[g].ri());h>b&&(b=h)}let i=this.Yi.zt();if(null!==i&&null!==this.mp&&2!==(a=this.ys.crosshair).mode&&a.horzLine.visible&&a.horzLine.labelVisible){let j=this.Yi.Ts(1,i),k=this.Yi.Ts(this.mp.height-2,i);
6b=Math.max(b,this.gp.Vi(d,this.Yi.Xi(Math.floor(Math.min(j,k))+.11111111111111,i)),this.gp.Vi(d,this.Yi.Xi(Math.ceil(Math.max(j,k))-.11111111111111,i)))}d.restore();let l=b||34;return bD(Math.ceil(c.S+c.C+c.I+c.B+5+l))}Np(a){null!==this.mp&&(0,y.J$)(this.mp,a)||(this.mp=a,this.xp=!0,this.Dp.resizeCanvasElement(a),this.Vp.resizeCanvasElement(a),this.xp=!1,this.Pf.style.width=`${a.width}px`,this.Pf.style.height=`${a.height}px`)}Wp(){return E(this.mp).width}_s(a){this.Yi!==a&&(null!==this.Yi&&this.Yi.Hl().u(this),this.Yi=a,a.Hl().i(this.il.bind(this),this))}Wt(){return this.Yi}In(){let a=this.yt.Wf();this.yt.Cp().Qt().Bo(a,E(this.Wt()))}Fp(a){if(null===this.mp)return;let b={colorSpace:this.yt.Cp().N().layout.colorSpace};if(1!==a){this.Hp(),this.Dp.applySuggestedBitmapSize();let c=(0,y.sE)(this.Dp,b);null!==c&&(c.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a)}),this.yt.qp(c,this.Rp),this.Yp(c),this.yt.qp(c,this.kp),this.jp(c))}this.Vp.applySuggestedBitmapSize();let d=(0,y.sE)(this.Vp,b);null!==d&&(d.useBitmapCoordinateSpace(({context:a,bitmapSize:b})=>{a.clearRect(0,0,b.width,b.height)}),this.Zp(d),this.yt.qp(d,this.Tp))}Vf(){return this.Dp.bitmapSize}If(a,b,c){let d=this.Vf();d.width>0&&d.height>0&&a.drawImage(this.Dp.canvasElement,b,c)}Pt(){this.Yi?.Va()}Lf(a){if(null===this.Yi||this.Yi.Zi()||!this.ys.handleScale.axisPressedMouseMove.price)return;let b=this.yt.Cp().Qt(),c=this.yt.Wf();this.wp=!0,b.Po(c,this.Yi,a.localY)}Of(a){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let b=this.yt.Cp().Qt(),c=this.yt.Wf(),d=this.Yi;b.ko(c,d,a.localY)}Ip(){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let a=this.yt.Cp().Qt(),b=this.yt.Wf(),c=this.Yi;this.wp&&(this.wp=!1,a.To(b,c))}Nf(a){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let b=this.yt.Cp().Qt(),c=this.yt.Wf();this.wp=!1,b.To(c,this.Yi)}Bp(a){this.ys.handleScale.axisDoubleClickReset.price&&this.In()}Ap(a){null!==this.Yi&&(!this.yt.Cp().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Le()||this.Yi.gl()||this.Kp(1))}zf(a){this.Kp(0)}Op(){let a=[],b=null===this.Yi?void 0:this.Yi;return(c=>{for(let d=0;d<c.length;++d){let e=c[d].Fs(this.yt.Wf(),b);for(let f=0;f<e.length;f++)a.push(e[f])}})(this.yt.Wf().Dt()),a}Up({context:a,bitmapSize:b}){let{width:c,height:d}=b,e=this.yt.Wf().Qt(),f=e.$(),g=e.xc();f===g?_(a,0,0,c,d,f):ac(a,0,0,c,d,f,g)}$p({context:a,bitmapSize:b,horizontalPixelRatio:c}){if(null===this.mp||null===this.Yi||!this.Yi.N().borderVisible)return;a.fillStyle=this.Yi.N().borderColor;let d=Math.max(1,Math.floor(this.Ep().S*c)),e;e=this.Pp?b.width-d:0,a.fillRect(e,0,d,b.height)}Yp(a){if(null===this.mp||null===this.Yi)return;let b=this.Yi.Va(),c=this.Yi.N(),d=this.Ep(),e=this.Pp?this.mp.width-d.C:0;c.borderVisible&&c.ticksVisible&&a.useBitmapCoordinateSpace(({context:a,horizontalPixelRatio:f,verticalPixelRatio:g})=>{a.fillStyle=c.borderColor;let h=Math.max(1,Math.floor(g)),i=Math.floor(.5*g),j=Math.round(d.C*f);for(let k of(a.beginPath(),b))a.rect(Math.floor(e*f),Math.round(k.Pa*g)-i,j,h);a.fill()}),a.useMediaCoordinateSpace(({context:a})=>{a.font=this.Lp(),a.fillStyle=c.textColor??this._l.textColor,a.textAlign=this.Pp?"right":"left",a.textBaseline="middle";let f=this.Pp?Math.round(e-d.I):Math.round(e+d.C+d.I),g=b.map(b=>this.gp.Di(a,b.$a));for(let h=b.length;h--;){let i=b[h];a.fillText(i.$a,f,i.Pa+g[h])}})}Hp(){if(null===this.mp||null===this.Yi)return;let a=this.mp.height/2,b=[],c=this.Yi.Dt().slice(),d=this.yt.Wf(),e=this.Ep();this.Yi===d.$n()&&this.yt.Wf().Dt().forEach(a=>{d.Un(a)&&c.push(a)});let f=this.Yi.ba()[0],g=this.Yi;c.forEach(c=>{let e=c.Fs(d,g);e.forEach(a=>{a.Fi(null),a.Hi()&&b.push(a)}),f===c&&e.length>0&&(a=e[0].Bi())}),b.forEach(a=>a.Fi(a.Bi())),this.Yi.N().alignLabels&&this.Xp(b,e,a)}Xp(a,b,c){if(null===this.mp)return;let d=a.filter(a=>a.Bi()<=c),e=a.filter(a=>a.Bi()>c);for(let f of(d.sort((a,b)=>b.Bi()-a.Bi()),d.length&&e.length&&e.push(d[0]),e.sort((a,b)=>a.Bi()-b.Bi()),a)){let g=Math.floor(f.$t(b)/2),h=f.Bi();h> -g&&h<g&&f.Fi(g),h>this.mp.height-g&&h<this.mp.height+g&&f.Fi(this.mp.height-g)}
6bV(d,1,this.mp.height,b),bV(e,-1,this.mp.height,b)}jp(a){if(null===this.mp)return;let b=this.Op(),c=this.Ep(),d=this.Pp?"right":"left";b.forEach(b=>{b.Ui()&&b.Tt(E(this.Yi)).nt(a,c,this.gp,d)})}Zp(a){if(null===this.mp||null===this.Yi)return;let b=this.yt.Cp().Qt(),c=[],d=this.yt.Wf(),e=b.Yu().Fs(d,this.Yi);e.length&&c.push(e);let f=this.Ep(),g=this.Pp?"right":"left";c.forEach(b=>{b.forEach(b=>{b.Tt(E(this.Yi)).nt(a,f,this.gp,g)})})}Kp(a){this.Pf.style.cursor=1===a?"ns-resize":"default"}il(){let a=this.zp();this.bp<a&&this.yt.Cp().Qt().Bh(),this.bp=a}Lp(){return Q(this._l.fontSize,this._l.fontFamily)}}function bX(a,b){return a.Jh?.(b)??[]}function bY(a,b){return a.Ws?.(b)??[]}function bZ(a,b){return a.us?.(b)??[]}function b$(a,b){return a.Kh?.(b)??[]}class b_{constructor(a,b){this.mp=(0,y.dp)({width:0,height:0}),this.Gp=null,this.Jp=null,this.Qp=null,this.tv=null,this.iv=!1,this.sv=new G,this.nv=new G,this.ev=0,this.rv=!1,this.hv=null,this.av=!1,this.lv=null,this.ov=null,this.xp=!1,this.Sp=()=>{this.xp||null===this._v||this.ts().ar()},this.yp=()=>{this.xp||null===this._v||this.ts().ar()},this._p=a,this._v=b,this._v.zo().i(this.uv.bind(this),this,!0),this.cv=document.createElement("td"),this.cv.style.padding="0",this.cv.style.position="relative";let c=document.createElement("div");c.style.width="100%",c.style.height="100%",c.style.position="relative",c.style.overflow="hidden",this.dv=document.createElement("td"),this.dv.style.padding="0",this.fv=document.createElement("td"),this.fv.style.padding="0",this.cv.appendChild(c),this.Dp=bP(c,(0,y.dp)({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);let d=this.Dp.canvasElement;d.style.position="absolute",d.style.zIndex="1",d.style.left="0",d.style.top="0",this.Vp=bP(c,(0,y.dp)({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);let e=this.Vp.canvasElement;e.style.position="absolute",e.style.zIndex="2",e.style.left="0",e.style.top="0",this.yf=document.createElement("tr"),this.yf.appendChild(this.dv),this.yf.appendChild(this.cv),this.yf.appendChild(this.fv),this.pv(),this.wf=new bE(this.Vp.canvasElement,this,{Wd:()=>null===this.hv&&!this._p.N().handleScroll.vertTouchDrag,Fd:()=>null===this.hv&&!this._p.N().handleScroll.horzTouchDrag})}m(){null!==this.Gp&&this.Gp.m(),null!==this.Jp&&this.Jp.m(),this.Qp=null,this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),bQ(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),bQ(this.Dp.canvasElement),this.Dp.dispose(),null!==this._v&&(this._v.zo().u(this),this._v.m()),this.wf.m()}Wf(){return E(this._v)}vv(a){null!==this._v&&this._v.zo().u(this),this._v=a,null!==this._v&&this._v.zo().i(b_.prototype.uv.bind(this),this,!0),this.pv(),this._p.Sf().indexOf(this)===this._p.Sf().length-1?(this.Qp=this.Qp??new bO(this.cv,this._p),this.Qp.Pt()):(this.Qp?.cp(),this.Qp=null)}Cp(){return this._p}Rf(){return this.yf}pv(){if(null!==this._v&&(this.mv(),0!==this.ts().js().length)){if(null!==this.Gp){let a=this._v.Co();this.Gp._s(E(a))}if(null!==this.Jp){let b=this._v.yo();this.Jp._s(E(b))}}}wv(){null!==this.Gp&&this.Gp.Pt(),null!==this.Jp&&this.Jp.Pt()}fo(){return null!==this._v?this._v.fo():0}po(a){this._v&&this._v.po(a)}Ed(a){if(!this._v)return;this.gv();let b=a.localX,c=a.localY;this.Mv(b,c,a)}tf(a){this.gv(),this.bv(),this.Mv(a.localX,a.localY,a)}zd(a){if(!this._v)return;this.gv();let b=a.localX,c=a.localY;this.Mv(b,c,a)}Kd(a){null!==this._v&&(this.gv(),this.xv(a))}Td(a){null!==this._v&&this.Sv(this.nv,a)}Cd(a){this.Td(a)}$d(a){this.gv(),this.Cv(a),this.Mv(a.localX,a.localY,a)}Zd(a){null!==this._v&&(this.gv(),this.rv=!1,this.yv(a))}jd(a){null!==this._v&&this.xv(a)}cf(a){if(this.rv=!0,null===this.hv){let b={x:a.localX,y:a.localY};this.Pv(b,b,a)}}uf(a){null!==this._v&&(this.gv(),this._v.Qt().Uu(null),this.kv())}Tv(){return this.sv}Rv(){return this.nv}ef(){this.ev=1,this.ts().hn()}rf(a,b){if(!this._p.N().handleScale.pinch)return;let c=5*(b-this.ev);this.ev=b,this.ts().tc(a._t,c)}Jd(a){this.rv=!1,this.av=null!==this.hv,this.bv();let b=this.ts().Yu();null!==this.hv&&b.Vt()&&(this.lv={x:b.si(),y:b.ni()},this.hv={x:a.localX,y:a.localY})}Hd(a){if(null===this._v)return;let b=a.localX,c=a.localY;if(null===this.hv)this.Cv(a);else{this.av=!1;let d=E(this.lv),e=d.x+(b-this.hv.x),f=d.y+(c-this.hv.y);this.Mv(e,f,a)}}Yd(a){0===this.Cp().N().trackingMode.exitMode&&(this.av=!0),this.Dv(),this.yv(a)}jn(a,b){let c=this._v;return null===c?null:bh(c,a,b)}Vv(a,b){E("left"===b?this.Gp:this.Jp).Np((0,y.dp)({width:a,height:this.mp.height}))}Df(){return this.mp}Np(a){(0,y.J$)(this.mp,a)||(this.mp=a,this.xp=!0,this.Dp.resizeCanvasElement(a),this.Vp.resizeCanvasElement(a),this.xp=!1,this.cv.style.width=a.width+"px",this.cv.style.height=a.height+"px")}Iv(){let a=E(this._v);for(let b of(a.So(a.Co()),a.So(a.yo()),a.ba()))if(a.Un(b)){let c=b.Wt();null!==c&&a.So(c),b.Ns()}for(let d of a.Oo())d.Ns()}Vf(){return this.Dp.bitmapSize}If(a,b,c){let d=this.Vf();d.width>0&&d.height>0&&a.drawImage(this.Dp.canvasElement,b,c)}Fp(a){if(0===a||null===this._v)return;a>1&&this.Iv(),null!==this.Gp&&this.Gp.Fp(a),null!==this.Jp&&this.Jp.Fp(a);let b={colorSpace:this._p.N().layout.colorSpace};if(1!==a){this.Dp.applySuggestedBitmapSize();let c=(0,y.sE)(this.Dp,b);null!==c&&(c.useBitmapCoordinateSpace(a=>{this.Up(a)}),this._v&&(this.Bv(c,bX),this.Av(c),this.Bv(c,bY),this.Bv(c,bZ)))}this.Vp.applySuggestedBitmapSize();let d=(0,y.sE)(this.Vp,b);null!==d&&(d.useBitmapCoordinateSpace(({context:a,bitmapSize:b})=>{a.clearRect(0,0,b.width,b.height)}),this.Ev(d),this.Bv(d,b$),this.Bv(d,bZ))}zv(){return this.Gp}Lv(){return this.Jp}qp(a,b){this.Bv(a,b)}uv(){null!==this._v&&this._v.zo().u(this),this._v=null}xv(a){this.Sv(this.sv,a)}Sv(a,b){let c=b.localX,d=b.localY;a.v()&&a.p(this.ts().At().Z_(c),{x:c,y:d},b)}Up({context:a,bitmapSize:b}){let{width:c,height:d}=b,e=this.ts(),f=e.$(),g=e.xc();f===g?_(a,0,0,c,d,g):ac(a,0,0,c,d,f,g)}Av(a){let b=E(this._v),c=b.Lo().lr().Tt(b);null!==c&&c.nt(a,!1)}Ev(a){this.Ov(a,bY,bS,this.ts().Yu())}Bv(a,b){let c=E(this._v),d=c.Dt(),e=c.Oo();for(let f of e)this.Ov(a,b,bR,f);for(let g of d)this.Ov(a,b,bR,g);for(let h of e)this.Ov(a,b,bS,h);for(let i of d)this.Ov(a,b,bS,i)}Ov(a,b,c,d){let e=E(this._v),f=e.Qt().Hu(),g=null!==f&&f.Wo===d,h=null!==f&&g&& void 0!==f.Fo?f.Fo.Kn:void 0;bT(b,b=>c(b,a,g,h),d,e)}mv(){if(null===this._v)return;let a=this._p,b=this._v.Co().N().visible,c=this._v.yo().N().visible;b||null===this.Gp||(this.dv.removeChild(this.Gp.Rf()),this.Gp.m(),this.Gp=null),c||null===this.Jp||(this.fv.removeChild(this.Jp.Rf()),this.Jp.m(),this.Jp=null);let d=a.Qt().cc();b&&null===this.Gp&&(this.Gp=new bW(this,a.N(),d,"left"),this.dv.appendChild(this.Gp.Rf())),c&&null===this.Jp&&(this.Jp=new bW(this,a.N(),d,"right"),this.fv.appendChild(this.Jp.Rf()))}Nv(a){return a.df&&this.rv||null!==this.hv}Wv(a){return Math.max(0,Math.min(a,this.mp.width-1))}Fv(a){return Math.max(0,Math.min(a,this.mp.height-1))}Mv(a,b,c){this.ts().lc(this.Wv(a),this.Fv(b),c,E(this._v))}kv(){this.ts()._c()}Dv(){this.av&&(this.hv=null,this.kv())}Pv(a,b,c){this.hv=a,this.av=!1,this.Mv(b.x,b.y,c);let d=this.ts().Yu();this.lv={x:d.si(),y:d.ni()}}ts(){return this._p.Qt()}yv(a){if(!this.iv)return;let b=this.ts(),c=this.Wf();if(b.Vo(c,c.ks()),this.tv=null,this.iv=!1,b.rc(),null!==this.ov){let d=performance.now(),e=b.At();this.ov.le(e.iu(),d),this.ov.uu(d)||b._n(this.ov)}}gv(){this.hv=null}bv(){if(this._v){if(this.ts().hn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)E(document.activeElement).blur();else{let a=document.getSelection();null!==a&&a.removeAllRanges()}this._v.ks().Zi()||this.ts().At().Zi()}}Cv(a){if(null===this._v)return;let b=this.ts(),c=b.At();if(c.Zi())return;let d=this._p.N(),e=d.handleScroll,f=d.kineticScroll;if((!e.pressedMouseMove||a.df)&&(!e.horzTouchDrag&&!e.vertTouchDrag||!a.df))return;let g=this._v.ks(),h=performance.now();if(null!==this.tv||this.Nv(a)||(this.tv={x:a.clientX,y:a.clientY,Lc:h,Hv:a.localX,Uv:a.localY}),null!==this.tv&&!this.iv&&(this.tv.x!==a.clientX||this.tv.y!==a.clientY)){if(a.df&&f.touch|| !a.df&&f.mouse){let i=c.Q_();this.ov=new bN(.2/i,7/i,.997,15/i),this.ov.ep(c.iu(),this.tv.Lc)}else this.ov=null;g.Zi()||b.Ro(this._v,g,a.localY),b.nc(a.localX),this.iv=!0}this.iv&&(g.Zi()||b.Do(this._v,g,a.localY),b.ec(a.localX),null!==this.ov&&this.ov.ep(c.iu(),h))}}class b0{constructor(a,b,c,d,e){this.St=!0,this.mp=(0,y.dp)({width:0,height:0}),this.Sp=()=>this.Fp(3),this.Pp="left"===a,this.Au=c.cc,this.ys=b,this.$v=d,this.qv=e,this.Pf=document.createElement("div"),this.Pf.style.width="25px",this.Pf.style.height="100%",this.Pf.style.overflow="hidden",this.Dp=bP(this.Pf,(0,y.dp)({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp)}m(){this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),bQ(this.Dp.canvasElement),this.Dp.dispose()}Rf(){return this.Pf}Df(){return this.mp}Np(a){(0,y.J$)(this.mp,a)||(this.mp=a,this.Dp.resizeCanvasElement(a),this.Pf.style.width=`${a.width}px`,this.Pf.style.height=`${a.height}px`,this.St=!0)}Fp(a){if(a<3&&!this.St||0===this.mp.width||0===this.mp.height)return;this.St=!1,this.Dp.applySuggestedBitmapSize();
6let b=(0,y.sE)(this.Dp,{colorSpace:this.ys.layout.colorSpace});null!==b&&b.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a)})}Vf(){return this.Dp.bitmapSize}If(a,b,c){let d=this.Vf();d.width>0&&d.height>0&&a.drawImage(this.Dp.canvasElement,b,c)}$p({context:a,bitmapSize:b,horizontalPixelRatio:c,verticalPixelRatio:d}){if(!this.$v())return;a.fillStyle=this.ys.timeScale.borderColor;let e=Math.floor(this.Au.N().S*c),f=Math.floor(this.Au.N().S*d),g=this.Pp?b.width-e:0;a.fillRect(g,0,e,f)}Up({context:a,bitmapSize:b}){_(a,0,0,b.width,b.height,this.qv())}}function b1(a){return b=>b.ia?.(a)??[]}let b2=b1("normal"),b3=b1("top"),b4=b1("bottom"),b5=!!bA&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(a=>a.brand.includes("Chromium"))&&!!bA&&(navigator?.userAgentData?.platform?"Windows"===navigator.userAgentData.platform:navigator.userAgent.toLowerCase().indexOf("win")>=0);function b6(a){return Boolean(a.handleScroll.mouseWheel||a.handleScale.mouseWheel)}function b7(a){return void 0===a.open&& void 0===a.value}function b8(a){var b,c;return void 0!==(b=a).open|| void 0!==(c=a).value}function b9(a,b,c,d){let e=c.value,f={Re:b,wt:a,Ft:[e,e,e,e],ew:d};return void 0!==c.color&&(f.R=c.color),f}function ca(a,b,c,d){let e=c.value,f={Re:b,wt:a,Ft:[e,e,e,e],ew:d};return void 0!==c.lineColor&&(f.vt=c.lineColor),void 0!==c.topColor&&(f.mr=c.topColor),void 0!==c.bottomColor&&(f.wr=c.bottomColor),f}function cb(a,b,c,d){let e=c.value,f={Re:b,wt:a,Ft:[e,e,e,e],ew:d};return void 0!==c.topLineColor&&(f.gr=c.topLineColor),void 0!==c.bottomLineColor&&(f.Mr=c.bottomLineColor),void 0!==c.topFillColor1&&(f.br=c.topFillColor1),void 0!==c.topFillColor2&&(f.Sr=c.topFillColor2),void 0!==c.bottomFillColor1&&(f.Cr=c.bottomFillColor1),void 0!==c.bottomFillColor2&&(f.yr=c.bottomFillColor2),f}function cc(a,b,c,d){let e={Re:b,wt:a,Ft:[c.open,c.high,c.low,c.close],ew:d};return void 0!==c.color&&(e.R=c.color),e}function cd(a,b,c,d){let e={Re:b,wt:a,Ft:[c.open,c.high,c.low,c.close],ew:d};return void 0!==c.color&&(e.R=c.color),void 0!==c.borderColor&&(e.Ht=c.borderColor),void 0!==c.wickColor&&(e.vr=c.wickColor),e}function ce(a,b,c,d,e){let f=D(e)(c),g=f[f.length-1],{time:h,color:i,...j}=c;return{Re:b,wt:a,Ft:[g,Math.max(...f),Math.min(...f),g],ew:d,se:j,R:i}}function cf(a){return void 0!==a.Ft}function cg(a,b){return void 0!==b.customValues&&(a.uw=b.customValues),a}function ch(a){return(b,c,d,e,f,g)=>{var h,i;return(h=d,(i=g)?i(h):b7(h))?cg({wt:b,Re:c,ew:e},d):cg(a(b,c,d,e,f),d)}}function ci(a){return({Candlestick:ch(cd),Bar:ch(cc),Area:ch(ca),Baseline:ch(cb),Histogram:ch(b9),Line:ch(b9),Custom:ch(ce)})[a]}function cj(a){return{Re:0,cw:new Map,Hh:a}}function ck(a,b){if(void 0!==a&&0!==a.length)return{dw:b.key(a[0].wt),fw:b.key(a[a.length-1].wt)}}function cl(a){let b;return a.forEach(a=>{void 0===b&&(b=a.ew)}),D(b)}function cm(a,b){a.Re=b,a.cw.forEach(a=>{a.Re=b})}function cn(a,b){return a.wt<b}function co(a,b){return b<a.wt}function cp(a,b,c){let d=b.Uh(),e=b.bi(),f=aB(a,d,cn),g=aC(a,e,co);if(!c)return{from:f,to:g};let h=f,i=g;return f>0&&f<a.length&&a[f].wt>=d&&(h=f-1),g>0&&g<a.length&&a[g-1].wt<=e&&(i=g+1),{from:h,to:i}}class cq{constructor(a,b,c){this.Bw=!0,this.Aw=!0,this.Ew=!0,this.zw=[],this.Lw=null,this.Jn=a,this.Qn=b,this.Ow=c}Pt(a){this.Bw=!0,"data"===a&&(this.Aw=!0),"options"===a&&(this.Ew=!0)}Tt(){return this.Jn.Vt()?(this.Nw(),null===this.Lw?null:this.Ww):null}Fw(){this.zw=this.zw.map(a=>({...a,...this.Jn.Rh().Dr(a.wt)}))}Hw(){this.Lw=null}Nw(){this.Aw&&(this.Uw(),this.Aw=!1),this.Ew&&(this.Fw(),this.Ew=!1),this.Bw&&(this.$w(),this.Bw=!1)}$w(){let a=this.Jn.Wt(),b=this.Qn.At();if(this.Hw(),b.Zi()||a.Zi())return;let c=b.ye();if(null===c||0===this.Jn.Ks().zr())return;let d=this.Jn.zt();null!==d&&(this.Lw=cp(this.zw,c,this.Ow),this.qw(a,b,d.Ft),this.Yw())}}class cr extends cq{constructor(a,b,c){super(a,b,!1),this.sh=c,this.Ww=new class{constructor(a,b){this.jw=a,this.Yi=b}nt(a,b,c){this.jw.draw(a,this.Yi,b,c)}}(this.sh.renderer(),b=>{let c=a.zt();return null===c?null:a.Wt().Nt(b,c.Ft)})}fa(a){return this.sh.priceValueBuilder(a)}va(a){return this.sh.isWhitespace(a)}Uw(){let a=this.Jn.Rh();this.zw=this.Jn.Ks().Hr().map(b=>({wt:b.Re,_t:NaN,...a.Dr(b.Re),Zw:b.se}))}qw(a,b){b.j_(this.zw,O(this.Lw))}Yw(){this.sh.update({bars:this.zw.map(cs),barSpacing:this.Qn.At().Q_(),visibleRange:this.Lw},this.Jn.N())}}function cs(a){return{x:a._t,time:a.wt,originalData:a.Zw,barColor:a.cr}}let ct={color:"#2196f3"},cu=(a,b,c)=>{let d=F(c);return new cr(a,b,d)};function cv(a){let b={value:a.Ft[3],time:a.ew};return void 0!==a.uw&&(b.customValues=a.uw),b}function cw(a){let b=cv(a);return void 0!==a.R&&(b.color=a.R),b}function cx(a){let b=cv(a);return void 0!==a.vt&&(b.lineColor=a.vt),void 0!==a.mr&&(b.topColor=a.mr),void 0!==a.wr&&(b.bottomColor=a.wr),b}function cy(a){let b=cv(a);return void 0!==a.gr&&(b.topLineColor=a.gr),void 0!==a.Mr&&(b.bottomLineColor=a.Mr),void 0!==a.br&&(b.topFillColor1=a.br),void 0!==a.Sr&&(b.topFillColor2=a.Sr),void 0!==a.Cr&&(b.bottomFillColor1=a.Cr),void 0!==a.yr&&(b.bottomFillColor2=a.yr),b}function cz(a){let b={open:a.Ft[0],high:a.Ft[1],low:a.Ft[2],close:a.Ft[3],time:a.ew};return void 0!==a.uw&&(b.customValues=a.uw),b}function cA(a){let b=cz(a);return void 0!==a.R&&(b.color=a.R),b}function cB(a){let b=cz(a),{R:c,Ht:d,vr:e}=a;return void 0!==c&&(b.color=c),void 0!==d&&(b.borderColor=d),void 0!==e&&(b.wickColor=e),b}function cC(a){return({Area:cx,Line:cw,Baseline:cy,Histogram:cw,Bar:cA,Candlestick:cB,Custom:cD})[a]}function cD(a){let b=a.ew;return{...a.se,time:b}}let cE={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroun
6dColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},cF={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},cG={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:P,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},cH={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},cI={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function cJ(){return{width:0,height:0,autoSize:!1,layout:cG,crosshair:cE,grid:cF,overlayPriceScales:{...cH},leftPriceScale:{...cH,visible:!1},rightPriceScale:{...cH,visible:!0},timeScale:cI,localization:{locale:bA?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class cK{constructor(a,b,c){this.bf=a,this.Kw=b,this.Xw=c??0}applyOptions(a){this.bf.Qt().$u(this.Kw,a,this.Xw)}options(){return this.Yi().N()}width(){return aj(this.Kw)?this.bf.Hm(this.Kw):0}Yi(){return E(this.bf.Qt().qu(this.Kw,this.Xw)).Wt}}class cL{constructor(a,b,c,d){this.bf=a,this.yt=c,this.Gw=b,this.Jw=d}getHeight(){return this.yt.$t()}setHeight(a){let b=this.bf.Qt(),c=b.Cc(this.yt);b.Xu(c,a)}paneIndex(){return this.bf.Qt().Cc(this.yt)}moveTo(a){let b=this.paneIndex();b!==a&&(C(a>=0&&a<this.bf.Sf().length,"Invalid pane index"),this.bf.Qt().Gu(b,a))}getSeries(){return this.yt.wo().map(a=>this.Gw(a))??[]}getHTMLElement(){return this.bf.Sf()[this.paneIndex()].Rf()}attachPrimitive(a){this.yt.ua(a),a.attached&&a.attached({chart:this.Jw,requestUpdate:()=>this.yt.Qt().Bh()})}detachPrimitive(a){this.yt.ca(a)}priceScale(a){if(null===this.yt.co(a))throw Error(`Cannot find price scale with id: ${a}`);return new cK(this.bf,a,this.paneIndex())}}let cM={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class cN{constructor(a){this.ir=a}applyOptions(a){this.ir.hr(a)}options(){return this.ir.N()}Qw(){return this.ir}}class cO{constructor(a,b,c,d,e,f){this.tg=new G,this.Jn=a,this.ig=b,this.sg=c,this.Yo=e,this.Jw=d,this.ng=f}m(){this.tg.m()}priceFormatter(){return this.Jn.ra()}priceToCoordinate(a){let b=this.Jn.zt();return null===b?null:this.Jn.Wt().Nt(a,b.Ft)}coordinateToPrice(a){let b=this.Jn.zt();return null===b?null:this.Jn.Wt().Ts(a,b.Ft)}barsInLogicalRange(a){if(null===a)return null;let b=new bl(new bj(a.from,a.to)).o_(),c=this.Jn.Ks();if(c.Zi())return null;let d=c.Wr(b.Uh(),1),e=c.Wr(b.bi(),-1),f=E(c.Lr()),g=E(c.Zs());if(null!==d&&null!==e&&d.Re>e.Re)return{barsBefore:a.from-f,barsAfter:g-a.to};let h={barsBefore:null===d||d.Re===f?a.from-f:d.Re-f,barsAfter:null===e||e.Re===g?g-a.to:g-e.Re};return null!==d&&null!==e&&(h.from=d.ew,h.to=e.ew),h}setData(a){this.Yo,this.Jn.Rr(),this.ig.eg(this.Jn,a),this.rg("full")}update(a,b=!1){this.Jn.Rr(),this.ig.hg(this.Jn,a,b),this.rg("update")}dataByIndex(a,b){let c=this.Jn.Ks().Wr(a,b);return null===c?null:cC(this.seriesType())(c)}data(){let a=cC(this.seriesType());return this.Jn.Ks().Hr().map(b=>a(b))}subscribeDataChanged(a){this.tg.i(a)}unsubscribeDataChanged(a){this.tg._(a)}applyOptions(a){this.Jn.hr(a)}options(){return M(this.Jn.N())}priceScale(){return this.sg.priceScale(this.Jn.Wt().wa(),this.getPane().paneIndex())}createPriceLine(a){let b=H(M(cM),a),c=this.Jn.Oh(b);return new cN(c)}
6removePriceLine(a){this.Jn.Nh(a.Qw())}priceLines(){return this.Jn.Wh().map(a=>new cN(a))}seriesType(){return this.Jn.Rr()}attachPrimitive(a){this.Jn.ua(a),a.attached&&a.attached({chart:this.Jw,series:this,requestUpdate:()=>this.Jn.Qt().Bh(),horzScaleBehavior:this.Yo})}detachPrimitive(a){this.Jn.ca(a),a.detached&&a.detached(),this.Jn.Qt().Bh()}getPane(){let a=this.Jn,b=E(this.Jn.Qt().Hn(a));return this.ng(b)}moveToPane(a){this.Jn.Qt().Mc(this.Jn,a)}rg(a){this.tg.v()&&this.tg.p(a)}}function cP(a){return function(a){if(L(a.handleScale)){let b=a.handleScale;a.handleScale={axisDoubleClickReset:{time:b,price:b},axisPressedMouseMove:{time:b,price:b},mouseWheel:b,pinch:b}}else if(void 0!==a.handleScale){let{axisPressedMouseMove:c,axisDoubleClickReset:d}=a.handleScale;L(c)&&(a.handleScale.axisPressedMouseMove={time:c,price:c}),L(d)&&(a.handleScale.axisDoubleClickReset={time:d,price:d})}let e=a.handleScroll;L(e)&&(a.handleScroll={horzTouchDrag:e,vertTouchDrag:e,mouseWheel:e,pressedMouseMove:e})}(a),a}class cQ{constructor(a,b,c){this.ug=new Map,this.cg=new Map,this.dg=new G,this.fg=new G,this.pg=new G,this.ku=new WeakMap,this.vg=new class{constructor(a){this.pw=new Map,this.mw=new Map,this.ww=new Map,this.gw=[],this.Yo=a}m(){this.pw.clear(),this.mw.clear(),this.ww.clear(),this.gw=[]}Mw(a,b){let c=0!==this.pw.size,d=!1,e=this.mw.get(a);if(void 0!==e){if(1===this.mw.size)c=!1,d=!0,this.pw.clear();else for(let f of this.gw)f.pointData.cw.delete(a)&&(d=!0)}let g=[];if(0!==b.length){let h=b.map(a=>a.time),i=this.Yo.createConverterToInternalObj(b),j=ci(a.Rr()),k=a.da(),l=a.pa();g=b.map((b,c)=>{let e=i(b.time),f=this.Yo.key(e),g=this.pw.get(f);void 0===g&&(g=cj(e),this.pw.set(f,g),d=!0);let m=j(e,g.Re,b,h[c],k,l);return g.cw.set(a,m),m})}c&&this.bw(),this.xw(a,g);let m=-1;if(d){let n=[];this.pw.forEach(a=>{n.push({timeWeight:0,time:a.Hh,pointData:a,originalTime:cl(a.cw)})}),n.sort((a,b)=>this.Yo.key(a.time)-this.Yo.key(b.time)),m=this.Sw(n)}return this.Cw(a,m,function(a,b,c){let d=ck(a,c),e=ck(b,c);if(void 0!==d&& void 0!==e)return{yw:!1,zh:d.fw>=e.fw&&d.dw>=e.dw}}(this.mw.get(a),e,this.Yo))}vc(a){return this.Mw(a,[])}Pw(a,b,c){var d;let e=b;void 0===(d=e).ew&&(d.ew=d.time),this.Yo.preprocessData(b);let f=this.Yo.createConverterToInternalObj([b])(b.time),g=this.ww.get(a);if(!c&& void 0!==g&&this.Yo.key(f)<this.Yo.key(g))throw Error(`Cannot update oldest data, last time=${g}, new time=${f}`);let h=this.pw.get(this.Yo.key(f));if(c&& void 0===h)throw Error("Cannot update non-existing data point when historicalUpdate is true");let i=void 0===h;void 0===h&&(h=cj(f),this.pw.set(this.Yo.key(f),h));let j=ci(a.Rr()),k=a.da(),l=a.pa(),m=j(f,h.Re,b,e.ew,k,l);h.cw.set(a,m),c?this.kw(a,m,h.Re):this.Tw(a,m);let n={zh:cf(m),yw:c};if(!i)return this.Cw(a,-1,n);let o={timeWeight:0,time:h.Hh,pointData:h,originalTime:cl(h.cw)},p=aB(this.gw,this.Yo.key(o.time),(a,b)=>this.Yo.key(a.time)<b);this.gw.splice(p,0,o);for(let q=p;q<this.gw.length;++q)cm(this.gw[q].pointData,q);return this.Yo.fillWeightsForPoints(this.gw,p),this.Cw(a,p,n)}Tw(a,b){let c=this.mw.get(a);void 0===c&&(c=[],this.mw.set(a,c));let d=0!==c.length?c[c.length-1]:null;null===d||this.Yo.key(b.wt)>this.Yo.key(d.wt)?cf(b)&&c.push(b):cf(b)?c[c.length-1]=b:c.splice(-1,1),this.ww.set(a,b.wt)}kw(a,b,c){let d=this.mw.get(a);if(void 0===d)return;let e=aB(d,c,(a,b)=>a.Re<b);cf(b)?d[e]=b:d.splice(e,1)}xw(a,b){0!==b.length?(this.mw.set(a,b.filter(cf)),this.ww.set(a,b[b.length-1].wt)):(this.mw.delete(a),this.ww.delete(a))}bw(){for(let a of this.gw)0===a.pointData.cw.size&&this.pw.delete(this.Yo.key(a.time))}Sw(a){let b=-1;for(let c=0;c<this.gw.length&&c<a.length;++c){let d=this.gw[c],e=a[c];if(this.Yo.key(d.time)!==this.Yo.key(e.time)){b=c;break}e.timeWeight=d.timeWeight,cm(e.pointData,c)}if(-1===b&&this.gw.length!==a.length&&(b=Math.min(this.gw.length,a.length)),-1===b)return -1;for(let f=b;f<a.length;++f)cm(a[f].pointData,f);return this.Yo.fillWeightsForPoints(a,b),this.gw=a,b}Rw(){if(0===this.mw.size)return null;let a=0;return this.mw.forEach(b=>{0!==b.length&&(a=Math.max(a,b[b.length-1].Re))}),a}Cw(a,b,c){let d={wo:new Map,At:{Y_:this.Rw()}};
6if(-1!==b)this.mw.forEach((b,e)=>{d.wo.set(e,{se:b,Dw:e===a?c:void 0})}),this.mw.has(a)||d.wo.set(a,{se:[],Dw:c}),d.At.Vw=this.gw,d.At.Iw=b;else{let e=this.mw.get(a);d.wo.set(a,{se:e||[],Dw:c})}return d}}(b);let d=void 0===c?M(cJ()):H(M(cJ()),cP(c));this.mg=b,this.bf=new class{constructor(a,b,c){var d;this.fm=[],this.pm=[],this.vm=0,this.ja=0,this.no=0,this.wm=0,this.gm=0,this.Mm=null,this.bm=!1,this.sv=new G,this.nv=new G,this.Vu=new G,this.xm=null,this.Sm=null,this.op=a,this.ys=b,this.Yo=c,this.hp=document.createElement("div"),this.hp.classList.add("tv-lightweight-charts"),this.hp.style.overflow="hidden",this.hp.style.direction="ltr",this.hp.style.width="100%",this.hp.style.height="100%",(d=this.hp).style.userSelect="none",d.style.webkitUserSelect="none",d.style.msUserSelect="none",d.style.MozUserSelect="none",d.style.webkitTapHighlightColor="transparent",this.Cm=document.createElement("table"),this.Cm.setAttribute("cellspacing","0"),this.hp.appendChild(this.Cm),this.ym=this.Pm.bind(this),b6(this.ys)&&this.km(!0),this.ts=new class{constructor(a,b,c){this.ku=[],this.Tu=[],this.no=0,this.Ru=null,this.Du=new G,this.Vu=new G,this.Iu=null,this.Bu=a,this.ys=b,this.Yo=c,this.cl=new class{constructor(a,b){this.q=new Map,this.Y=a,b&&(this.q=b)}j(a,b){if("transparent"===a)return a;let c=this.Z(a),d=c[3];return`rgba(${c[0]}, ${c[1]}, ${c[2]}, ${b*d})`}K(a){let b=this.Z(a);return{X:`rgb(${b[0]}, ${b[1]}, ${b[2]})`,G:S(b)>160?"black":"white"}}J(a){return S(this.Z(a))}tt(a,b,c){var d;let[e,f,g,h]=this.Z(a),[i,j,k,l]=this.Z(b),m=[R(e+c*(i-e)),R(f+c*(j-f)),R(g+c*(k-g)),(d=h+c*(l-h))<=0||d>1?Math.min(Math.max(d,0),1):Math.round(1e4*d)/1e4];return`rgba(${m[0]}, ${m[1]}, ${m[2]}, ${m[3]})`}Z(a){let b=this.q.get(a);if(b)return b;let c=function(a){let b=document.createElement("div");b.style.display="none",document.body.appendChild(b),b.style.color=a;let c=window.getComputedStyle(b).color;return document.body.removeChild(b),c}(a),d=c.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!d){if(this.Y.length)for(let e of this.Y){let f=e(a);if(f)return this.q.set(a,f),f}throw Error(`Failed to parse color: ${a}`)}let g=[parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),d[4]?parseFloat(d[4]):1];return this.q.set(a,g),g}}(this.ys.layout.colorParsers),this.Au=new class{constructor(a){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=a}N(){let a=this.M,b=this.W(),c=this.F();return a.P===b&&a.T===c||(a.P=b,a.T=c,a.k=Q(b,c),a.A=2.5/12*b,a.V=a.A,a.I=b/12*a.C,a.B=b/12*a.C,a.L=0),a.R=this.H(),a.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}W(){return this.O.N().layout.fontSize}F(){return this.O.N().layout.fontFamily}}(this),this.uh=new class{constructor(a,b,c,d){this.no=0,this.c_=null,this.d_=[],this.al=null,this.hl=null,this.f_=new class{constructor(){this.Jo=new Map,this.Dn=null,this.Qo=!1}t_(a){this.Qo=a,this.Dn=null}i_(a,b){this.s_(b),this.Dn=null;for(let c=b;c<a.length;++c){let d=a[c],e=this.Jo.get(d.timeWeight);void 0===e&&(e=[],this.Jo.set(d.timeWeight,e)),e.push({index:c,time:d.time,weight:d.timeWeight,originalTime:d.originalTime})}}n_(a,b,c,d,e){let f=Math.ceil(b/a);return null!==this.Dn&&this.Dn.e_===f&&e===this.Dn.r_&&c===this.Dn.h_||(this.Dn={r_:e,h_:c,Va:this.a_(f,c,d),e_:f}),this.Dn.Va}s_(a){if(0===a)return void this.Jo.clear();let b=[];for(let c of(this.Jo.forEach((c,d)=>{a<=c[0].index?b.push(d):c.splice(aB(c,a,b=>b.index<a),1/0)}),b))this.Jo.delete(c)}a_(a,b,c){let d=[],e=a=>!b||c.has(a.index);for(let f of Array.from(this.Jo.keys()).sort((a,b)=>b-a)){if(!this.Jo.get(f))continue;let g=d;d=[];let h=g.length,i=0,j=D(this.Jo.get(f)),k=j.length,l=1/0,m=-1/0;for(let n=0;n<k;n++){let o=j[n],p=o.index;for(;i<h;){let q=g[i],r=q.index;if(!(r<p&&e(q))){l=r;break}i++,d.push(q),m=r,l=1/0}if(l-p>=a&&p-m>=a&&e(o))d.push(o),m=p;else if(this.Qo)return g}for(;i<h;i++)e(g[i])&&d.push(g[i])}return d}},this.p_=new Map,this.v_=bl.u_(),this.m_=!0,this.w_=new G,this.g_=new G,this.M_=new G,this.b_=null,this.x_=null,this.S_=new Map,this.C_=-1,this.y_=[],this.ys=b,this.ul=c,this.P_=b.rightOffset,this.k_=b.barSpacing,this.ts=a,this.Yo=d,this.T_(),this.f_.t_(b.uniformDistribution),this.R_()}N(){return this.ys}D_(a){H(this.ul,a),this.V_(),this.T_()}hr(a,b){H(this.ys,a),this.ys.fixLeftEdge&&this.I_(),this.ys.fixRightEdge&&this.B_(),void 0!==a.barSpacing&&this.ts.dn(a.barSpacing),void 0!==a.rightOffset&&this.ts.fn(a.rightOffset),void 0===a.minBarSpacing&& void 0===a.maxBarSpacing||this.ts.dn(a.barSpacing??this.k_),void 0!==a.ignoreWhitespaceIndices&&a.ignoreWhitespaceIndices!==this.ys.ignoreWhitespaceIndices&&this.R_(),this.V_(),this.T_(),this.M_.p()}Rs(a){return this.d_[a]?.time??null}ss(a){return this.d_[a]??null}A_(a,b){if(this.d_.length<1)return null;if(this.Yo.key(a)>this.Yo.key(this.d_[this.d_.length-1].time))return b?this.d_.length-1:null;
6let c=aB(this.d_,this.Yo.key(a),(a,b)=>this.Yo.key(a.time)<b);return this.Yo.key(a)<this.Yo.key(this.d_[c].time)?b?c:null:c}Zi(){return 0===this.no||0===this.d_.length||null===this.c_}E_(){return this.d_.length>0}ye(){return this.z_(),this.v_.o_()}L_(){return this.z_(),this.v_.__()}O_(){let a=this.ye();if(null===a)return null;let b={from:a.Uh(),to:a.bi()};return this.N_(b)}N_(a){let b=Math.round(a.from),c=Math.round(a.to),d=E(this.W_()),e=E(this.F_());return{from:E(this.ss(Math.max(d,b))),to:E(this.ss(Math.min(e,c)))}}H_(a){return{from:E(this.A_(a.from,!0)),to:E(this.A_(a.to,!0))}}Qi(){return this.no}vo(a){if(!isFinite(a)||a<=0||this.no===a)return;let b=this.L_(),c=this.no;if(this.no=a,this.m_=!0,this.ys.lockVisibleTimeRangeOnResize&&0!==c){let d=this.k_*a/c;this.k_=d}if(this.ys.fixLeftEdge&&null!==b&&0>=b.Uh()){let e=c-a;this.P_-=Math.round(e/this.k_)+1,this.m_=!0}this.U_(),this.q_()}qt(a){if(this.Zi()||!J(a))return 0;let b=this.Y_()+this.P_-a;return this.no-(b+.5)*this.k_-1}j_(a,b){let c=this.Y_(),d=void 0===b?0:b.from,e=void 0===b?a.length:b.to;for(let f=d;f<e;f++){let g=a[f].wt,h=c+this.P_-g,i=this.no-(h+.5)*this.k_-1;a[f]._t=i}}Z_(a,b){let c=Math.ceil(this.K_(a));return b&&this.ys.ignoreWhitespaceIndices&&!this.X_(c)?this.G_(c):c}fn(a){this.m_=!0,this.P_=a,this.q_(),this.ts.J_(),this.ts.ar()}Q_(){return this.k_}dn(a){this.tu(a),this.q_(),this.ts.J_(),this.ts.ar()}iu(){return this.P_}Va(){if(this.Zi())return null;if(null!==this.x_)return this.x_;let a=this.k_,b=5*(this.ts.N().layout.fontSize+4)/8*(this.ys.tickMarkMaxCharacterLength||8),c=Math.round(b/a),d=E(this.ye()),e=Math.max(d.Uh(),d.Uh()-c),f=Math.max(d.bi(),d.bi()-c),g=this.f_.n_(a,b,this.ys.ignoreWhitespaceIndices,this.S_,this.C_),h=this.W_()+c,i=this.F_()-c,j=this.su(),k=this.ys.fixLeftEdge||j,l=this.ys.fixRightEdge||j,m=0;for(let n of g){if(!(e<=n.index&&n.index<=f))continue;let o;m<this.y_.length?((o=this.y_[m]).coord=this.qt(n.index),o.label=this.nu(n),o.weight=n.weight):(o={needAlignCoordinate:!1,coord:this.qt(n.index),label:this.nu(n),weight:n.weight},this.y_.push(o)),this.k_>b/2&&!j?o.needAlignCoordinate=!1:o.needAlignCoordinate=k&&n.index<=h||l&&n.index>=i,m++}return this.y_.length=m,this.x_=this.y_,this.y_}eu(){this.m_=!0,this.dn(this.ys.barSpacing),this.fn(this.ys.rightOffset)}ru(a){this.m_=!0,this.c_=a,this.q_(),this.I_()}hu(a,b){let c=this.K_(a),d=this.Q_();this.dn(d+b*(d/10)),this.ys.rightBarStaysOnScroll||this.fn(this.iu()+(c-this.K_(a)))}Ul(a){this.al&&this.Zl(),null===this.hl&&null===this.b_&&(this.Zi()||(this.hl=a,this.au()))}$l(a){if(null===this.b_)return;let b=a4(this.no-a,0,this.no),c=a4(this.no-E(this.hl),0,this.no);0!==b&&0!==c&&this.dn(this.b_.Q_*b/c)}ql(){null!==this.hl&&(this.hl=null,this.lu())}Yl(a){null===this.al&&null===this.b_&&(this.Zi()||(this.al=a,this.au()))}jl(a){if(null===this.al)return;let b=(this.al-a)/this.Q_();this.P_=E(this.b_).iu+b,this.m_=!0,this.q_()}Zl(){null!==this.al&&(this.al=null,this.lu())}ou(){this._u(this.ys.rightOffset)}_u(a,b=400){if(!isFinite(a))throw RangeError("offset is required and must be finite number");if(!isFinite(b)||b<=0)throw RangeError("animationDuration (optional) must be finite positive number");let c=this.P_,d=performance.now();this.ts._n({uu:a=>(a-d)/b>=1,cu:e=>{let f=(e-d)/b;return f>=1?a:c+(a-c)*f}})}Pt(a,b){this.m_=!0,this.d_=a,this.f_.i_(a,b),this.q_()}du(){return this.w_}fu(){return this.g_}pu(){return this.M_}Y_(){return this.c_||0}vu(a){let b=a.Go();this.tu(this.no/b),this.P_=a.bi()-this.Y_(),this.q_(),this.m_=!0,this.ts.J_(),this.ts.ar()}mu(){let a=this.W_(),b=this.F_();null!==a&&null!==b&&this.vu(new bj(a,b+this.ys.rightOffset))}wu(a){let b=new bj(a.from,a.to);this.vu(b)}ns(a){return void 0!==this.ul.timeFormatter?this.ul.timeFormatter(a.originalTime):this.Yo.formatHorzItem(a.time)}R_(){if(!this.ys.ignoreWhitespaceIndices)return;this.S_.clear();let a=this.ts.js();for(let b of a)for(let c of b.ma())this.S_.set(c,!0);this.C_++}su(){let a=this.ts.N().handleScroll,b=this.ts.N().handleScale;return!(a.horzTouchDrag||a.mouseWheel||a.pressedMouseMove||a.vertTouchDrag||b.axisDoubleClickReset.time||b.axisPressedMouseMove.time||b.mouseWheel||b.pinch)}W_(){return 0===this.d_.length?null:0}F_(){return 0===this.d_.length?null:this.d_.length-1}gu(a){return(this.no-1-a)/this.k_}K_(a){let b=this.gu(a),c=this.Y_()+this.P_-b;return Math.round(1e6*c)/1e6}tu(a){let b=this.k_;this.k_=a,this.U_(),b!==this.k_&&(this.m_=!0,this.Mu())}z_(){if(!this.m_)return;if(this.m_=!1,this.Zi())return void this.bu(bl.u_());let a=this.Y_(),b=this.no/this.k_,c=this.P_+a,d=new bj(c-b+1,c);this.bu(new bl(d))}U_(){let a=a4(this.k_,this.xu(),this.Su());this.k_!==a&&(this.k_=a,this.m_=!0)}Su(){return this.ys.maxBarSpacing>0?this.ys.maxBarSpacing:.5*this.no}xu(){return this.ys.fixLeftEdge&&this.ys.fixRightEdge&&0!==this.d_.length?this.no/this.d_.length:this.ys.minBarSpacing}q_(){let a=this.Cu();null!==a&&this.P_<a&&(this.P_=a,this.m_=!0);let b=this.yu();this.P_>b&&(this.P_=b,this.m_=!0)}Cu(){let a=this.W_(),b=this.c_;return null===a||null===b?null:a-b-1+(this.ys.fixLeftEdge?this.no/this.k_:Math.min(2,this.d_.length))}yu(){return this.ys.fixRightEdge?0:this.no/this.k_-Math.min(2,this.d_.length)}au(){this.b_={Q_:this.Q_(),iu:this.iu()}}lu(){this.b_=null}nu(a){let b=this.p_.get(a.weight);
6return void 0===b&&(b=new bi(a=>this.Pu(a),this.Yo),this.p_.set(a.weight,b)),b.jo(a)}Pu(a){return this.Yo.formatTickmark(a,this.ul)}bu(a){let b=this.v_;this.v_=a,bk(b.o_(),this.v_.o_())||this.w_.p(),bk(b.__(),this.v_.__())||this.g_.p(),this.Mu()}Mu(){this.x_=null}V_(){this.Mu(),this.p_.clear()}T_(){this.Yo.updateFormatter(this.ul)}I_(){if(!this.ys.fixLeftEdge)return;let a=this.W_();if(null===a)return;let b=this.ye();if(null===b)return;let c=b.Uh()-a;if(c<0){let d=this.P_-c-1;this.fn(d)}this.U_()}B_(){this.q_(),this.U_()}X_(a){return!this.ys.ignoreWhitespaceIndices||this.S_.get(a)||!1}G_(a){let b=function*(a){let b=Math.round(a),c=b<a,d=1;for(;;)c?(yield b+d,yield b-d):(yield b-d,yield b+d),d++}(a),c=this.F_();for(;c;){let d=b.next().value;if(this.S_.get(d))return d;if(d<0||d>c)break}return a}}(this,b.timeScale,this.ys.localization,c),this.Ct=new class extends ai{constructor(a,b){var c,d,e,f;super(),this.yt=null,this.ds=NaN,this.fs=0,this.ps=!1,this.vs=new Map,this.ws=!1,this.gs=new WeakMap,this.Ms=new WeakMap,this.bs=NaN,this.xs=NaN,this.Ss=NaN,this.Cs=NaN,this.ts=a,this.ys=b,this.Ps=(c=()=>this.ds,d=()=>this.xs,a=>{let b=d(),e=c();if(a===E(this.yt).ks())return{gt:e,Bi:b};{let f=E(a.zt());return{gt:a.Ts(b,f),Bi:b}}});let g=(e=()=>this.fs,f=()=>this.si(),()=>{let a=this.ts.At().Rs(e()),b=f();return a&&Number.isFinite(b)?{wt:a,Bi:b}:null});this.Ds=new class{constructor(a,b,c){this.St=!0,this.Gt=new ah,this.Xt={Vt:!1,X:"#4c525e",R:"white",ri:"",Qi:0,Bi:NaN,pi:!0},this.Ct=a,this.ts=b,this.ji=c}Pt(){this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Gt.ht(this.Xt),this.Gt}Rt(){let a=this.Xt;if(a.Vt=!1,2===this.Ct.N().mode)return;let b=this.Ct.N().vertLine;if(!b.labelVisible)return;let c=this.ts.At();if(c.Zi())return;a.Qi=c.Qi();let d=this.ji();if(null===d)return;a.Bi=d.Bi;let e=c.ss(this.Ct.Bt());a.ri=c.ns(E(e)),a.Vt=!0;let f=this.ts.Ki().K(b.labelBackgroundColor);a.X=f.X,a.R=f.G,a.pi=c.N().ticksVisible}}(this,a,g)}N(){return this.ys}Vs(a,b){this.Ss=a,this.Cs=b}Is(){this.Ss=NaN,this.Cs=NaN}Bs(){return this.Ss}As(){return this.Cs}Es(a,b,c){this.ws||(this.ws=!0),this.ps=!0,this.zs(a,b,c)}Bt(){return this.fs}si(){return this.bs}ni(){return this.xs}Vt(){return this.ps}Ls(){this.ps=!1,this.Os(),this.ds=NaN,this.bs=NaN,this.xs=NaN,this.yt=null,this.Is(),this.Ns()}Ws(a){let b=this.gs.get(a);b||(b=new Z(this,a),this.gs.set(a,b));let c=this.Ms.get(a);return c||(c=new Y(this.ts,this,a),this.Ms.set(a,c)),[b,c]}ti(a){return a===this.yt&&this.ys.horzLine.visible}ii(){return this.ys.vertLine.visible}Fs(a,b){this.ps&&this.yt===a||this.vs.clear();let c=[];return this.yt===a&&c.push(this.Hs(this.vs,b,this.Ps)),c}cs(){return this.ps?[this.Ds]:[]}Us(){return this.yt}Ns(){this.ts.$s().forEach(a=>{this.gs.get(a)?.Pt(),this.Ms.get(a)?.Pt()}),this.vs.forEach(a=>a.Pt()),this.Ds.Pt()}qs(a){return a&&!a.ks().Zi()?a.ks():null}zs(a,b,c){this.Ys(a,b,c)&&this.Ns()}Ys(a,b,c){let d=this.bs,e=this.xs,f=this.ds,g=this.fs,h=this.yt,i=this.qs(c);this.fs=a,this.bs=isNaN(a)?NaN:this.ts.At().qt(a),this.yt=c;let j=null!==i?i.zt():null;return null!==i&&null!==j?(this.ds=b,this.xs=i.Nt(b,j)):(this.ds=NaN,this.xs=NaN),d!==this.bs||e!==this.xs||g!==this.fs||f!==this.ds||h!==this.yt}Os(){let a=this.ts.js().map(a=>a.Ks().Zs()).filter(N),b=0===a.length?null:Math.max(...a);this.fs=null!==b?b:NaN}Hs(a,b,c){let d=a.get(b);return void 0===d&&(d=new af(this,b,c),a.set(b,d)),d}}(this,b.crosshair),this.Eu=new class{constructor(a){this.ys=a}Ma(a,b,c){let d=a;if(0===this.ys.mode)return d;let e=c.ks(),f=e.zt();if(null===f)return d;let g=e.Nt(a,f),h=c.ba().filter(a=>a instanceof aT).reduce((a,d)=>{if(c.Un(d)||!d.Vt())return a;let e=d.Wt(),f=d.Ks();if(e.Zi()||!f.Te(b))return a;let g=f.kr(b);if(null===g)return a;let h=F(d.zt()),i=3===this.ys.mode?aV:aU;return a.concat(i.map(a=>e.Nt(g.Ft[a],h.Ft)))},[]);if(0===h.length)return d;h.sort((a,b)=>Math.abs(a-g)-Math.abs(b-g));let i=h[0];return e.Ts(i,f)}}(b.crosshair),this.zu(0),this.ku[0].po(2e3),this.Lu=this.Ou(0),this.Nu=this.Ou(1)}Bh(){this.Wu(ak.gn())}ar(){this.Wu(ak.wn())}Xh(){this.Wu(new ak(1))}Ah(a){let b=this.Fu(a);this.Wu(b)}Hu(){return this.Ru}Uu(a){if(this.Ru?.Wo===a?.Wo&&this.Ru?.Fo?.Zn===a?.Fo?.Zn)return;let b=this.Ru;this.Ru=a,null!==b&&this.Ah(b.Wo),null!==a&&a.Wo!==b?.Wo&&this.Ah(a.Wo)}N(){return this.ys}hr(a){H(this.ys,a),this.ku.forEach(b=>b.uo(a)),void 0!==a.timeScale&&this.uh.hr(a.timeScale),void 0!==a.localization&&this.uh.D_(a.localization),(a.leftPriceScale||a.rightPriceScale)&&this.Du.p(),this.Lu=this.Ou(0),this.Nu=this.Ou(1),this.Bh()}$u(a,b,c=0){let d=this.ku[c];if(void 0===d)return;if("left"===a)return H(this.ys,{leftPriceScale:b}),d.uo({leftPriceScale:b}),this.Du.p(),void this.Bh();if("right"===a)return H(this.ys,{rightPriceScale:b}),d.uo({rightPriceScale:b}),this.Du.p(),void this.Bh();let e=this.qu(a,c);null!==e&&(e.Wt.hr(b),this.Du.p())}qu(a,b){let c=this.ku[b];if(void 0===c)return null;let d=c.co(a);return null!==d?{Us:c,Wt:d}:null}At(){return this.uh}$s(){return this.ku}Yu(){return this.Ct}ju(){return this.Vu}Zu(a,b){a.Cl(b),this.J_()}vo(a){this.no=a,this.uh.vo(this.no),this.ku.forEach(b=>b.vo(a)),this.J_()}
6Ku(a){1!==this.ku.length&&(C(a>=0&&a<this.ku.length,"Invalid pane index"),this.ku.splice(a,1),this.Bh())}Xu(a,b){if(this.ku.length<2)return;C(a>=0&&a<this.ku.length,"Invalid pane index");let c=this.ku[a],d=this.ku.reduce((a,b)=>a+b.fo(),0),e=this.ku.reduce((a,b)=>a+b.$t(),0),f=e-30*(this.ku.length-1);b=Math.min(f,Math.max(30,b));let g=d/e,h=c.$t();c.po(b*g);let i=b-h,j=this.ku.length-1;for(let k of this.ku)if(k!==c){let l=Math.min(f,Math.max(30,k.$t()-i/j));i-=k.$t()-l,j-=1;let m=l*g;k.po(m)}this.Bh()}Gu(a,b){C(a>=0&&a<this.ku.length&&b>=0&&b<this.ku.length,"Invalid pane index");let c=this.ku[a],d=this.ku[b];this.ku[a]=d,this.ku[b]=c,this.Bh()}Po(a,b,c){a.Po(b,c)}ko(a,b,c){a.ko(b,c),this.Eh(),this.Wu(this.Ju(a,2))}To(a,b){a.To(b),this.Wu(this.Ju(a,2))}Ro(a,b,c){b.wl()||a.Ro(b,c)}Do(a,b,c){b.wl()||(a.Do(b,c),this.Eh(),this.Wu(this.Ju(a,2)))}Vo(a,b){b.wl()||(a.Vo(b),this.Wu(this.Ju(a,2)))}Bo(a,b){a.Bo(b),this.Wu(this.Ju(a,2))}Qu(a){this.uh.Ul(a)}tc(a,b){let c=this.At();if(c.Zi()||0===b)return;let d=c.Qi();a=Math.max(1,Math.min(a,d)),c.hu(a,b),this.J_()}sc(a){this.nc(0),this.ec(a),this.rc()}hc(a){this.uh.$l(a),this.J_()}ac(){this.uh.ql(),this.ar()}nc(a){this.uh.Yl(a)}ec(a){this.uh.jl(a),this.J_()}rc(){this.uh.Zl(),this.ar()}js(){return this.Tu}lc(a,b,c,d,e){this.Ct.Vs(a,b);let f=NaN,g=this.uh.Z_(a,!0),h=this.uh.ye();null!==h&&(g=Math.min(Math.max(h.Uh(),g),h.bi()));let i=d.ks(),j=i.zt();if(null!==j&&(f=i.Ts(b,j)),f=this.Eu.Ma(f,g,d),this.Ct.Es(g,f,d),this.Xh(),!e){let k=bh(d,a,b);this.Uu(k&&{Wo:k.Wo,Fo:k.Fo,Uo:k.Uo||null}),this.Vu.p(this.Ct.Bt(),{x:a,y:b},c)}}oc(a,b,c){let d=c.ks(),e=d.zt(),f=d.Nt(a,E(e)),g=this.uh.A_(b,!0),h=this.uh.qt(E(g));this.lc(h,f,null,c,!0)}_c(a){this.Yu().Ls(),this.Xh(),a||this.Vu.p(null,null,null)}Eh(){let a=this.Ct.Us();if(null!==a){let b=this.Ct.Bs(),c=this.Ct.As();this.lc(b,c,null,a)}this.Ct.Ns()}uc(a,b,c){let d=this.uh.Rs(0);void 0!==b&& void 0!==c&&this.uh.Pt(b,c);let e=this.uh.Rs(0),f=this.uh.Y_(),g=this.uh.ye();if(null!==g&&null!==d&&null!==e){let h=g.Te(f),i=this.Yo.key(d)>this.Yo.key(e),j=null!==a&&a>f&&!i,k=this.uh.N().allowShiftVisibleRangeOnWhitespaceReplacement,l=h&&(void 0!==c||k)&&this.uh.N().shiftVisibleRangeOnNewBar;if(j&&!l){let m=a-f;this.uh.fn(this.uh.iu()-m)}}this.uh.ru(a)}Lh(a){null!==a&&a.Eo()}Hn(a){var b;if((b=a)instanceof bd)return a;let c=this.ku.find(b=>b.Dt().includes(a));return void 0===c?null:c}J_(){this.ku.forEach(a=>a.Eo()),this.Eh()}m(){this.ku.forEach(a=>a.m()),this.ku.length=0,this.ys.localization.priceFormatter=void 0,this.ys.localization.percentageFormatter=void 0,this.ys.localization.timeFormatter=void 0}cc(){return this.Au}Yn(){return this.Au.N()}do(){return this.Du}dc(a,b){let c=this.zu(b);this.fc(a,c),this.Tu.push(a),1===this.Tu.length?this.Bh():this.ar()}vc(a){let b=this.Hn(a),c=this.Tu.indexOf(a);C(-1!==c,"Series not found");let d=E(b);this.Tu.splice(c,1),d.Wl(a),a.m&&a.m(),this.uh.R_(),this.mc(d)}Ih(a,b){let c=E(this.Hn(a));c.Wl(a),c.Ol(a,b,E(a.hs()))}mu(){let a=ak.wn();a.rn(),this.Wu(a)}wc(a){let b=ak.wn();b.ln(a),this.Wu(b)}cn(){let a=ak.wn();a.cn(),this.Wu(a)}dn(a){let b=ak.wn();b.dn(a),this.Wu(b)}fn(a){let b=ak.wn();b.fn(a),this.Wu(b)}_n(a){let b=ak.wn();b._n(a),this.Wu(b)}hn(){let a=ak.wn();a.hn(),this.Wu(a)}gc(){return this.ys.rightPriceScale.visible?"right":"left"}Mc(a,b){if(C(b>=0,"Index should be greater or equal to 0"),b===this.bc(a))return;let c=E(this.Hn(a));c.Wl(a);let d=this.zu(b);this.fc(a,d),0===c.ba().length&&this.mc(c)}xc(){return this.Nu}$(){return this.Lu}Ut(a){let b=this.Nu,c=this.Lu;if(b===c)return b;if(a=Math.max(0,Math.min(100,Math.round(100*a))),null===this.Iu||this.Iu.mr!==c||this.Iu.wr!==b)this.Iu={mr:c,wr:b,Sc:new Map};else{let d=this.Iu.Sc.get(a);if(void 0!==d)return d}let e=this.cl.tt(c,b,a/100);return this.Iu.Sc.set(a,e),e}Cc(a){return this.ku.indexOf(a)}Ki(){return this.cl}zu(a){if(C(a>=0,"Index should be greater or equal to 0"),(a=Math.min(this.ku.length,a))<this.ku.length)return this.ku[a];let b=new bd(this.uh,this);this.ku.push(b);let c=ak.gn();return c.Qs(a,{tn:0,sn:!0}),this.Wu(c),b}bc(a){return this.ku.findIndex(b=>b.wo().includes(a))}Ju(a,b){let c=new ak(b);if(null!==a){let d=this.ku.indexOf(a);c.Qs(d,{tn:b})}return c}Fu(a,b){return void 0===b&&(b=2),this.Ju(this.Hn(a),b)}Wu(a){this.Bu&&this.Bu(a),this.ku.forEach(a=>a.Lo().lr().Pt())}fc(a,b){let c=a.N().priceScaleId,d=void 0!==c?c:this.gc();
6b.Ol(a,d),aj(d)||a.hr(a.N())}Ou(a){let b=this.ys.layout;return"gradient"===b.background.type?0===a?b.background.topColor:b.background.bottomColor:b.background.color}mc(a){0===a.ba().length&&this.ku.length>1&&(this.ku.splice(this.Cc(a),1),this.Bh())}}(this.Bu.bind(this),this.ys,c),this.Qt().ju().i(this.Tm.bind(this),this),this.Rm=new class{constructor(a,b){this.Yv=null,this.jv=null,this.M=null,this.Zv=!1,this.mp=(0,y.dp)({width:0,height:0}),this.Kv=new G,this.gp=new aq(5),this.xp=!1,this.Sp=()=>{this.xp||this._p.Qt().ar()},this.yp=()=>{this.xp||this._p.Qt().ar()},this._p=a,this.Yo=b,this.ys=a.N().layout,this.hp=document.createElement("tr"),this.Xv=document.createElement("td"),this.Xv.style.padding="0",this.Gv=document.createElement("td"),this.Gv.style.padding="0",this.Pf=document.createElement("td"),this.Pf.style.height="25px",this.Pf.style.padding="0",this.Jv=document.createElement("div"),this.Jv.style.width="100%",this.Jv.style.height="100%",this.Jv.style.position="relative",this.Jv.style.overflow="hidden",this.Pf.appendChild(this.Jv),this.Dp=bP(this.Jv,(0,y.dp)({width:16,height:16})),this.Dp.subscribeSuggestedBitmapSizeChanged(this.Sp);let c=this.Dp.canvasElement;c.style.position="absolute",c.style.zIndex="1",c.style.left="0",c.style.top="0",this.Vp=bP(this.Jv,(0,y.dp)({width:16,height:16})),this.Vp.subscribeSuggestedBitmapSizeChanged(this.yp);let d=this.Vp.canvasElement;d.style.position="absolute",d.style.zIndex="2",d.style.left="0",d.style.top="0",this.hp.appendChild(this.Xv),this.hp.appendChild(this.Pf),this.hp.appendChild(this.Gv),this.Qv(),this._p.Qt().do().i(this.Qv.bind(this),this),this.wf=new bE(this.Vp.canvasElement,this,{Wd:()=>!0,Fd:()=>!this._p.N().handleScroll.horzTouchDrag})}m(){this.wf.m(),null!==this.Yv&&this.Yv.m(),null!==this.jv&&this.jv.m(),this.Vp.unsubscribeSuggestedBitmapSizeChanged(this.yp),bQ(this.Vp.canvasElement),this.Vp.dispose(),this.Dp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),bQ(this.Dp.canvasElement),this.Dp.dispose()}Rf(){return this.hp}tm(){return this.Yv}im(){return this.jv}tf(a){if(this.Zv)return;this.Zv=!0;let b=this._p.Qt();!b.At().Zi()&&this._p.N().handleScale.axisPressedMouseMove.time&&b.Qu(a.localX)}Jd(a){this.tf(a)}if(){let a=this._p.Qt();!a.At().Zi()&&this.Zv&&(this.Zv=!1,this._p.N().handleScale.axisPressedMouseMove.time&&a.ac())}$d(a){let b=this._p.Qt();!b.At().Zi()&&this._p.N().handleScale.axisPressedMouseMove.time&&b.hc(a.localX)}Hd(a){this.$d(a)}Zd(){this.Zv=!1;let a=this._p.Qt();a.At().Zi()&&!this._p.N().handleScale.axisPressedMouseMove.time||a.ac()}Yd(){this.Zd()}Td(){this._p.N().handleScale.axisDoubleClickReset.time&&this._p.Qt().cn()}Cd(){this.Td()}Ed(){this._p.Qt().N().handleScale.axisPressedMouseMove.time&&this.Kp(1)}uf(){this.Kp(0)}Df(){return this.mp}sm(){return this.Kv}nm(a,b,c){(0,y.J$)(this.mp,a)||(this.mp=a,this.xp=!0,this.Dp.resizeCanvasElement(a),this.Vp.resizeCanvasElement(a),this.xp=!1,this.Pf.style.width=`${a.width}px`,this.Pf.style.height=`${a.height}px`,this.Kv.p(a)),null!==this.Yv&&this.Yv.Np((0,y.dp)({width:b,height:a.height})),null!==this.jv&&this.jv.Np((0,y.dp)({width:c,height:a.height}))}rm(){let a=this.hm();return Math.ceil(a.S+a.C+a.P+a.A+a.V+a.am)}Pt(){this._p.Qt().At().Va()}Vf(){return this.Dp.bitmapSize}If(a,b,c){let d=this.Vf();d.width>0&&d.height>0&&a.drawImage(this.Dp.canvasElement,b,c)}Fp(a){if(0===a)return;let b={colorSpace:this.ys.colorSpace};if(1!==a){this.Dp.applySuggestedBitmapSize();let c=(0,y.sE)(this.Dp,b);null!==c&&(c.useBitmapCoordinateSpace(a=>{this.Up(a),this.$p(a),this.lm(c,b4)}),this.Yp(c),this.lm(c,b2)),null!==this.Yv&&this.Yv.Fp(a),null!==this.jv&&this.jv.Fp(a)}this.Vp.applySuggestedBitmapSize();let d=(0,y.sE)(this.Vp,b);null!==d&&(d.useBitmapCoordinateSpace(({context:a,bitmapSize:b})=>{a.clearRect(0,0,b.width,b.height)}),this.om([...this._p.Qt().js(),this._p.Qt().Yu()],d),this.lm(d,b3))}lm(a,b){let c=this._p.Qt().js();for(let d of c)bT(b,b=>bR(b,a,!1,void 0),d,void 0);for(let e of c)bT(b,b=>bS(b,a,!1,void 0),e,void 0)}Up({context:a,bitmapSize:b}){_(a,0,0,b.width,b.height,this._p.Qt().xc())}$p({context:a,bitmapSize:b,verticalPixelRatio:c}){if(this._p.N().timeScale.borderVisible){a.fillStyle=this._m();let d=Math.max(1,Math.floor(this.hm().S*c));a.fillRect(0,0,b.width,d)}}Yp(a){let b=this._p.Qt().At(),c=b.Va();if(!c||0===c.length)return;let d=this.Yo.maxTickMarkWeight(c),e=this.hm(),f=b.N();f.borderVisible&&f.ticksVisible&&a.useBitmapCoordinateSpace(({context:a,horizontalPixelRatio:b,verticalPixelRatio:d})=>{a.strokeStyle=this._m(),a.fillStyle=this._m();let f=Math.max(1,Math.floor(b)),g=Math.floor(.5*b);a.beginPath();let h=Math.round(e.C*d);for(let i=c.length;i--;){let j=Math.round(c[i].coord*b);a.rect(j-g,0,f,h)}a.fill()}),a.useMediaCoordinateSpace(({context:a})=>{let b=e.S+e.C+e.A+e.P/2;for(let f of(a.textAlign="center",a.textBaseline="middle",a.fillStyle=this.H(),a.font=this.Lp(),c))if(f.weight<d){let g=f.needAlignCoordinate?this.um(a,f.coord,f.label):f.coord;a.fillText(f.label,g,b)}for(let h of(this._p.N().timeScale.allowBoldLabels&&(a.font=this.dm()),c))if(h.weight>=d){let i=h.needAlignCoordinate?this.um(a,h.coord,h.label):h.coord;a.fillText(h.label,i,b)}})}
6um(a,b,c){let d=this.gp.Vi(a,c),e=d/2,f=Math.floor(b-e)+.5;return f<0?b+=Math.abs(0-f):f+d>this.mp.width&&(b-=Math.abs(this.mp.width-(f+d))),b}om(a,b){let c=this.hm();for(let d of a)for(let e of d.cs())e.Tt().nt(b,c)}_m(){return this._p.N().timeScale.borderColor}H(){return this.ys.textColor}W(){return this.ys.fontSize}Lp(){return Q(this.W(),this.ys.fontFamily)}dm(){return Q(this.W(),this.ys.fontFamily,"bold")}hm(){null===this.M&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Gi:new aq,am:0});let a=this.M,b=this.Lp();if(a.k!==b){let c=this.W();a.P=c,a.k=b,a.A=3*c/12,a.V=3*c/12,a.Ji=9*c/12,a.L=0,a.am=4*c/12,a.Gi.In()}return this.M}Kp(a){this.Pf.style.cursor=1===a?"ew-resize":"default"}Qv(){let a=this._p.Qt(),b=a.N();b.leftPriceScale.visible||null===this.Yv||(this.Xv.removeChild(this.Yv.Rf()),this.Yv.m(),this.Yv=null),b.rightPriceScale.visible||null===this.jv||(this.Gv.removeChild(this.jv.Rf()),this.jv.m(),this.jv=null);let c={cc:this._p.Qt().cc()},d=()=>a.xc();b.leftPriceScale.visible&&null===this.Yv&&(this.Yv=new b0("left",b,c,()=>b.leftPriceScale.borderVisible&&a.At().N().borderVisible,d),this.Xv.appendChild(this.Yv.Rf())),b.rightPriceScale.visible&&null===this.jv&&(this.jv=new b0("right",b,c,()=>b.leftPriceScale.borderVisible&&a.At().N().borderVisible,d),this.Gv.appendChild(this.jv.Rf()))}}(this,this.Yo),this.Cm.appendChild(this.Rm.Rf());let e=b.autoSize&&this.Dm(),f=this.ys.width,g=this.ys.height;if(e||0===f||0===g){let h=a.getBoundingClientRect();f=f||h.width,g=g||h.height}this.Vm(f,g),this.Im(),a.appendChild(this.hp),this.Bm(),this.ts.At().pu().i(this.ts.Bh.bind(this.ts),this),this.ts.do().i(this.ts.Bh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.ys}Sf(){return this.fm}Am(){return this.Rm}m(){for(let a of(this.km(!1),0!==this.vm&&window.cancelAnimationFrame(this.vm),this.ts.ju().u(this),this.ts.At().pu().u(this),this.ts.do().u(this),this.ts.m(),this.fm))this.Cm.removeChild(a.Rf()),a.Tv().u(this),a.Rv().u(this),a.m();for(let b of(this.fm=[],this.pm))this.Em(b);this.pm=[],E(this.Rm).m(),null!==this.hp.parentElement&&this.hp.parentElement.removeChild(this.hp),this.Vu.m(),this.sv.m(),this.nv.m(),this.zm()}Vm(a,b,c=!1){if(this.ja===b&&this.no===a)return;let d=function(a){let b=Math.floor(a.width),c=Math.floor(a.height);return(0,y.dp)({width:b-b%2,height:c-c%2})}((0,y.dp)({width:a,height:b}));this.ja=d.height,this.no=d.width;let e=this.ja+"px",f=this.no+"px";E(this.hp).style.height=e,E(this.hp).style.width=f,this.Cm.style.height=e,this.Cm.style.width=f,c?this.Lm(ak.gn(),performance.now()):this.ts.Bh()}Fp(a){void 0===a&&(a=ak.gn());for(let b=0;b<this.fm.length;b++)this.fm[b].Fp(a.en(b).tn);this.ys.timeScale.visible&&this.Rm.Fp(a.nn())}hr(a){let b=b6(this.ys);this.ts.hr(a);let c=b6(this.ys);c!==b&&this.km(c),a.layout?.panes&&this.Om(),this.Bm(),this.Nm(a)}Tv(){return this.sv}Rv(){return this.nv}ju(){return this.Vu}Wm(){null!==this.Mm&&(this.Lm(this.Mm,performance.now()),this.Mm=null);let a=this.Fm(null),b=document.createElement("canvas");b.width=a.width,b.height=a.height;let c=E(b.getContext("2d"));return this.Fm(c),b}Hm(a){return("left"!==a||this.Um())&&("right"!==a||this.$m())&&0!==this.fm.length?E("left"===a?this.fm[0].zv():this.fm[0].Lv()).Wp():0}qm(){return this.ys.autoSize&&null!==this.xm}Af(){return this.hp}Ym(a){this.Sm=a,this.Sm?this.Af().style.setProperty("cursor",a):this.Af().style.removeProperty("cursor")}jm(){return this.Sm}Zm(a){return D(this.fm[a]).Df()}Om(){this.pm.forEach(a=>{a.Pt()})}Nm(a){(void 0!==a.autoSize||!this.xm|| void 0===a.width&& void 0===a.height)&&(a.autoSize&&!this.xm&&this.Dm(),!1===a.autoSize&&null!==this.xm&&this.zm(),a.autoSize|| void 0===a.width&& void 0===a.height||this.Vm(a.width||this.no,a.height||this.ja))}Fm(a){let b=0,c=0,d=this.fm[0],e=(b,c)=>{let d=0;for(let e=0;e<this.fm.length;e++){let f=this.fm[e],g=E("left"===b?f.zv():f.Lv()),h=g.Vf();if(null!==a&&g.If(a,c,d),d+=h.height,e<this.fm.length-1){let i=this.pm[e],j=i.Vf();null!==a&&i.If(a,c,d),d+=j.height}}};this.Um()&&(e("left",0),b+=E(d.zv()).Vf().width);for(let f=0;f<this.fm.length;f++){let g=this.fm[f],h=g.Vf();if(null!==a&&g.If(a,b,c),c+=h.height,f<this.fm.length-1){let i=this.pm[f],j=i.Vf();null!==a&&i.If(a,b,c),c+=j.height}}b+=d.Vf().width,this.$m()&&(e("right",b),b+=E(d.Lv()).Vf().width);let k=(b,c,d)=>{E("left"===b?this.Rm.tm():this.Rm.im()).If(E(a),c,d)};if(this.ys.timeScale.visible){let l=this.Rm.Vf();if(null!==a){let m=0;this.Um()&&(k("left",m,c),m=E(d.zv()).Vf().width),this.Rm.If(a,m,c),m+=l.width,this.$m()&&k("right",m,c)}c+=l.height}return(0,y.dp)({width:b,height:c})}Km(){var a;let b=0,c=0,d=0;for(let e of this.fm)this.Um()&&(c=Math.max(c,E(e.zv()).zp(),this.ys.leftPriceScale.minimumWidth)),this.$m()&&(d=Math.max(d,E(e.Lv()).zp(),this.ys.rightPriceScale.minimumWidth)),b+=e.fo();c=bD(c),d=bD(d);let f=this.no,g=this.ja,h=Math.max(f-c-d,0),i=1*this.pm.length,j=this.ys.timeScale.visible,k=j?Math.max(this.Rm.rm(),this.ys.timeScale.minimumHeight):0;k=(a=k)+a%2;let l=i+k,m=g<l?0:g-l,n=m/b,o=0,p=window.devicePixelRatio||1;for(let q=0;q<this.fm.length;++q){let r=this.fm[q];r.vv(this.ts.$s()[q]);let s=0,t=0;t=q===this.fm.length-1?Math.ceil((m-o)*p)/p:Math.round(r.fo()*n*p)/p,s=Math.max(t,2),o+=s,r.Np((0,y.dp)({width:h,height:s})),this.Um()&&r.Vv(c,"left"),this.$m()&&r.Vv(d,"right"),r.Wf()&&this.ts.Zu(r.Wf(),s)}this.Rm.nm((0,y.dp)({width:j?h:0,height:k}),j?c:0,j?d:0),this.ts.vo(h),this.wm!==c&&(this.wm=c),this.gm!==d&&(this.gm=d)}km(a){a?this.hp.addEventListener("wheel",this.ym,{passive:!1}):this.hp.removeEventListener("wheel",this.ym)}Xm(a){switch(a.deltaMode){case a.DOM_DELTA_PAGE:return 120;case a.DOM_DELTA_LINE:return 32}return b5?1/window.devicePixelRatio:1}Pm(a){if(!(0!==a.deltaX&&this.ys.handleScroll.mouseWheel||0!==a.deltaY&&this.ys.handleScale.mouseWheel))return;let b=this.Xm(a),c=b*a.deltaX/100,d=-b*a.deltaY/100;if(a.cancelable&&a.preventDefault(),0!==d&&this.ys.handleScale.mouseWheel){let e=Math.sign(d)*Math.min(1,Math.abs(d)),f=a.clientX-this.hp.getBoundingClientRect().left;this.Qt().tc(f,e)}0!==c&&this.ys.handleScroll.mouseWheel&&this.Qt().sc(-80*c)}Lm(a,b){let c=a.nn();3===c&&this.Gm(),3!==c&&2!==c||(this.Jm(a),this.Qm(a,b),this.Rm.Pt(),this.fm.forEach(a=>{a.wv()}),3===this.Mm?.nn()&&(this.Mm.vn(a),this.Gm(),this.Jm(this.Mm),this.Qm(this.Mm,b),a=this.Mm,this.Mm=null)),this.Fp(a)}Qm(a,b){for(let c of a.pn())this.mn(c,b)}Jm(a){let b=this.ts.$s();for(let c=0;c<b.length;c++)a.en(c).sn&&b[c].Ao()}mn(a,b){let c=this.ts.At();switch(a.an){case 0:c.mu();break;case 1:c.wu(a.Ft);break;case 2:c.dn(a.Ft);break;case 3:c.fn(a.Ft);break;case 4:c.eu();break;case 5:a.Ft.uu(b)||c.fn(a.Ft.cu(b))}}Bu(a){null!==this.Mm?this.Mm.vn(a):this.Mm=a,this.bm||(this.bm=!0,this.vm=window.requestAnimationFrame(a=>{if(this.bm=!1,this.vm=0,null!==this.Mm){let b=this.Mm;for(let c of(this.Mm=null,this.Lm(b,a),b.pn()))if(5===c.an&&!c.Ft.uu(a)){this.Qt()._n(c.Ft);break}}}))}Gm(){this.Im()}
6Em(a){this.Cm.removeChild(a.Rf()),a.m()}Im(){let a=this.ts.$s(),b=a.length,c=this.fm.length;for(let d=b;d<c;d++){let e=D(this.fm.pop());this.Cm.removeChild(e.Rf()),e.Tv().u(this),e.Rv().u(this),e.m();let f=this.pm.pop();void 0!==f&&this.Em(f)}for(let g=c;g<b;g++){let h=new b_(this,a[g]);if(h.Tv().i(this.tw.bind(this,h),this),h.Rv().i(this.iw.bind(this,h),this),this.fm.push(h),g>0){let i=new bK(this,g-1,g);this.pm.push(i),this.Cm.insertBefore(i.Rf(),this.Rm.Rf())}this.Cm.insertBefore(h.Rf(),this.Rm.Rf())}for(let j=0;j<b;j++){let k=a[j],l=this.fm[j];l.Wf()!==k?l.vv(k):l.pv()}this.Bm(),this.Km()}sw(a,b,c,d){let e=new Map;null!==a&&this.ts.js().forEach(b=>{let c=b.Ks().Wr(a);null!==c&&e.set(b,c)});let f;if(null!==a){let g=this.ts.At().ss(a)?.originalTime;void 0!==g&&(f=g)}let h=this.Qt().Hu(),i=null!==h&&h.Wo instanceof aT?h.Wo:void 0,j=null!==h&& void 0!==h.Fo?h.Fo.Zn:void 0,k=this.nw(d);return{ew:f,Re:a??void 0,rw:b??void 0,hw:-1!==k?k:void 0,aw:i,lw:e,ow:j,_w:c??void 0}}nw(a){let b=-1;if(a)b=this.fm.indexOf(a);else{let c=this.Qt().Yu().Us();null!==c&&(b=this.Qt().$s().indexOf(c))}return b}tw(a,b,c,d){this.sv.p(()=>this.sw(b,c,d,a))}iw(a,b,c,d){this.nv.p(()=>this.sw(b,c,d,a))}Tm(a,b,c){this.Ym(this.Qt().Hu()?.Uo??null),this.Vu.p(()=>this.sw(a,b,c))}Bm(){let a=this.ys.timeScale.visible?"":"none";this.Rm.Rf().style.display=a}Um(){return this.fm[0].Wf().Co().N().visible}$m(){return this.fm[0].Wf().yo().N().visible}Dm(){return"ResizeObserver"in window&&(this.xm=new ResizeObserver(a=>{let b=a[a.length-1];b&&this.Vm(b.contentRect.width,b.contentRect.height)}),this.xm.observe(this.op,{box:"border-box"}),!0)}zm(){null!==this.xm&&this.xm.disconnect(),this.xm=null}}(a,d,b),this.bf.Tv().i(a=>{this.dg.v()&&this.dg.p(this.wg(a()))},this),this.bf.Rv().i(a=>{this.fg.v()&&this.fg.p(this.wg(a()))},this),this.bf.ju().i(a=>{this.pg.v()&&this.pg.p(this.wg(a()))},this);let e=this.bf.Qt();this.gg=new class{constructor(a,b,c){this.ag=new G,this.g_=new G,this.Kv=new G,this.ts=a,this.uh=a.At(),this.Rm=b,this.uh.du().i(this.lg.bind(this)),this.uh.fu().i(this.og.bind(this)),this.Rm.sm().i(this._g.bind(this)),this.Yo=c}m(){this.uh.du().u(this),this.uh.fu().u(this),this.Rm.sm().u(this),this.ag.m(),this.g_.m(),this.Kv.m()}scrollPosition(){return this.uh.iu()}scrollToPosition(a,b){b?this.uh._u(a,1e3):this.ts.fn(a)}scrollToRealTime(){this.uh.ou()}getVisibleRange(){let a=this.uh.O_();return null===a?null:{from:a.from.originalTime,to:a.to.originalTime}}setVisibleRange(a){let b={from:this.Yo.convertHorzItemToInternal(a.from),to:this.Yo.convertHorzItemToInternal(a.to)},c=this.uh.H_(b);this.ts.wc(c)}getVisibleLogicalRange(){let a=this.uh.L_();return null===a?null:{from:a.Uh(),to:a.bi()}}setVisibleLogicalRange(a){C(a.from<=a.to,"The from index cannot be after the to index."),this.ts.wc(a)}resetTimeScale(){this.ts.cn()}fitContent(){this.ts.mu()}logicalToCoordinate(a){let b=this.ts.At();return b.Zi()?null:b.qt(a)}coordinateToLogical(a){return this.uh.Zi()?null:this.uh.Z_(a)}timeToIndex(a,b){let c=this.Yo.convertHorzItemToInternal(a);return this.uh.A_(c,b)}timeToCoordinate(a){let b=this.timeToIndex(a,!1);return null===b?null:this.uh.qt(b)}coordinateToTime(a){let b=this.ts.At(),c=b.Z_(a),d=b.ss(c);return null===d?null:d.originalTime}width(){return this.Rm.Df().width}height(){return this.Rm.Df().height}subscribeVisibleTimeRangeChange(a){this.ag.i(a)}unsubscribeVisibleTimeRangeChange(a){this.ag._(a)}subscribeVisibleLogicalRangeChange(a){this.g_.i(a)}unsubscribeVisibleLogicalRangeChange(a){this.g_._(a)}subscribeSizeChange(a){this.Kv.i(a)}unsubscribeSizeChange(a){this.Kv._(a)}applyOptions(a){this.uh.hr(a)}options(){return{...M(this.uh.N()),barSpacing:this.uh.Q_()}}lg(){this.ag.v()&&this.ag.p(this.getVisibleRange())}og(){this.g_.v()&&this.g_.p(this.getVisibleLogicalRange())}_g(a){this.Kv.p(a.width,a.height)}}(e,this.bf.Am(),this.mg)}remove(){this.bf.Tv().u(this),this.bf.Rv().u(this),this.bf.ju().u(this),this.gg.m(),this.bf.m(),this.ug.clear(),this.cg.clear(),this.dg.m(),this.fg.m(),this.pg.m(),this.vg.m()}resize(a,b,c){this.autoSizeActive()||this.bf.Vm(a,b,c)}addCustomSeries(a,b={},c=0){var d;let e=(d=F(a),{type:"Custom",isBuiltIn:!1,defaultOptions:{...ct,...d.defaultOptions()},Mg:cu,bg:d});return this.xg(e,b,c)}addSeries(a,b={},c=0){return this.xg(a,b,c)}removeSeries(a){let b=D(this.ug.get(a)),c=this.vg.vc(b);this.bf.Qt().vc(b),this.Sg(c),this.ug.delete(a),this.cg.delete(b)}eg(a,b){this.Sg(this.vg.Mw(a,b))}hg(a,b,c){this.Sg(this.vg.Pw(a,b,c))}subscribeClick(a){this.dg.i(a)}unsubscribeClick(a){this.dg._(a)}subscribeCrosshairMove(a){this.pg.i(a)}unsubscribeCrosshairMove(a){this.pg._(a)}subscribeDblClick(a){this.fg.i(a)}unsubscribeDblClick(a){this.fg._(a)}priceScale(a,b=0){return new cK(this.bf,a,b)}timeScale(){return this.gg}applyOptions(a){this.bf.hr(cP(a))}options(){return this.bf.N()}takeScreenshot(){return this.bf.Wm()}removePane(a){this.bf.Qt().Ku(a)}swapPanes(a,b){this.bf.Qt().Gu(a,b)}autoSizeActive(){return this.bf.qm()}chartElement(){return this.bf.Af()}panes(){return this.bf.Qt().$s().map(a=>this.Cg(a))}
6paneSize(a=0){let b=this.bf.Zm(a);return{height:b.height,width:b.width}}setCrosshairPosition(a,b,c){let d=this.ug.get(c);if(void 0===d)return;let e=this.bf.Qt().Hn(d);null!==e&&this.bf.Qt().oc(a,b,e)}clearCrosshairPosition(){this.bf.Qt()._c(!0)}horzBehaviour(){return this.mg}xg(a,b={},c=0){var d;C(void 0!==a.Mg),function(a){if(void 0===a||"custom"===a.type)return;let b=a;void 0!==b.minMove&& void 0===b.precision&&(b.precision=function(a){if(a>=1)return 0;let b=0;for(;b<8;b++){let c=Math.round(a);if(1e-8>Math.abs(c-a))break;a*=10}return b}(b.minMove))}(b.priceFormat),"Candlestick"===a.type&&(void 0!==(d=b).borderColor&&(d.borderUpColor=d.borderColor,d.borderDownColor=d.borderColor),void 0!==d.wickColor&&(d.wickUpColor=d.wickColor,d.wickDownColor=d.wickColor));let e=H(M(z),M(a.defaultOptions),b),f=a.Mg,g=new aT(this.bf.Qt(),a.type,e,f,a.bg);this.bf.Qt().dc(g,c);let h=new cO(g,this,this,this,this.mg,a=>this.Cg(a));return this.ug.set(h,g),this.cg.set(g,h),h}Sg(a){let b=this.bf.Qt();b.uc(a.At.Y_,a.At.Vw,a.At.Iw),a.wo.forEach((a,b)=>b.ht(a.se,a.Dw)),b.At().R_(),b.J_()}yg(a){return D(this.cg.get(a))}wg(a){let b=new Map;a.lw.forEach((a,c)=>{let d=c.Rr(),e=cC(d)(a);if("Custom"!==d)C(b8(e));else{let f=c.pa();C(!f|| !1===f(e))}b.set(this.yg(c),e)});let c=void 0!==a.aw&&this.cg.has(a.aw)?this.yg(a.aw):void 0;return{time:a.ew,logical:a.Re,point:a.rw,paneIndex:a.hw,hoveredSeries:c,hoveredObjectId:a.ow,seriesData:b,sourceEvent:a._w}}Cg(a){let b=this.ku.get(a);return b||(b=new cL(this.bf,a=>this.yg(a),a,this),this.ku.set(a,b)),b}}function cR(a,b){return function a(b,c,d){let e=function a(b){if(K(b)){let c=document.getElementById(b);return C(null!==c,`Cannot find element in DOM with id=${b}`),c}return b}(b),f=new cQ(e,c,d);return c.setOptions(f.options()),f}(a,new bz,bz.Wc(b))}class cS extends cq{constructor(a,b){super(a,b,!0)}qw(a,b,c){b.j_(this.zw,O(this.Lw)),a.Dl(this.zw,c,O(this.Lw))}Pg(a,b){return{wt:a,gt:b,_t:NaN,ut:NaN}}Uw(){let a=this.Jn.Rh();this.zw=this.Jn.Ks().Hr().map(b=>{let c=b.Ft[3];return this.kg(b.Re,c,a)})}}function cT(a,b,c,d,e,f,g){if(0===b.length||d.from>=b.length||d.to<=0)return;let{context:h,horizontalPixelRatio:i,verticalPixelRatio:j}=a,k=b[d.from],l=f(a,k),m=k;if(d.to-d.from<2){let n=e/2;h.beginPath();let o={_t:k._t-n,ut:k.ut},p={_t:k._t+n,ut:k.ut};h.moveTo(o._t*i,o.ut*j),h.lineTo(p._t*i,p.ut*j),g(a,l,o,p)}else{let q=(b,c)=>{g(a,l,m,c),h.beginPath(),l=b,m=c},r=m;h.beginPath(),h.moveTo(k._t*i,k.ut*j);for(let s=d.from+1;s<d.to;++s){r=b[s];let t=f(a,r);switch(c){case 0:h.lineTo(r._t*i,r.ut*j);break;case 1:h.lineTo(r._t*i,b[s-1].ut*j),t!==l&&(q(t,r),h.lineTo(r._t*i,b[s-1].ut*j)),h.lineTo(r._t*i,r.ut*j);break;case 2:{let[u,v]=cW(b,s-1,s);h.bezierCurveTo(u._t*i,u.ut*j,v._t*i,v.ut*j,r._t*i,r.ut*j)}}1!==c&&t!==l&&(q(t,r),h.moveTo(r._t*i,r.ut*j))}(m!==r||m===r&&1===c)&&g(a,l,m,r)}}function cU(a,b){return{_t:a._t-b._t,ut:a.ut-b.ut}}function cV(a,b){return{_t:a._t/b,ut:a.ut/b}}function cW(a,b,c){var d,e;let f=Math.min(a.length-1,c+1);return[(d=a[b],e=cV(cU(a[c],a[Math.max(0,b-1)]),6),{_t:d._t+e._t,ut:d.ut+e.ut}),cU(a[c],cV(cU(a[f],a[b]),6))]}function cX(a,b){let c=a.context;c.strokeStyle=b,c.stroke()}class cY extends U{constructor(){super(...arguments),this.rt=null}ht(a){this.rt=a}et(a){if(null===this.rt)return;let{ot:b,lt:c,Tg:d,Rg:e,ct:f,Kt:g,Dg:h}=this.rt;if(null===c)return;let i=a.context;i.lineCap="butt",i.lineWidth=f*a.verticalPixelRatio,A(i,g),i.lineJoin="round";let j=this.Vg.bind(this);void 0!==e&&cT(a,b,e,c,d,j,cX),h&&function(a,b,c,d,e){if(d.to-d.from<=0)return;let{horizontalPixelRatio:f,verticalPixelRatio:g,context:h}=a,i=null,j=Math.max(1,Math.floor(f))%2/2,k=c*g+j;for(let l=d.to-1;l>=d.from;--l){let m=b[l];if(m){let n=e(a,m);n!==i&&(h.beginPath(),null!==i&&h.fill(),h.fillStyle=n,i=n);let o=Math.round(m._t*f)+j,p=m.ut*g;h.moveTo(o,p),h.arc(o,p,k,0,2*Math.PI)}}h.fill()}(a,b,h,c,j)}}class cZ extends cY{Vg(a,b){return b.vt}}class c$ extends cS{constructor(){super(...arguments),this.Ww=new cZ}kg(a,b,c){return{...this.Pg(a,b),...c.Dr(a)}}Yw(){let a=this.Jn.N(),b={ot:this.zw,Kt:a.lineStyle,Rg:a.lineVisible?a.lineType:void 0,ct:a.lineWidth,Dg:a.pointMarkersVisible?a.pointMarkersRadius||a.lineWidth/2+2:void 0,lt:this.Lw,Tg:this.Qn.At().Q_()};this.Ww.ht(b)}}let c_={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroun
6dColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Mg:(a,b)=>new c$(a,b)};function c0(a,b){return a.weight>b.weight?a:b}let c1={lastValueVisible:!1,priceLineVisible:!1};function c2(a,b){return a.weight>b.weight?a:b}function c3(a,b,c,d,e){let{context:f,horizontalPixelRatio:g,verticalPixelRatio:h}=b;f.lineTo(e._t*g,a*h),f.lineTo(d._t*g,a*h),f.closePath(),f.fillStyle=c,f.fill()}class c4 extends U{constructor(){super(...arguments),this.rt=null}ht(a){this.rt=a}et(a){if(null===this.rt)return;let{ot:b,lt:c,Tg:d,ct:e,Kt:f,Rg:g}=this.rt,h=this.rt.Og??(this.rt.Ng?0:a.mediaSize.height);if(null===c)return;let i=a.context;i.lineCap="butt",i.lineJoin="round",i.lineWidth=e,A(i,f),i.lineWidth=1,cT(a,b,g,c,d,this.Wg.bind(this),c3.bind(null,h))}}class c5{Fg(a,b){let c=this.Hg,{Ug:d,$g:e,qg:f,Yg:g,Og:h,jg:i,Zg:j}=b;if(void 0===this.Kg|| void 0===c||c.Ug!==d||c.$g!==e||c.qg!==f||c.Yg!==g||c.Og!==h||c.jg!==i||c.Zg!==j){let{verticalPixelRatio:k}=a,l=h||i>0?k:1,m=i*l,n=j===a.bitmapSize.height?j:j*l,o=(h??0)*l,p=a.context.createLinearGradient(0,m,0,n);if(p.addColorStop(0,d),null!=h){let q=a4((o-m)/(n-m),0,1);p.addColorStop(q,e),p.addColorStop(q,f)}p.addColorStop(1,g),this.Kg=p,this.Hg=b}return this.Kg}}class c6 extends cS{constructor(a,b){super(a,b),this.Ww=new T,this.Jg=new class extends c4{constructor(){super(...arguments),this.Xg=new c5}Wg(a,b){let c=this.rt;return this.Xg.Fg(a,{Ug:b.br,$g:b.Sr,qg:b.Cr,Yg:b.yr,Og:c.Og,jg:c.jg??0,Zg:c.Zg??a.bitmapSize.height})}},this.Qg=new class extends cY{constructor(){super(...arguments),this.Gg=new c5}Vg(a,b){let c=this.rt;return this.Gg.Fg(a,{Ug:b.gr,$g:b.gr,qg:b.Mr,Yg:b.Mr,Og:c.Og,jg:c.jg??0,Zg:c.Zg??a.bitmapSize.height})}},this.Ww.st([this.Jg,this.Qg])}kg(a,b,c){return{...this.Pg(a,b),...c.Dr(a)}}Yw(){let a=this.Jn.zt();if(null===a)return;let b=this.Jn.N(),c=this.Jn.Wt().Nt(b.baseValue.price,a.Ft),d=this.Qn.At().Q_();if(null===this.Lw||0===this.zw.length)return;let e,f;if(b.relativeGradient){e=this.zw[this.Lw.from].ut,f=this.zw[this.Lw.from].ut;for(let g=this.Lw.from;g<this.Lw.to;g++){let h=this.zw[g];h.ut<e&&(e=h.ut),h.ut>f&&(f=h.ut)}}this.Jg.ht({ot:this.zw,ct:b.lineWidth,Kt:b.lineStyle,Rg:b.lineType,Og:c,jg:e,Zg:f,Ng:!1,lt:this.Lw,Tg:d}),this.Qg.ht({ot:this.zw,ct:b.lineWidth,Kt:b.lineStyle,Rg:b.lineVisible?b.lineType:void 0,Dg:b.pointMarkersVisible?b.pointMarkersRadius||b.lineWidth/2+2:void 0,Og:c,jg:e,Zg:f,lt:this.Lw,Tg:d})}}let c7={type:"Baseline",isBuiltIn:!0,defaultOptions:{baseValue:{type:"price",price:0},relativeGradient:!1,topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Mg:(a,b)=>new c6(a,b)};class c8 extends cS{constructor(a,b){super(a,b),this.Ww=new T,this.tM=new class extends c4{constructor(){super(...arguments),this.Xg=new c5}Wg(a,b){return this.Xg.Fg(a,{Ug:b.mr,$g:"",qg:"",Yg:b.wr,jg:this.rt?.jg??0,Zg:a.bitmapSize.height})}},this.iM=new cZ,this.Ww.st([this.tM,this.iM])}kg(a,b,c){return{...this.Pg(a,b),...c.Dr(a)}}Yw(){let a=this.Jn.N();if(null===this.Lw||0===this.zw.length)return;let b;if(a.relativeGradient){b=this.zw[this.Lw.from].ut;for(let c=this.Lw.from;c<this.Lw.to;c++){let d=this.zw[c];d.ut<b&&(b=d.ut)}}this.tM.ht({Rg:a.lineType,ot:this.zw,Kt:a.lineStyle,ct:a.lineWidth,Og:null,jg:b,Ng:a.invertFilledArea,lt:this.Lw,Tg:this.Qn.At().Q_()}),this.iM.ht({Rg:a.lineVisible?a.lineType:void 0,ot:this.zw,Kt:a.lineStyle,ct:a.lineWidth,lt:this.Lw,Tg:this.Qn.At().Q_(),Dg:a.pointMarkersVisible?a.pointMarkersRadius||a.lineWidth/2+2:void 0})}}let c9={type:"Area",isBuiltIn:!0,defaultOptions:{topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,relativeGradient:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroun
6dColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Mg:(a,b)=>new c8(a,b)};class da extends cq{constructor(a,b){super(a,b,!1)}qw(a,b,c){b.j_(this.zw,O(this.Lw)),a.Il(this.zw,c,O(this.Lw))}aM(a,b,c){return{wt:a,qh:b.Ft[0],Yh:b.Ft[1],jh:b.Ft[2],Zh:b.Ft[3],_t:NaN,Bl:NaN,Al:NaN,El:NaN,zl:NaN}}Uw(){let a=this.Jn.Rh();this.zw=this.Jn.Ks().Hr().map(b=>this.kg(b.Re,b,a))}}let db={visible:!0,horzAlign:"center",vertAlign:"center",lines:[]},dc={color:"rgba(0, 0, 0, 0.5)",fontSize:48,fontFamily:P,fontStyle:"",text:""};class dd{constructor(a){this.wM=new Map,this.Yt=a}draw(a){a.useMediaCoordinateSpace(a=>{if(!this.Yt.visible)return;let{context:b,mediaSize:c}=a,d=0;for(let e of this.Yt.lines){if(0===e.text.length)continue;b.font=e.k;let f=this.gM(b,e.text);f>c.width?e.hu=c.width/f:e.hu=1,d+=e.lineHeight*e.hu}let g=0;switch(this.Yt.vertAlign){case"top":g=0;break;case"center":g=Math.max((c.height-d)/2,0);break;case"bottom":g=Math.max(c.height-d,0)}for(let h of this.Yt.lines){b.save(),b.fillStyle=h.color;let i=0;switch(this.Yt.horzAlign){case"left":b.textAlign="left",i=h.lineHeight/2;break;case"center":b.textAlign="center",i=c.width/2;break;case"right":b.textAlign="right",i=c.width-1-h.lineHeight/2}b.translate(i,g),b.textBaseline="top",b.font=h.k,b.scale(h.hu,h.hu),b.fillText(h.text,0,h.MM),b.restore(),g+=h.lineHeight*h.hu}})}gM(a,b){let c=this.bM(a.font),d=c.get(b);return void 0===d&&(d=a.measureText(b).width,c.set(b,d)),d}bM(a){let b=this.wM.get(a);return void 0===b&&(b=new Map,this.wM.set(a,b)),b}}function de(a){return{...a,k:Q(a.fontSize,a.fontFamily,a.fontStyle),lineHeight:a.lineHeight||1.2*a.fontSize,MM:0,hu:0}}function df(a){return{...a,lines:a.lines.map(de)}}function dg(a){return{...dc,...a}}function dh(a){return{...db,...a,lines:a.lines?.map(dg)??[]}}let di={alpha:1,padding:0};class dj{constructor(a){this.Yt=a}draw(a){a.useMediaCoordinateSpace(a=>{let b=a.context,c=this.CM(this.Yt,a.mediaSize);c&&this.Yt.yM&&(b.globalAlpha=this.Yt.alpha??1,b.drawImage(this.Yt.yM,c._t,c.ut,c.Qi,c.$t))})}CM(a,b){let{maxHeight:c,maxWidth:d,PM:e,kM:f,padding:g}=a,h=Math.round(b.width/2),i=Math.round(b.height/2),j=g??0,k=b.width-2*j,l=b.height-2*j;c&&(l=Math.min(l,c)),d&&(k=Math.min(k,d));let m=k/f,n=l/e,o=Math.min(m,n),p=f*o,q=e*o;return{_t:h-.5*p,ut:i-.5*q,$t:q,Qi:p}}}function dk(a,b,c,d){return{...a,yM:b,kM:c,PM:d}}function dl(a){return{...di,...a}}class dm{constructor(a,b){this.Jn=a,this.ah=b,this.mM()}detach(){this.Jn.detachPrimitive(this.ah)}getSeries(){return this.Jn}applyOptions(a){this.ah&&this.ah.hr&&this.ah.hr(a)}mM(){this.Jn.attachPrimitive(this.ah)}}function dn(a,b){return a5(Math.min(Math.max(a,12),30)*b)}function dp(a,b){switch(a){case"arrowDown":case"arrowUp":return dn(b,1);case"circle":return dn(b,.8);case"square":return dn(b,.7)}}function dq(a){return function(a){let b=Math.ceil(a);return b%2!=0?b-1:b}(dn(a,1))}function dr(a){return Math.max(dn(a,.1),3)}function ds(a,b,c){return b?a:c?Math.ceil(a/2):0}function dt(a,b,c,d){let e=(dp("arrowUp",d)-1)/2*c.WM,f=(a5(d/2)-1)/2*c.WM;b.beginPath(),a?(b.moveTo(c._t-e,c.ut),b.lineTo(c._t,c.ut-e),b.lineTo(c._t+e,c.ut),b.lineTo(c._t+f,c.ut),b.lineTo(c._t+f,c.ut+e),b.lineTo(c._t-f,c.ut+e),b.lineTo(c._t-f,c.ut)):(b.moveTo(c._t-e,c.ut),b.lineTo(c._t,c.ut+e),b.lineTo(c._t+e,c.ut),b.lineTo(c._t+f,c.ut),b.lineTo(c._t+f,c.ut-e),b.lineTo(c._t-f,c.ut-e),b.lineTo(c._t-f,c.ut)),b.fill()}function du(a,b,c,d,e,f){let g=(dp("arrowUp",d)-1)/2,h=(a5(d/2)-1)/2;return e>=b-h-2&&e<=b+h+2&&f>=(a?c:c-g)-2&&f<=(a?c+g:c)+2||(()=>{if(e<b-g-3||e>b+g+3||f<(a?c-g-3:c)||f>(a?c:c+g+3))return!1;let d=Math.abs(e-b);return Math.abs(f-c)+3>=d/2})()}function dv(a,b,c,d){var e,f,g,h,i,j,k,l,m;b.fillStyle=a.R,void 0!==a.ri&&(e=b,f=a.ri.FM,g=a.ri._t,h=a.ri.ut,i=c,j=d,e.save(),e.scale(i,j),e.fillText(f,g,h),e.restore()),function(a,b,c){if(0!==a.zr){switch(a.HM){case"arrowDown":return void dt(!1,b,c,a.zr);case"arrowUp":return void dt(!0,b,c,a.zr);case"circle":return void function(a,b,c){let d=(dp("circle",c)-1)/2;a.beginPath(),a.arc(b._t,b.ut,d*b.WM,0,2*Math.PI,!1),a.fill()}(b,c,a.zr);case"square":return void function(a,b,c){let d=dp("square",c),e=(d-1)*b.WM/2,f=b._t-e,g=b.ut-e;a.fillRect(f,g,d*b.WM,d*b.WM)}(b,c,a.zr)}a.HM}}(a,b,(k=a,l=c,m=d,{_t:Math.round(k._t*l)+Math.max(1,Math.floor(l))%2/2,ut:k.ut*m,WM:l}))}function dw(a,b,c){return!(void 0===a.ri||!function(a,b,c,d,e,f){let g=d/2;return e>=a&&e<=a+c&&f>=b-g&&f<=b+g}(a.ri._t,a.ri.ut,a.ri.Qi,a.ri.$t,b,c))||function(a,b,c){if(0===a.zr)return!1;switch(a.HM){case"arrowDown":return du(!0,a._t,a.ut,a.zr,b,c);case"arrowUp":return du(!1,a._t,a.ut,a.zr,b,c);case"circle":return function(a,b,c,d,e){let f=2+dp("circle",c)/2,g=a-d,h=b-e;return Math.sqrt(g*g+h*h)<=f}(a._t,a.ut,a.zr,b,c);case"square":return function(a,b,c,d,e){let f=dp("square",c),g=(f-1)/2,h=a-g,i=b-g;return d>=h&&d<=h+f&&e>=i&&e<=i+f}(a._t,a.ut,a.zr,b,c)}}(a,b,c)}function dx(a){return"atPriceTop"===a||"atPriceBottom"===a||"atPriceMiddle"===a}function dy(a,b,c,d,e,f,g,h){let i=function(a,b){var c,d;if(dx(b.position)&& void 0!==b.price)return b.price;if("value"in(c=a)&&"number"==typeof c.value)return a.value;if("open"in(d=a)&&"high"in d&&"low"in d&&"close"in d){if("inBar"===b.position)return a.close;if("aboveBar"===b.position)return a.high;if("belowBar"===b.position)return a.low}}(c,b);if(void 0===i)return;let j=dx(b.position),k=h.timeScale(),l=I(b.size)?Math.max(b.size,0):1,m=dq(k.options().barSpacing)*l,n=m/2;switch(a.zr=m,b.position){case"inBar":case"atPriceMiddle":return a.ut=E(g.priceToCoordinate(i)),void(void 0!==a.ri&&(a.ri.ut=a.ut+n+f+.6*e));case"aboveBar":case"atPriceTop":{let o=j?0:d.UM;return a.ut=E(g.priceToCoordinate(i))-n-o,void 0!==a.ri&&(a.ri.ut=a.ut-n-.6*e,d.UM+=1.2*e),void(j||(d.UM+=m+f))}case"belowBar":case"atPriceBottom":{let p=j?0:d.$M;return a.ut=E(g.priceToCoordinate(i))+n+p,void 0!==a.ri&&(a.ri.ut=a.ut+n+f+.6*e,d.$M+=1.2*e),void(j||(d.$M+=m+f))}}}class dz{constructor(a,b){this.qM=[],this.St=!0,this.YM=!0,this.Gt=new class{constructor(){this.Yt=null,this.On=new aq,this.W=-1,this.F="",this.Mp=""}ht(a){this.Yt=a}Nn(a,b){this.W===a&&this.F===b||(this.W=a,this.F=b,this.Mp=Q(a,b),this.On.In())}jn(a,b){if(null===this.Yt||null===this.Yt.lt)return null;for(let c=this.Yt.lt.from;c<this.Yt.lt.to;c++){let d=this.Yt.ot[c];if(d&&dw(d,a,b))return{zOrder:"normal",externalId:d.Zn??""}}return null}draw(a){a.useBitmapCoordinateSpace(a=>{this.et(a)})}et({context:a,horizontalPixelRatio:b,verticalPixelRatio:c}){if(null!==this.Yt&&null!==this.Yt.lt){a.textBaseline="middle",a.font=this.Mp;for(let d=this.Yt.lt.from;d<this.Yt.lt.to;d++){let e=this.Yt.ot[d];void 0!==e.ri&&(e.ri.Qi=this.On.Vi(a,e.ri.FM),e.ri.$t=this.W,e.ri._t=e._t-e.ri.Qi/2),dv(e,a,b,c)}}}},this.ge=a,this._p=b,this.Yt={ot:[],lt:null}}renderer(){if(!this.ge.options().visible)return null;this.St&&this.jM();let a=this._p.options().layout;return this.Gt.Nn(a.fontSize,a.fontFamily),this.Gt.ht(this.Yt),this.Gt}ZM(a){this.qM=a,this.Pt("data")}Pt(a){this.St=!0,"data"===a&&(this.YM=!0)}jM(){let a=this._p.timeScale(),b=this.qM;this.YM&&(this.Yt.ot=b.map(a=>({wt:a.time,_t:0,ut:0,zr:0,HM:a.shape,R:a.color,Zn:a.id,KM:a.KM,ri:void 0})),this.YM=!1);let c=this._p.options().layout;this.Yt.lt=null;let d=a.getVisibleLogicalRange();if(null===d)return;let e=new bj(Math.floor(d.from),Math.ceil(d.to));if(null===this.ge.data()[0]||0===this.Yt.ot.length)return;let f=NaN,g=dr(a.options().barSpacing),h={UM:g,$M:g};this.Yt.lt=cp(this.Yt.ot,e,!0);for(let i=this.Yt.lt.from;i<this.Yt.lt.to;i++){let j=b[i];j.time!==f&&(h.UM=g,h.$M=g,f=j.time);let k=this.Yt.ot[i];k._t=E(a.logicalToCoordinate(j.time)),void 0!==j.text&&j.text.length>0&&(k.ri={FM:j.text,_t:0,ut:0,Qi:0,$t:0});let l=this.ge.dataByIndex(j.time,0);null!==l&&dy(k,j,l,h,c.fontSize,g,this.ge,this._p)}this.St=!1}}class dA{constructor(){this.sh=null,this.qM=[],this.XM=[],this.GM=null,this.ge=null,this._p=null,this.JM=!0,this.QM=null,this.tb=null,this.ib=null,this.sb=!0}attached(a){this.nb(),this._p=a.chart,this.ge=a.series,this.sh=new dz(this.ge,E(this._p)),this.OM=a.requestUpdate,this.ge.subscribeDataChanged(a=>this.rg(a)),this.sb=!0,this.SM()}SM(){this.OM&&this.OM()}detached(){this.ge&&this.GM&&this.ge.unsubscribeDataChanged(this.GM),this._p=null,this.ge=null,this.sh=null,this.GM=null}ZM(a){this.sb=!0,this.qM=a,this.nb(),this.JM=!0,this.tb=null,this.SM()}eb(){return this.qM}paneViews(){return this.sh?[this.sh]:[]}updateAllViews(){this.rb()}
6hitTest(a,b){return this.sh?this.sh.renderer()?.jn(a,b)??null:null}autoscaleInfo(a,b){if(this.sh){let c=this.hb();if(c)return{priceRange:null,margins:c}}return null}hb(){let a=E(this._p).timeScale().options().barSpacing;if(this.JM||a!==this.ib){if(this.ib=a,this.qM.length>0){let b=dr(a),c=1.5*dq(a)+2*b,d=this.ab();this.QM={above:ds(c,d.aboveBar,d.inBar),below:ds(c,d.belowBar,d.inBar)}}else this.QM=null;this.JM=!1}return this.QM}ab(){return null===this.tb&&(this.tb=this.qM.reduce((a,b)=>(a[b.position]||(a[b.position]=!0),a),{inBar:!1,aboveBar:!1,belowBar:!1,atPriceTop:!1,atPriceBottom:!1,atPriceMiddle:!1})),this.tb}nb(){if(!this.sb||!this._p||!this.ge)return;let a=this._p.timeScale(),b=this.ge?.data();if(null==a.getVisibleLogicalRange()||!this.ge||0===b.length)return void(this.XM=[]);let c=a.timeToIndex(E(b[0].time),!0);this.XM=this.qM.map((b,d)=>{let e=a.timeToIndex(b.time,!0),f=e<c?1:-1,g=E(this.ge).dataByIndex(e,f),h={time:a.timeToIndex(E(g).time,!1),position:b.position,shape:b.shape,color:b.color,id:b.id,KM:d,text:b.text,size:b.size,price:b.price,ew:b.time};if(("atPriceTop"===b.position||"atPriceBottom"===b.position||"atPriceMiddle"===b.position)&& void 0===b.price)throw Error(`Price is required for position ${b.position}`);return{...h,position:b.position,price:b.price}}),this.sb=!1}rb(a){this.sh&&(this.nb(),this.sh.ZM(this.XM),this.sh.Pt(a))}rg(a){this.sb=!0,this.SM()}}class dB extends dm{constructor(a,b,c){super(a,b),c&&this.setMarkers(c)}setMarkers(a){this.ah.ZM(a)}markers(){return this.ah.eb()}}function dC(a,b){let c=new dB(a,new dA);return b&&c.setMarkers(b),c}class dD{constructor(a,b,c,d){this.Yt=a,this.gb=b,this.Mb=c,this.bb=d}draw(a){a.useBitmapCoordinateSpace(a=>{let b=a.context,c=Math.max(1,Math.floor(a.horizontalPixelRatio))%2/2,d=4*a.verticalPixelRatio+c;this.Yt.forEach(e=>{let f=Math.round(e._t*a.horizontalPixelRatio)+c;b.beginPath();let g=this.xb(e.Sb);b.fillStyle=g,b.arc(f,e.ut*a.verticalPixelRatio,d,0,2*Math.PI,!1),b.fill(),e.Sb&&(b.strokeStyle=g,b.lineWidth=Math.floor(2*a.horizontalPixelRatio),b.beginPath(),b.moveTo((e._t-4.7)*a.horizontalPixelRatio+c,(e.ut-7*e.Sb)*a.verticalPixelRatio),b.lineTo(e._t*a.horizontalPixelRatio+c,(e.ut-7*e.Sb-7*e.Sb*.5)*a.verticalPixelRatio),b.lineTo((e._t+4.7)*a.horizontalPixelRatio+c,(e.ut-7*e.Sb)*a.verticalPixelRatio),b.stroke())})})}xb(a){return 0===a?this.gb:a>0?this.bb:this.Mb}}class dE{constructor(a,b,c){this.Yt=[],this.ge=a,this.uh=b,this.ys=c}Pt(a){this.Yt=a.map(a=>{let b=this.ge.priceToCoordinate(a.value);return null===b?null:{_t:E(this.uh.timeToCoordinate(a.time)),ut:b,Sb:a.sign}}).filter(N)}renderer(){var a,b,c,d;let e=(a=this.ge.options(),"Area"===(d=b=this.ge.seriesType())?a.lineColor:a.color);return new dD(this.Yt,e,this.ys.negativeColor,this.ys.positiveColor)}}function dF(a,b){return"Line"===b||"Area"===b}function dG(a,b){return a===b?0:a-b>0?1:-1}}}])

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.