diff --git a/websites/default/index.html b/websites/default/index.html
index 334ae6d5c..fb126cae9 100644
--- a/websites/default/index.html
+++ b/websites/default/index.html
@@ -2,7 +2,7 @@
- kibo.money
+
details,
@@ -887,7 +887,7 @@
bottom: 0;
left: 0;
right: 0;
- z-index: 20;
+ z-index: 10;
pointer-events: none;
}
.shadow-left {
@@ -901,7 +901,7 @@
left: 0;
top: 0;
bottom: 0;
- z-index: 40 !important;
+ z-index: 50;
pointer-events: none;
}
.shadow-right {
@@ -915,7 +915,7 @@
right: 0;
top: 0;
bottom: 0;
- z-index: 10;
+ z-index: 30;
pointer-events: none;
}
@@ -1160,7 +1160,6 @@
window.document.documentElement.dataset.display = "standalone";
}
- console.log(navigator);
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/scripts/service-worker.js");
}
@@ -1535,29 +1534,11 @@
-
-
-
+
@@ -1625,5 +1606,15 @@
+
+
diff --git a/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/script.js b/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/script.js
new file mode 100644
index 000000000..bf8d1ba41
--- /dev/null
+++ b/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/script.js
@@ -0,0 +1,8 @@
+// @ts-nocheck
+/*!
+ * @license
+ * TradingView Lightweight Charts™ v5.0.7-dev+202506071500
+ * Copyright (c) 2025 TradingView, Inc.
+ * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
+ */
+const t={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}};var i,s;function n(t,i){const s={0:[],1:[t.lineWidth,t.lineWidth],2:[2*t.lineWidth,2*t.lineWidth],3:[6*t.lineWidth,6*t.lineWidth],4:[t.lineWidth,4*t.lineWidth]}[i];t.setLineDash(s)}function e(t,i,s,n){t.beginPath();const e=t.lineWidth%2?.5:0;t.moveTo(s,i+e),t.lineTo(n,i+e),t.stroke()}function r(t,i){if(!t)throw new Error("Assertion failed"+(i?": "+i:""))}function h(t){if(void 0===t)throw new Error("Value is undefined");return t}function l(t){if(null===t)throw new Error("Value is null");return t}function a(t){return l(h(t))}!function(t){t[t.Simple=0]="Simple",t[t.WithSteps=1]="WithSteps",t[t.Curved=2]="Curved"}(i||(i={})),function(t){t[t.Solid=0]="Solid",t[t.Dotted=1]="Dotted",t[t.Dashed=2]="Dashed",t[t.LargeDashed=3]="LargeDashed",t[t.SparseDotted=4]="SparseDotted"}(s||(s={}));class o{constructor(){this.t=[]}i(t,i,s){const n={h:t,l:i,o:!0===s};this.t.push(n)}_(t){const i=this.t.findIndex((i=>t===i.h));i>-1&&this.t.splice(i,1)}u(t){this.t=this.t.filter((i=>i.l!==t))}p(t,i,s){const n=[...this.t];this.t=this.t.filter((t=>!t.o)),n.forEach((n=>n.h(t,i,s)))}v(){return this.t.length>0}m(){this.t=[]}}function _(t,...i){for(const s of i)for(const i in s)void 0!==s[i]&&Object.prototype.hasOwnProperty.call(s,i)&&!["__proto__","constructor","prototype"].includes(i)&&("object"!=typeof s[i]||void 0===t[i]||Array.isArray(s[i])?t[i]=s[i]:_(t[i],s[i]));return t}function u(t){return"number"==typeof t&&isFinite(t)}function c(t){return"number"==typeof t&&t%1==0}function d(t){return"string"==typeof t}function f(t){return"boolean"==typeof t}function p(t){const i=t;if(!i||"object"!=typeof i)return i;let s,n,e;for(n in s=Array.isArray(i)?[]:{},i)i.hasOwnProperty(n)&&(e=i[n],s[n]=e&&"object"==typeof e?p(e):e);return s}function v(t){return null!==t}function m(t){return null===t?void 0:t}const w="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function g(t,i,s){return void 0===i&&(i=w),`${s=void 0!==s?`${s} `:""}${t}px ${i}`}class b{constructor(t){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,A:0,B:0,L:0},this.O=t}N(){const t=this.M,i=this.F(),s=this.W();return t.P===i&&t.T===s||(t.P=i,t.T=s,t.k=g(i,s),t.B=2.5/12*i,t.V=t.B,t.I=i/12*t.C,t.A=i/12*t.C,t.L=0),t.R=this.H(),t.D=this.$(),this.M}H(){return this.O.N().layout.textColor}$(){return this.O.U()}F(){return this.O.N().layout.fontSize}W(){return this.O.N().layout.fontFamily}}function M(t){return t<0?0:t>255?255:Math.round(t)||0}function S(t){return.199*t[0]+.687*t[1]+.114*t[2]}class x{constructor(t,i){this.j=new Map,this.Y=t,i&&(this.j=i)}X(t,i){if("transparent"===t)return t;const s=this.Z(t),n=s[3];return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${i*n})`}q(t){const i=this.Z(t);return{G:`rgb(${i[0]}, ${i[1]}, ${i[2]})`,K:S(i)>160?"black":"white"}}J(t){return S(this.Z(t))}tt(t,i,s){const[n,e,r,h]=this.Z(t),[l,a,o,_]=this.Z(i),u=[M(n+s*(l-n)),M(e+s*(a-e)),M(r+s*(o-r)),(c=h+s*(_-h),c<=0||c>1?Math.min(Math.max(c,0),1):Math.round(1e4*c)/1e4)];var c;return`rgba(${u[0]}, ${u[1]}, ${u[2]}, ${u[3]})`}Z(t){const i=this.j.get(t);if(i)return i;const s=function(t){const i=document.createElement("div");i.style.display="none",document.body.appendChild(i),i.style.color=t;const s=window.getComputedStyle(i).color;return document.body.removeChild(i),s}(t),n=s.match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!n){if(this.Y.length)for(const i of this.Y){const s=i(t);if(s)return this.j.set(t,s),s}throw new Error(`Failed to parse color: ${t}`)}const e=[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),n[4]?parseFloat(n[4]):1];return this.j.set(t,e),e}}class C{constructor(){this.it=[]}st(t){this.it=t}nt(t,i,s){this.it.forEach((n=>{n.nt(t,i,s)}))}}class y{nt(t,i,s){t.useBitmapCoordinateSpace((t=>this.et(t,i,s)))}}class P extends y{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){if(null===this.rt||null===this.rt.lt)return;const n=this.rt.lt,e=this.rt,r=Math.max(1,Math.floor(i))%2/2,h=h=>{t.beginPath();for(let l=n.to-1;l>=n.from;--l){const n=e.ot[l],a=Math.round(n._t*i)+r,o=n.ut*s,_=h*s+r;t.moveTo(a,o),t.arc(a,o,_,0,2*Math.PI)}t.fill()};e.ct>0&&(t.fillStyle=e.dt,h(e.ft+e.ct)),t.fillStyle=e.vt,h(e.ft)}}function k(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}const T={from:0,to:1};class R{constructor(t,i,s){this.bt=new C,this.Mt=[],this.St=[],this.xt=!0,this.O=t,this.Ct=i,this.yt=s,this.bt.st(this.Mt)}Pt(t){this.kt(),this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.bt}kt(){const t=this.yt.Dt();t.length!==this.Mt.length&&(this.St=t.map(k),this.Mt=this.St.map((t=>{const i=new P;return i.ht(t),i})),this.bt.st(this.Mt))}Rt(){const t=2===this.Ct.N().mode||!this.Ct.Et(),i=this.yt.Vt(),s=this.Ct.zt(),n=this.O.It();this.kt(),i.forEach(((i,e)=>{const r=this.St[e],h=i.At(s),l=i.Bt();!t&&null!==h&&i.Et()&&null!==l?(r.vt=h.Lt,r.ft=h.ft,r.ct=h.Ot,r.ot[0].gt=h.gt,r.ot[0].ut=i.Ft().Nt(h.gt,l.Wt),r.dt=h.Ht??this.O.$t(r.ot[0].ut/i.Ft().Ut()),r.ot[0].wt=s,r.ot[0]._t=n.jt(s),r.lt=T):r.lt=null}))}}class D extends y{constructor(t){super(),this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:r}){if(null===this.Yt)return;const h=this.Yt.Xt.Et,l=this.Yt.Zt.Et;if(!h&&!l)return;const a=Math.round(this.Yt._t*s),o=Math.round(this.Yt.ut*r);t.lineCap="butt",h&&a>=0&&(t.lineWidth=Math.floor(this.Yt.Xt.ct*s),t.strokeStyle=this.Yt.Xt.R,t.fillStyle=this.Yt.Xt.R,n(t,this.Yt.Xt.qt),function(t,i,s,n){t.beginPath();const e=t.lineWidth%2?.5:0;t.moveTo(i+e,s),t.lineTo(i+e,n),t.stroke()}(t,a,0,i.height)),l&&o>=0&&(t.lineWidth=Math.floor(this.Yt.Zt.ct*r),t.strokeStyle=this.Yt.Zt.R,t.fillStyle=this.Yt.Zt.R,n(t,this.Yt.Zt.qt),e(t,o,0,i.width))}}class E{constructor(t,i){this.xt=!0,this.Gt={Xt:{ct:1,qt:0,R:"",Et:!1},Zt:{ct:1,qt:0,R:"",Et:!1},_t:0,ut:0},this.Kt=new D(this.Gt),this.Jt=t,this.yt=i}Pt(){this.xt=!0}Tt(t){return this.xt&&(this.Rt(),this.xt=!1),this.Kt}Rt(){const t=this.Jt.Et(),i=this.yt.Qt().N().crosshair,s=this.Gt;if(2===i.mode)return s.Zt.Et=!1,void(s.Xt.Et=!1);s.Zt.Et=t&&this.Jt.ti(this.yt),s.Xt.Et=t&&this.Jt.ii(),s.Zt.ct=i.horzLine.width,s.Zt.qt=i.horzLine.style,s.Zt.R=i.horzLine.color,s.Xt.ct=i.vertLine.width,s.Xt.qt=i.vertLine.style,s.Xt.R=i.vertLine.color,s._t=this.Jt.si(),s.ut=this.Jt.ni()}}function V(t,i,s,n,e,r){t.fillRect(i+r,s,n-2*r,r),t.fillRect(i+r,s+e-r,n-2*r,r),t.fillRect(i,s,r,e),t.fillRect(i+n-r,s,r,e)}function z(t,i,s,n,e,r){t.save(),t.globalCompositeOperation="copy",t.fillStyle=r,t.fillRect(i,s,n,e),t.restore()}function I(t,i,s,n,e,r){t.beginPath(),t.roundRect?t.roundRect(i,s,n,e,r):(t.lineTo(i+n-r[1],s),0!==r[1]&&t.arcTo(i+n,s,i+n,s+r[1],r[1]),t.lineTo(i+n,s+e-r[2]),0!==r[2]&&t.arcTo(i+n,s+e,i+n-r[2],s+e,r[2]),t.lineTo(i+r[3],s+e),0!==r[3]&&t.arcTo(i,s+e,i,s+e-r[3],r[3]),t.lineTo(i,s+r[0]),0!==r[0]&&t.arcTo(i,s,i+r[0],s,r[0]))}function A(t,i,s,n,e,r,h=0,l=[0,0,0,0],a=""){if(t.save(),!h||!a||a===r)return I(t,i,s,n,e,l),t.fillStyle=r,t.fill(),void t.restore();const o=h/2;var _;I(t,i+o,s+o,n-h,e-h,(_=-o,l.map((t=>0===t?t:t+_)))),"transparent"!==r&&(t.fillStyle=r,t.fill()),"transparent"!==a&&(t.lineWidth=h,t.strokeStyle=a,t.closePath(),t.stroke()),t.restore()}function B(t,i,s,n,e,r,h){t.save(),t.globalCompositeOperation="copy";const l=t.createLinearGradient(0,0,0,e);l.addColorStop(0,r),l.addColorStop(1,h),t.fillStyle=l,t.fillRect(i,s,n,e),t.restore()}class L{constructor(t,i){this.ht(t,i)}ht(t,i){this.Yt=t,this.ei=i}Ut(t,i){return this.Yt.Et?t.P+t.B+t.V:0}nt(t,i,s,n){if(!this.Yt.Et||0===this.Yt.ri.length)return;const e=this.Yt.R,r=this.ei.G,h=t.useBitmapCoordinateSpace((t=>{const h=t.context;h.font=i.k;const l=this.hi(t,i,s,n),a=l.li;return l.ai?A(h,a.oi,a._i,a.ui,a.ci,r,a.di,[a.ft,0,0,a.ft],r):A(h,a.fi,a._i,a.ui,a.ci,r,a.di,[0,a.ft,a.ft,0],r),this.Yt.pi&&(h.fillStyle=e,h.fillRect(a.fi,a.mi,a.wi-a.fi,a.gi)),this.Yt.bi&&(h.fillStyle=i.D,h.fillRect(l.ai?a.Mi-a.di:0,a._i,a.di,a.Si-a._i)),l}));t.useMediaCoordinateSpace((({context:t})=>{const s=h.xi;t.font=i.k,t.textAlign=h.ai?"right":"left",t.textBaseline="middle",t.fillStyle=e,t.fillText(this.Yt.ri,s.Ci,(s._i+s.Si)/2+s.yi)}))}hi(t,i,s,n){const{context:e,bitmapSize:r,mediaSize:h,horizontalPixelRatio:l,verticalPixelRatio:a}=t,o=this.Yt.pi||!this.Yt.Pi?i.C:0,_=this.Yt.ki?i.S:0,u=i.B+this.ei.Ti,c=i.V+this.ei.Ri,d=i.I,f=i.A,p=this.Yt.ri,v=i.P,m=s.Di(e,p),w=Math.ceil(s.Ei(e,p)),g=v+u+c,b=i.S+d+f+w+o,M=Math.max(1,Math.floor(a));let S=Math.round(g*a);S%2!=M%2&&(S+=1);const x=_>0?Math.max(1,Math.floor(_*l)):0,C=Math.round(b*l),y=Math.round(o*l),P=this.ei.Vi??this.ei.zi,k=Math.round(P*a)-Math.floor(.5*a),T=Math.floor(k+M/2-S/2),R=T+S,D="right"===n,E=D?h.width-_:_,V=D?r.width-x:x;let z,I,A;return D?(z=V-C,I=V-y,A=E-o-d-_):(z=V+C,I=V+y,A=E+o+d),{ai:D,li:{_i:T,mi:k,Si:R,ui:C,ci:S,ft:2*l,di:x,oi:z,fi:V,wi:I,gi:M,Mi:r.width},xi:{_i:T/a,Si:R/a,Ci:A,yi:m}}}}class O{constructor(t){this.Ii={zi:0,G:"#000",Ri:0,Ti:0},this.Ai={ri:"",Et:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",bi:!1,ki:!1},this.Bi={ri:"",Et:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",bi:!0,ki:!0},this.xt=!0,this.Li=new(t||L)(this.Ai,this.Ii),this.Oi=new(t||L)(this.Bi,this.Ii)}ri(){return this.Ni(),this.Ai.ri}zi(){return this.Ni(),this.Ii.zi}Pt(){this.xt=!0}Ut(t,i=!1){return Math.max(this.Li.Ut(t,i),this.Oi.Ut(t,i))}Fi(){return this.Ii.Vi||0}Wi(t){this.Ii.Vi=t}Hi(){return this.Ni(),this.Ai.Et||this.Bi.Et}$i(){return this.Ni(),this.Ai.Et}Tt(t){return this.Ni(),this.Ai.pi=this.Ai.pi&&t.N().ticksVisible,this.Bi.pi=this.Bi.pi&&t.N().ticksVisible,this.Li.ht(this.Ai,this.Ii),this.Oi.ht(this.Bi,this.Ii),this.Li}Ui(){return this.Ni(),this.Li.ht(this.Ai,this.Ii),this.Oi.ht(this.Bi,this.Ii),this.Oi}Ni(){this.xt&&(this.Ai.pi=!0,this.Bi.pi=!1,this.ji(this.Ai,this.Bi,this.Ii))}}class N extends O{constructor(t,i,s){super(),this.Jt=t,this.Yi=i,this.Xi=s}ji(t,i,s){if(t.Et=!1,2===this.Jt.N().mode)return;const n=this.Jt.N().horzLine;if(!n.labelVisible)return;const e=this.Yi.Bt();if(!this.Jt.Et()||this.Yi.Zi()||null===e)return;const r=this.Yi.qi().q(n.labelBackgroundColor);s.G=r.G,t.R=r.K;const h=2/12*this.Yi.P();s.Ti=h,s.Ri=h;const l=this.Xi(this.Yi);s.zi=l.zi,t.ri=this.Yi.Gi(l.gt,e),t.Et=!0}}const F=/[1-9]/g;class W{constructor(){this.Yt=null}ht(t){this.Yt=t}nt(t,i){if(null===this.Yt||!1===this.Yt.Et||0===this.Yt.ri.length)return;const s=t.useMediaCoordinateSpace((({context:t})=>(t.font=i.k,Math.round(i.Ki.Ei(t,l(this.Yt).ri,F)))));if(s<=0)return;const n=i.Ji,e=s+2*n,r=e/2,h=this.Yt.Qi;let a=this.Yt.zi,o=Math.floor(a-r)+.5;o<0?(a+=Math.abs(0-o),o=Math.floor(a-r)+.5):o+e>h&&(a-=Math.abs(h-(o+e)),o=Math.floor(a-r)+.5);const _=o+e,u=Math.ceil(0+i.S+i.C+i.B+i.P+i.V);t.useBitmapCoordinateSpace((({context:t,horizontalPixelRatio:s,verticalPixelRatio:n})=>{const e=l(this.Yt);t.fillStyle=e.G;const r=Math.round(o*s),h=Math.round(0*n),a=Math.round(_*s),c=Math.round(u*n),d=Math.round(2*s);if(t.beginPath(),t.moveTo(r,h),t.lineTo(r,c-d),t.arcTo(r,c,r+d,c,d),t.lineTo(a-d,c),t.arcTo(a,c,a,c-d,d),t.lineTo(a,h),t.fill(),e.pi){const r=Math.round(e.zi*s),l=h,a=Math.round((l+i.C)*n);t.fillStyle=e.R;const o=Math.max(1,Math.floor(s)),_=Math.floor(.5*s);t.fillRect(r-_,l,o,a-l)}})),t.useMediaCoordinateSpace((({context:t})=>{const s=l(this.Yt),e=0+i.S+i.C+i.B+i.P/2;t.font=i.k,t.textAlign="left",t.textBaseline="middle",t.fillStyle=s.R;const r=i.Ki.Di(t,"Apr0");t.translate(o+n,e+r),t.fillText(s.ri,0,0)}))}}class H{constructor(t,i,s){this.xt=!0,this.Kt=new W,this.Gt={Et:!1,G:"#4c525e",R:"white",ri:"",Qi:0,zi:NaN,pi:!0},this.Ct=t,this.ts=i,this.Xi=s}Pt(){this.xt=!0}Tt(){return this.xt&&(this.Rt(),this.xt=!1),this.Kt.ht(this.Gt),this.Kt}Rt(){const t=this.Gt;if(t.Et=!1,2===this.Ct.N().mode)return;const i=this.Ct.N().vertLine;if(!i.labelVisible)return;const s=this.ts.It();if(s.Zi())return;t.Qi=s.Qi();const n=this.Xi();if(null===n)return;t.zi=n.zi;const e=s.ss(this.Ct.zt());t.ri=s.ns(l(e)),t.Et=!0;const r=this.ts.qi().q(i.labelBackgroundColor);t.G=r.G,t.R=r.K,t.pi=s.N().ticksVisible}}class ${constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(t){this.rs=t}Ft(){return this.es}os(t){this.es=t}_s(t){return[]}us(){return[]}Et(){return!0}}var U;!function(t){t[t.Normal=0]="Normal",t[t.Magnet=1]="Magnet",t[t.Hidden=2]="Hidden",t[t.MagnetOHLC=3]="MagnetOHLC"}(U||(U={}));class j extends ${constructor(t,i){super(),this.yt=null,this.cs=NaN,this.ds=0,this.fs=!1,this.ps=new Map,this.vs=!1,this.ws=new WeakMap,this.gs=new WeakMap,this.bs=NaN,this.Ms=NaN,this.Ss=NaN,this.xs=NaN,this.ts=t,this.Cs=i;this.ys=((t,i)=>s=>{const n=i(),e=t();if(s===l(this.yt).Ps())return{gt:e,zi:n};{const t=l(s.Bt());return{gt:s.ks(n,t),zi:n}}})((()=>this.cs),(()=>this.Ms));const s=((t,i)=>()=>{const s=this.ts.It().Ts(t()),n=i();return s&&Number.isFinite(n)?{wt:s,zi:n}:null})((()=>this.ds),(()=>this.si()));this.Rs=new H(this,t,s)}N(){return this.Cs}Ds(t,i){this.Ss=t,this.xs=i}Es(){this.Ss=NaN,this.xs=NaN}Vs(){return this.Ss}zs(){return this.xs}Is(t,i,s){this.vs||(this.vs=!0),this.fs=!0,this.As(t,i,s)}zt(){return this.ds}si(){return this.bs}ni(){return this.Ms}Et(){return this.fs}Bs(){this.fs=!1,this.Ls(),this.cs=NaN,this.bs=NaN,this.Ms=NaN,this.yt=null,this.Es(),this.Os()}Ns(t){let i=this.ws.get(t);i||(i=new E(this,t),this.ws.set(t,i));let s=this.gs.get(t);return s||(s=new R(this.ts,this,t),this.gs.set(t,s)),[i,s]}ti(t){return t===this.yt&&this.Cs.horzLine.visible}ii(){return this.Cs.vertLine.visible}Fs(t,i){this.fs&&this.yt===t||this.ps.clear();const s=[];return this.yt===t&&s.push(this.Ws(this.ps,i,this.ys)),s}us(){return this.fs?[this.Rs]:[]}Hs(){return this.yt}Os(){this.ts.$s().forEach((t=>{this.ws.get(t)?.Pt(),this.gs.get(t)?.Pt()})),this.ps.forEach((t=>t.Pt())),this.Rs.Pt()}Us(t){return t&&!t.Ps().Zi()?t.Ps():null}As(t,i,s){this.js(t,i,s)&&this.Os()}js(t,i,s){const n=this.bs,e=this.Ms,r=this.cs,h=this.ds,l=this.yt,a=this.Us(s);this.ds=t,this.bs=isNaN(t)?NaN:this.ts.It().jt(t),this.yt=s;const o=null!==a?a.Bt():null;return null!==a&&null!==o?(this.cs=i,this.Ms=a.Nt(i,o)):(this.cs=NaN,this.Ms=NaN),n!==this.bs||e!==this.Ms||h!==this.ds||r!==this.cs||l!==this.yt}Ls(){const t=this.ts.Ys().map((t=>t.Zs().Xs())).filter(v),i=0===t.length?null:Math.max(...t);this.ds=null!==i?i:NaN}Ws(t,i,s){let n=t.get(i);return void 0===n&&(n=new N(this,i,s),t.set(i,n)),n}}function Y(t){return"left"===t||"right"===t}class X{constructor(t){this.qs=new Map,this.Gs=[],this.Ks=t}Js(t,i){const s=function(t,i){return void 0===t?i:{Qs:Math.max(t.Qs,i.Qs),tn:t.tn||i.tn}}(this.qs.get(t),i);this.qs.set(t,s)}sn(){return this.Ks}nn(t){const i=this.qs.get(t);return void 0===i?{Qs:this.Ks}:{Qs:Math.max(this.Ks,i.Qs),tn:i.tn}}en(){this.rn(),this.Gs=[{hn:0}]}ln(t){this.rn(),this.Gs=[{hn:1,Wt:t}]}an(t){this._n(),this.Gs.push({hn:5,Wt:t})}rn(){this._n(),this.Gs.push({hn:6})}un(){this.rn(),this.Gs=[{hn:4}]}cn(t){this.rn(),this.Gs.push({hn:2,Wt:t})}dn(t){this.rn(),this.Gs.push({hn:3,Wt:t})}fn(){return this.Gs}pn(t){for(const i of t.Gs)this.vn(i);this.Ks=Math.max(this.Ks,t.Ks),t.qs.forEach(((t,i)=>{this.Js(i,t)}))}static mn(){return new X(2)}static wn(){return new X(3)}vn(t){switch(t.hn){case 0:this.en();break;case 1:this.ln(t.Wt);break;case 2:this.cn(t.Wt);break;case 3:this.dn(t.Wt);break;case 4:this.un();break;case 5:this.an(t.Wt);break;case 6:this._n()}}_n(){const t=this.Gs.findIndex((t=>5===t.hn));-1!==t&&this.Gs.splice(t,1)}}const Z=".";function q(t,i){if(!u(t))return"n/a";if(!c(i))throw new TypeError("invalid length");if(i<0||i>16)throw new TypeError("invalid length");if(0===i)return t.toString();return("0000000000000000"+t.toString()).slice(-i)}class G{constructor(t,i){if(i||(i=1),u(t)&&c(t)||(t=100),t<0)throw new TypeError("invalid base");this.Yi=t,this.gn=i,this.bn()}format(t){const i=t<0?"−":"";return t=Math.abs(t),i+this.Mn(t)}bn(){if(this.Sn=0,this.Yi>0&&this.gn>0){let t=this.Yi;for(;t>1;)t/=10,this.Sn++}}Mn(t){const i=this.Yi/this.gn;let s=Math.floor(t),n="";const e=void 0!==this.Sn?this.Sn:NaN;if(i>1){let r=+(Math.round(t*i)-s*i).toFixed(this.Sn);r>=i&&(r-=i,s+=1),n=Z+q(+r.toFixed(this.Sn)*this.gn,e)}else s=Math.round(s*i)/i,e>0&&(n=Z+q(0,e));return s.toFixed(0)+n}}class K extends G{constructor(t=100){super(t)}format(t){return`${super.format(t)}%`}}class J{constructor(t){this.xn=t}format(t){let i="";return t<0&&(i="-",t=-t),t<995?i+this.Cn(t):t<999995?i+this.Cn(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),i+this.Cn(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),i+this.Cn(t/1e9)+"B")}Cn(t){let i;const s=Math.pow(10,this.xn);return i=(t=Math.round(t*s)/s)>=1e-15&&t<1?t.toFixed(this.xn).replace(/\.?0+$/,""):String(t),i.replace(/(\.[1-9]*)0+$/,((t,i)=>i))}}const Q=/[2-9]/g;class tt{constructor(t=50){this.yn=0,this.Pn=1,this.kn=1,this.Tn={},this.Rn=new Map,this.Dn=t}En(){this.yn=0,this.Rn.clear(),this.Pn=1,this.kn=1,this.Tn={}}Ei(t,i,s){return this.Vn(t,i,s).width}Di(t,i,s){const n=this.Vn(t,i,s);return((n.actualBoundingBoxAscent||0)-(n.actualBoundingBoxDescent||0))/2}Vn(t,i,s){const n=s||Q,e=String(i).replace(n,"0");if(this.Rn.has(e))return h(this.Rn.get(e)).zn;if(this.yn===this.Dn){const t=this.Tn[this.kn];delete this.Tn[this.kn],this.Rn.delete(t),this.kn++,this.yn--}t.save(),t.textBaseline="middle";const r=t.measureText(e);return t.restore(),0===r.width&&i.length||(this.Rn.set(e,{zn:r,In:this.Pn}),this.Tn[this.Pn]=e,this.yn++,this.Pn++),r}}class it{constructor(t){this.An=null,this.M=null,this.Bn="right",this.Ln=t}On(t,i,s){this.An=t,this.M=i,this.Bn=s}nt(t){null!==this.M&&null!==this.An&&this.An.nt(t,this.M,this.Ln,this.Bn)}}class st{constructor(t,i,s){this.Nn=t,this.Ln=new tt(50),this.Fn=i,this.O=s,this.F=-1,this.Kt=new it(this.Ln)}Tt(){const t=this.O.Wn(this.Fn);if(null===t)return null;const i=t.Hn(this.Fn)?t.$n():this.Fn.Ft();if(null===i)return null;const s=t.Un(i);if("overlay"===s)return null;const n=this.O.jn();return n.P!==this.F&&(this.F=n.P,this.Ln.En()),this.Kt.On(this.Nn.Ui(),n,s),this.Kt}}class nt extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}Yn(t,i){if(!this.Yt?.Et)return null;const{ut:s,ct:n,Xn:e}=this.Yt;return i>=s-n-7&&i<=s+n+7?{Zn:this.Yt,Xn:e}:null}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:r}){if(null===this.Yt)return;if(!1===this.Yt.Et)return;const h=Math.round(this.Yt.ut*r);h<0||h>i.height||(t.lineCap="butt",t.strokeStyle=this.Yt.R,t.lineWidth=Math.floor(this.Yt.ct*s),n(t,this.Yt.qt),e(t,h,0,i.width))}}class et{constructor(t){this.qn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,qt:0,Et:!1},this.Gn=new nt,this.xt=!0,this.Kn=t,this.Jn=t.Qt(),this.Gn.ht(this.qn)}Pt(){this.xt=!0}Tt(){return this.Kn.Et()?(this.xt&&(this.Qn(),this.xt=!1),this.Gn):null}}class rt extends et{constructor(t){super(t)}Qn(){this.qn.Et=!1;const t=this.Kn.Ft(),i=t.te().te;if(2!==i&&3!==i)return;const s=this.Kn.N();if(!s.baseLineVisible||!this.Kn.Et())return;const n=this.Kn.Bt();null!==n&&(this.qn.Et=!0,this.qn.ut=t.Nt(n.Wt,n.Wt),this.qn.R=s.baseLineColor,this.qn.ct=s.baseLineWidth,this.qn.qt=s.baseLineStyle)}}class ht extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}ie(){return this.Yt}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){const n=this.Yt;if(null===n)return;const e=Math.max(1,Math.floor(i)),r=e%2/2,h=Math.round(n.se.x*i)+r,l=n.se.y*s;t.fillStyle=n.ne,t.beginPath();const a=Math.max(2,1.5*n.ee)*i;t.arc(h,l,a,0,2*Math.PI,!1),t.fill(),t.fillStyle=n.re,t.beginPath(),t.arc(h,l,n.ft*i,0,2*Math.PI,!1),t.fill(),t.lineWidth=e,t.strokeStyle=n.he,t.beginPath(),t.arc(h,l,n.ft*i+e/2,0,2*Math.PI,!1),t.stroke()}}const lt=[{le:0,ae:.25,oe:4,_e:10,ue:.25,ce:0,de:.4,fe:.8},{le:.25,ae:.525,oe:10,_e:14,ue:0,ce:0,de:.8,fe:0},{le:.525,ae:1,oe:14,_e:14,ue:0,ce:0,de:0,fe:0}];class at{constructor(t){this.Kt=new ht,this.xt=!0,this.pe=!0,this.ve=performance.now(),this.me=this.ve-1,this.we=t}ge(){this.me=this.ve-1,this.Pt()}be(){if(this.Pt(),2===this.we.N().lastPriceAnimation){const t=performance.now(),i=this.me-t;if(i>0)return void(i<650&&(this.me+=2600));this.ve=t,this.me=t+2600}}Pt(){this.xt=!0}Me(){this.pe=!0}Et(){return 0!==this.we.N().lastPriceAnimation}Se(){switch(this.we.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.me}}Tt(){return this.xt?(this.Rt(),this.xt=!1,this.pe=!1):this.pe&&(this.xe(),this.pe=!1),this.Kt}Rt(){this.Kt.ht(null);const t=this.we.Qt().It(),i=t.Ce(),s=this.we.Bt();if(null===i||null===s)return;const n=this.we.ye(!0);if(n.Pe||!i.ke(n.Te))return;const e={x:t.jt(n.Te),y:this.we.Ft().Nt(n.gt,s.Wt)},r=n.R,h=this.we.N().lineWidth,l=this.Re(this.De(),r);this.Kt.ht({ne:r,ee:h,re:l.re,he:l.he,ft:l.ft,se:e})}xe(){const t=this.Kt.ie();if(null!==t){const i=this.Re(this.De(),t.ne);t.re=i.re,t.he=i.he,t.ft=i.ft}}De(){return this.Se()?performance.now()-this.ve:2599}Ee(t,i,s,n){const e=s+(n-s)*i;return this.we.Qt().qi().X(t,e)}Re(t,i){const s=t%2600/2600;let n;for(const t of lt)if(s>=t.le&&s<=t.ae){n=t;break}r(void 0!==n,"Last price animation internal logic error");const e=(s-n.le)/(n.ae-n.le);return{re:this.Ee(i,e,n.ue,n.ce),he:this.Ee(i,e,n.de,n.fe),ft:(h=e,l=n.oe,a=n._e,l+(a-l)*h)};var h,l,a}}class ot extends et{constructor(t){super(t)}Qn(){const t=this.qn;t.Et=!1;const i=this.Kn.N();if(!i.priceLineVisible||!this.Kn.Et())return;const s=this.Kn.ye(0===i.priceLineSource);s.Pe||(t.Et=!0,t.ut=s.zi,t.R=this.Kn.Ve(s.R),t.ct=i.priceLineWidth,t.qt=i.priceLineStyle)}}class _t extends O{constructor(t){super(),this.Jt=t}ji(t,i,s){t.Et=!1,i.Et=!1;const n=this.Jt;if(!n.Et())return;const e=n.N(),r=e.lastValueVisible,h=""!==n.ze(),l=0===e.seriesLastValueMode,a=n.ye(!1);if(a.Pe)return;r&&(t.ri=this.Ie(a,r,l),t.Et=0!==t.ri.length),(h||l)&&(i.ri=this.Ae(a,r,h,l),i.Et=i.ri.length>0);const o=n.Ve(a.R),_=this.Jt.Qt().qi().q(o);s.G=_.G,s.zi=a.zi,i.Ht=n.Qt().$t(a.zi/n.Ft().Ut()),t.Ht=o,t.R=_.K,i.R=_.K}Ae(t,i,s,n){let e="";const r=this.Jt.ze();return s&&0!==r.length&&(e+=`${r} `),i&&n&&(e+=this.Jt.Ft().Be()?t.Le:t.Oe),e.trim()}Ie(t,i,s){return i?s?this.Jt.Ft().Be()?t.Oe:t.Le:t.ri:""}}function ut(t,i,s,n){const e=Number.isFinite(i),r=Number.isFinite(s);return e&&r?t(i,s):e||r?e?i:s:n}class ct{constructor(t,i){this.Ne=t,this.Fe=i}We(t){return null!==t&&(this.Ne===t.Ne&&this.Fe===t.Fe)}He(){return new ct(this.Ne,this.Fe)}$e(){return this.Ne}Ue(){return this.Fe}je(){return this.Fe-this.Ne}Zi(){return this.Fe===this.Ne||Number.isNaN(this.Fe)||Number.isNaN(this.Ne)}pn(t){return null===t?this:new ct(ut(Math.min,this.$e(),t.$e(),-1/0),ut(Math.max,this.Ue(),t.Ue(),1/0))}Ye(t){if(!u(t))return;if(0===this.Fe-this.Ne)return;const i=.5*(this.Fe+this.Ne);let s=this.Fe-i,n=this.Ne-i;s*=t,n*=t,this.Fe=i+s,this.Ne=i+n}Xe(t){u(t)&&(this.Fe+=t,this.Ne+=t)}Ze(){return{minValue:this.Ne,maxValue:this.Fe}}static qe(t){return null===t?null:new ct(t.minValue,t.maxValue)}}class dt{constructor(t,i){this.Ge=t,this.Ke=i||null}Je(){return this.Ge}Qe(){return this.Ke}Ze(){return{priceRange:null===this.Ge?null:this.Ge.Ze(),margins:this.Ke||void 0}}static qe(t){return null===t?null:new dt(ct.qe(t.priceRange),t.margins)}}class ft extends et{constructor(t,i){super(t),this.tr=i}Qn(){const t=this.qn;t.Et=!1;const i=this.tr.N();if(!this.Kn.Et()||!i.lineVisible)return;const s=this.tr.ir();null!==s&&(t.Et=!0,t.ut=s,t.R=i.color,t.ct=i.lineWidth,t.qt=i.lineStyle,t.Xn=this.tr.N().id)}}class pt extends O{constructor(t,i){super(),this.we=t,this.tr=i}ji(t,i,s){t.Et=!1,i.Et=!1;const n=this.tr.N(),e=n.axisLabelVisible,r=""!==n.title,h=this.we;if(!e||!h.Et())return;const l=this.tr.ir();if(null===l)return;r&&(i.ri=n.title,i.Et=!0),i.Ht=h.Qt().$t(l/h.Ft().Ut()),t.ri=this.sr(n.price),t.Et=!0;const a=this.we.Qt().qi().q(n.axisLabelColor||n.color);s.G=a.G;const o=n.axisLabelTextColor||a.K;t.R=o,i.R=o,s.zi=l}sr(t){const i=this.we.Bt();return null===i?"":this.we.Ft().Gi(t,i.Wt)}}class vt{constructor(t,i){this.we=t,this.Cs=i,this.nr=new ft(t,this),this.Nn=new pt(t,this),this.er=new st(this.Nn,t,t.Qt())}rr(t){_(this.Cs,t),this.Pt(),this.we.Qt().hr()}N(){return this.Cs}lr(){return this.nr}ar(){return this.er}_r(){return this.Nn}Pt(){this.nr.Pt(),this.Nn.Pt()}ir(){const t=this.we,i=t.Ft();if(t.Qt().It().Zi()||i.Zi())return null;const s=t.Bt();return null===s?null:i.Nt(this.Cs.price,s.Wt)}}class mt extends ${constructor(t){super(),this.ts=t}Qt(){return this.ts}}const wt={Bar:(t,i,s,n)=>{const e=i.upColor,r=i.downColor,h=l(t(s,n)),o=a(h.Wt[0])<=a(h.Wt[3]);return{ur:h.R??(o?e:r)}},Candlestick:(t,i,s,n)=>{const e=i.upColor,r=i.downColor,h=i.borderUpColor,o=i.borderDownColor,_=i.wickUpColor,u=i.wickDownColor,c=l(t(s,n)),d=a(c.Wt[0])<=a(c.Wt[3]);return{ur:c.R??(d?e:r),cr:c.Ht??(d?h:o),dr:c.pr??(d?_:u)}},Custom:(t,i,s,n)=>({ur:l(t(s,n)).R??i.color}),Area:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.vt??i.lineColor,vt:e.vt??i.lineColor,vr:e.vr??i.topColor,mr:e.mr??i.bottomColor}},Baseline:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.Wt[3]>=i.baseValue.price?i.topLineColor:i.bottomLineColor,wr:e.wr??i.topLineColor,gr:e.gr??i.bottomLineColor,br:e.br??i.topFillColor1,Mr:e.Mr??i.topFillColor2,Sr:e.Sr??i.bottomFillColor1,Cr:e.Cr??i.bottomFillColor2}},Line:(t,i,s,n)=>{const e=l(t(s,n));return{ur:e.R??i.color,vt:e.R??i.color}},Histogram:(t,i,s,n)=>({ur:l(t(s,n)).R??i.color})};class gt{constructor(t){this.yr=(t,i)=>void 0!==i?i.Wt:this.we.Zs().Pr(t),this.we=t,this.kr=wt[t.Tr()]}Rr(t,i){return this.kr(this.yr,this.we.N(),t,i)}}function bt(t,i,s,n,e=0,r=i.length){let h=r-e;for(;0>1,l=e+r;n(i[l],s)===t?(e=l+1,h-=r+1):h=r}return e}const Mt=bt.bind(null,!0),St=bt.bind(null,!1);var xt;!function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.None=0]="None",t[t.NearestRight=1]="NearestRight"}(xt||(xt={}));const Ct=30;class yt{constructor(){this.Dr=[],this.Er=new Map,this.Vr=new Map,this.zr=[]}Ir(){return this.Ar()>0?this.Dr[this.Dr.length-1]:null}Br(){return this.Ar()>0?this.Lr(0):null}Xs(){return this.Ar()>0?this.Lr(this.Dr.length-1):null}Ar(){return this.Dr.length}Zi(){return 0===this.Ar()}ke(t){return null!==this.Or(t,0)}Pr(t){return this.Nr(t)}Nr(t,i=0){const s=this.Or(t,i);return null===s?null:{...this.Fr(s),Te:this.Lr(s)}}Wr(){return this.Dr}Hr(t,i,s){if(this.Zi())return null;let n=null;for(const e of s){n=Pt(n,this.$r(t,i,e))}return n}ht(t){this.Vr.clear(),this.Er.clear(),this.Dr=t,this.zr=t.map((t=>t.Te))}Ur(){return this.zr}Lr(t){return this.Dr[t].Te}Fr(t){return this.Dr[t]}Or(t,i){const s=this.jr(t);if(null===s&&0!==i)switch(i){case-1:return this.Yr(t);case 1:return this.Xr(t);default:throw new TypeError("Unknown search mode")}return s}Yr(t){let i=this.Zr(t);return i>0&&(i-=1),i!==this.Dr.length&&this.Lr(i)t.Tet.Te>i))}Gr(t,i,s){let n=null;for(let e=t;en.Jr&&(n.Jr=t)))}return n}$r(t,i,s){if(this.Zi())return null;let n=null;const e=l(this.Br()),r=l(this.Xs()),h=Math.max(t,e),a=Math.min(i,r),o=Math.ceil(h/Ct)*Ct,_=Math.max(o,Math.floor(a/Ct)*Ct);{const t=this.Zr(h),e=this.qr(Math.min(a,o,i));n=Pt(n,this.Gr(t,e,s))}let u=this.Er.get(s);void 0===u&&(u=new Map,this.Er.set(s,u));for(let t=Math.max(o+1,h);t<_;t+=Ct){const i=Math.floor(t/Ct);let e=u.get(i);if(void 0===e){const t=this.Zr(i*Ct),n=this.qr((i+1)*Ct-1);e=this.Gr(t,n,s),u.set(i,e)}n=Pt(n,e)}{const t=this.Zr(_),i=this.qr(a);n=Pt(n,this.Gr(t,i,s))}return n}}function Pt(t,i){if(null===t)return i;if(null===i)return t;return{Kr:Math.min(t.Kr,i.Kr),Jr:Math.max(t.Jr,i.Jr)}}class kt{constructor(t){this.Qr=t}nt(t,i,s){this.Qr.draw(t)}th(t,i,s){this.Qr.drawBackground?.(t)}}class Tt{constructor(t){this.Rn=null,this.ih=t}Tt(){const t=this.ih.renderer();if(null===t)return null;if(this.Rn?.sh===t)return this.Rn.nh;const i=new kt(t);return this.Rn={sh:t,nh:i},i}eh(){return this.ih.zOrder?.()??"normal"}}class Rt{constructor(t){this.rh=null,this.hh=t}ah(){return this.hh}Os(){this.hh.updateAllViews?.()}Ns(){const t=this.hh.paneViews?.()??[];if(this.rh?.sh===t)return this.rh.nh;const i=t.map((t=>new Tt(t)));return this.rh={sh:t,nh:i},i}Yn(t,i){return this.hh.hitTest?.(t,i)??null}}class Dt extends Rt{_s(){return[]}}class Et{constructor(t){this.Qr=t}nt(t,i,s){this.Qr.draw(t)}th(t,i,s){this.Qr.drawBackground?.(t)}}class Vt{constructor(t){this.Rn=null,this.ih=t}Tt(){const t=this.ih.renderer();if(null===t)return null;if(this.Rn?.sh===t)return this.Rn.nh;const i=new Et(t);return this.Rn={sh:t,nh:i},i}eh(){return this.ih.zOrder?.()??"normal"}}function zt(t){return{ri:t.text(),zi:t.coordinate(),Vi:t.fixedCoordinate?.(),R:t.textColor(),G:t.backColor(),Et:t.visible?.()??!0,pi:t.tickVisible?.()??!0}}class It{constructor(t,i){this.Kt=new W,this.oh=t,this._h=i}Tt(){return this.Kt.ht({Qi:this._h.Qi(),...zt(this.oh)}),this.Kt}}class At extends O{constructor(t,i){super(),this.oh=t,this.Yi=i}ji(t,i,s){const n=zt(this.oh);s.G=n.G,t.R=n.R;const e=2/12*this.Yi.P();s.Ti=e,s.Ri=e,s.zi=n.zi,s.Vi=n.Vi,t.ri=n.ri,t.Et=n.Et,t.pi=n.pi}}class Bt extends Rt{constructor(t,i){super(t),this.uh=null,this.dh=null,this.fh=null,this.ph=null,this.we=i}us(){const t=this.hh.timeAxisViews?.()??[];if(this.uh?.sh===t)return this.uh.nh;const i=this.we.Qt().It(),s=t.map((t=>new It(t,i)));return this.uh={sh:t,nh:s},s}Fs(){const t=this.hh.priceAxisViews?.()??[];if(this.dh?.sh===t)return this.dh.nh;const i=this.we.Ft(),s=t.map((t=>new At(t,i)));return this.dh={sh:t,nh:s},s}mh(){const t=this.hh.priceAxisPaneViews?.()??[];if(this.fh?.sh===t)return this.fh.nh;const i=t.map((t=>new Vt(t)));return this.fh={sh:t,nh:i},i}wh(){const t=this.hh.timeAxisPaneViews?.()??[];if(this.ph?.sh===t)return this.ph.nh;const i=t.map((t=>new Vt(t)));return this.ph={sh:t,nh:i},i}gh(t,i){return this.hh.autoscaleInfo?.(t,i)??null}}function Lt(t,i,s,n){t.forEach((t=>{i(t).forEach((t=>{t.eh()===s&&n.push(t)}))}))}function Ot(t){return t.Ns()}function Nt(t){return t.mh()}function Ft(t){return t.wh()}const Wt=["Area","Line","Baseline"];class Ht extends mt{constructor(t,i,s,n,e){super(t),this.Yt=new yt,this.nr=new ot(this),this.bh=[],this.Mh=new rt(this),this.Sh=null,this.xh=null,this.Ch=null,this.yh=[],this.Cs=s,this.Ph=i;const r=new _t(this);this.ps=[r],this.er=new st(r,this,t),Wt.includes(this.Ph)&&(this.Sh=new at(this)),this.kh(),this.ih=n(this,this.Qt(),e)}m(){null!==this.Ch&&clearTimeout(this.Ch)}Ve(t){return this.Cs.priceLineColor||t}ye(t){const i={Pe:!0},s=this.Ft();if(this.Qt().It().Zi()||s.Zi()||this.Yt.Zi())return i;const n=this.Qt().It().Ce(),e=this.Bt();if(null===n||null===e)return i;let r,h;if(t){const t=this.Yt.Ir();if(null===t)return i;r=t,h=t.Te}else{const t=this.Yt.Nr(n.Mi(),-1);if(null===t)return i;if(r=this.Yt.Pr(t.Te),null===r)return i;h=t.Te}const l=r.Wt[3],a=this.Th().Rr(h,{Wt:r}),o=s.Nt(l,e.Wt);return{Pe:!1,gt:l,ri:s.Gi(l,e.Wt),Le:s.Rh(l),Oe:s.Dh(l,e.Wt),R:a.ur,zi:o,Te:h}}Th(){return null!==this.xh||(this.xh=new gt(this)),this.xh}N(){return this.Cs}rr(t){const i=t.priceScaleId;void 0!==i&&i!==this.Cs.priceScaleId&&this.Qt().Eh(this,i),_(this.Cs,t),void 0!==t.priceFormat&&(this.kh(),this.Qt().Vh()),this.Qt().zh(this),this.Qt().Ih(),this.ih.Pt("options")}ht(t,i){this.Yt.ht(t),this.ih.Pt("data"),null!==this.Sh&&(i&&i.Ah?this.Sh.be():0===t.length&&this.Sh.ge());const s=this.Qt().Wn(this);this.Qt().Bh(s),this.Qt().zh(this),this.Qt().Ih(),this.Qt().hr()}Lh(t){const i=new vt(this,t);return this.bh.push(i),this.Qt().zh(this),i}Oh(t){const i=this.bh.indexOf(t);-1!==i&&this.bh.splice(i,1),this.Qt().zh(this)}Nh(){return this.bh}Tr(){return this.Ph}Bt(){const t=this.Fh();return null===t?null:{Wt:t.Wt[3],Wh:t.wt}}Fh(){const t=this.Qt().It().Ce();if(null===t)return null;const i=t.Hh();return this.Yt.Nr(i,1)}Zs(){return this.Yt}$h(t){const i=this.Yt.Pr(t);return null===i?null:"Bar"===this.Ph||"Candlestick"===this.Ph||"Custom"===this.Ph?{Uh:i.Wt[0],jh:i.Wt[1],Yh:i.Wt[2],Xh:i.Wt[3]}:i.Wt[3]}Zh(t){const i=[];Lt(this.yh,Ot,"top",i);const s=this.Sh;return null!==s&&s.Et()?(null===this.Ch&&s.Se()&&(this.Ch=setTimeout((()=>{this.Ch=null,this.Qt().qh()}),0)),s.Me(),i.unshift(s),i):i}Ns(){const t=[];this.Gh()||t.push(this.Mh),t.push(this.ih,this.nr);const i=this.bh.map((t=>t.lr()));return t.push(...i),Lt(this.yh,Ot,"normal",t),t}Kh(){return this.Jh(Ot,"bottom")}Qh(t){return this.Jh(Nt,t)}tl(t){return this.Jh(Ft,t)}il(t,i){return this.yh.map((s=>s.Yn(t,i))).filter((t=>null!==t))}_s(){return[this.er,...this.bh.map((t=>t.ar()))]}Fs(t,i){if(i!==this.es&&!this.Gh())return[];const s=[...this.ps];for(const t of this.bh)s.push(t._r());return this.yh.forEach((t=>{s.push(...t.Fs())})),s}us(){const t=[];return this.yh.forEach((i=>{t.push(...i.us())})),t}gh(t,i){if(void 0!==this.Cs.autoscaleInfoProvider){const s=this.Cs.autoscaleInfoProvider((()=>{const s=this.sl(t,i);return null===s?null:s.Ze()}));return dt.qe(s)}return this.sl(t,i)}nl(){return this.Cs.priceFormat.minMove}el(){return this.rl}Os(){this.ih.Pt();for(const t of this.ps)t.Pt();for(const t of this.bh)t.Pt();this.nr.Pt(),this.Mh.Pt(),this.Sh?.Pt(),this.yh.forEach((t=>t.Os()))}Ft(){return l(super.Ft())}At(t){if(!(("Line"===this.Ph||"Area"===this.Ph||"Baseline"===this.Ph)&&this.Cs.crosshairMarkerVisible))return null;const i=this.Yt.Pr(t);if(null===i)return null;return{gt:i.Wt[3],ft:this.hl(),Ht:this.ll(),Ot:this.al(),Lt:this.ol(t)}}ze(){return this.Cs.title}Et(){return this.Cs.visible}_l(t){this.yh.push(new Bt(t,this))}ul(t){this.yh=this.yh.filter((i=>i.ah()!==t))}cl(){if("Custom"===this.Ph)return t=>this.ih.dl(t)}fl(){if("Custom"===this.Ph)return t=>this.ih.pl(t)}vl(){return this.Yt.Ur()}Gh(){return!Y(this.Ft().ml())}sl(t,i){if(!c(t)||!c(i)||this.Yt.Zi())return null;const s="Line"===this.Ph||"Area"===this.Ph||"Baseline"===this.Ph||"Histogram"===this.Ph?[3]:[2,1],n=this.Yt.Hr(t,i,s);let e=null!==n?new ct(n.Kr,n.Jr):null,r=null;if("Histogram"===this.Tr()){const t=this.Cs.base,i=new ct(t,t);e=null!==e?e.pn(i):i}return this.yh.forEach((s=>{const n=s.gh(t,i);if(n?.priceRange){const t=new ct(n.priceRange.minValue,n.priceRange.maxValue);e=null!==e?e.pn(t):t}n?.margins&&(r=n.margins)})),new dt(e,r)}hl(){switch(this.Ph){case"Line":case"Area":case"Baseline":return this.Cs.crosshairMarkerRadius}return 0}ll(){switch(this.Ph){case"Line":case"Area":case"Baseline":{const t=this.Cs.crosshairMarkerBorderColor;if(0!==t.length)return t}}return null}al(){switch(this.Ph){case"Line":case"Area":case"Baseline":return this.Cs.crosshairMarkerBorderWidth}return 0}ol(t){switch(this.Ph){case"Line":case"Area":case"Baseline":{const t=this.Cs.crosshairMarkerBackgroundColor;if(0!==t.length)return t}}return this.Th().Rr(t).ur}kh(){switch(this.Cs.priceFormat.type){case"custom":this.rl={format:this.Cs.priceFormat.formatter};break;case"volume":this.rl=new J(this.Cs.priceFormat.precision);break;case"percent":this.rl=new K(this.Cs.priceFormat.precision);break;default:{const t=Math.pow(10,this.Cs.priceFormat.precision);this.rl=new G(t,this.Cs.priceFormat.minMove*t)}}null!==this.es&&this.es.wl()}Jh(t,i){const s=[];return Lt(this.yh,t,i,s),s}}const $t=[3],Ut=[0,1,2,3];class jt{constructor(t){this.Cs=t}gl(t,i,s){let n=t;if(0===this.Cs.mode)return n;const e=s.Ps(),r=e.Bt();if(null===r)return n;const h=e.Nt(t,r),l=s.bl().filter((t=>t instanceof Ht)).reduce(((t,n)=>{if(s.Hn(n)||!n.Et())return t;const e=n.Ft(),r=n.Zs();if(e.Zi()||!r.ke(i))return t;const h=r.Pr(i);if(null===h)return t;const l=a(n.Bt()),o=3===this.Cs.mode?Ut:$t;return t.concat(o.map((t=>e.Nt(h.Wt[t],l.Wt))))}),[]);if(0===l.length)return n;l.sort(((t,i)=>Math.abs(t-h)-Math.abs(i-h)));const o=l[0];return n=e.ks(o,r),n}}function Yt(t,i,s){return Math.min(Math.max(t,i),s)}function Xt(t,i,s){return i-t<=s}class Zt extends y{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){if(null===this.Yt)return;const r=Math.max(1,Math.floor(s));t.lineWidth=r,function(t,i){t.save(),t.lineWidth%2&&t.translate(.5,.5),i(),t.restore()}(t,(()=>{const h=l(this.Yt);if(h.Ml){t.strokeStyle=h.Sl,n(t,h.xl),t.beginPath();for(const n of h.Cl){const e=Math.round(n.yl*s);t.moveTo(e,-r),t.lineTo(e,i.height+r)}t.stroke()}if(h.Pl){t.strokeStyle=h.kl,n(t,h.Tl),t.beginPath();for(const s of h.Rl){const n=Math.round(s.yl*e);t.moveTo(-r,n),t.lineTo(i.width+r,n)}t.stroke()}}))}}class qt{constructor(t){this.Kt=new Zt,this.xt=!0,this.yt=t}Pt(){this.xt=!0}Tt(){if(this.xt){const t=this.yt.Qt().N().grid,i={Pl:t.horzLines.visible,Ml:t.vertLines.visible,kl:t.horzLines.color,Sl:t.vertLines.color,Tl:t.horzLines.style,xl:t.vertLines.style,Rl:this.yt.Ps().Dl(),Cl:(this.yt.Qt().It().Dl()||[]).map((t=>({yl:t.coord})))};this.Kt.ht(i),this.xt=!1}return this.Kt}}class Gt{constructor(t){this.ih=new qt(t)}lr(){return this.ih}}const Kt={El:4,Vl:1e-4};function Jt(t,i){const s=100*(t-i)/i;return i<0?-s:s}function Qt(t,i){const s=Jt(t.$e(),i),n=Jt(t.Ue(),i);return new ct(s,n)}function ti(t,i){const s=100*(t-i)/i+100;return i<0?-s:s}function ii(t,i){const s=ti(t.$e(),i),n=ti(t.Ue(),i);return new ct(s,n)}function si(t,i){const s=Math.abs(t);if(s<1e-15)return 0;const n=Math.log10(s+i.Vl)+i.El;return t<0?-n:n}function ni(t,i){const s=Math.abs(t);if(s<1e-15)return 0;const n=Math.pow(10,s-i.El)-i.Vl;return t<0?-n:n}function ei(t,i){if(null===t)return null;const s=si(t.$e(),i),n=si(t.Ue(),i);return new ct(s,n)}function ri(t,i){if(null===t)return null;const s=ni(t.$e(),i),n=ni(t.Ue(),i);return new ct(s,n)}function hi(t){if(null===t)return Kt;const i=Math.abs(t.Ue()-t.$e());if(i>=1||i<1e-15)return Kt;const s=Math.ceil(Math.abs(Math.log10(i))),n=Kt.El+s;return{El:n,Vl:1/Math.pow(10,n)}}class li{constructor(t,i){if(this.zl=t,this.Il=i,function(t){if(t<0)return!1;for(let i=t;i>1;i/=10)if(i%10!=0)return!1;return!0}(this.zl))this.Al=[2,2.5,2];else{this.Al=[];for(let t=this.zl;1!==t;){if(t%2==0)this.Al.push(2),t/=2;else{if(t%5!=0)throw new Error("unexpected base");this.Al.push(2,2.5),t/=5}if(this.Al.length>100)throw new Error("something wrong with base")}}}Bl(t,i,s){const n=0===this.zl?0:1/this.zl;let e=Math.pow(10,Math.max(0,Math.ceil(Math.log10(t-i)))),r=0,h=this.Il[0];for(;;){const t=Xt(e,n,1e-14)&&e>n+1e-14,i=Xt(e,s*h,1e-14),l=Xt(e,1,1e-14);if(!(t&&i&&l))break;e/=h,h=this.Il[++r%this.Il.length]}if(e<=n+1e-14&&(e=n),e=Math.max(1,e),this.Al.length>0&&(l=e,a=1,o=1e-14,Math.abs(l-a)n+1e-14;)e/=h,h=this.Al[++r%this.Al.length];var l,a,o;return e}}class ai{constructor(t,i,s,n){this.Ll=[],this.Yi=t,this.zl=i,this.Ol=s,this.Nl=n}Bl(t,i){if(t=n?1:-1;let _=null,u=0;for(let c=s-a;c>n;c-=i){const s=this.Nl(c,t,!0);null!==_&&Math.abs(s-_)r||(u0&&h[0].yl-l.yl0&&a.yl-h[h.length-1].yll(t.hs())-l(i.hs())))}var _i;!function(t){t[t.Normal=0]="Normal",t[t.Logarithmic=1]="Logarithmic",t[t.Percentage=2]="Percentage",t[t.IndexedTo100=3]="IndexedTo100"}(_i||(_i={}));const ui=new K,ci=new G(100,1);class di{constructor(t,i,s,n,e){this.Ql=0,this.ta=null,this.Ge=null,this.ia=null,this.sa={na:!1,ea:null},this.ra=!1,this.ha=0,this.la=0,this.aa=new o,this.oa=new o,this._a=[],this.ua=null,this.ca=null,this.da=null,this.fa=null,this.pa=null,this.rl=ci,this.va=hi(null),this.ma=t,this.Cs=i,this.wa=s,this.ga=n,this.ba=e,this.Ma=new ai(this,100,this.Sa.bind(this),this.xa.bind(this))}ml(){return this.ma}N(){return this.Cs}rr(t){if(_(this.Cs,t),this.wl(),void 0!==t.mode&&this.Ca({te:t.mode}),void 0!==t.scaleMargins){const i=h(t.scaleMargins.top),s=h(t.scaleMargins.bottom);if(i<0||i>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${i}`);if(s<0||s>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${s}`);if(i+s>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${i+s}`);this.ya(),this.da=null}}Pa(){return this.Cs.autoScale}ka(){return this.ra}Gl(){return 1===this.Cs.mode}Be(){return 2===this.Cs.mode}Ta(){return 3===this.Cs.mode}Jl(){return this.va}te(){return{tn:this.Cs.autoScale,Ra:this.Cs.invertScale,te:this.Cs.mode}}Ca(t){const i=this.te();let s=null;void 0!==t.tn&&(this.Cs.autoScale=t.tn),void 0!==t.te&&(this.Cs.mode=t.te,2!==t.te&&3!==t.te||(this.Cs.autoScale=!0),this.sa.na=!1),1===i.te&&t.te!==i.te&&(!function(t,i){if(null===t)return!1;const s=ni(t.$e(),i),n=ni(t.Ue(),i);return isFinite(s)&&isFinite(n)}(this.Ge,this.va)?this.Cs.autoScale=!0:(s=ri(this.Ge,this.va),null!==s&&this.Da(s))),1===t.te&&t.te!==i.te&&(s=ei(this.Ge,this.va),null!==s&&this.Da(s));const n=i.te!==this.Cs.mode;n&&(2===i.te||this.Be())&&this.wl(),n&&(3===i.te||this.Ta())&&this.wl(),void 0!==t.Ra&&i.Ra!==t.Ra&&(this.Cs.invertScale=t.Ra,this.Ea()),this.oa.p(i,this.te())}Va(){return this.oa}P(){return this.wa.fontSize}Ut(){return this.Ql}za(t){this.Ql!==t&&(this.Ql=t,this.ya(),this.da=null)}Ia(){if(this.ta)return this.ta;const t=this.Ut()-this.Aa()-this.Ba();return this.ta=t,t}Je(){return this.La(),this.Ge}Da(t,i){const s=this.Ge;(i||null===s&&null!==t||null!==s&&!s.We(t))&&(this.da=null,this.Ge=t)}Oa(t){this.Da(t),this.Na(null!==t)}Zi(){return this.La(),0===this.Ql||!this.Ge||this.Ge.Zi()}Fa(t){return this.Ra()?t:this.Ut()-1-t}Nt(t,i){return this.Be()?t=Jt(t,i):this.Ta()&&(t=ti(t,i)),this.xa(t,i)}Wa(t,i,s){this.La();const n=this.Ba(),e=l(this.Je()),r=e.$e(),h=e.Ue(),a=this.Ia()-1,o=this.Ra(),_=a/(h-r),u=void 0===s?0:s.from,c=void 0===s?t.length:s.to,d=this.Ha();for(let s=u;st.Os()))}Ul(){return this.Cs.ensureEdgeTickMarksVisible&&this.Pa()}Yl(){return this.P()/2}wl(){this.da=null;let t=1/0;this.ua=null;for(const i of this._a)i.hs()si(t,this.va):null}uo(t,i,s){return void 0===i?(void 0===s&&(s=this.el()),s.format(t)):i(t)}sr(t,i){return this.uo(t,this.ga.priceFormatter,i)}lo(t,i){return this.uo(t,this.ga.percentageFormatter,i)}}function fi(t){return t instanceof Ht}class pi{constructor(t,i){this._a=[],this.co=new Map,this.Ql=0,this.do=0,this.fo=1e3,this.ca=null,this.po=new o,this.yh=[],this._h=t,this.ts=i,this.vo=new Gt(this);const s=i.N();this.mo=this.wo("left",s.leftPriceScale),this.bo=this.wo("right",s.rightPriceScale),this.mo.Va().i(this.Mo.bind(this,this.mo),this),this.bo.Va().i(this.Mo.bind(this,this.bo),this),this.So(s)}So(t){if(t.leftPriceScale&&this.mo.rr(t.leftPriceScale),t.rightPriceScale&&this.bo.rr(t.rightPriceScale),t.localization&&(this.mo.wl(),this.bo.wl()),t.overlayPriceScales){const i=Array.from(this.co.values());for(const s of i){const i=l(s[0].Ft());i.rr(t.overlayPriceScales),t.localization&&i.wl()}}}xo(t){switch(t){case"left":return this.mo;case"right":return this.bo}return this.co.has(t)?h(this.co.get(t))[0].Ft():null}m(){this.Qt().Co().u(this),this.mo.Va().u(this),this.bo.Va().u(this),this._a.forEach((t=>{t.m&&t.m()})),this.yh=this.yh.filter((t=>{const i=t.ah();return i.detached&&i.detached(),!1})),this.po.p()}yo(){return this.fo}Po(t){this.fo=t}Qt(){return this.ts}Qi(){return this.do}Ut(){return this.Ql}ko(t){this.do=t,this.To()}za(t){this.Ql=t,this.mo.za(t),this.bo.za(t),this._a.forEach((i=>{if(this.Hn(i)){const s=i.Ft();null!==s&&s.za(t)}})),this.To()}Ro(){return this._a.filter(fi)}bl(){return this._a}Hn(t){const i=t.Ft();return null===i||this.mo!==i&&this.bo!==i}qa(t,i,s){this.Do(t,i,s?t.hs():this._a.length)}Ka(t,i){const s=this._a.indexOf(t);r(-1!==s,"removeDataSource: invalid data source"),this._a.splice(s,1),i||this._a.forEach(((t,i)=>t.ls(i)));const n=l(t.Ft()).ml();if(this.co.has(n)){const i=h(this.co.get(n)),s=i.indexOf(t);-1!==s&&(i.splice(s,1),0===i.length&&this.co.delete(n))}const e=t.Ft();e&&e.bl().indexOf(t)>=0&&(e.Ka(t),this.Eo(e)),this.ca=null}Un(t){return t===this.mo?"left":t===this.bo?"right":"overlay"}Vo(){return this.mo}zo(){return this.bo}Io(t,i){t.io(i)}Ao(t,i){t.so(i),this.To()}Bo(t){t.no()}Lo(t,i){t.eo(i)}Oo(t,i){t.ro(i),this.To()}No(t){t.ho()}To(){this._a.forEach((t=>{t.Os()}))}Ps(){let t=null;return this.ts.N().rightPriceScale.visible&&0!==this.bo.bl().length?t=this.bo:this.ts.N().leftPriceScale.visible&&0!==this.mo.bl().length?t=this.mo:0!==this._a.length&&(t=this._a[0].Ft()),null===t&&(t=this.bo),t}$n(){let t=null;return this.ts.N().rightPriceScale.visible?t=this.bo:this.ts.N().leftPriceScale.visible&&(t=this.mo),t}Eo(t){null!==t&&t.Pa()&&this.Fo(t)}Wo(t){const i=this._h.Ce();t.Ca({tn:!0}),null!==i&&t.oo(i),this.To()}Ho(){this.Fo(this.mo),this.Fo(this.bo)}$o(){this.Eo(this.mo),this.Eo(this.bo),this._a.forEach((t=>{this.Hn(t)&&this.Eo(t.Ft())})),this.To(),this.ts.hr()}Dt(){return null===this.ca&&(this.ca=oi(this._a)),this.ca}Uo(t,i){i=Yt(i,0,this._a.length-1);const s=this._a.indexOf(t);r(-1!==s,"setSeriesOrder: invalid data source"),this._a.splice(s,1),this._a.splice(i,0,t),this._a.forEach(((t,i)=>t.ls(i))),this.ca=null;for(const t of[this.mo,this.bo])t.Ga(),t.wl();this.ts.hr()}Vt(){return this.Dt().filter(fi)}jo(){return this.po}Yo(){return this.vo}_l(t){this.yh.push(new Dt(t))}ul(t){this.yh=this.yh.filter((i=>i.ah()!==t)),t.detached&&t.detached(),this.ts.hr()}Xo(){return this.yh}il(t,i){return this.yh.map((s=>s.Yn(t,i))).filter((t=>null!==t))}Fo(t){const i=t.ao();if(i&&i.length>0&&!this._h.Zi()){const i=this._h.Ce();null!==i&&t.oo(i)}t.Os()}Do(t,i,s){let n=this.xo(i);if(null===n&&(n=this.wo(i,this.ts.N().overlayPriceScales)),this._a.splice(s,0,t),!Y(i)){const s=this.co.get(i)||[];s.push(t),this.co.set(i,s)}t.ls(s),n.qa(t),t.os(n),this.Eo(n),this.ca=null}Mo(t,i,s){i.te!==s.te&&this.Fo(t)}wo(t,i){const s={visible:!0,autoScale:!0,...p(i)},n=new di(t,s,this.ts.N().layout,this.ts.N().localization,this.ts.qi());return n.za(this.Ut()),n}}function vi(t){return{Zo:t.Zo,qo:{Xn:t.Go.externalId},Ko:t.Go.cursorStyle}}function mi(t,i,s,n){for(const e of t){const t=e.Tt(n);if(null!==t&&t.Yn){const n=t.Yn(i,s);if(null!==n)return{Jo:e,qo:n}}}return null}function wi(t){return void 0!==t.Ns}function gi(t,i,s){const n=[t,...t.Dt()],e=function(t,i,s){let n,e;for(const l of t){const t=l.il?.(i,s)??[];for(const i of t)r=i.zOrder,h=n?.zOrder,(!h||"top"===r&&"top"!==h||"normal"===r&&"bottom"===h)&&(n=i,e=l)}var r,h;return n&&e?{Go:n,Zo:e}:null}(n,i,s);if("top"===e?.Go.zOrder)return vi(e);for(const r of n){if(e&&e.Zo===r&&"bottom"!==e.Go.zOrder&&!e.Go.isBackground)return vi(e);if(wi(r)){const n=mi(r.Ns(t),i,s,t);if(null!==n)return{Zo:r,Jo:n.Jo,qo:n.qo}}if(e&&e.Zo===r&&"bottom"!==e.Go.zOrder&&e.Go.isBackground)return vi(e)}return e?.Go?vi(e):null}class bi{constructor(t,i,s=50){this.yn=0,this.Pn=1,this.kn=1,this.Rn=new Map,this.Tn=new Map,this.Qo=t,this.t_=i,this.Dn=s}i_(t){const i=t.time,s=this.t_.cacheKey(i),n=this.Rn.get(s);if(void 0!==n)return n.s_;if(this.yn===this.Dn){const t=this.Tn.get(this.kn);this.Tn.delete(this.kn),this.Rn.delete(h(t)),this.kn++,this.yn--}const e=this.Qo(t);return this.Rn.set(s,{s_:e,In:this.Pn}),this.Tn.set(this.Pn,s),this.yn++,this.Pn++,e}}class Mi{constructor(t,i){r(t<=i,"right should be >= left"),this.n_=t,this.e_=i}Hh(){return this.n_}Mi(){return this.e_}r_(){return this.e_-this.n_+1}ke(t){return this.n_<=t&&t<=this.e_}We(t){return this.n_===t.Hh()&&this.e_===t.Mi()}}function Si(t,i){return null===t||null===i?t===i:t.We(i)}class xi{constructor(){this.h_=new Map,this.Rn=null,this.l_=!1}a_(t){this.l_=t,this.Rn=null}o_(t,i){this.__(i),this.Rn=null;for(let s=i;s{t<=s[0].index?i.push(n):s.splice(Mt(s,t,(i=>i.index!i||s.has(t.index);for(const i of Array.from(this.h_.keys()).sort(((t,i)=>i-t))){if(!this.h_.get(i))continue;const s=n;n=[];const r=s.length;let l=0;const a=h(this.h_.get(i)),o=a.length;let _=1/0,u=-1/0;for(let i=0;i=t&&o-u>=t&&e(h))n.push(h),u=o;else if(this.l_)return s}for(;li.weight?t:i}class Pi{constructor(t,i,s,n){this.do=0,this.b_=null,this.M_=[],this.pa=null,this.fa=null,this.S_=new xi,this.x_=new Map,this.C_=Ci.g_(),this.y_=!0,this.P_=new o,this.k_=new o,this.T_=new o,this.R_=null,this.D_=null,this.E_=new Map,this.V_=-1,this.z_=[],this.Cs=i,this.ga=s,this.I_=i.rightOffset,this.A_=i.barSpacing,this.ts=t,this.t_=n,this.B_(),this.S_.a_(i.uniformDistribution),this.L_()}N(){return this.Cs}O_(t){_(this.ga,t),this.N_(),this.B_()}rr(t,i){_(this.Cs,t),this.Cs.fixLeftEdge&&this.F_(),this.Cs.fixRightEdge&&this.W_(),void 0!==t.barSpacing&&this.ts.cn(t.barSpacing),void 0!==t.rightOffset&&this.ts.dn(t.rightOffset),void 0===t.minBarSpacing&&void 0===t.maxBarSpacing||this.ts.cn(t.barSpacing??this.A_),void 0!==t.ignoreWhitespaceIndices&&t.ignoreWhitespaceIndices!==this.Cs.ignoreWhitespaceIndices&&this.L_(),this.N_(),this.B_(),this.T_.p()}Ts(t){return this.M_[t]?.time??null}ss(t){return this.M_[t]??null}H_(t,i){if(this.M_.length<1)return null;if(this.t_.key(t)>this.t_.key(this.M_[this.M_.length-1].time))return i?this.M_.length-1:null;const s=Mt(this.M_,this.t_.key(t),((t,i)=>this.t_.key(t.time)0}Ce(){return this.j_(),this.C_.m_()}Y_(){return this.j_(),this.C_.w_()}X_(){const t=this.Ce();if(null===t)return null;const i={from:t.Hh(),to:t.Mi()};return this.Z_(i)}Z_(t){const i=Math.round(t.from),s=Math.round(t.to),n=l(this.q_()),e=l(this.G_());return{from:l(this.ss(Math.max(n,i))),to:l(this.ss(Math.min(e,s)))}}K_(t){return{from:l(this.H_(t.from,!0)),to:l(this.H_(t.to,!0))}}Qi(){return this.do}ko(t){if(!isFinite(t)||t<=0)return;if(this.do===t)return;const i=this.Y_(),s=this.do;if(this.do=t,this.y_=!0,this.Cs.lockVisibleTimeRangeOnResize&&0!==s){const i=this.A_*t/s;this.A_=i}if(this.Cs.fixLeftEdge&&null!==i&&i.Hh()<=0){const i=s-t;this.I_-=Math.round(i/this.A_)+1,this.y_=!0}this.J_(),this.Q_()}jt(t){if(this.Zi()||!c(t))return 0;const i=this.tu()+this.I_-t;return this.do-(i+.5)*this.A_-1}iu(t,i){const s=this.tu(),n=void 0===i?0:i.from,e=void 0===i?t.length:i.to;for(let i=n;ii/2&&!_?s.needAlignCoordinate=!1:s.needAlignCoordinate=u&&t.index<=a||c&&t.index>=o,d++}return this.z_.length=d,this.D_=this.z_,this.z_}cu(){this.y_=!0,this.cn(this.Cs.barSpacing),this.dn(this.Cs.rightOffset)}du(t){this.y_=!0,this.b_=t,this.Q_(),this.F_()}fu(t,i){const s=this.nu(t),n=this.lu(),e=n+i*(n/10);this.cn(e),this.Cs.rightBarStaysOnScroll||this.dn(this.ou()+(s-this.nu(t)))}io(t){this.pa&&this.ho(),null===this.fa&&null===this.R_&&(this.Zi()||(this.fa=t,this.pu()))}so(t){if(null===this.R_)return;const i=Yt(this.do-t,0,this.do),s=Yt(this.do-l(this.fa),0,this.do);0!==i&&0!==s&&this.cn(this.R_.lu*i/s)}no(){null!==this.fa&&(this.fa=null,this.vu())}eo(t){null===this.pa&&null===this.R_&&(this.Zi()||(this.pa=t,this.pu()))}ro(t){if(null===this.pa)return;const i=(this.pa-t)/this.lu();this.I_=l(this.R_).ou+i,this.y_=!0,this.Q_()}ho(){null!==this.pa&&(this.pa=null,this.vu())}mu(){this.wu(this.Cs.rightOffset)}wu(t,i=400){if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(!isFinite(i)||i<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const s=this.I_,n=performance.now();this.ts.an({gu:t=>(t-n)/i>=1,bu:e=>{const r=(e-n)/i;return r>=1?t:s+(t-s)*r}})}Pt(t,i){this.y_=!0,this.M_=t,this.S_.o_(t,i),this.Q_()}Mu(){return this.P_}Su(){return this.k_}xu(){return this.T_}tu(){return this.b_||0}Cu(t){const i=t.r_();this.au(this.do/i),this.I_=t.Mi()-this.tu(),this.Q_(),this.y_=!0,this.ts.hu(),this.ts.hr()}yu(){const t=this.q_(),i=this.G_();null!==t&&null!==i&&this.Cu(new Mi(t,i+this.Cs.rightOffset))}Pu(t){const i=new Mi(t.from,t.to);this.Cu(i)}ns(t){return void 0!==this.ga.timeFormatter?this.ga.timeFormatter(t.originalTime):this.t_.formatHorzItem(t.time)}L_(){if(!this.Cs.ignoreWhitespaceIndices)return;this.E_.clear();const t=this.ts.Ys();for(const i of t)for(const t of i.vl())this.E_.set(t,!0);this.V_++}_u(){const t=this.ts.N().handleScroll,i=this.ts.N().handleScale;return!(t.horzTouchDrag||t.mouseWheel||t.pressedMouseMove||t.vertTouchDrag||i.axisDoubleClickReset.time||i.axisPressedMouseMove.time||i.mouseWheel||i.pinch)}q_(){return 0===this.M_.length?null:0}G_(){return 0===this.M_.length?null:this.M_.length-1}ku(t){return(this.do-1-t)/this.A_}nu(t){const i=this.ku(t),s=this.tu()+this.I_-i;return Math.round(1e6*s)/1e6}au(t){const i=this.A_;this.A_=t,this.J_(),i!==this.A_&&(this.y_=!0,this.Tu())}j_(){if(!this.y_)return;if(this.y_=!1,this.Zi())return void this.Ru(Ci.g_());const t=this.tu(),i=this.do/this.A_,s=this.I_+t,n=new Mi(s-i+1,s);this.Ru(new Ci(n))}J_(){const t=Yt(this.A_,this.Du(),this.Eu());this.A_!==t&&(this.A_=t,this.y_=!0)}Eu(){return this.Cs.maxBarSpacing>0?this.Cs.maxBarSpacing:.5*this.do}Du(){return this.Cs.fixLeftEdge&&this.Cs.fixRightEdge&&0!==this.M_.length?this.do/this.M_.length:this.Cs.minBarSpacing}Q_(){const t=this.Vu();null!==t&&this.I_i&&(this.I_=i,this.y_=!0)}Vu(){const t=this.q_(),i=this.b_;if(null===t||null===i)return null;return t-i-1+(this.Cs.fixLeftEdge?this.do/this.A_:Math.min(2,this.M_.length))}zu(){return this.Cs.fixRightEdge?0:this.do/this.A_-Math.min(2,this.M_.length)}pu(){this.R_={lu:this.lu(),ou:this.ou()}}vu(){this.R_=null}uu(t){let i=this.x_.get(t.weight);return void 0===i&&(i=new bi((t=>this.Iu(t)),this.t_),this.x_.set(t.weight,i)),i.i_(t)}Iu(t){return this.t_.formatTickmark(t,this.ga)}Ru(t){const i=this.C_;this.C_=t,Si(i.m_(),this.C_.m_())||this.P_.p(),Si(i.w_(),this.C_.w_())||this.k_.p(),this.Tu()}Tu(){this.D_=null}N_(){this.Tu(),this.x_.clear()}B_(){this.t_.updateFormatter(this.ga)}F_(){if(!this.Cs.fixLeftEdge)return;const t=this.q_();if(null===t)return;const i=this.Ce();if(null===i)return;const s=i.Hh()-t;if(s<0){const t=this.I_-s-1;this.dn(t)}this.J_()}W_(){this.Q_(),this.J_()}eu(t){return!this.Cs.ignoreWhitespaceIndices||(this.E_.get(t)||!1)}ru(t){const i=function*(t){const i=Math.round(t),s=is)break}return t}}var ki,Ti,Ri,Di,Ei;!function(t){t[t.OnTouchEnd=0]="OnTouchEnd",t[t.OnNextTap=1]="OnNextTap"}(ki||(ki={}));class Vi{constructor(t,i,s){this.Au=[],this.Bu=[],this.do=0,this.Lu=null,this.Ou=new o,this.Nu=new o,this.Fu=null,this.Wu=t,this.Cs=i,this.t_=s,this.ba=new x(this.Cs.layout.colorParsers),this.Hu=new b(this),this._h=new Pi(this,i.timeScale,this.Cs.localization,s),this.Ct=new j(this,i.crosshair),this.$u=new jt(i.crosshair),this.Uu(0),this.Au[0].Po(2e3),this.ju=this.Yu(0),this.Xu=this.Yu(1)}Vh(){this.Zu(X.wn())}hr(){this.Zu(X.mn())}qh(){this.Zu(new X(1))}zh(t){const i=this.qu(t);this.Zu(i)}Gu(){return this.Lu}Ku(t){if(this.Lu?.Zo===t?.Zo&&this.Lu?.qo?.Xn===t?.qo?.Xn)return;const i=this.Lu;this.Lu=t,null!==i&&this.zh(i.Zo),null!==t&&t.Zo!==i?.Zo&&this.zh(t.Zo)}N(){return this.Cs}rr(t){_(this.Cs,t),this.Au.forEach((i=>i.So(t))),void 0!==t.timeScale&&this._h.rr(t.timeScale),void 0!==t.localization&&this._h.O_(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this.Ou.p(),this.ju=this.Yu(0),this.Xu=this.Yu(1),this.Vh()}Ju(t,i,s=0){const n=this.Au[s];if(void 0===n)return;if("left"===t)return _(this.Cs,{leftPriceScale:i}),n.So({leftPriceScale:i}),this.Ou.p(),void this.Vh();if("right"===t)return _(this.Cs,{rightPriceScale:i}),n.So({rightPriceScale:i}),this.Ou.p(),void this.Vh();const e=this.Qu(t,s);null!==e&&(e.Ft.rr(i),this.Ou.p())}Qu(t,i){const s=this.Au[i];if(void 0===s)return null;const n=s.xo(t);return null!==n?{Hs:s,Ft:n}:null}It(){return this._h}$s(){return this.Au}tc(){return this.Ct}sc(){return this.Nu}nc(t,i){t.za(i),this.hu()}ko(t){this.do=t,this._h.ko(this.do),this.Au.forEach((i=>i.ko(t))),this.hu()}ec(t){1!==this.Au.length&&(r(t>=0&&t=0&&tt+i.yo()),0),e=this.Au.reduce(((t,i)=>t+i.Ut()),0),h=e-30*(this.Au.length-1);i=Math.min(h,Math.max(30,i));const l=n/e,a=s.Ut();s.Po(i*l);let o=i-a,_=this.Au.length-1;for(const t of this.Au)if(t!==s){const i=Math.min(h,Math.max(30,t.Ut()-o/_));o-=t.Ut()-i,_-=1;const s=i*l;t.Po(s)}this.Vh()}hc(t,i){r(t>=0&&t=0&&ithis.t_.key(e),a=null!==t&&t>r&&!l,o=this._h.N().allowShiftVisibleRangeOnWhitespaceReplacement,_=i&&(!(void 0===s)||o)&&this._h.N().shiftVisibleRangeOnNewBar;if(a&&!_){const i=t-r;this._h.dn(this._h.ou()-i)}}this._h.du(t)}Bh(t){null!==t&&t.$o()}Wn(t){if(function(t){return t instanceof pi}(t))return t;const i=this.Au.find((i=>i.Dt().includes(t)));return void 0===i?null:i}hu(){this.Au.forEach((t=>t.$o())),this.Ih()}m(){this.Au.forEach((t=>t.m())),this.Au.length=0,this.Cs.localization.priceFormatter=void 0,this.Cs.localization.percentageFormatter=void 0,this.Cs.localization.timeFormatter=void 0}Mc(){return this.Hu}jn(){return this.Hu.N()}Co(){return this.Ou}Sc(t,i){const s=this.Uu(i);this.xc(t,s),this.Bu.push(t),1===this.Bu.length?this.Vh():this.hr()}Cc(t){const i=this.Wn(t),s=this.Bu.indexOf(t);r(-1!==s,"Series not found");const n=l(i);this.Bu.splice(s,1),n.Ka(t),t.m&&t.m(),this._h.L_(),this.yc(n)}Eh(t,i){const s=l(this.Wn(t));s.Ka(t,!0),s.qa(t,i,!0)}yu(){const t=X.mn();t.en(),this.Zu(t)}Pc(t){const i=X.mn();i.ln(t),this.Zu(i)}un(){const t=X.mn();t.un(),this.Zu(t)}cn(t){const i=X.mn();i.cn(t),this.Zu(i)}dn(t){const i=X.mn();i.dn(t),this.Zu(i)}an(t){const i=X.mn();i.an(t),this.Zu(i)}rn(){const t=X.mn();t.rn(),this.Zu(t)}kc(){return this.Cs.rightPriceScale.visible?"right":"left"}Tc(t,i){r(i>=0,"Index should be greater or equal to 0");if(i===this.Rc(t))return;const s=l(this.Wn(t));s.Ka(t);const n=this.Uu(i);this.xc(t,n),0===s.bl().length&&this.yc(s)}Dc(){return this.Xu}U(){return this.ju}$t(t){const i=this.Xu,s=this.ju;if(i===s)return i;if(t=Math.max(0,Math.min(100,Math.round(100*t))),null===this.Fu||this.Fu.vr!==s||this.Fu.mr!==i)this.Fu={vr:s,mr:i,Ec:new Map};else{const i=this.Fu.Ec.get(t);if(void 0!==i)return i}const n=this.ba.tt(s,i,t/100);return this.Fu.Ec.set(t,n),n}Vc(t){return this.Au.indexOf(t)}qi(){return this.ba}Uu(t){if(r(t>=0,"Index should be greater or equal to 0"),(t=Math.min(this.Au.length,t))i.Ro().includes(t)))}lc(t,i){const s=new X(i);if(null!==t){const n=this.Au.indexOf(t);s.Js(n,{Qs:i})}return s}qu(t,i){return void 0===i&&(i=2),this.lc(this.Wn(t),i)}Zu(t){this.Wu&&this.Wu(t),this.Au.forEach((t=>t.Yo().lr().Pt()))}xc(t,i){const s=t.N().priceScaleId,n=void 0!==s?s:this.kc();i.qa(t,n),Y(n)||t.rr(t.N())}Yu(t){const i=this.Cs.layout;return"gradient"===i.background.type?0===t?i.background.topColor:i.background.bottomColor:i.background.color}yc(t){0===t.bl().length&&this.Au.length>1&&(this.Au.splice(this.Vc(t),1),this.Vh())}}function zi(t){return!u(t)&&!d(t)}function Ii(t){return u(t)}!function(t){t[t.Disabled=0]="Disabled",t[t.Continuous=1]="Continuous",t[t.OnDataUpdate=2]="OnDataUpdate"}(Ti||(Ti={})),function(t){t[t.LastBar=0]="LastBar",t[t.LastVisible=1]="LastVisible"}(Ri||(Ri={})),function(t){t.Solid="solid",t.VerticalGradient="gradient"}(Di||(Di={})),function(t){t[t.Year=0]="Year",t[t.Month=1]="Month",t[t.DayOfMonth=2]="DayOfMonth",t[t.Time=3]="Time",t[t.TimeWithSeconds=4]="TimeWithSeconds"}(Ei||(Ei={}));const Ai=t=>t.getUTCFullYear();function Bi(t,i,s){return i.replace(/yyyy/g,(t=>q(Ai(t),4))(t)).replace(/yy/g,(t=>q(Ai(t)%100,2))(t)).replace(/MMMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(t,s)).replace(/MMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(t,s)).replace(/MM/g,(t=>q((t=>t.getUTCMonth()+1)(t),2))(t)).replace(/dd/g,(t=>q((t=>t.getUTCDate())(t),2))(t))}class Li{constructor(t="yyyy-MM-dd",i="default"){this.zc=t,this.Ic=i}i_(t){return Bi(t,this.zc,this.Ic)}}class Oi{constructor(t){this.Ac=t||"%h:%m:%s"}i_(t){return this.Ac.replace("%h",q(t.getUTCHours(),2)).replace("%m",q(t.getUTCMinutes(),2)).replace("%s",q(t.getUTCSeconds(),2))}}const Ni={Bc:"yyyy-MM-dd",Lc:"%h:%m:%s",Oc:" ",Nc:"default"};class Fi{constructor(t={}){const i={...Ni,...t};this.Fc=new Li(i.Bc,i.Nc),this.Wc=new Oi(i.Lc),this.Hc=i.Oc}i_(t){return`${this.Fc.i_(t)}${this.Hc}${this.Wc.i_(t)}`}}function Wi(t){return 60*t*60*1e3}function Hi(t){return 60*t*1e3}const $i=[{$c:(Ui=1,1e3*Ui),Uc:10},{$c:Hi(1),Uc:20},{$c:Hi(5),Uc:21},{$c:Hi(30),Uc:22},{$c:Wi(1),Uc:30},{$c:Wi(3),Uc:31},{$c:Wi(6),Uc:32},{$c:Wi(12),Uc:33}];var Ui;function ji(t,i){if(t.getUTCFullYear()!==i.getUTCFullYear())return 70;if(t.getUTCMonth()!==i.getUTCMonth())return 60;if(t.getUTCDate()!==i.getUTCDate())return 50;for(let s=$i.length-1;s>=0;--s)if(Math.floor(i.getTime()/$i[s].$c)!==Math.floor(t.getTime()/$i[s].$c))return $i[s].Uc;return 0}function Yi(t){let i=t;if(d(t)&&(i=Zi(t)),!zi(i))throw new Error("time must be of type BusinessDay");const s=new Date(Date.UTC(i.year,i.month-1,i.day,0,0,0,0));return{jc:Math.round(s.getTime()/1e3),Yc:i}}function Xi(t){if(!Ii(t))throw new Error("time must be of type isUTCTimestamp");return{jc:t}}function Zi(t){const i=new Date(t);if(isNaN(i.getTime()))throw new Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);return{day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()}}function qi(t){d(t.time)&&(t.time=Zi(t.time))}class Gi{options(){return this.Cs}setOptions(t){this.Cs=t,this.updateFormatter(t.localization)}preprocessData(t){Array.isArray(t)?function(t){t.forEach(qi)}(t):qi(t)}createConverterToInternalObj(t){return l(function(t){return 0===t.length?null:zi(t[0].time)||d(t[0].time)?Yi:Xi}(t))}key(t){return"object"==typeof t&&"jc"in t?t.jc:this.key(this.convertHorzItemToInternal(t))}cacheKey(t){const i=t;return void 0===i.Yc?new Date(1e3*i.jc).getTime():new Date(Date.UTC(i.Yc.year,i.Yc.month-1,i.Yc.day)).getTime()}convertHorzItemToInternal(t){return Ii(i=t)?Xi(i):zi(i)?Yi(i):Yi(Zi(i));var i}updateFormatter(t){if(!this.Cs)return;const i=t.dateFormat;this.Cs.timeScale.timeVisible?this.Xc=new Fi({Bc:i,Lc:this.Cs.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Oc:" ",Nc:t.locale}):this.Xc=new Li(i,t.locale)}formatHorzItem(t){const i=t;return this.Xc.i_(new Date(1e3*i.jc))}formatTickmark(t,i){const s=function(t,i,s){switch(t){case 0:case 10:return i?s?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return i?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(t.weight,this.Cs.timeScale.timeVisible,this.Cs.timeScale.secondsVisible),n=this.Cs.timeScale;if(void 0!==n.tickMarkFormatter){const e=n.tickMarkFormatter(t.originalTime,s,i.locale);if(null!==e)return e}return function(t,i,s){const n={};switch(i){case 0:n.year="numeric";break;case 1:n.month="short";break;case 2:n.day="numeric";break;case 3:n.hour12=!1,n.hour="2-digit",n.minute="2-digit";break;case 4:n.hour12=!1,n.hour="2-digit",n.minute="2-digit",n.second="2-digit"}const e=void 0===t.Yc?new Date(1e3*t.jc):new Date(Date.UTC(t.Yc.year,t.Yc.month-1,t.Yc.day));return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()).toLocaleString(s,n)}(t.time,s,i.locale)}maxTickMarkWeight(t){let i=t.reduce(yi,t[0]).weight;return i>30&&i<50&&(i=30),i}fillWeightsForPoints(t,i){!function(t,i=0){if(0===t.length)return;let s=0===i?null:t[i-1].time.jc,n=null!==s?new Date(1e3*s):null,e=0;for(let r=i;r1){const i=Math.ceil(e/(t.length-1)),s=new Date(1e3*(t[0].time.jc-i));t[0].timeWeight=ji(new Date(1e3*t[0].time.jc),s)}}(t,i)}static Zc(t){return _({localization:{dateFormat:"dd MMM 'yy"}},t??{})}}function Ki(t){var i=t.width,s=t.height;if(i<0)throw new Error("Negative width is not allowed for Size");if(s<0)throw new Error("Negative height is not allowed for Size");return{width:i,height:s}}function Ji(t,i){return t.width===i.width&&t.height===i.height}var Qi=function(){function t(t){var i=this;this._resolutionListener=function(){return i._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=t,this._installResolutionListener()}return t.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(t.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),t.prototype.subscribe=function(t){var i=this,s={next:t};return this._observers.push(s),{unsubscribe:function(){i._observers=i._observers.filter((function(t){return t!==s}))}}},t.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw new Error("Resolution listener is already installed");var t=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(t,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},t.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},t.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},t.prototype._onResolutionChanged=function(){var t=this;this._observers.forEach((function(i){return i.next(t._window.devicePixelRatio)})),this._reinstallResolutionListener()},t}();var ts=function(){function t(t,i,s){var n;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=t,this._canvasElementClientSize=Ki({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=null!=i?i:function(t){return t},this._allowResizeObserver=null===(n=null==s?void 0:s.allowResizeObserver)||void 0===n||n,this._chooseAndInitObserver()}return t.prototype.dispose=function(){var t,i;if(null===this._canvasElement)throw new Error("Object is disposed");null===(t=this._canvasElementResizeObserver)||void 0===t||t.disconnect(),this._canvasElementResizeObserver=null,null===(i=this._devicePixelRatioObservable)||void 0===i||i.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(t.prototype,"canvasElement",{get:function(){if(null===this._canvasElement)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bitmapSize",{get:function(){return Ki({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),t.prototype.resizeCanvasElement=function(t){this._canvasElementClientSize=Ki(t),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},t.prototype.subscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeBitmapSizeChanged=function(t){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter((function(i){return i!==t}))},Object.defineProperty(t.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),t.prototype.subscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners.push(t)},t.prototype.unsubscribeSuggestedBitmapSizeChanged=function(t){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter((function(i){return i!==t}))},t.prototype.applySuggestedBitmapSize=function(){if(null!==this._suggestedBitmapSize){var t=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(t),this._emitSuggestedBitmapSizeChanged(t,this._suggestedBitmapSize)}},t.prototype._resizeBitmap=function(t){var i=this.bitmapSize;Ji(i,t)||(this.canvasElement.width=t.width,this.canvasElement.height=t.height,this._emitBitmapSizeChanged(i,t))},t.prototype._emitBitmapSizeChanged=function(t,i){var s=this;this._bitmapSizeChangedListeners.forEach((function(n){return n.call(s,t,i)}))},t.prototype._suggestNewBitmapSize=function(t){var i=this._suggestedBitmapSize,s=Ki(this._transformBitmapSize(t,this._canvasElementClientSize)),n=Ji(this.bitmapSize,s)?null:s;null===i&&null===n||null!==i&&null!==n&&Ji(i,n)||(this._suggestedBitmapSize=n,this._emitSuggestedBitmapSizeChanged(i,n))},t.prototype._emitSuggestedBitmapSizeChanged=function(t,i){var s=this;this._suggestedBitmapSizeChangedListeners.forEach((function(n){return n.call(s,t,i)}))},t.prototype._chooseAndInitObserver=function(){var t=this;this._allowResizeObserver?new Promise((function(t){var i=new ResizeObserver((function(s){t(s.every((function(t){return"devicePixelContentBoxSize"in t}))),i.disconnect()}));i.observe(document.body,{box:"device-pixel-content-box"})})).catch((function(){return!1})).then((function(i){return i?t._initResizeObserver():t._initDevicePixelRatioObservable()})):this._initDevicePixelRatioObservable()},t.prototype._initDevicePixelRatioObservable=function(){var t=this;if(null!==this._canvasElement){var i=is(this._canvasElement);if(null===i)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=function(t){return new Qi(t)}(i),this._devicePixelRatioObservable.subscribe((function(){return t._invalidateBitmapSize()})),this._invalidateBitmapSize()}},t.prototype._invalidateBitmapSize=function(){var t,i;if(null!==this._canvasElement){var s=is(this._canvasElement);if(null!==s){var n=null!==(i=null===(t=this._devicePixelRatioObservable)||void 0===t?void 0:t.value)&&void 0!==i?i:s.devicePixelRatio,e=this._canvasElement.getClientRects(),r=void 0!==e[0]?function(t,i){return Ki({width:Math.round(t.left*i+t.width*i)-Math.round(t.left*i),height:Math.round(t.top*i+t.height*i)-Math.round(t.top*i)})}(e[0],n):Ki({width:this._canvasElementClientSize.width*n,height:this._canvasElementClientSize.height*n});this._suggestNewBitmapSize(r)}}},t.prototype._initResizeObserver=function(){var t=this;null!==this._canvasElement&&(this._canvasElementResizeObserver=new ResizeObserver((function(i){var s=i.find((function(i){return i.target===t._canvasElement}));if(s&&s.devicePixelContentBoxSize&&s.devicePixelContentBoxSize[0]){var n=s.devicePixelContentBoxSize[0],e=Ki({width:n.inlineSize,height:n.blockSize});t._suggestNewBitmapSize(e)}})),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},t}();function is(t){return t.ownerDocument.defaultView}var ss=function(){function t(t,i,s){if(0===i.width||0===i.height)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=i,0===s.width||0===s.height)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=s,this._context=t}return t.prototype.useMediaCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),t({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},t.prototype.useBitmapCoordinateSpace=function(t){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),t({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(t.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),t}();function ns(t,i){var s=t.canvasElementClientSize;if(0===s.width||0===s.height)return null;var n=t.bitmapSize;if(0===n.width||0===n.height)return null;var e=t.canvasElement.getContext("2d",i);return null===e?null:new ss(e,s,n)}const es="undefined"!=typeof window;function rs(){return!!es&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function hs(){return!!es&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function ls(t){return t+t%2}function as(t){es&&void 0!==window.chrome&&t.addEventListener("mousedown",(t=>{if(1===t.button)return t.preventDefault(),!1}))}class os{constructor(t,i,s){this.qc=0,this.Gc=null,this.Kc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Jc=0,this.Qc=null,this.td={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.sd=null,this.nd=!1,this.ed=null,this.rd=null,this.hd=!1,this.ld=!1,this.ad=!1,this.od=null,this._d=null,this.ud=null,this.dd=null,this.fd=null,this.pd=null,this.vd=null,this.md=0,this.wd=!1,this.gd=!1,this.bd=!1,this.Md=0,this.Sd=null,this.xd=!hs(),this.Cd=t=>{this.yd(t)},this.Pd=t=>{if(this.kd(t)){const i=this.Td(t);if(++this.Jc,this.Qc&&this.Jc>1){const{Rd:s}=this.Dd(cs(t),this.td);s<30&&!this.ad&&this.Ed(i,this.zd.Vd),this.Id()}}else{const i=this.Td(t);if(++this.qc,this.Gc&&this.qc>1){const{Rd:s}=this.Dd(cs(t),this.Kc);s<5&&!this.ld&&this.Ad(i,this.zd.Bd),this.Ld()}}},this.Od=t,this.zd=i,this.Cs=s,this.Nd()}m(){null!==this.od&&(this.od(),this.od=null),null!==this._d&&(this._d(),this._d=null),null!==this.dd&&(this.dd(),this.dd=null),null!==this.fd&&(this.fd(),this.fd=null),null!==this.pd&&(this.pd(),this.pd=null),null!==this.ud&&(this.ud(),this.ud=null),this.Fd(),this.Ld()}Wd(t){this.dd&&this.dd();const i=this.Hd.bind(this);if(this.dd=()=>{this.Od.removeEventListener("mousemove",i)},this.Od.addEventListener("mousemove",i),this.kd(t))return;const s=this.Td(t);this.Ad(s,this.zd.$d),this.xd=!0}Ld(){null!==this.Gc&&clearTimeout(this.Gc),this.qc=0,this.Gc=null,this.Kc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Id(){null!==this.Qc&&clearTimeout(this.Qc),this.Jc=0,this.Qc=null,this.td={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Hd(t){if(this.bd||null!==this.rd)return;if(this.kd(t))return;const i=this.Td(t);this.Ad(i,this.zd.Ud),this.xd=!0}jd(t){const i=fs(t.changedTouches,l(this.Sd));if(null===i)return;if(this.Md=ds(t),null!==this.vd)return;if(this.gd)return;this.wd=!0;const s=this.Dd(cs(i),l(this.rd)),{Yd:n,Xd:e,Rd:r}=s;if(this.hd||!(r<5)){if(!this.hd){const t=.5*n,i=e>=t&&!this.Cs.Zd(),s=t>e&&!this.Cs.qd();i||s||(this.gd=!0),this.hd=!0,this.ad=!0,this.Fd(),this.Id()}if(!this.gd){const s=this.Td(t,i);this.Ed(s,this.zd.Gd),us(t)}}}Kd(t){if(0!==t.button)return;const i=this.Dd(cs(t),l(this.ed)),{Rd:s}=i;if(s>=5&&(this.ld=!0,this.Ld()),this.ld){const i=this.Td(t);this.Ad(i,this.zd.Jd)}}Dd(t,i){const s=Math.abs(i._t-t._t),n=Math.abs(i.ut-t.ut);return{Yd:s,Xd:n,Rd:s+n}}Qd(t){let i=fs(t.changedTouches,l(this.Sd));if(null===i&&0===t.touches.length&&(i=t.changedTouches[0]),null===i)return;this.Sd=null,this.Md=ds(t),this.Fd(),this.rd=null,this.pd&&(this.pd(),this.pd=null);const s=this.Td(t,i);if(this.Ed(s,this.zd.tf),++this.Jc,this.Qc&&this.Jc>1){const{Rd:t}=this.Dd(cs(i),this.td);t<30&&!this.ad&&this.Ed(s,this.zd.Vd),this.Id()}else this.ad||(this.Ed(s,this.zd.if),this.zd.if&&us(t));0===this.Jc&&us(t),0===t.touches.length&&this.nd&&(this.nd=!1,us(t))}yd(t){if(0!==t.button)return;const i=this.Td(t);if(this.ed=null,this.bd=!1,this.fd&&(this.fd(),this.fd=null),rs()){this.Od.ownerDocument.documentElement.removeEventListener("mouseleave",this.Cd)}if(!this.kd(t))if(this.Ad(i,this.zd.sf),++this.qc,this.Gc&&this.qc>1){const{Rd:s}=this.Dd(cs(t),this.Kc);s<5&&!this.ld&&this.Ad(i,this.zd.Bd),this.Ld()}else this.ld||this.Ad(i,this.zd.nf)}Fd(){null!==this.sd&&(clearTimeout(this.sd),this.sd=null)}ef(t){if(null!==this.Sd)return;const i=t.changedTouches[0];this.Sd=i.identifier,this.Md=ds(t);const s=this.Od.ownerDocument.documentElement;this.ad=!1,this.hd=!1,this.gd=!1,this.rd=cs(i),this.pd&&(this.pd(),this.pd=null);{const i=this.jd.bind(this),n=this.Qd.bind(this);this.pd=()=>{s.removeEventListener("touchmove",i),s.removeEventListener("touchend",n)},s.addEventListener("touchmove",i,{passive:!1}),s.addEventListener("touchend",n,{passive:!1}),this.Fd(),this.sd=setTimeout(this.rf.bind(this,t),240)}const n=this.Td(t,i);this.Ed(n,this.zd.hf),this.Qc||(this.Jc=0,this.Qc=setTimeout(this.Id.bind(this),500),this.td=cs(i))}lf(t){if(0!==t.button)return;const i=this.Od.ownerDocument.documentElement;rs()&&i.addEventListener("mouseleave",this.Cd),this.ld=!1,this.ed=cs(t),this.fd&&(this.fd(),this.fd=null);{const t=this.Kd.bind(this),s=this.yd.bind(this);this.fd=()=>{i.removeEventListener("mousemove",t),i.removeEventListener("mouseup",s)},i.addEventListener("mousemove",t),i.addEventListener("mouseup",s)}if(this.bd=!0,this.kd(t))return;const s=this.Td(t);this.Ad(s,this.zd.af),this.Gc||(this.qc=0,this.Gc=setTimeout(this.Ld.bind(this),500),this.Kc=cs(t))}Nd(){this.Od.addEventListener("mouseenter",this.Wd.bind(this)),this.Od.addEventListener("touchcancel",this.Fd.bind(this));{const t=this.Od.ownerDocument,i=t=>{this.zd._f&&(t.composed&&this.Od.contains(t.composedPath()[0])||t.target&&this.Od.contains(t.target)||this.zd._f())};this._d=()=>{t.removeEventListener("touchstart",i)},this.od=()=>{t.removeEventListener("mousedown",i)},t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!0})}hs()&&(this.ud=()=>{this.Od.removeEventListener("dblclick",this.Pd)},this.Od.addEventListener("dblclick",this.Pd)),this.Od.addEventListener("mouseleave",this.uf.bind(this)),this.Od.addEventListener("touchstart",this.ef.bind(this),{passive:!0}),as(this.Od),this.Od.addEventListener("mousedown",this.lf.bind(this)),this.cf(),this.Od.addEventListener("touchmove",(()=>{}),{passive:!1})}cf(){void 0===this.zd.df&&void 0===this.zd.ff&&void 0===this.zd.pf||(this.Od.addEventListener("touchstart",(t=>this.vf(t.touches)),{passive:!0}),this.Od.addEventListener("touchmove",(t=>{if(2===t.touches.length&&null!==this.vd&&void 0!==this.zd.ff){const i=_s(t.touches[0],t.touches[1])/this.md;this.zd.ff(this.vd,i),us(t)}}),{passive:!1}),this.Od.addEventListener("touchend",(t=>{this.vf(t.touches)})))}vf(t){1===t.length&&(this.wd=!1),2!==t.length||this.wd||this.nd?this.mf():this.wf(t)}wf(t){const i=this.Od.getBoundingClientRect()||{left:0,top:0};this.vd={_t:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,ut:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this.md=_s(t[0],t[1]),void 0!==this.zd.df&&this.zd.df(),this.Fd()}mf(){null!==this.vd&&(this.vd=null,void 0!==this.zd.pf&&this.zd.pf())}uf(t){if(this.dd&&this.dd(),this.kd(t))return;if(!this.xd)return;const i=this.Td(t);this.Ad(i,this.zd.gf),this.xd=!hs()}rf(t){const i=fs(t.touches,l(this.Sd));if(null===i)return;const s=this.Td(t,i);this.Ed(s,this.zd.bf),this.ad=!0,this.nd=!0}kd(t){return t.sourceCapabilities&&void 0!==t.sourceCapabilities.firesTouchEvents?t.sourceCapabilities.firesTouchEvents:ds(t){"touchstart"!==t.type&&us(t)}}}}function _s(t,i){const s=t.clientX-i.clientX,n=t.clientY-i.clientY;return Math.sqrt(s*s+n*n)}function us(t){t.cancelable&&t.preventDefault()}function cs(t){return{_t:t.pageX,ut:t.pageY}}function ds(t){return t.timeStamp||performance.now()}function fs(t,i){for(let s=0;s!1,qd:()=>!0}),this.yf={Hf:s,Wf:t}}Af(){this.If.style.background=this.Rf.N().layout.panes.separatorColor}$f(t){null!==this.yf&&(this.yf.Hf.style.backgroundColor=this.Rf.N().layout.panes.separatorHoverColor)}Uf(t){null!==this.yf&&null===this.Tf&&(this.yf.Hf.style.backgroundColor="")}jf(t){if(null===this.yf)return;const i=this.Df.Zf().yo()+this.Vf.Zf().yo(),s=i/(this.Df.Of().height+this.Vf.Of().height),n=30*s;i<=2*n||(this.Tf={qf:t.pageY,Gf:this.Df.Zf().yo(),Kf:i-n,Jf:i,Qf:s,tp:n},this.yf.Wf.style.display="block")}Yf(t){const i=this.Tf;if(null===i)return;const s=(t.pageY-i.qf)*i.Qf,n=Yt(i.Gf+s,i.tp,i.Kf);this.Df.Zf().Po(n),this.Vf.Zf().Po(i.Jf-n),this.Rf.Qt().Vh()}Xf(t){null!==this.Tf&&null!==this.yf&&(this.Tf=null,this.yf.Wf.style.display="none")}}function vs(t,i){return t.ip-i.ip}function ms(t,i,s){const n=(t.ip-i.ip)/(t.wt-i.wt);return Math.sign(n)*Math.min(Math.abs(n),s)}class ws{constructor(t,i,s,n){this.sp=null,this.np=null,this.ep=null,this.rp=null,this.hp=null,this.lp=0,this.ap=0,this.op=t,this._p=i,this.up=s,this.gn=n}cp(t,i){if(null!==this.sp){if(this.sp.wt===i)return void(this.sp.ip=t);if(Math.abs(this.sp.ip-t)50)return;let s=0;const n=ms(this.sp,this.np,this._p),e=vs(this.sp,this.np),r=[n],h=[e];if(s+=e,null!==this.ep){const t=ms(this.np,this.ep,this._p);if(Math.sign(t)===Math.sign(n)){const i=vs(this.np,this.ep);if(r.push(t),h.push(i),s+=i,null!==this.rp){const t=ms(this.ep,this.rp,this._p);if(Math.sign(t)===Math.sign(n)){const i=vs(this.ep,this.rp);r.push(t),h.push(i),s+=i}}}}let l=0;for(let t=0;t160?"dark":"light"}Sp(){return this.wp.N().layout.attributionLogo}Cp(){const t=new URL(location.href);return t.hostname?"&utm_source="+t.hostname+t.pathname:""}gp(){this.Mp()&&(this.bp(),this.fs=this.Sp(),this.fs&&(this.vp=this.xp(),this.pp=document.createElement("style"),this.pp.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.fp=document.createElement("a"),this.fp.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.Cp()}`,this.fp.title="Charting by TradingView",this.fp.id="tv-attr-logo",this.fp.target="_blank",this.fp.innerHTML='',this.fp.toggleAttribute("data-dark","dark"===this.vp),this.mp.appendChild(this.pp),this.mp.appendChild(this.fp)))}}function bs(t,i){const s=l(t.ownerDocument).createElement("canvas");t.appendChild(s);const n=new ts(s,(e={options:{allowResizeObserver:!0},transform:(t,i)=>({width:Math.max(t.width,i.width),height:Math.max(t.height,i.height)})}).transform,e.options);var e;return n.resizeCanvasElement(i),n}function Ms(t){t.width=1,t.height=1,t.getContext("2d")?.clearRect(0,0,1,1)}function Ss(t,i,s,n){t.th&&t.th(i,s,n)}function xs(t,i,s,n){t.nt(i,s,n)}function Cs(t,i,s,n){const e=t(s,n);for(const t of e){const s=t.Tt(n);null!==s&&i(s)}}function ys(t,i){return s=>{if(!function(t){return void 0!==t.Ft}(s))return[];return(s.Ft()?.ml()??"")!==i?[]:s.Qh?.(t)??[]}}function Ps(t,i,s,n){if(!t.length)return;let e=0;const r=t[0].Ut(n,!0);let h=1===i?s/2-(t[0].Fi()-r/2):t[0].Fi()-r/2-s/2;h=Math.max(0,h);for(let r=1;ru-o:_s)&&h>0){const n=1===i?-1-r:r-s,l=Math.min(n,h);for(let s=e;s{this.Dp||this.yt.Vp().Qt().hr()},this.zp=()=>{this.Dp||this.yt.Vp().Qt().hr()},this.yt=t,this.Cs=i,this.wa=i.layout,this.Hu=s,this.Ip="left"===n,this.Ap=ys("normal",n),this.Bp=ys("top",n),this.Lp=ys("bottom",n),this.If=document.createElement("div"),this.If.style.height="100%",this.If.style.overflow="hidden",this.If.style.width="25px",this.If.style.left="0",this.If.style.position="relative",this.Op=bs(this.If,Ki({width:16,height:16})),this.Op.subscribeSuggestedBitmapSizeChanged(this.Ep);const e=this.Op.canvasElement;e.style.position="absolute",e.style.zIndex="1",e.style.left="0",e.style.top="0",this.Np=bs(this.If,Ki({width:16,height:16})),this.Np.subscribeSuggestedBitmapSizeChanged(this.zp);const r=this.Np.canvasElement;r.style.position="absolute",r.style.zIndex="2",r.style.left="0",r.style.top="0";const h={af:this.jf.bind(this),hf:this.jf.bind(this),Jd:this.Yf.bind(this),Gd:this.Yf.bind(this),_f:this.Fp.bind(this),sf:this.Xf.bind(this),tf:this.Xf.bind(this),Bd:this.Wp.bind(this),Vd:this.Wp.bind(this),$d:this.Hp.bind(this),gf:this.Uf.bind(this)};this.Pf=new os(this.Np.canvasElement,h,{Zd:()=>!this.Cs.handleScroll.vertTouchDrag,qd:()=>!0})}m(){this.Pf.m(),this.Np.unsubscribeSuggestedBitmapSizeChanged(this.zp),Ms(this.Np.canvasElement),this.Np.dispose(),this.Op.unsubscribeSuggestedBitmapSizeChanged(this.Ep),Ms(this.Op.canvasElement),this.Op.dispose(),null!==this.Yi&&this.Yi.Qa().u(this),this.Yi=null}Lf(){return this.If}P(){return this.wa.fontSize}$p(){const t=this.Hu.N();return this.Tp!==t.k&&(this.kp.En(),this.Tp=t.k),t}Up(){if(null===this.Yi)return 0;let t=0;const i=this.$p(),s=l(this.Op.canvasElement.getContext("2d",{colorSpace:this.yt.Vp().N().layout.colorSpace}));s.save();const n=this.Yi.Dl();s.font=this.jp(),n.length>0&&(t=Math.max(this.kp.Ei(s,n[0].Zl),this.kp.Ei(s,n[n.length-1].Zl)));const e=this.Yp();for(let i=e.length;i--;){const n=this.kp.Ei(s,e[i].ri());n>t&&(t=n)}const r=this.Yi.Bt();if(null!==r&&null!==this.yp&&(2!==(h=this.Cs.crosshair).mode&&h.horzLine.visible&&h.horzLine.labelVisible)){const i=this.Yi.ks(1,r),n=this.Yi.ks(this.yp.height-2,r);t=Math.max(t,this.kp.Ei(s,this.Yi.Gi(Math.floor(Math.min(i,n))+.11111111111111,r)),this.kp.Ei(s,this.Yi.Gi(Math.ceil(Math.max(i,n))-.11111111111111,r)))}var h;s.restore();const a=t||34;return ls(Math.ceil(i.S+i.C+i.I+i.A+5+a))}Xp(t){null!==this.yp&&Ji(this.yp,t)||(this.yp=t,this.Dp=!0,this.Op.resizeCanvasElement(t),this.Np.resizeCanvasElement(t),this.Dp=!1,this.If.style.width=`${t.width}px`,this.If.style.height=`${t.height}px`)}Zp(){return l(this.yp).width}os(t){this.Yi!==t&&(null!==this.Yi&&this.Yi.Qa().u(this),this.Yi=t,t.Qa().i(this.aa.bind(this),this))}Ft(){return this.Yi}En(){const t=this.yt.Zf();this.yt.Vp().Qt().Wo(t,l(this.Ft()))}qp(t){if(null===this.yp)return;const i={colorSpace:this.yt.Vp().N().layout.colorSpace};if(1!==t){this.Gp(),this.Op.applySuggestedBitmapSize();const t=ns(this.Op,i);null!==t&&(t.useBitmapCoordinateSpace((t=>{this.Kp(t),this.Jp(t)})),this.yt.Qp(t,this.Lp),this.tv(t),this.yt.Qp(t,this.Ap),this.iv(t))}this.Np.applySuggestedBitmapSize();const s=ns(this.Np,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.sv(s),this.yt.Qp(s,this.Bp))}Nf(){return this.Op.bitmapSize}Ff(t,i,s){const n=this.Nf();n.width>0&&n.height>0&&t.drawImage(this.Op.canvasElement,i,s)}Pt(){this.Yi?.Dl()}jf(t){if(null===this.Yi||this.Yi.Zi()||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Vp().Qt(),s=this.yt.Zf();this.Pp=!0,i.Io(s,this.Yi,t.localY)}Yf(t){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Vp().Qt(),s=this.yt.Zf(),n=this.Yi;i.Ao(s,n,t.localY)}Fp(){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const t=this.yt.Vp().Qt(),i=this.yt.Zf(),s=this.Yi;this.Pp&&(this.Pp=!1,t.Bo(i,s))}Xf(t){if(null===this.Yi||!this.Cs.handleScale.axisPressedMouseMove.price)return;const i=this.yt.Vp().Qt(),s=this.yt.Zf();this.Pp=!1,i.Bo(s,this.Yi)}Wp(t){this.Cs.handleScale.axisDoubleClickReset.price&&this.En()}Hp(t){if(null===this.Yi)return;!this.yt.Vp().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Be()||this.Yi.Ta()||this.nv(1)}Uf(t){this.nv(0)}Yp(){const t=[],i=null===this.Yi?void 0:this.Yi;return(s=>{for(let n=0;n{t.fillStyle=s.borderColor;const l=Math.max(1,Math.floor(h)),a=Math.floor(.5*h),o=Math.round(n.C*r);t.beginPath();for(const s of i)t.rect(Math.floor(e*r),Math.round(s.yl*h)-a,o,l);t.fill()})),t.useMediaCoordinateSpace((({context:t})=>{t.font=this.jp(),t.fillStyle=s.textColor??this.wa.textColor,t.textAlign=this.Ip?"right":"left",t.textBaseline="middle";const r=this.Ip?Math.round(e-n.I):Math.round(e+n.C+n.I),h=i.map((i=>this.kp.Di(t,i.Zl)));for(let s=i.length;s--;){const n=i[s];t.fillText(n.Zl,r,n.yl+h[s])}}))}Gp(){if(null===this.yp||null===this.Yi)return;let t=this.yp.height/2;const i=[],s=this.Yi.Dt().slice(),n=this.yt.Zf(),e=this.$p();this.Yi===n.$n()&&this.yt.Zf().Dt().forEach((t=>{n.Hn(t)&&s.push(t)}));const r=this.Yi.bl()[0],h=this.Yi;s.forEach((s=>{const e=s.Fs(n,h);e.forEach((t=>{t.Wi(null),t.Hi()&&i.push(t)})),r===s&&e.length>0&&(t=e[0].zi())})),i.forEach((t=>t.Wi(t.zi())));this.Yi.N().alignLabels&&this.ev(i,e,t)}ev(t,i,s){if(null===this.yp)return;const n=t.filter((t=>t.zi()<=s)),e=t.filter((t=>t.zi()>s));n.sort(((t,i)=>i.zi()-t.zi())),n.length&&e.length&&e.push(n[0]),e.sort(((t,i)=>t.zi()-i.zi()));for(const s of t){const t=Math.floor(s.Ut(i)/2),n=s.zi();n>-t&&nthis.yp.height-t&&n{if(i.$i()){i.Tt(l(this.Yi)).nt(t,s,this.kp,n)}}))}sv(t){if(null===this.yp||null===this.Yi)return;const i=this.yt.Vp().Qt(),s=[],n=this.yt.Zf(),e=i.tc().Fs(n,this.Yi);e.length&&s.push(e);const r=this.$p(),h=this.Ip?"right":"left";s.forEach((i=>{i.forEach((i=>{i.Tt(l(this.Yi)).nt(t,r,this.kp,h)}))}))}nv(t){this.If.style.cursor=1===t?"ns-resize":"default"}aa(){const t=this.Up();this.Rp{this.Dp||null===this.wv||this.ts().hr()},this.zp=()=>{this.Dp||null===this.wv||this.ts().hr()},this.wp=t,this.wv=i,this.wv.jo().i(this.gv.bind(this),this,!0),this.bv=document.createElement("td"),this.bv.style.padding="0",this.bv.style.position="relative";const s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",s.style.overflow="hidden",this.Mv=document.createElement("td"),this.Mv.style.padding="0",this.Sv=document.createElement("td"),this.Sv.style.padding="0",this.bv.appendChild(s),this.Op=bs(s,Ki({width:16,height:16})),this.Op.subscribeSuggestedBitmapSizeChanged(this.Ep);const n=this.Op.canvasElement;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.Np=bs(s,Ki({width:16,height:16})),this.Np.subscribeSuggestedBitmapSizeChanged(this.zp);const e=this.Np.canvasElement;e.style.position="absolute",e.style.zIndex="2",e.style.left="0",e.style.top="0",this.zf=document.createElement("tr"),this.zf.appendChild(this.Mv),this.zf.appendChild(this.bv),this.zf.appendChild(this.Sv),this.xv(),this.Pf=new os(this.Np.canvasElement,this,{Zd:()=>null===this.fv&&!this.wp.N().handleScroll.vertTouchDrag,qd:()=>null===this.fv&&!this.wp.N().handleScroll.horzTouchDrag})}m(){null!==this.rv&&this.rv.m(),null!==this.hv&&this.hv.m(),this.lv=null,this.Np.unsubscribeSuggestedBitmapSizeChanged(this.zp),Ms(this.Np.canvasElement),this.Np.dispose(),this.Op.unsubscribeSuggestedBitmapSizeChanged(this.Ep),Ms(this.Op.canvasElement),this.Op.dispose(),null!==this.wv&&(this.wv.jo().u(this),this.wv.m()),this.Pf.m()}Zf(){return l(this.wv)}Cv(t){null!==this.wv&&this.wv.jo().u(this),this.wv=t,null!==this.wv&&this.wv.jo().i(Vs.prototype.gv.bind(this),this,!0),this.xv(),this.wp.Ef().indexOf(this)===this.wp.Ef().length-1?(this.lv=this.lv??new gs(this.bv,this.wp),this.lv.Pt()):(this.lv?.bp(),this.lv=null)}Vp(){return this.wp}Lf(){return this.zf}xv(){if(null!==this.wv&&(this.yv(),0!==this.ts().Ys().length)){if(null!==this.rv){const t=this.wv.Vo();this.rv.os(l(t))}if(null!==this.hv){const t=this.wv.zo();this.hv.os(l(t))}}}Pv(){null!==this.rv&&this.rv.Pt(),null!==this.hv&&this.hv.Pt()}yo(){return null!==this.wv?this.wv.yo():0}Po(t){this.wv&&this.wv.Po(t)}$d(t){if(!this.wv)return;this.kv();const i=t.localX,s=t.localY;this.Tv(i,s,t)}af(t){this.kv(),this.Rv(),this.Tv(t.localX,t.localY,t)}Ud(t){if(!this.wv)return;this.kv();const i=t.localX,s=t.localY;this.Tv(i,s,t)}nf(t){null!==this.wv&&(this.kv(),this.Dv(t))}Bd(t){null!==this.wv&&this.Ev(this.uv,t)}Vd(t){this.Bd(t)}Jd(t){this.kv(),this.Vv(t),this.Tv(t.localX,t.localY,t)}sf(t){null!==this.wv&&(this.kv(),this.dv=!1,this.zv(t))}if(t){null!==this.wv&&this.Dv(t)}bf(t){if(this.dv=!0,null===this.fv){const i={x:t.localX,y:t.localY};this.Iv(i,i,t)}}gf(t){null!==this.wv&&(this.kv(),this.wv.Qt().Ku(null),this.Av())}Bv(){return this._v}Lv(){return this.uv}df(){this.cv=1,this.ts().rn()}ff(t,i){if(!this.wp.N().handleScale.pinch)return;const s=5*(i-this.cv);this.cv=i,this.ts().oc(t._t,s)}hf(t){this.dv=!1,this.pv=null!==this.fv,this.Rv();const i=this.ts().tc();null!==this.fv&&i.Et()&&(this.vv={x:i.si(),y:i.ni()},this.fv={x:t.localX,y:t.localY})}Gd(t){if(null===this.wv)return;const i=t.localX,s=t.localY;if(null===this.fv)this.Vv(t);else{this.pv=!1;const n=l(this.vv),e=n.x+(i-this.fv.x),r=n.y+(s-this.fv.y);this.Tv(e,r,t)}}tf(t){0===this.Vp().N().trackingMode.exitMode&&(this.pv=!0),this.Ov(),this.zv(t)}Yn(t,i){const s=this.wv;return null===s?null:gi(s,t,i)}Nv(t,i){l("left"===i?this.rv:this.hv).Xp(Ki({width:t,height:this.yp.height}))}Of(){return this.yp}Xp(t){Ji(this.yp,t)||(this.yp=t,this.Dp=!0,this.Op.resizeCanvasElement(t),this.Np.resizeCanvasElement(t),this.Dp=!1,this.bv.style.width=t.width+"px",this.bv.style.height=t.height+"px")}Fv(){const t=l(this.wv);t.Eo(t.Vo()),t.Eo(t.zo());for(const i of t.bl())if(t.Hn(i)){const s=i.Ft();null!==s&&t.Eo(s),i.Os()}for(const i of t.Xo())i.Os()}Nf(){return this.Op.bitmapSize}Ff(t,i,s){const n=this.Nf();n.width>0&&n.height>0&&t.drawImage(this.Op.canvasElement,i,s)}qp(t){if(0===t)return;if(null===this.wv)return;t>1&&this.Fv(),null!==this.rv&&this.rv.qp(t),null!==this.hv&&this.hv.qp(t);const i={colorSpace:this.wp.N().layout.colorSpace};if(1!==t){this.Op.applySuggestedBitmapSize();const t=ns(this.Op,i);null!==t&&(t.useBitmapCoordinateSpace((t=>{this.Kp(t)})),this.wv&&(this.Wv(t,Ts),this.Hv(t),this.Wv(t,Rs),this.Wv(t,Ds)))}this.Np.applySuggestedBitmapSize();const s=ns(this.Np,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.$v(s),this.Wv(s,Es),this.Wv(s,Ds))}Uv(){return this.rv}jv(){return this.hv}Qp(t,i){this.Wv(t,i)}gv(){null!==this.wv&&this.wv.jo().u(this),this.wv=null}Dv(t){this.Ev(this._v,t)}Ev(t,i){const s=i.localX,n=i.localY;t.v()&&t.p(this.ts().It().su(s),{x:s,y:n},i)}Kp({context:t,bitmapSize:i}){const{width:s,height:n}=i,e=this.ts(),r=e.U(),h=e.Dc();r===h?z(t,0,0,s,n,h):B(t,0,0,s,n,r,h)}Hv(t){const i=l(this.wv),s=i.Yo().lr().Tt(i);null!==s&&s.nt(t,!1)}$v(t){this.Yv(t,Rs,xs,this.ts().tc())}Wv(t,i){const s=l(this.wv),n=s.Dt(),e=s.Xo();for(const s of e)this.Yv(t,i,Ss,s);for(const s of n)this.Yv(t,i,Ss,s);for(const s of e)this.Yv(t,i,xs,s);for(const s of n)this.Yv(t,i,xs,s)}Yv(t,i,s,n){const e=l(this.wv),r=e.Qt().Gu(),h=null!==r&&r.Zo===n,a=null!==r&&h&&void 0!==r.qo?r.qo.Zn:void 0;Cs(i,(i=>s(i,t,h,a)),n,e)}yv(){if(null===this.wv)return;const t=this.wp,i=this.wv.Vo().N().visible,s=this.wv.zo().N().visible;i||null===this.rv||(this.Mv.removeChild(this.rv.Lf()),this.rv.m(),this.rv=null),s||null===this.hv||(this.Sv.removeChild(this.hv.Lf()),this.hv.m(),this.hv=null);const n=t.Qt().Mc();i&&null===this.rv&&(this.rv=new ks(this,t.N(),n,"left"),this.Mv.appendChild(this.rv.Lf())),s&&null===this.hv&&(this.hv=new ks(this,t.N(),n,"right"),this.Sv.appendChild(this.hv.Lf()))}Xv(t){return t.Mf&&this.dv||null!==this.fv}Zv(t){return Math.max(0,Math.min(t,this.yp.width-1))}qv(t){return Math.max(0,Math.min(t,this.yp.height-1))}Tv(t,i,s){this.ts().mc(this.Zv(t),this.qv(i),s,l(this.wv))}Av(){this.ts().gc()}Ov(){this.pv&&(this.fv=null,this.Av())}Iv(t,i,s){this.fv=t,this.pv=!1,this.Tv(i.x,i.y,s);const n=this.ts().tc();this.vv={x:n.si(),y:n.ni()}}ts(){return this.wp.Qt()}zv(t){if(!this.ov)return;const i=this.ts(),s=this.Zf();if(i.No(s,s.Ps()),this.av=null,this.ov=!1,i.dc(),null!==this.mv){const t=performance.now(),s=i.It();this.mv.le(s.ou(),t),this.mv.gu(t)||i.an(this.mv)}}kv(){this.fv=null}Rv(){if(!this.wv)return;if(this.ts().rn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)l(document.activeElement).blur();else{const t=document.getSelection();null!==t&&t.removeAllRanges()}!this.wv.Ps().Zi()&&this.ts().It().Zi()}Vv(t){if(null===this.wv)return;const i=this.ts(),s=i.It();if(s.Zi())return;const n=this.wp.N(),e=n.handleScroll,r=n.kineticScroll;if((!e.pressedMouseMove||t.Mf)&&(!e.horzTouchDrag&&!e.vertTouchDrag||!t.Mf))return;const h=this.wv.Ps(),l=performance.now();if(null!==this.av||this.Xv(t)||(this.av={x:t.clientX,y:t.clientY,jc:l,Gv:t.localX,Kv:t.localY}),null!==this.av&&!this.ov&&(this.av.x!==t.clientX||this.av.y!==t.clientY)){if(t.Mf&&r.touch||!t.Mf&&r.mouse){const t=s.lu();this.mv=new ws(.2/t,7/t,.997,15/t),this.mv.cp(s.ou(),this.av.jc)}else this.mv=null;h.Zi()||i.Lo(this.wv,h,t.localY),i.uc(t.localX),this.ov=!0}this.ov&&(h.Zi()||i.Oo(this.wv,h,t.localY),i.cc(t.localX),null!==this.mv&&this.mv.cp(s.ou(),l))}}class zs{constructor(t,i,s,n,e){this.xt=!0,this.yp=Ki({width:0,height:0}),this.Ep=()=>this.qp(3),this.Ip="left"===t,this.Hu=s.Mc,this.Cs=i,this.Jv=n,this.Qv=e,this.If=document.createElement("div"),this.If.style.width="25px",this.If.style.height="100%",this.If.style.overflow="hidden",this.Op=bs(this.If,Ki({width:16,height:16})),this.Op.subscribeSuggestedBitmapSizeChanged(this.Ep)}m(){this.Op.unsubscribeSuggestedBitmapSizeChanged(this.Ep),Ms(this.Op.canvasElement),this.Op.dispose()}Lf(){return this.If}Of(){return this.yp}Xp(t){Ji(this.yp,t)||(this.yp=t,this.Op.resizeCanvasElement(t),this.If.style.width=`${t.width}px`,this.If.style.height=`${t.height}px`,this.xt=!0)}qp(t){if(t<3&&!this.xt)return;if(0===this.yp.width||0===this.yp.height)return;this.xt=!1,this.Op.applySuggestedBitmapSize();const i=ns(this.Op,{colorSpace:this.Cs.layout.colorSpace});null!==i&&i.useBitmapCoordinateSpace((t=>{this.Kp(t),this.Jp(t)}))}Nf(){return this.Op.bitmapSize}Ff(t,i,s){const n=this.Nf();n.width>0&&n.height>0&&t.drawImage(this.Op.canvasElement,i,s)}Jp({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:n}){if(!this.Jv())return;t.fillStyle=this.Cs.timeScale.borderColor;const e=Math.floor(this.Hu.N().S*s),r=Math.floor(this.Hu.N().S*n),h=this.Ip?i.width-e:0;t.fillRect(h,0,e,r)}Kp({context:t,bitmapSize:i}){z(t,0,0,i.width,i.height,this.Qv())}}function Is(t){return i=>i.tl?.(t)??[]}const As=Is("normal"),Bs=Is("top"),Ls=Is("bottom");class Os{constructor(t,i){this.tm=null,this.im=null,this.M=null,this.sm=!1,this.yp=Ki({width:0,height:0}),this.nm=new o,this.kp=new tt(5),this.Dp=!1,this.Ep=()=>{this.Dp||this.wp.Qt().hr()},this.zp=()=>{this.Dp||this.wp.Qt().hr()},this.wp=t,this.t_=i,this.Cs=t.N().layout,this.fp=document.createElement("tr"),this.rm=document.createElement("td"),this.rm.style.padding="0",this.hm=document.createElement("td"),this.hm.style.padding="0",this.If=document.createElement("td"),this.If.style.height="25px",this.If.style.padding="0",this.lm=document.createElement("div"),this.lm.style.width="100%",this.lm.style.height="100%",this.lm.style.position="relative",this.lm.style.overflow="hidden",this.If.appendChild(this.lm),this.Op=bs(this.lm,Ki({width:16,height:16})),this.Op.subscribeSuggestedBitmapSizeChanged(this.Ep);const s=this.Op.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Np=bs(this.lm,Ki({width:16,height:16})),this.Np.subscribeSuggestedBitmapSizeChanged(this.zp);const n=this.Np.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0",this.fp.appendChild(this.rm),this.fp.appendChild(this.If),this.fp.appendChild(this.hm),this.am(),this.wp.Qt().Co().i(this.am.bind(this),this),this.Pf=new os(this.Np.canvasElement,this,{Zd:()=>!0,qd:()=>!this.wp.N().handleScroll.horzTouchDrag})}m(){this.Pf.m(),null!==this.tm&&this.tm.m(),null!==this.im&&this.im.m(),this.Np.unsubscribeSuggestedBitmapSizeChanged(this.zp),Ms(this.Np.canvasElement),this.Np.dispose(),this.Op.unsubscribeSuggestedBitmapSizeChanged(this.Ep),Ms(this.Op.canvasElement),this.Op.dispose()}Lf(){return this.fp}om(){return this.tm}_m(){return this.im}af(t){if(this.sm)return;this.sm=!0;const i=this.wp.Qt();!i.It().Zi()&&this.wp.N().handleScale.axisPressedMouseMove.time&&i.ac(t.localX)}hf(t){this.af(t)}_f(){const t=this.wp.Qt();!t.It().Zi()&&this.sm&&(this.sm=!1,this.wp.N().handleScale.axisPressedMouseMove.time&&t.vc())}Jd(t){const i=this.wp.Qt();!i.It().Zi()&&this.wp.N().handleScale.axisPressedMouseMove.time&&i.fc(t.localX)}Gd(t){this.Jd(t)}sf(){this.sm=!1;const t=this.wp.Qt();t.It().Zi()&&!this.wp.N().handleScale.axisPressedMouseMove.time||t.vc()}tf(){this.sf()}Bd(){this.wp.N().handleScale.axisDoubleClickReset.time&&this.wp.Qt().un()}Vd(){this.Bd()}$d(){this.wp.Qt().N().handleScale.axisPressedMouseMove.time&&this.nv(1)}gf(){this.nv(0)}Of(){return this.yp}um(){return this.nm}dm(t,i,s){Ji(this.yp,t)||(this.yp=t,this.Dp=!0,this.Op.resizeCanvasElement(t),this.Np.resizeCanvasElement(t),this.Dp=!1,this.If.style.width=`${t.width}px`,this.If.style.height=`${t.height}px`,this.nm.p(t)),null!==this.tm&&this.tm.Xp(Ki({width:i,height:t.height})),null!==this.im&&this.im.Xp(Ki({width:s,height:t.height}))}fm(){const t=this.pm();return Math.ceil(t.S+t.C+t.P+t.B+t.V+t.vm)}Pt(){this.wp.Qt().It().Dl()}Nf(){return this.Op.bitmapSize}Ff(t,i,s){const n=this.Nf();n.width>0&&n.height>0&&t.drawImage(this.Op.canvasElement,i,s)}qp(t){if(0===t)return;const i={colorSpace:this.Cs.colorSpace};if(1!==t){this.Op.applySuggestedBitmapSize();const s=ns(this.Op,i);null!==s&&(s.useBitmapCoordinateSpace((t=>{this.Kp(t),this.Jp(t),this.wm(s,Ls)})),this.tv(s),this.wm(s,As)),null!==this.tm&&this.tm.qp(t),null!==this.im&&this.im.qp(t)}this.Np.applySuggestedBitmapSize();const s=ns(this.Np,i);null!==s&&(s.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.gm([...this.wp.Qt().Ys(),this.wp.Qt().tc()],s),this.wm(s,Bs))}wm(t,i){const s=this.wp.Qt().Ys();for(const n of s)Cs(i,(i=>Ss(i,t,!1,void 0)),n,void 0);for(const n of s)Cs(i,(i=>xs(i,t,!1,void 0)),n,void 0)}Kp({context:t,bitmapSize:i}){z(t,0,0,i.width,i.height,this.wp.Qt().Dc())}Jp({context:t,bitmapSize:i,verticalPixelRatio:s}){if(this.wp.N().timeScale.borderVisible){t.fillStyle=this.bm();const n=Math.max(1,Math.floor(this.pm().S*s));t.fillRect(0,0,i.width,n)}}tv(t){const i=this.wp.Qt().It(),s=i.Dl();if(!s||0===s.length)return;const n=this.t_.maxTickMarkWeight(s),e=this.pm(),r=i.N();r.borderVisible&&r.ticksVisible&&t.useBitmapCoordinateSpace((({context:t,horizontalPixelRatio:i,verticalPixelRatio:n})=>{t.strokeStyle=this.bm(),t.fillStyle=this.bm();const r=Math.max(1,Math.floor(i)),h=Math.floor(.5*i);t.beginPath();const l=Math.round(e.C*n);for(let n=s.length;n--;){const e=Math.round(s[n].coord*i);t.rect(e-h,0,r,l)}t.fill()})),t.useMediaCoordinateSpace((({context:t})=>{const i=e.S+e.C+e.B+e.P/2;t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.H(),t.font=this.jp();for(const e of s)if(e.weight=n){const s=e.needAlignCoordinate?this.Mm(t,e.coord,e.label):e.coord;t.fillText(e.label,s,i)}}))}Mm(t,i,s){const n=this.kp.Ei(t,s),e=n/2,r=Math.floor(i-e)+.5;return r<0?i+=Math.abs(0-r):r+n>this.yp.width&&(i-=Math.abs(this.yp.width-(r+n))),i}gm(t,i){const s=this.pm();for(const n of t)for(const t of n.us())t.Tt().nt(i,s)}bm(){return this.wp.N().timeScale.borderColor}H(){return this.Cs.textColor}F(){return this.Cs.fontSize}jp(){return g(this.F(),this.Cs.fontFamily)}Sm(){return g(this.F(),this.Cs.fontFamily,"bold")}pm(){null===this.M&&(this.M={S:1,L:NaN,B:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Ki:new tt,vm:0});const t=this.M,i=this.jp();if(t.k!==i){const s=this.F();t.P=s,t.k=i,t.B=3*s/12,t.V=3*s/12,t.Ji=9*s/12,t.L=0,t.vm=4*s/12,t.Ki.En()}return this.M}nv(t){this.If.style.cursor=1===t?"ew-resize":"default"}am(){const t=this.wp.Qt(),i=t.N();i.leftPriceScale.visible||null===this.tm||(this.rm.removeChild(this.tm.Lf()),this.tm.m(),this.tm=null),i.rightPriceScale.visible||null===this.im||(this.hm.removeChild(this.im.Lf()),this.im.m(),this.im=null);const s={Mc:this.wp.Qt().Mc()},n=()=>i.leftPriceScale.borderVisible&&t.It().N().borderVisible,e=()=>t.Dc();i.leftPriceScale.visible&&null===this.tm&&(this.tm=new zs("left",i,s,n,e),this.rm.appendChild(this.tm.Lf())),i.rightPriceScale.visible&&null===this.im&&(this.im=new zs("right",i,s,n,e),this.hm.appendChild(this.im.Lf()))}}const Ns=!!es&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>t.brand.includes("Chromium")))&&!!es&&(navigator?.userAgentData?.platform?"Windows"===navigator.userAgentData.platform:navigator.userAgent.toLowerCase().indexOf("win")>=0);class Fs{constructor(t,i,s){var n;this.xm=[],this.Cm=[],this.ym=0,this.Ql=0,this.do=0,this.Pm=0,this.km=0,this.Tm=null,this.Rm=!1,this._v=new o,this.uv=new o,this.Nu=new o,this.Dm=null,this.Em=null,this.mp=t,this.Cs=i,this.t_=s,this.fp=document.createElement("div"),this.fp.classList.add("tv-lightweight-charts"),this.fp.style.overflow="hidden",this.fp.style.direction="ltr",this.fp.style.width="100%",this.fp.style.height="100%",(n=this.fp).style.userSelect="none",n.style.webkitUserSelect="none",n.style.msUserSelect="none",n.style.MozUserSelect="none",n.style.webkitTapHighlightColor="transparent",this.Vm=document.createElement("table"),this.Vm.setAttribute("cellspacing","0"),this.fp.appendChild(this.Vm),this.zm=this.Im.bind(this),Ws(this.Cs)&&this.Am(!0),this.ts=new Vi(this.Wu.bind(this),this.Cs,s),this.Qt().sc().i(this.Bm.bind(this),this),this.Lm=new Os(this,this.t_),this.Vm.appendChild(this.Lm.Lf());const e=i.autoSize&&this.Om();let r=this.Cs.width,h=this.Cs.height;if(e||0===r||0===h){const i=t.getBoundingClientRect();r=r||i.width,h=h||i.height}this.Nm(r,h),this.Fm(),t.appendChild(this.fp),this.Wm(),this.ts.It().xu().i(this.ts.Vh.bind(this.ts),this),this.ts.Co().i(this.ts.Vh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.Cs}Ef(){return this.xm}Hm(){return this.Lm}m(){this.Am(!1),0!==this.ym&&window.cancelAnimationFrame(this.ym),this.ts.sc().u(this),this.ts.It().xu().u(this),this.ts.Co().u(this),this.ts.m();for(const t of this.xm)this.Vm.removeChild(t.Lf()),t.Bv().u(this),t.Lv().u(this),t.m();this.xm=[];for(const t of this.Cm)this.$m(t);this.Cm=[],l(this.Lm).m(),null!==this.fp.parentElement&&this.fp.parentElement.removeChild(this.fp),this.Nu.m(),this._v.m(),this.uv.m(),this.Um()}Nm(t,i,s=!1){if(this.Ql===i&&this.do===t)return;const n=function(t){const i=Math.floor(t.width),s=Math.floor(t.height);return Ki({width:i-i%2,height:s-s%2})}(Ki({width:t,height:i}));this.Ql=n.height,this.do=n.width;const e=this.Ql+"px",r=this.do+"px";l(this.fp).style.height=e,l(this.fp).style.width=r,this.Vm.style.height=e,this.Vm.style.width=r,s?this.jm(X.wn(),performance.now()):this.ts.Vh()}qp(t){void 0===t&&(t=X.wn());for(let i=0;i{t.Pt()}))}Xm(t){(void 0!==t.autoSize||!this.Dm||void 0===t.width&&void 0===t.height)&&(t.autoSize&&!this.Dm&&this.Om(),!1===t.autoSize&&null!==this.Dm&&this.Um(),t.autoSize||void 0===t.width&&void 0===t.height||this.Nm(t.width||this.do,t.height||this.Ql))}qm(t){let i=0,s=0;const n=this.xm[0],e=(i,s)=>{let n=0;for(let e=0;e{l("left"===i?this.Lm.om():this.Lm._m()).Ff(l(t),s,n)};if(this.Cs.timeScale.visible){const i=this.Lm.Nf();if(null!==t){let e=0;this.Km()&&(r("left",e,s),e=l(n.Uv()).Nf().width),this.Lm.Ff(t,e,s),e+=i.width,this.Jm()&&r("right",e,s)}s+=i.height}return Ki({width:i,height:s})}nw(){let t=0,i=0,s=0;for(const n of this.xm)this.Km()&&(i=Math.max(i,l(n.Uv()).Up(),this.Cs.leftPriceScale.minimumWidth)),this.Jm()&&(s=Math.max(s,l(n.jv()).Up(),this.Cs.rightPriceScale.minimumWidth)),t+=n.yo();i=ls(i),s=ls(s);const n=this.do,e=this.Ql,r=Math.max(n-i-s,0),h=1*this.Cm.length,a=this.Cs.timeScale.visible;let o=a?Math.max(this.Lm.fm(),this.Cs.timeScale.minimumHeight):0;var _;o=(_=o)+_%2;const u=h+o,c=e{t.Pv()})),3===this.Tm?.sn()&&(this.Tm.pn(t),this.rw(),this.hw(this.Tm),this.lw(this.Tm,i),t=this.Tm,this.Tm=null)),this.qp(t)}lw(t,i){for(const s of t.fn())this.vn(s,i)}hw(t){const i=this.ts.$s();for(let s=0;s{if(this.Rm=!1,this.ym=0,null!==this.Tm){const i=this.Tm;this.Tm=null,this.jm(i,t);for(const s of i.fn())if(5===s.hn&&!s.Wt.gu(t)){this.Qt().an(s.Wt);break}}})))}rw(){this.Fm()}$m(t){this.Vm.removeChild(t.Lf()),t.m()}Fm(){const t=this.ts.$s(),i=t.length,s=this.xm.length;for(let t=i;t0){const t=new ps(this,n-1,n);this.Cm.push(t),this.Vm.insertBefore(t.Lf(),this.Lm.Lf())}this.Vm.insertBefore(i.Lf(),this.Lm.Lf())}for(let s=0;s{const s=i.Zs().Nr(t);null!==s&&e.set(i,s)}))}let r;if(null!==t){const i=this.ts.It().ss(t)?.originalTime;void 0!==i&&(r=i)}const h=this.Qt().Gu(),l=null!==h&&h.Zo instanceof Ht?h.Zo:void 0,a=null!==h&&void 0!==h.qo?h.qo.Xn:void 0,o=this.uw(n);return{cw:r,Te:t??void 0,dw:i??void 0,fw:-1!==o?o:void 0,pw:l,mw:e,ww:a,gw:s??void 0}}uw(t){let i=-1;if(t)i=this.xm.indexOf(t);else{const t=this.Qt().tc().Hs();null!==t&&(i=this.Qt().$s().indexOf(t))}return i}aw(t,i,s,n){this._v.p((()=>this._w(i,s,n,t)))}ow(t,i,s,n){this.uv.p((()=>this._w(i,s,n,t)))}Bm(t,i,s){this.tw(this.Qt().Gu()?.Ko??null),this.Nu.p((()=>this._w(t,i,s)))}Wm(){const t=this.Cs.timeScale.visible?"":"none";this.Lm.Lf().style.display=t}Km(){return this.xm[0].Zf().Vo().N().visible}Jm(){return this.xm[0].Zf().zo().N().visible}Om(){return"ResizeObserver"in window&&(this.Dm=new ResizeObserver((t=>{const i=t[t.length-1];i&&this.Nm(i.contentRect.width,i.contentRect.height)})),this.Dm.observe(this.mp,{box:"border-box"}),!0)}Um(){null!==this.Dm&&this.Dm.disconnect(),this.Dm=null}}function Ws(t){return Boolean(t.handleScroll.mouseWheel||t.handleScale.mouseWheel)}function Hs(t){return function(t){return void 0!==t.open}(t)||function(t){return void 0!==t.value}(t)}function $s(t,i,s,n){const e=s.value,r={Te:i,wt:t,Wt:[e,e,e,e],cw:n};return void 0!==s.color&&(r.R=s.color),r}function Us(t,i,s,n){const e=s.value,r={Te:i,wt:t,Wt:[e,e,e,e],cw:n};return void 0!==s.lineColor&&(r.vt=s.lineColor),void 0!==s.topColor&&(r.vr=s.topColor),void 0!==s.bottomColor&&(r.mr=s.bottomColor),r}function js(t,i,s,n){const e=s.value,r={Te:i,wt:t,Wt:[e,e,e,e],cw:n};return void 0!==s.topLineColor&&(r.wr=s.topLineColor),void 0!==s.bottomLineColor&&(r.gr=s.bottomLineColor),void 0!==s.topFillColor1&&(r.br=s.topFillColor1),void 0!==s.topFillColor2&&(r.Mr=s.topFillColor2),void 0!==s.bottomFillColor1&&(r.Sr=s.bottomFillColor1),void 0!==s.bottomFillColor2&&(r.Cr=s.bottomFillColor2),r}function Ys(t,i,s,n){const e={Te:i,wt:t,Wt:[s.open,s.high,s.low,s.close],cw:n};return void 0!==s.color&&(e.R=s.color),e}function Xs(t,i,s,n){const e={Te:i,wt:t,Wt:[s.open,s.high,s.low,s.close],cw:n};return void 0!==s.color&&(e.R=s.color),void 0!==s.borderColor&&(e.Ht=s.borderColor),void 0!==s.wickColor&&(e.pr=s.wickColor),e}function Zs(t,i,s,n,e){const r=h(e)(s),l=Math.max(...r),a=Math.min(...r),o=r[r.length-1],_=[o,l,a,o],{time:u,color:c,...d}=s;return{Te:i,wt:t,Wt:_,cw:n,ie:d,R:c}}function qs(t){return void 0!==t.Wt}function Gs(t,i){return void 0!==i.customValues&&(t.bw=i.customValues),t}function Ks(t){return(i,s,n,e,r,h)=>function(t,i){return i?i(t):void 0===(s=t).open&&void 0===s.value;var s}(n,h)?Gs({wt:i,Te:s,cw:e},n):Gs(t(i,s,n,e,r),n)}function Js(t){return{Candlestick:Ks(Xs),Bar:Ks(Ys),Area:Ks(Us),Baseline:Ks(js),Histogram:Ks($s),Line:Ks($s),Custom:Ks(Zs)}[t]}function Qs(t){return{Te:0,Mw:new Map,Wh:t}}function tn(t,i){if(void 0!==t&&0!==t.length)return{Sw:i.key(t[0].wt),xw:i.key(t[t.length-1].wt)}}function sn(t){let i;return t.forEach((t=>{void 0===i&&(i=t.cw)})),h(i)}class nn{constructor(t){this.Cw=new Map,this.yw=new Map,this.Pw=new Map,this.kw=[],this.t_=t}m(){this.Cw.clear(),this.yw.clear(),this.Pw.clear(),this.kw=[]}Tw(t,i){let s=0!==this.Cw.size,n=!1;const e=this.yw.get(t);if(void 0!==e)if(1===this.yw.size)s=!1,n=!0,this.Cw.clear();else for(const i of this.kw)i.pointData.Mw.delete(t)&&(n=!0);let r=[];if(0!==i.length){const s=i.map((t=>t.time)),e=this.t_.createConverterToInternalObj(i),h=Js(t.Tr()),l=t.cl(),a=t.fl();r=i.map(((i,r)=>{const o=e(i.time),_=this.t_.key(o);let u=this.Cw.get(_);void 0===u&&(u=Qs(o),this.Cw.set(_,u),n=!0);const c=h(o,u.Te,i,s[r],l,a);return u.Mw.set(t,c),c}))}s&&this.Rw(),this.Dw(t,r);let h=-1;if(n){const t=[];this.Cw.forEach((i=>{t.push({timeWeight:0,time:i.Wh,pointData:i,originalTime:sn(i.Mw)})})),t.sort(((t,i)=>this.t_.key(t.time)-this.t_.key(i.time))),h=this.Ew(t)}return this.Vw(t,h,function(t,i,s){const n=tn(t,s),e=tn(i,s);if(void 0!==n&&void 0!==e)return{zw:!1,Ah:n.xw>=e.xw&&n.Sw>=e.Sw}}(this.yw.get(t),e,this.t_))}Cc(t){return this.Tw(t,[])}Iw(t,i,s){const n=i;!function(t){void 0===t.cw&&(t.cw=t.time)}(n),this.t_.preprocessData(i);const e=this.t_.createConverterToInternalObj([i])(i.time),r=this.Pw.get(t);if(!s&&void 0!==r&&this.t_.key(e)this.t_.key(t.time)this.t_.key(n.wt)?qs(i)&&s.push(i):qs(i)?s[s.length-1]=i:s.splice(-1,1),this.Pw.set(t,i.wt)}Aw(t,i,s){const n=this.yw.get(t);if(void 0===n)return;const e=Mt(n,s,((t,i)=>t.Te{0!==i.length&&(t=Math.max(t,i[i.length-1].Te))})),t}Vw(t,i,s){const n={Ro:new Map,It:{tu:this.Lw()}};if(-1!==i)this.yw.forEach(((i,e)=>{n.Ro.set(e,{ie:i,Ow:e===t?s:void 0})})),this.yw.has(t)||n.Ro.set(t,{ie:[],Ow:s}),n.It.Nw=this.kw,n.It.Fw=i;else{const i=this.yw.get(t);n.Ro.set(t,{ie:i||[],Ow:s})}return n}}function en(t,i){t.Te=i,t.Mw.forEach((t=>{t.Te=i}))}function rn(t,i){return t.wt({...t,...this.Kn.Th().Rr(t.wt)})))}Gw(){this.jw=null}Xw(){this.Hw&&(this.Kw(),this.Hw=!1),this.$w&&(this.qw(),this.$w=!1),this.Ww&&(this.Jw(),this.Ww=!1)}Jw(){const t=this.Kn.Ft(),i=this.Jn.It();if(this.Gw(),i.Zi()||t.Zi())return;const s=i.Ce();if(null===s)return;if(0===this.Kn.Zs().Ar())return;const n=this.Kn.Bt();null!==n&&(this.jw=function(t,i,s){const n=i.Hh(),e=i.Mi(),r=Mt(t,n,rn),h=St(t,e,hn);if(!s)return{from:r,to:h};let l=r,a=h;return r>0&&r=n&&(l=r-1),h>0&&h{const s=t.Bt();return null===s?null:t.Ft().Nt(i,s.Wt)}))}dl(t){return this.ih.priceValueBuilder(t)}pl(t){return this.ih.isWhitespace(t)}Kw(){const t=this.Kn.Th();this.Uw=this.Kn.Zs().Wr().map((i=>({wt:i.Te,_t:NaN,...t.Rr(i.Te),sg:i.ie})))}Qw(t,i){i.iu(this.Uw,m(this.jw))}tg(){this.ih.update({bars:this.Uw.map(_n),barSpacing:this.Jn.It().lu(),visibleRange:this.jw},this.Kn.N())}}function _n(t){return{x:t._t,time:t.wt,originalData:t.sg,barColor:t.ur}}const un={color:"#2196f3"},cn=(t,i,s)=>{const n=a(s);return new on(t,i,n)};function dn(t){const i={value:t.Wt[3],time:t.cw};return void 0!==t.bw&&(i.customValues=t.bw),i}function fn(t){const i=dn(t);return void 0!==t.R&&(i.color=t.R),i}function pn(t){const i=dn(t);return void 0!==t.vt&&(i.lineColor=t.vt),void 0!==t.vr&&(i.topColor=t.vr),void 0!==t.mr&&(i.bottomColor=t.mr),i}function vn(t){const i=dn(t);return void 0!==t.wr&&(i.topLineColor=t.wr),void 0!==t.gr&&(i.bottomLineColor=t.gr),void 0!==t.br&&(i.topFillColor1=t.br),void 0!==t.Mr&&(i.topFillColor2=t.Mr),void 0!==t.Sr&&(i.bottomFillColor1=t.Sr),void 0!==t.Cr&&(i.bottomFillColor2=t.Cr),i}function mn(t){const i={open:t.Wt[0],high:t.Wt[1],low:t.Wt[2],close:t.Wt[3],time:t.cw};return void 0!==t.bw&&(i.customValues=t.bw),i}function wn(t){const i=mn(t);return void 0!==t.R&&(i.color=t.R),i}function gn(t){const i=mn(t),{R:s,Ht:n,pr:e}=t;return void 0!==s&&(i.color=s),void 0!==n&&(i.borderColor=n),void 0!==e&&(i.wickColor=e),i}function bn(t){return{Area:pn,Line:fn,Baseline:vn,Histogram:fn,Bar:wn,Candlestick:gn,Custom:Mn}[t]}function Mn(t){const i=t.cw;return{...t.ie,time:i}}const Sn={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},xn={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},Cn={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:w,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},yn={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,ensureEdgeTickMarksVisible:!1},Pn={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 kn(){return{width:0,height:0,autoSize:!1,layout:Cn,crosshair:Sn,grid:xn,overlayPriceScales:{...yn},leftPriceScale:{...yn,visible:!1},rightPriceScale:{...yn,visible:!0},timeScale:Pn,localization:{locale:es?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 Tn{constructor(t,i,s){this.Rf=t,this.ng=i,this.eg=s??0}applyOptions(t){this.Rf.Qt().Ju(this.ng,t,this.eg)}options(){return this.Yi().N()}width(){return Y(this.ng)?this.Rf.Gm(this.ng):0}setVisibleRange(t){this.setAutoScale(!1),this.Yi().Oa(new ct(t.from,t.to))}getVisibleRange(){const t=this.Yi().Je();return null===t?null:{from:t.$e(),to:t.Ue()}}setAutoScale(t){this.applyOptions({autoScale:t})}Yi(){return l(this.Rf.Qt().Qu(this.ng,this.eg)).Ft}}class Rn{constructor(t,i,s,n){this.Rf=t,this.yt=s,this.rg=i,this.hg=n}getHeight(){return this.yt.Ut()}setHeight(t){const i=this.Rf.Qt(),s=i.Vc(this.yt);i.rc(s,t)}paneIndex(){return this.Rf.Qt().Vc(this.yt)}moveTo(t){const i=this.paneIndex();i!==t&&(r(t>=0&&tthis.rg(t)))??[]}getHTMLElement(){return this.Rf.Ef()[this.paneIndex()].Lf()}attachPrimitive(t){this.yt._l(t),t.attached&&t.attached({chart:this.hg,requestUpdate:()=>this.yt.Qt().Vh()})}detachPrimitive(t){this.yt.ul(t)}priceScale(t){if(null===this.yt.xo(t))throw new Error(`Cannot find price scale with id: ${t}`);return new Tn(this.Rf,t,this.paneIndex())}}const Dn={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class En{constructor(t){this.tr=t}applyOptions(t){this.tr.rr(t)}options(){return this.tr.N()}lg(){return this.tr}}class Vn{constructor(t,i,s,n,e,r){this.ag=new o,this.Kn=t,this.og=i,this._g=s,this.t_=e,this.hg=n,this.ug=r}m(){this.ag.m()}priceFormatter(){return this.Kn.el()}priceToCoordinate(t){const i=this.Kn.Bt();return null===i?null:this.Kn.Ft().Nt(t,i.Wt)}coordinateToPrice(t){const i=this.Kn.Bt();return null===i?null:this.Kn.Ft().ks(t,i.Wt)}barsInLogicalRange(t){if(null===t)return null;const i=new Ci(new Mi(t.from,t.to)).m_(),s=this.Kn.Zs();if(s.Zi())return null;const n=s.Nr(i.Hh(),1),e=s.Nr(i.Mi(),-1),r=l(s.Br()),h=l(s.Xs());if(null!==n&&null!==e&&n.Te>e.Te)return{barsBefore:t.from-r,barsAfter:h-t.to};const a={barsBefore:null===n||n.Te===r?t.from-r:n.Te-r,barsAfter:null===e||e.Te===h?h-t.to:h-e.Te};return null!==n&&null!==e&&(a.from=n.cw,a.to=e.cw),a}setData(t){this.t_,this.Kn.Tr(),this.og.cg(this.Kn,t),this.dg("full")}update(t,i=!1){this.Kn.Tr(),this.og.fg(this.Kn,t,i),this.dg("update")}dataByIndex(t,i){const s=this.Kn.Zs().Nr(t,i);if(null===s)return null;return bn(this.seriesType())(s)}data(){const t=bn(this.seriesType());return this.Kn.Zs().Wr().map((i=>t(i)))}subscribeDataChanged(t){this.ag.i(t)}unsubscribeDataChanged(t){this.ag._(t)}applyOptions(t){this.Kn.rr(t)}options(){return p(this.Kn.N())}priceScale(){return this._g.priceScale(this.Kn.Ft().ml(),this.getPane().paneIndex())}createPriceLine(t){const i=_(p(Dn),t),s=this.Kn.Lh(i);return new En(s)}removePriceLine(t){this.Kn.Oh(t.lg())}priceLines(){return this.Kn.Nh().map((t=>new En(t)))}seriesType(){return this.Kn.Tr()}attachPrimitive(t){this.Kn._l(t),t.attached&&t.attached({chart:this.hg,series:this,requestUpdate:()=>this.Kn.Qt().Vh(),horzScaleBehavior:this.t_})}detachPrimitive(t){this.Kn.ul(t),t.detached&&t.detached(),this.Kn.Qt().Vh()}getPane(){const t=this.Kn,i=l(this.Kn.Qt().Wn(t));return this.ug(i)}moveToPane(t){this.Kn.Qt().Tc(this.Kn,t)}seriesOrder(){const t=this.Kn.Qt().Wn(this.Kn);return null===t?-1:t.Ro().indexOf(this.Kn)}setSeriesOrder(t){const i=this.Kn.Qt().Wn(this.Kn);null!==i&&i.Uo(this.Kn,t)}dg(t){this.ag.v()&&this.ag.p(t)}}class zn{constructor(t,i,s){this.pg=new o,this.k_=new o,this.nm=new o,this.ts=t,this._h=t.It(),this.Lm=i,this._h.Mu().i(this.vg.bind(this)),this._h.Su().i(this.mg.bind(this)),this.Lm.um().i(this.wg.bind(this)),this.t_=s}m(){this._h.Mu().u(this),this._h.Su().u(this),this.Lm.um().u(this),this.pg.m(),this.k_.m(),this.nm.m()}scrollPosition(){return this._h.ou()}scrollToPosition(t,i){i?this._h.wu(t,1e3):this.ts.dn(t)}scrollToRealTime(){this._h.mu()}getVisibleRange(){const t=this._h.X_();return null===t?null:{from:t.from.originalTime,to:t.to.originalTime}}setVisibleRange(t){const i={from:this.t_.convertHorzItemToInternal(t.from),to:this.t_.convertHorzItemToInternal(t.to)},s=this._h.K_(i);this.ts.Pc(s)}getVisibleLogicalRange(){const t=this._h.Y_();return null===t?null:{from:t.Hh(),to:t.Mi()}}setVisibleLogicalRange(t){r(t.from<=t.to,"The from index cannot be after the to index."),this.ts.Pc(t)}resetTimeScale(){this.ts.un()}fitContent(){this.ts.yu()}logicalToCoordinate(t){const i=this.ts.It();return i.Zi()?null:i.jt(t)}coordinateToLogical(t){return this._h.Zi()?null:this._h.su(t)}timeToIndex(t,i){const s=this.t_.convertHorzItemToInternal(t);return this._h.H_(s,i)}timeToCoordinate(t){const i=this.timeToIndex(t,!1);return null===i?null:this._h.jt(i)}coordinateToTime(t){const i=this.ts.It(),s=i.su(t),n=i.ss(s);return null===n?null:n.originalTime}width(){return this.Lm.Of().width}height(){return this.Lm.Of().height}subscribeVisibleTimeRangeChange(t){this.pg.i(t)}unsubscribeVisibleTimeRangeChange(t){this.pg._(t)}subscribeVisibleLogicalRangeChange(t){this.k_.i(t)}unsubscribeVisibleLogicalRangeChange(t){this.k_._(t)}subscribeSizeChange(t){this.nm.i(t)}unsubscribeSizeChange(t){this.nm._(t)}applyOptions(t){this._h.rr(t)}options(){return{...p(this._h.N()),barSpacing:this._h.lu()}}vg(){this.pg.v()&&this.pg.p(this.getVisibleRange())}mg(){this.k_.v()&&this.k_.p(this.getVisibleLogicalRange())}wg(t){this.nm.p(t.width,t.height)}}function In(t){if(void 0===t||"custom"===t.type)return;const i=t;void 0!==i.minMove&&void 0===i.precision&&(i.precision=function(t){if(t>=1)return 0;let i=0;for(;i<8;i++){const s=Math.round(t);if(Math.abs(s-t)<1e-8)return i;t*=10}return i}(i.minMove))}function An(t){return function(t){if(f(t.handleScale)){const i=t.handleScale;t.handleScale={axisDoubleClickReset:{time:i,price:i},axisPressedMouseMove:{time:i,price:i},mouseWheel:i,pinch:i}}else if(void 0!==t.handleScale){const{axisPressedMouseMove:i,axisDoubleClickReset:s}=t.handleScale;f(i)&&(t.handleScale.axisPressedMouseMove={time:i,price:i}),f(s)&&(t.handleScale.axisDoubleClickReset={time:s,price:s})}const i=t.handleScroll;f(i)&&(t.handleScroll={horzTouchDrag:i,vertTouchDrag:i,mouseWheel:i,pressedMouseMove:i})}(t),t}class Bn{constructor(t,i,s){this.gg=new Map,this.bg=new Map,this.Mg=new o,this.Sg=new o,this.xg=new o,this.Au=new WeakMap,this.Cg=new nn(i);const n=void 0===s?p(kn()):_(p(kn()),An(s));this.yg=i,this.Rf=new Fs(t,n,i),this.Rf.Bv().i((t=>{this.Mg.v()&&this.Mg.p(this.Pg(t()))}),this),this.Rf.Lv().i((t=>{this.Sg.v()&&this.Sg.p(this.Pg(t()))}),this),this.Rf.sc().i((t=>{this.xg.v()&&this.xg.p(this.Pg(t()))}),this);const e=this.Rf.Qt();this.kg=new zn(e,this.Rf.Hm(),this.yg)}remove(){this.Rf.Bv().u(this),this.Rf.Lv().u(this),this.Rf.sc().u(this),this.kg.m(),this.Rf.m(),this.gg.clear(),this.bg.clear(),this.Mg.m(),this.Sg.m(),this.xg.m(),this.Cg.m()}resize(t,i,s){this.autoSizeActive()||this.Rf.Nm(t,i,s)}addCustomSeries(t,i={},s=0){const n=(t=>({type:"Custom",isBuiltIn:!1,defaultOptions:{...un,...t.defaultOptions()},Tg:cn,Rg:t}))(a(t));return this.Dg(n,i,s)}addSeries(t,i={},s=0){return this.Dg(t,i,s)}removeSeries(t){const i=h(this.gg.get(t)),s=this.Cg.Cc(i);this.Rf.Qt().Cc(i),this.Eg(s),this.gg.delete(t),this.bg.delete(i)}cg(t,i){this.Eg(this.Cg.Tw(t,i))}fg(t,i,s){this.Eg(this.Cg.Iw(t,i,s))}subscribeClick(t){this.Mg.i(t)}unsubscribeClick(t){this.Mg._(t)}subscribeCrosshairMove(t){this.xg.i(t)}unsubscribeCrosshairMove(t){this.xg._(t)}subscribeDblClick(t){this.Sg.i(t)}unsubscribeDblClick(t){this.Sg._(t)}priceScale(t,i=0){return new Tn(this.Rf,t,i)}timeScale(){return this.kg}applyOptions(t){this.Rf.rr(An(t))}options(){return this.Rf.N()}takeScreenshot(){return this.Rf.Zm()}removePane(t){this.Rf.Qt().ec(t)}swapPanes(t,i){this.Rf.Qt().hc(t,i)}autoSizeActive(){return this.Rf.Qm()}chartElement(){return this.Rf.Hf()}panes(){return this.Rf.Qt().$s().map((t=>this.Vg(t)))}paneSize(t=0){const i=this.Rf.sw(t);return{height:i.height,width:i.width}}setCrosshairPosition(t,i,s){const n=this.gg.get(s);if(void 0===n)return;const e=this.Rf.Qt().Wn(n);null!==e&&this.Rf.Qt().wc(t,i,e)}clearCrosshairPosition(){this.Rf.Qt().gc(!0)}horzBehaviour(){return this.yg}Dg(i,s={},n=0){r(void 0!==i.Tg),In(s.priceFormat),"Candlestick"===i.type&&function(t){void 0!==t.borderColor&&(t.borderUpColor=t.borderColor,t.borderDownColor=t.borderColor),void 0!==t.wickColor&&(t.wickUpColor=t.wickColor,t.wickDownColor=t.wickColor)}(s);const e=_(p(t),p(i.defaultOptions),s),h=i.Tg,l=new Ht(this.Rf.Qt(),i.type,e,h,i.Rg);this.Rf.Qt().Sc(l,n);const a=new Vn(l,this,this,this,this.yg,(t=>this.Vg(t)));return this.gg.set(a,l),this.bg.set(l,a),a}Eg(t){const i=this.Rf.Qt();i.bc(t.It.tu,t.It.Nw,t.It.Fw),t.Ro.forEach(((t,i)=>i.ht(t.ie,t.Ow))),i.It().L_(),i.hu()}zg(t){return h(this.bg.get(t))}Pg(t){const i=new Map;t.mw.forEach(((t,s)=>{const n=s.Tr(),e=bn(n)(t);if("Custom"!==n)r(Hs(e));else{const t=s.fl();r(!t||!1===t(e))}i.set(this.zg(s),e)}));const s=void 0!==t.pw&&this.bg.has(t.pw)?this.zg(t.pw):void 0;return{time:t.cw,logical:t.Te,point:t.dw,paneIndex:t.fw,hoveredSeries:s,hoveredObjectId:t.ww,seriesData:i,sourceEvent:t.gw}}Vg(t){let i=this.Au.get(t);return i||(i=new Rn(this.Rf,(t=>this.zg(t)),t,this),this.Au.set(t,i)),i}}function Ln(t,i,s){const n=function(t){if(d(t)){const i=document.getElementById(t);return r(null!==i,`Cannot find element in DOM with id=${t}`),i}return t}(t),e=new Bn(n,i,s);return i.setOptions(e.options()),e}function On(t,i){return Ln(t,new Gi,Gi.Zc(i))}function Nn(){return Gi}class Fn extends ln{constructor(t,i){super(t,i,!0)}Qw(t,i,s){i.iu(this.Uw,m(this.jw)),t.Wa(this.Uw,s,m(this.jw))}Ig(t,i){return{wt:t,gt:i,_t:NaN,ut:NaN}}Kw(){const t=this.Kn.Th();this.Uw=this.Kn.Zs().Wr().map((i=>{const s=i.Wt[3];return this.Ag(i.Te,s,t)}))}}function Wn(t,i,s,n,e,r,h){if(0===i.length||n.from>=i.length||n.to<=0)return;const{context:l,horizontalPixelRatio:a,verticalPixelRatio:o}=t,_=i[n.from];let u=r(t,_),c=_;if(n.to-n.from<2){const i=e/2;l.beginPath();const s={_t:_._t-i,ut:_.ut},n={_t:_._t+i,ut:_.ut};l.moveTo(s._t*a,s.ut*o),l.lineTo(n._t*a,n.ut*o),h(t,u,s,n)}else{const e=(i,s)=>{h(t,u,c,s),l.beginPath(),u=i,c=s};let d=c;l.beginPath(),l.moveTo(_._t*a,_.ut*o);for(let h=n.from+1;h=n.from;--s){const n=i[s];if(n){const i=e(t,n);i!==a&&(l.beginPath(),null!==a&&l.fill(),l.fillStyle=i,a=i);const s=Math.round(n._t*r)+o,u=n.ut*h;l.moveTo(s,u),l.arc(s,u,_,0,2*Math.PI)}}l.fill()}(t,i,a,s,_)}}class Zn extends Xn{Ng(t,i){return i.vt}}class qn extends Fn{constructor(){super(...arguments),this.Zw=new Zn}Ag(t,i,s){return{...this.Ig(t,i),...s.Rr(t)}}tg(){const t=this.Kn.N(),i={ot:this.Uw,qt:t.lineStyle,Lg:t.lineVisible?t.lineType:void 0,ct:t.lineWidth,Og:t.pointMarkersVisible?t.pointMarkersRadius||t.lineWidth/2+2:void 0,lt:this.jw,Bg:this.Jn.It().lu()};this.Zw.ht(i)}}const Gn={type:"Line",isBuiltIn:!0,defaultOptions:{color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},Tg:(t,i)=>new qn(t,i)};function Kn(t,i,s,n,e){const{context:r,horizontalPixelRatio:h,verticalPixelRatio:l}=i;r.lineTo(e._t*h,t*l),r.lineTo(n._t*h,t*l),r.closePath(),r.fillStyle=s,r.fill()}class Jn extends y{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et(t){if(null===this.rt)return;const{ot:i,lt:s,Bg:e,ct:r,qt:h,Lg:l}=this.rt,a=this.rt.Fg??(this.rt.Wg?0:t.mediaSize.height);if(null===s)return;const o=t.context;o.lineCap="butt",o.lineJoin="round",o.lineWidth=r,n(o,h),o.lineWidth=1,Wn(t,i,l,s,e,this.Hg.bind(this),Kn.bind(null,a))}}class Qn{$g(t,i){const s=this.Ug,{jg:n,Yg:e,Xg:r,Zg:h,Fg:l,qg:a,Gg:o}=i;if(void 0===this.Kg||void 0===s||s.jg!==n||s.Yg!==e||s.Xg!==r||s.Zg!==h||s.Fg!==l||s.qg!==a||s.Gg!==o){const{verticalPixelRatio:s}=t,_=l||a>0?s:1,u=a*_,c=o===t.bitmapSize.height?o:o*_,d=(l??0)*_,f=t.context.createLinearGradient(0,u,0,c);if(f.addColorStop(0,n),null!=l){const t=Yt((d-u)/(c-u),0,1);f.addColorStop(t,e),f.addColorStop(t,r)}f.addColorStop(1,h),this.Kg=f,this.Ug=i}return this.Kg}}class te extends Jn{constructor(){super(...arguments),this.Jg=new Qn}Hg(t,i){const s=this.rt;return this.Jg.$g(t,{jg:i.br,Yg:i.Mr,Xg:i.Sr,Zg:i.Cr,Fg:s.Fg,qg:s.qg??0,Gg:s.Gg??t.bitmapSize.height})}}class ie extends Xn{constructor(){super(...arguments),this.Qg=new Qn}Ng(t,i){const s=this.rt;return this.Qg.$g(t,{jg:i.wr,Yg:i.wr,Xg:i.gr,Zg:i.gr,Fg:s.Fg,qg:s.qg??0,Gg:s.Gg??t.bitmapSize.height})}}class se extends Fn{constructor(t,i){super(t,i),this.Zw=new C,this.tb=new te,this.ib=new ie,this.Zw.st([this.tb,this.ib])}Ag(t,i,s){return{...this.Ig(t,i),...s.Rr(t)}}tg(){const t=this.Kn.Bt();if(null===t)return;const i=this.Kn.N(),s=this.Kn.Ft().Nt(i.baseValue.price,t.Wt),n=this.Jn.It().lu();if(null===this.jw||0===this.Uw.length)return;let e,r;if(i.relativeGradient){e=this.Uw[this.jw.from].ut,r=this.Uw[this.jw.from].ut;for(let t=this.jw.from;tr&&(r=i.ut)}}this.tb.ht({ot:this.Uw,ct:i.lineWidth,qt:i.lineStyle,Lg:i.lineType,Fg:s,qg:e,Gg:r,Wg:!1,lt:this.jw,Bg:n}),this.ib.ht({ot:this.Uw,ct:i.lineWidth,qt:i.lineStyle,Lg:i.lineVisible?i.lineType:void 0,Og:i.pointMarkersVisible?i.pointMarkersRadius||i.lineWidth/2+2:void 0,Fg:s,qg:e,Gg:r,lt:this.jw,Bg:n})}}const ne={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},Tg:(t,i)=>new se(t,i)};class ee extends y{constructor(){super(...arguments),this.Yt=null,this.sb=0}ht(t){this.Yt=t}et(t){if(null===this.Yt||0===this.Yt.Zs.length||null===this.Yt.lt)return;const{horizontalPixelRatio:i}=t;if(this.sb=function(t,i){if(t>=2.5&&t<=4)return Math.floor(3*i);const s=1-.2*Math.atan(Math.max(4,t)-4)/(.5*Math.PI),n=Math.floor(t*s*i),e=Math.floor(t*i),r=Math.min(n,e);return Math.max(Math.floor(i),r)}(this.Yt.lu,i),this.sb>=2){Math.floor(i)%2!=this.sb%2&&this.sb--}const s=this.Yt.Zs;this.Yt.nb&&this.eb(t,s,this.Yt.lt),this.Yt.bi&&this.Jp(t,s,this.Yt.lt);const n=this.rb(i);(!this.Yt.bi||this.sb>2*n)&&this.hb(t,s,this.Yt.lt)}eb(t,i,s){if(null===this.Yt)return;const{context:n,horizontalPixelRatio:e,verticalPixelRatio:r}=t;let h="",l=Math.min(Math.floor(e),Math.floor(this.Yt.lu*e));l=Math.max(Math.floor(e),Math.min(l,this.sb));const a=Math.floor(.5*l);let o=null;for(let t=s.from;t2*l)V(n,o,u,_-o+1,c-u+1,l);else{const t=_-o+1;n.fillRect(o,u,t,c-u+1)}a=_}}hb(t,i,s){if(null===this.Yt)return;const{context:n,horizontalPixelRatio:e,verticalPixelRatio:r}=t;let h="";const l=this.rb(e);for(let t=s.from;to||n.fillRect(_,a,u-_+1,o-a+1)}}}class re extends ln{constructor(t,i){super(t,i,!1)}Qw(t,i,s){i.iu(this.Uw,m(this.jw)),t.$a(this.Uw,s,m(this.jw))}lb(t,i,s){return{wt:t,Uh:i.Wt[0],jh:i.Wt[1],Yh:i.Wt[2],Xh:i.Wt[3],_t:NaN,Ua:NaN,ja:NaN,Ya:NaN,Xa:NaN}}Kw(){const t=this.Kn.Th();this.Uw=this.Kn.Zs().Wr().map((i=>this.Ag(i.Te,i,t)))}}class he extends re{constructor(){super(...arguments),this.Zw=new ee}Ag(t,i,s){return{...this.lb(t,i,s),...s.Rr(t)}}tg(){const t=this.Kn.N();this.Zw.ht({Zs:this.Uw,lu:this.Jn.It().lu(),nb:t.wickVisible,bi:t.borderVisible,lt:this.jw})}}const le={type:"Candlestick",isBuiltIn:!0,defaultOptions:{upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},Tg:(t,i)=>new he(t,i)},ae={...t,color:"#2196f3"};export{ne as BaselineSeries,le as CandlestickSeries,Di as ColorType,U as CrosshairMode,Ti as LastPriceAnimationMode,Gn as LineSeries,s as LineStyle,i as LineType,xt as MismatchDirection,Ri as PriceLineSource,_i as PriceScaleMode,Ei as TickMarkType,ki as TrackingModeExitMode,On as createChart,Ln as createChartEx,ae as customSeriesDefaultOptions,Nn as defaultHorzScaleBehavior,zi as isBusinessDay,Ii as isUTCTimestamp};
diff --git a/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/types.d.ts b/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/types.d.ts
new file mode 100644
index 000000000..e18b0d170
--- /dev/null
+++ b/websites/default/packages/lightweight-charts/v5.0.7-treeshaked/types.d.ts
@@ -0,0 +1,4114 @@
+// Generated by dts-bundle-generator v9.5.1
+
+type CanvasRenderingTarget2D = any;
+// import { CanvasRenderingTarget2D } from 'fancy-canvas';
+
+declare const baselineSeries: SeriesDefinition<"Baseline">;
+declare const candlestickSeries: SeriesDefinition<"Candlestick">;
+declare const lineSeries: SeriesDefinition<"Line">;
+export declare const customSeriesDefaultOptions: CustomSeriesOptions;
+/**
+ * Represents a type of color.
+ */
+export declare enum ColorType {
+ /** Solid color */
+ Solid = "solid",
+ /** Vertical gradient color */
+ VerticalGradient = "gradient",
+}
+/**
+ * Represents the crosshair mode.
+ */
+export declare enum CrosshairMode {
+ /**
+ * This mode allows crosshair to move freely on the chart.
+ */
+ Normal = 0,
+ /**
+ * This mode sticks crosshair's horizontal line to the price value of a single-value series or to the close price of OHLC-based series.
+ */
+ Magnet = 1,
+ /**
+ * This mode disables rendering of the crosshair.
+ */
+ Hidden = 2,
+ /**
+ * This mode sticks crosshair's horizontal line to the price value of a single-value series or to the open/high/low/close price of OHLC-based series.
+ */
+ MagnetOHLC = 3,
+}
+/**
+ * Represents the type of the last price animation for series such as area or line.
+ */
+export declare enum LastPriceAnimationMode {
+ /**
+ * Animation is always disabled
+ */
+ Disabled = 0,
+ /**
+ * Animation is always enabled.
+ */
+ Continuous = 1,
+ /**
+ * Animation is active after new data.
+ */
+ OnDataUpdate = 2,
+}
+/**
+ * Represents the possible line styles.
+ */
+export declare enum LineStyle {
+ /**
+ * A solid line.
+ */
+ Solid = 0,
+ /**
+ * A dotted line.
+ */
+ Dotted = 1,
+ /**
+ * A dashed line.
+ */
+ Dashed = 2,
+ /**
+ * A dashed line with bigger dashes.
+ */
+ LargeDashed = 3,
+ /**
+ * A dotted line with more space between dots.
+ */
+ SparseDotted = 4,
+}
+/**
+ * Represents the possible line types.
+ */
+export declare enum LineType {
+ /**
+ * A line.
+ */
+ Simple = 0,
+ /**
+ * A stepped line.
+ */
+ WithSteps = 1,
+ /**
+ * A curved line.
+ */
+ Curved = 2,
+}
+/**
+ * Search direction if no data found at provided index
+ */
+export declare enum MismatchDirection {
+ /**
+ * Search the nearest left item
+ */
+ NearestLeft = -1,
+ /**
+ * Do not search
+ */
+ None = 0,
+ /**
+ * Search the nearest right item
+ */
+ NearestRight = 1,
+}
+/**
+ * Represents the source of data to be used for the horizontal price line.
+ */
+export declare enum PriceLineSource {
+ /**
+ * Use the last bar data.
+ */
+ LastBar = 0,
+ /**
+ * Use the last visible data of the chart viewport.
+ */
+ LastVisible = 1,
+}
+/**
+ * Represents the price scale mode.
+ */
+export declare enum PriceScaleMode {
+ /**
+ * Price scale shows prices. Price range changes linearly.
+ */
+ Normal = 0,
+ /**
+ * Price scale shows prices. Price range changes logarithmically.
+ */
+ Logarithmic = 1,
+ /**
+ * Price scale shows percentage values according the first visible value of the price scale.
+ * The first visible value is 0% in this mode.
+ */
+ Percentage = 2,
+ /**
+ * The same as percentage mode, but the first value is moved to 100.
+ */
+ IndexedTo100 = 3,
+}
+/**
+ * Represents the type of a tick mark on the time axis.
+ */
+export declare enum TickMarkType {
+ /**
+ * The start of the year (e.g. it's the first tick mark in a year).
+ */
+ Year = 0,
+ /**
+ * The start of the month (e.g. it's the first tick mark in a month).
+ */
+ Month = 1,
+ /**
+ * A day of the month.
+ */
+ DayOfMonth = 2,
+ /**
+ * A time without seconds.
+ */
+ Time = 3,
+ /**
+ * A time with seconds.
+ */
+ TimeWithSeconds = 4,
+}
+/**
+ * Determine how to exit the tracking mode.
+ *
+ * By default, mobile users will long press to deactivate the scroll and have the ability to check values and dates.
+ * Another press is required to activate the scroll, be able to move left/right, zoom, etc.
+ */
+export declare enum TrackingModeExitMode {
+ /**
+ * Tracking Mode will be deactivated on touch end event.
+ */
+ OnTouchEnd = 0,
+ /**
+ * Tracking Mode will be deactivated on the next tap event.
+ */
+ OnNextTap = 1,
+}
+/**
+ * This function is the simplified main entry point of the Lightweight Charting Library with time points for the horizontal scale.
+ *
+ * @param container - ID of HTML element or element itself
+ * @param options - Any subset of options to be applied at start.
+ * @returns An interface to the created chart
+ */
+export declare function createChart(
+ container: string | HTMLElement,
+ options?: DeepPartial,
+): IChartApi;
+/**
+ * This function is the main entry point of the Lightweight Charting Library. If you are using time values
+ * for the horizontal scale then it is recommended that you rather use the {@link createChart} function.
+ *
+ * @template HorzScaleItem - type of points on the horizontal scale
+ * @template THorzScaleBehavior - type of horizontal axis strategy that encapsulate all the specific behaviors of the horizontal scale type
+ *
+ * @param container - ID of HTML element or element itself
+ * @param horzScaleBehavior - Horizontal scale behavior
+ * @param options - Any subset of options to be applied at start.
+ * @returns An interface to the created chart
+ */
+export declare function createChartEx<
+ HorzScaleItem,
+ THorzScaleBehavior extends IHorzScaleBehavior,
+>(
+ container: string | HTMLElement,
+ horzScaleBehavior: THorzScaleBehavior,
+ options?: DeepPartial>,
+): IChartApiBase;
+/**
+ * Provides the default implementation of the horizontal scale (time-based) that can be used as a base for extending the horizontal scale with custom behavior.
+ * This allows for the introduction of custom functionality without re-implementing the entire {@link IHorzScaleBehavior}<{@link Time}> interface.
+ *
+ * For further details, refer to the {@link createChartEx} chart constructor method.
+ *
+ * @returns An uninitialized class implementing the {@link IHorzScaleBehavior}<{@link Time}> interface
+ */
+export declare function defaultHorzScaleBehavior(): new () => IHorzScaleBehavior