"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7670],{53660:e=>{const t=55296,s=127995,i=127999,r=[776,2359,2359,2367,2367,2984,3007,3021,3633,3635,3648,3657,4352,4449,4520];function n(e){if("string"!=typeof e)throw new Error("string cannot be undefined or null");const t=[];let s=0,i=0;for(;s=t&&e<=s}e.exports=n,e.exports.substr=function(e,t,s){const i=n(e);if(void 0===t)return e;if(t>=i.length)return"";const r=i.length-t;let o=t+(void 0===s?r:s);return o>t+r&&(o=void 0),i.slice(t,o).join("")}},93700:(e,t,s)=>{s.d(t,{HHistBasedValuesProvider:()=>f});var i=s(97486),r=s(85842),n=s(45958),o=s(44850),a=s(54951),l=s(34192),h=s(78795),u=s(62116),c=s(62950);function d(e,t="",s=""){return{id:t,index:e,orderIndex:e,title:s,value:"",visible:!1}}const p=n.CheckMobile.any(),_=(0,l.getVolumeFormatter)();class f{constructor(e,t,s=!1){this._emptyValues=[],this._study=e,this._model=t,this._emptyTitles=s,void 0!==this._study.metaInfo().graphics.hhists&&this._emptyValues.push(d(0),d(1),d(2))}getItems(){return this._emptyValues}getValues(e){const t=this._emptyValues.map((e=>({...e})));t.forEach((e=>{e.visible=this._study.isVisible(),e.value=c.notAvailable}));const s=this._study.properties().childs().inputs.childs().volume.value();switch(s){case h.HHistVolumeMode.UpDown:this._emptyTitles||(t[0].title="Up",t[1].title="Down",t[2].title="Total");break;case h.HHistVolumeMode.Total:this._emptyTitles||(t[0].title="Total"),t[1].visible=!1,t[2].visible=!1;break;case h.HHistVolumeMode.Delta:this._emptyTitles||(t[0].title="Delta",t[1].title="Max(Up, Down)",t[2].title="Total")}const n=this._study.priceScale(),a=this._model.timeScale();if(null===n||n.isEmpty()||a.isEmpty()||this._hideValues())return t;if(null===e||!isFinite(e)){const s=this._study.data().last();if(null===s)return t;e=s.index}const l=this._model.crosshairSource(),u=l.price;if(!isFinite(l.y)&&null===(e=function(e,t){const s=e.visibleBarsStrictRange()?.lastBar();if(!s)return null;const i=t.data().search(s,o.PlotRowSearchMode.NearestLeft);return i?i.index:null}(this._model.timeScale(),this._model.mainSeries())))return t;const d=function(e,t,s,i){if(0===e.size)return null;if(!s){const e=(0,r.ensureNotNull)(i.data().valueAt(t));s=i.barFunction()(e)}const n=function(e,t){let s=null ;return e.forEach(((e,i)=>{null!==i&&i<=t&&(null===s||i>s)&&(s=i)})),s}(e,t);if(null===n)return null;const o=e.get(n);if(!o||0===o.size)return null;return function(e,t){let s=null;return e.forEach((e=>{e.priceLow<=t&&t{e.value="0"})),t;const p=this._study.metaInfo().graphics.hhists;if(void 0===p)return t;if(void 0===p[d.styleId])return t;const f=this._study.properties().childs().graphics.childs().hhists?.childs()[d.styleId]?.childs(),m=e=>(0,i.isNumber)(e)?_.format(e):"";if(s!==h.HHistVolumeMode.Delta){if(d.rate.forEach(((e,s)=>{t[s].value=m(e),t[s].color=(0,r.ensureDefined)(f).colors[s].value()})),s===h.HHistVolumeMode.UpDown){const e=d.rate[0]+d.rate[1];t[2].value=m(e),t[2].color=(0,r.ensureDefined)(f).valuesColor.value()}}else{const e=d.rate[0]>d.rate[1]?0:1,s=(0,r.ensureDefined)(f).colors[e].value(),i=d.rate[0]+d.rate[1];[2*d.rate[e]-i,d.rate[e],i].forEach(((e,i)=>{t[i].value=m(e),t[i].color=s}))}return t}_hideValues(){return p&&(null===this._model.crosshairSource().pane||(0,u.isLineToolName)(a.tool.value())||null!==this._model.lineBeingEdited())}}},3405:(e,t,s)=>{s.d(t,{StudyBaseWindowView:()=>n});var i=s(88990),r=s(65366);class n extends i.DataWindowView{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._valueProvider=this._createValuesProvider(e,t),this._items=this._valueProvider.getItems().map((e=>new i.DataWindowItem(e.id,e.title,"")))}update(e){"hover-change"!==e.type&&(this._invalidated=!0)}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}study(){return this._study}_updateImpl(){this._header=this._study.title(r.TitleDisplayTarget.DataWindow),this._title=this._study.title(r.TitleDisplayTarget.DataWindow,!1);const e=this._valueProvider.getValues(this._currentIndex());for(let t=0;t{s.d(t,{StudyChartFloatingTooltipView:()=>n});var i=s(7321),r=s(65366);class n{constructor(e,t){this._items=[],this._invalidated=!0,this._study=e,this._model=t}destroy(){}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}update(e){this._invalidated=!0}_updateImpl(){const e=this._study.chartFloatingTooltipValuesProvider(),t=this._model.crosshairSource().appliedIndex(),s=e.getValues(t),n=this._study.titleInParts(r.TitleDisplayTarget.StatusLine),o=n[0];let a="";if(n.length>1){const e=n[1];e.length>0&&(a=e.join(" "))}this._items=s.filter(i.notUndefined).filter((e=>e.visible)).map(((e,t)=>({titleText:0===t?o:"",titleInputs:0===t?a:"",value:e.value,valueColor:e.color})))}}},59217:(e,t,s)=>{s.d(t,{StudyDataWindowView:()=>a});var i=s(3405),r=s(53416),n=s(93700);class o{constructor(e,t){this._study=e,this._model=t, this._hhistBasedStudy=void 0!==e.metaInfo().graphics.hhists,this._valuesProvider=this._createValuesProvider(e,t)}getItems(){return this._valuesProvider.getItems()}getValues(e){const t=this._valuesProvider.getValues(e),s=e=>!!this._hhistBasedStudy||this._study.isPlotVisibleAt(e,2);for(const e of t)e.visible=e.visible&&s(e.id);return t}_createValuesProvider(e,t){return this._hhistBasedStudy?new n.HHistBasedValuesProvider(e,t):new r.StudyValuesProvider(e,t)}}class a extends i.StudyBaseWindowView{canShowItems(){const e=this._model.paneForSource(this._study);return!!e?.maximized().value()||this._model.panes().every((e=>!e.maximized().value()))}_createValuesProvider(e,t){return new o(e,t)}}},49695:(e,t,s)=>{s.d(t,{StudyStatusProvider:()=>n});var i=s(91599),r=(s(32137),s(79925));i.t(null,void 0,s(37966));class n extends r.StudyStatusProviderBase{sourceStatusText(){this._source.status();return super.sourceStatusText()}}},53416:(e,t,s)=>{s.d(t,{StudyValuesProvider:()=>v});var i=s(97486),r=s(16905),n=s(45958),o=s(82347),a=s(44850),l=s(62116),h=s(54951),u=s(65164),c=s(49545),d=s(3774),p=s(85842),_=s(62950),f=s(65366);const m=n.CheckMobile.any(),y=(0,r.isFeaturesetEnabled)("hide_last_na_study_output"),g=(0,r.isFeaturesetEnabled)("always_show_legend_values_on_mobile");class v{constructor(e,t,s,i=!0){this._emptyValues=[],this._colorProviders=new Map,this._study=e,this._model=t,this._searchNearestLeft=i,this._studyMetaInfo=this._study.metaInfo(),this._studyProperties=this._study.properties().childs(),this._isFundamental=!1;const r=this._studyMetaInfo.plots;if(!r)return;let n=0;r.forEach(((e,t)=>{if((0,u.isPlotWithTechnicalValues)(e))return;const i=e.id;this._emptyValues.push(function(e,t,s="",i=""){return{id:s,index:e,orderIndex:t,title:i,value:"",visible:!1}}(t,n++,i,s?"":this._study.guiPlotName(f.TitleDisplayTarget.StatusLine,i)));const r=(0,u.isOhlcPlot)(e)?e.target:i;this._colorProviders.set(r,(0,c.createStudyPlotColorProvider)(this._studyMetaInfo,this._study.properties(),r))}))}getItems(){return this._emptyValues}getPlotColor(e,t){const s=t[e+1];if(!(0,i.isNumber)(s))return"";const r=s>0;let n;const o=this._studyMetaInfo.plots[e];let a=o.id;const l=this._studyProperties;if((0,u.isOhlcPlot)(o))a=o.target||a,n=(0,p.ensureDefined)(l.ohlcPlots.childs()[a].childs().color).value();else if((0,u.isArrowsPlot)(o)){const e=(0,p.ensureDefined)(l.styles.childs()[a]);n=r?e.childs().colorup.value():e.childs().colordown.value()}else n=(0,p.ensureDefined)(l.styles.childs()[a]?.child("color")).value();let h=n;const c=this._colorProviders.get(a),d=c&&c.getPlotPointStyle(t);return d&&((0,u.isArrowsPlot)(o)?(r&&void 0!==d.colors[5]&&(h=d.colors[5]),r||void 0===d.colors[6]||(h=d.colors[6])):void 0!==d.colors[0]&&(h=d.colors[0])),"transparent"===h&&(h=n),h}getValues(e){const t=this._emptyValues.map((e=>({...e})));let s=null;const r=this._study.data().lastIndex(),n=this._studyProperties;if(null!==r){const e=this._searchNearestLeft?a.PlotRowSearchMode.NearestLeft:a.PlotRowSearchMode.Exact;for(const i of t){ const t=n.styles.childs()[i.id]?.childs().display.value();if(0===t)continue;const o=this._study.nearestIndex(r,e,i.index+1);if(void 0===o)continue;const a=o+this._study.offset(i.id);s=null!==s?Math.max(a,s):a}}(null===e||null!==s&&e>s)&&(e=s);const l=this._hideValues(),h=this._study.isVisible()&&!l?_.notAvailable:"";for(const e of t)e.value=h;if(l)return t;y&&t.length&&(t[t.length-1].value="");const c=this._study.priceScale();if(!this._study.isVisible()||null===e||null===c||c.isEmpty()||this._model.timeScale().isEmpty())return t;const f={};for(const s of t){const t=s.id,l=(0,d.getPriceValueFormatterForStudy)(this._study,t),h=(0,p.ensureDefined)(n.styles.childs()[t]),c=h.childs().display.value();if(s.visible=0!==c,!s.visible)continue;const _=h.hasChild("plottype")?h.child("plottype")?.value():null,m=this._searchNearestLeft&&this._isFundamental&&(_===u.LineStudyPlotStyle.StepLine||_===u.LineStudyPlotStyle.StepLineWithDiamonds),y=s.index,g=e-this._study.offset(t),v=m||null!==r&&g>r?a.PlotRowSearchMode.NearestLeft:a.PlotRowSearchMode.Exact,S=this._study.nearestIndex(g,v);if(void 0===S)continue;let b=f[t];if(void 0===b&&(b=this._study.getMinFirstBarIndexForPlot(t),Number.isFinite(b)&&(f[t]=b)),b>S)continue;const P=this._study.data().last(),w=this._study.data().valueAt(S)||(null!==P?P.value:null);if(null===w)continue;const I=w[y+1];(0,i.isNumber)(I)&&(s.value=l(I),s.color=(0,o.resetTransparency)(this.getPlotColor(y,w)))}return t}_hideValues(){return g?(0,l.isLineToolName)(h.tool.value())||null!==this._model.lineBeingEdited():m&&(null===this._model.crosshairSource().pane||(0,l.isLineToolName)(h.tool.value())||null!==this._model.lineBeingEdited())}}},67670:(e,t,s)=>{s.r(t),s.d(t,{StudiesChunkName:()=>es,Study:()=>ys,emptyPrecalculatedAutoscaleInfo:()=>ss,studyFormatter:()=>fs});var i=s(83991),r=s(57600),n=s(35558),o=s(90570),a=s(16905);const l=e=>e instanceof Date,h=e=>null!=e&&"object"==typeof e,u=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),c=e=>h(e)&&(e=>0===Object.keys(e).length)(e),d=(e,t)=>{if(e===t)return{};if(!h(e)||!h(t))return t;const s=Object.keys(e).reduce(((e,s)=>(u(t,s)||(e[s]=void 0),e)),Object.create(null));return l(e)||l(t)?e.valueOf()==t.valueOf()?{}:t:Object.keys(t).reduce(((s,i)=>{if(!u(e,i))return s[i]=t[i],s;const r=d(e[i],t[i]);return!c(r)||l(r)||!c(e[i])&&c(t[i])?(s[i]=r,s):s}),s)},p=d;var _=s(85842),f=s(7321),m=s(73775),y=s(42897),g=s(91599),v=s(21515),S=s(35313);function b(e){const{name:t,group:s}=e;return t.length>0?`${s?`${s}.`:""}${t}`:void 0}var P=s(22872);var w=s(70397),I=s(89659),x=s(89772),C=s(36870),V=s(82347),M=s(95168),T=s(14520),R=s(46675),A=(s(62352),s(43459)),O=s(33578),D=s(55531),N=s(4865),B=s(6620),F=s(95359),k=s(44850),E=s(62565),L=s(3405),H=s(9840),W=s(53416),z=s(93700);class U{constructor(e,t,s,i){this._study=e,this._model=t,this._showStudyValues=i??t.properties().childs().paneProperties.childs().legendProperties.childs().showStudyValues,this._hhistBasedStudy=void 0!==e.metaInfo().graphics.hhists,this._valuesProvider=this._createValuesProvider(e,t,s)}getItems(){ return this._valuesProvider.getItems()}getValues(e){const t=this._valuesProvider.getValues(e),s=this._study.properties(),i=this._showStudyValues.value()&&s.childs().showLegendValues.value(),r=e=>!!this._hhistBasedStudy||this._study.isPlotVisibleAt(e,8);for(const e of t)e.visible=e.visible&&i&&r(e.id);return t}_createValuesProvider(e,t,s){return this._hhistBasedStudy?new z.HHistBasedValuesProvider(e,t,s):new W.StudyValuesProvider(e,t,s)}}var j=s(65164);class G extends L.StudyBaseWindowView{constructor(e,t){super(e,t),this._showStudyValues=t.properties().childs().paneProperties.childs().legendProperties.childs().showStudyValues,this._showStudyValues.subscribe(this,(()=>this.update((0,H.sourceChangeEvent)(e.id()))));const s=this._study.properties();s.childs().showLegendValues.subscribe(this,(()=>this.update((0,H.sourceChangeEvent)(e.id()))));const i=this._study.metaInfo().plots,r=new Set;i.forEach((t=>{if((0,j.isOhlcPlot)(t)){const i=t.target;if(r.has(i))return;r.add(i),s.childs().ohlcPlots.childs()[i].childs().display.subscribe(this,(()=>this.update((0,H.sourceChangeEvent)(e.id()))))}else(0,j.isPlotSupportDisplay)(t)&&s.childs().styles.childs()[t.id]?.childs().display.subscribe(this,(()=>this.update((0,H.sourceChangeEvent)(e.id()))))}))}areValuesVisible(){return this._showStudyValues.value()}additional(){return null}destroy(){this._showStudyValues.unsubscribeAll(this);const e=this._study.properties();e.childs().showLegendValues.unsubscribeAll(this);const t=this._study.metaInfo().plots,s=new Set;t.forEach((t=>{if((0,j.isOhlcPlot)(t)){const i=t.target;if(s.has(i))return;s.add(i),e.childs().ohlcPlots.childs()[i].childs().display.unsubscribeAll(this)}else(0,j.isPlotSupportDisplay)(t)&&e.childs().styles.childs()[t.id]?.childs().display.unsubscribeAll(this)}))}_createValuesProvider(e,t){return new U(e,t)}}var $=s(54951),K=s(3811),Y=s(66085),X=s(95847),q=s(36637),J=s(49695);class Z{constructor(e,t,s){this._study=e,this._model=t,this._valuesProvider=new W.StudyValuesProvider(e,t,s)}getItems(){return this._valuesProvider.getItems()}getValues(e){const t=this._valuesProvider.getValues(e),s=e=>this._study.isPlotVisibleAt(e,8)||this._study.isPlotVisibleAt(e,1);for(const e of t)e.visible=e.visible&&s(e.id);return t}}var Q=s(65366),ee=s(20707);function te(e,t){return e.studyId.localeCompare(t.studyId)}function se(e){const t=new Set,s=[];return e.forEach((e=>{t.has(e.studyId)||(t.add(e.studyId),s.push(e))})),s}function ie(e){const t=e.model().mainSeries();return{studyId:(0,_.ensureNotNull)(e.sourceId()),turnaround:e.turnaround(),sourceStudies:e.parentSources().filter((e=>e!==t)).map((e=>ie(e)))}}var re=s(16570),ne=s(99680),oe=s(57507);class ae extends oe.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){return null}_drawImpl(e){}_drawBackgroundImpl(e){const{context:t,horizontalPixelRatio:s,bitmapSize:i}=e,r=this._data;for(let e=0;e0?(s-=r,i+=r):(s+=r,i-=r);const n=this._study.getMinFirstBarIndexForPlot(this._plotName);if(n>i)return;s=Math.max(n,s);const o=this._study.data();for(const e of o.rangeIterator(s,i)){let s=e.index;const i=e.value;s+=r;const n={timePointIndex:Math.floor(s),left:NaN,center:NaN,right:NaN};let o=(0,f.isNumber)(t)?t:50;o=Math.min(o,100),o=Math.max(o,0);const a=this._colorProvider.getPlotPointStyle(i);void 0!==a.colors[1]&&(n.color=(0,V.generateColor)((0,_.ensureDefined)(a.colors[1]),o)),this._items.push(n)}this._model.timeScale().fillBarBorders(this._items)}}var ce,de=s(59793),pe=s(71367),_e=s(30220),fe=s(85728),me=s(88858),ye=s(95953),ge=s(53598),ve=s(57415),Se=s(91069),be=s(97486),Pe=s(95385),we=s(83077),Ie=s(30598),xe=s(31048),Ce=s(35433),Ve=s(91903);!function(e){e.Left="left",e.Center="center",e.Right="right"}(ce||(ce={}));const Me=(0,Ve.createDisconnectedCanvas)(document,(0,Ce.size)({width:0,height:0}),1);class Te{constructor(e,t,s,i,r,n="center",o=0){this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,s,i){return(0,xe.makeFont)(i,s,`${e?"bold ":""}${t?"italic ":""}`)}(t,s,i,r),this._fontSize=r,this._verticalPadding=~~(r/6),this._textAlign=n,this._lineSpacing=o;const a=(0,_.ensureNotNull)(Me.getContext("2d"));a.font=this._font,a.textBaseline="top";let l=0;for(let e=0;e{for(const e of this._lines)o.strokeStyle&&s.strokeText(e,a,l),s.fillText(e,a,l),l+=this._fontSize,l+=this._lineSpacing})),s.restore()}}class Re extends Ie.AbstractMapContainer{constructor(e){super(),this._maxSize=e,this._keysQueue=[]}get(e){const{fontSize:t,text:s,align:i,font:r,bold:n,italic:o,lineSpacing:a=0}=e;if(!s||!t||!i)return null;const l=(0,xe.makeFont)(t,r,o?"italic":"",n?"bold":""),h=(0,Ie.getDefault3)(this._map,a,i,l,new Map);let u=h.get(s);return void 0!==u||(this._size>=this._maxSize?this._deleteFirstKey():++this._size,this._keysQueue.push([l,i,a,s]),u=new Te(s,n,o,r,t,i,a),h.set(s,u)),u}_deleteFirstKey(){const e=this._keysQueue.shift(),[t,s,i,r]=e,n=(0,_.ensureDefined)(this._map.get(i)),o=(0,_.ensureDefined)(n.get(s)),a=(0,_.ensureDefined)(o.get(t));a.delete(r),0===a.size&&o.delete(t),0===o.size&&n.delete(s),0===n.size&&this._map.delete(i)}}var Ae,Oe=s(14491),De=s(45958);!function(e){e.Transparent="rgba(0, 0, 0, 0)"}(Ae||(Ae={}));class Ne extends oe.BitmapCoordinatesPaneRenderer{constructor(e,t={skipRenderingOptimizations:!1}){super(),this._items=[],this._barSpacing=0,this._vertOffset=0,this._textCache=t.textCache||new Re(5e3),this._drawOperation=t.skipRenderingOptimizations?this._drawWithoutOptimizations.bind(this):this._drawWithOptimizations.bind(this),null!==e&&this.setData(e)}hitTest(e){const t=we.HitTarget.Regular;let s=null;for(const i of this._items){if(!i)continue;const r=this._calcBoundingBox(i);if(r&&(0,Se.pointInBox)(e,r)){const e={tooltip:this._getTooltip(i,r)};s=new we.HitTestResult(t,e)}}return s}setData(e){if(this._height=void 0!==e.height?e.height:e.width,this._width=void 0!==e.width?e.width:e.height,this._color=e.color,this._borderColor=e.borderColor,this._vertOffset=e.vertOffset||0,e.text&&(this._text=e.text,this._fontSize=e.fontSize,this._lineSpacing=e.lineSpacing,this._textColor=e.textColor,this._textAlign=e.textAlign||"center"),void 0!==e.items&&void 0!==e.barSpacing){ const t=e.visibleItemsRange?.startItemIndex??0,s=e.visibleItemsRange?.endItemIndex??e.items.length;this.setItems(s>t?e.items.slice(t,s):[],e.barSpacing)}}setItems(e,t){this._setBaseData(e,t)}_drawImpl(e){this._preDrawInit(),this._drawOperation(e)}_calcBoundingBox(e){const t=e.vertOffset,s=this._getTextCache(e);if(!s)return;const i=s.textImageWidth,r=s.textImageHeight,n=i/2,o=e.y+t+e.textVertOffset,a=t>0?0:-r,l=t>0?r:0,h=new ve.Point(e.center-n,o+a),u=new ve.Point(e.center+n,o+l);return(0,ve.box)(h,u)}_unionBox(e,t){const s=Math.min(e.min.x,t.min.x),i=Math.max(e.max.x,t.max.x),r=Math.min(e.min.y,t.min.y),n=Math.max(e.max.y,t.max.y),o=new ve.Point(s,r),a=new ve.Point(i,n);return(0,ve.box)(o,a)}_getTooltip(e,t){if(e.tooltip)return{content:{type:"text",data:e.tooltip},tooltipDelay:200,extendMargin:!0,rect:{x:t.min.x,y:t.min.y,w:Math.abs(t.max.x-t.min.x),h:Math.abs(t.max.y-t.min.y)}}}_setBaseData(e,t){this._items.length=0,this._barSpacing=t;for(const t of e){if((0,be.isNaN)(t.y))continue;const e=void 0===t.width?(0,_.ensureDefined)(this._width):t.width,s=void 0===t.height?(0,_.ensureDefined)(this._height):t.height,i=void 0===t.vertOffset?this._vertOffset:t.vertOffset,r=i>0?s:-s;this._items.push({width:e,height:s,vertOffset:i,textVertOffset:r,shapeWidth:0,shapeHeight:0,stepX:0,stepY:0,...t})}}_drawItemText(e,t){const s=this._getTextCache(t);if(null===s)return;const i=t.center,r=t.vertOffset,n=t.y+r+t.textVertOffset;let o;o=t.style&&void 0!==t.style.textColor?t.style.textColor:this._textColor;const a={style:{fillStyle:o},location:{x:i,y:n,horzAlign:Pe.HorizontalAlign.Center,vertAlign:r>0?Pe.VerticalAlign.Top:Pe.VerticalAlign.Bottom}};s.paintTo(e,a)}_drawWithOptimizations(e){let t,s,i=null,r=!1;for(const n of this._items)(0,be.isNaN)(n.y)||(n.style&&void 0!==n.style.color?(t=n.style.color||"rgba(0, 0, 0, 0)",s=n.style.borderColor||"rgba(0, 0, 0, 0)"):(t=this._color,s=this._borderColor),(i!==t||De.isSafari)&&(i=t,r&&this._endPath(e),this._startPath(e,t,s)),this._drawItemShape(e,n),r=!0);r&&this._endPath(e);for(const t of this._items)(0,be.isNaN)(t.y)||this._drawItemText(e,t)}_drawWithoutOptimizations(e){let t,s;for(const i of this._items){if((0,be.isNaN)(i.y))continue;const r=(0,_.ensureDefined)(i.style);t=r.color||"rgba(0, 0, 0, 0)",s=r.borderColor||"rgba(0, 0, 0, 0)",this._startPath(e,t,s),this._drawItemShape(e,i),this._endPath(e),this._drawItemText(e,i)}}_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e;(0,Ve.drawScaled)(s,i,r,(()=>this._drawItemShapeUsingCSSPixels(s,t)))}_drawItemShapeUsingCSSPixels(e,t){}_preDrawInit(){}_startPath(e,t,s){}_endPath(e){}_getTextCache(e){const t=e.text||this._text,s=e.fontSize||this._fontSize,i=e.lineSpacing??this._lineSpacing,r=e.textAlign||this._textAlign,n=e.font??Oe.CHART_FONT_FAMILY,o=e.bold??!1,a=e.italic??!1;return this._textCache.get({text:t,bold:o,italic:a,font:n,fontSize:s,lineSpacing:i,align:r})}}class Be extends Ne{_startPath(e,t,s){const i=e.context;i.beginPath(),i.lineWidth=this._lineWidth(e),i.lineCap="butt",i.strokeStyle=t}_endPath(e){ e.context.stroke()}_lineWidth(e){return Math.max(1,Math.floor(2*e.horizontalPixelRatio))}}class Fe extends Ne{_startPath(e,t,s){const i=e.context;i.beginPath(),i.lineWidth=this._lineWidth(e),i.lineCap="butt",i.fillStyle=t,i.strokeStyle=s}_endPath(e){const t=e.context;t.fill(),t.stroke()}_lineWidth(e){return Math.max(1,Math.floor(e.horizontalPixelRatio))}}class ke extends Fe{constructor(){super(...arguments),this._sign=0,this._thinArrow=!1,this._thinArrowLineWidth=0,this._headHeight=0,this._arrowWidth=0}setItems(e,t){this._setBaseData(e,t)}_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e,n=this._lineWidth(e)%2?.5:0,o=this._sign,a=this._arrowWidth,l=this._headHeight,h=Math.abs(t.height),u=Math.round(t.center*i)+n,c=t.vertOffset,d=Math.round((t.y+c+o*h/2)*r)+n,p=(0,fe.ceiledEven)(a*i),_=p/2,f=Math.round(h*r),m=Math.round(l*r);s.translate(u,d),this._thinArrow?(s.moveTo(0,0),s.lineTo(-_,-_*o),s.moveTo(0,0),s.lineTo(_,-_*o),s.moveTo(0,0),s.lineTo(0,-f*o),s.moveTo(-_,-f*o),s.lineTo(_,-f*o)):(s.moveTo(0,0),f=0?e.vertOffset:e.vertOffset-e.shapeHeight}}),je.set("PaneRendererLabelDown",class extends Le{_calcBoundingBox(e){const t=e.center-e.shapeWidth/2,s=e.center+e.shapeWidth/2,i=e.y-e.shapeHeight+e.vertOffset,r=e.y+e.vertOffset,n=new ve.Point(t,i),o=new ve.Point(s,r);return(0,ve.box)(n,o)}_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e,n=this._lineWidth(e)%2?.5:0,o=Math.max(1,Math.floor(i))%2?.5:0,a=this._getArrowSize(t);let l=Math.round(a*i);(o+l)%1!=n%1&&(l+=.5);let h=Math.round(t.shapeWidth/2*i);(o+h)%1!=n%1&&(h+=.5);const u=Math.round(t.center*i)+o,c=Math.round((t.y+t.vertOffset)*r)+n,d=u+l,p=Math.round((t.y+t.vertOffset-a)*r)+n,_=u-l,f=u+h,m=Math.round((t.y+t.vertOffset-t.shapeHeight-a)*r)+n,y=u-h;s.moveTo(d,p),s.lineTo(u,c),s.lineTo(_,p),t.shapeWidth<=2*a?(s.lineTo(y,p),this._drawCorner(e,y,m,We.leftUp),this._drawCorner(e,f,m,We.rightUp),s.lineTo(f,p)):(this._drawCorner(e,y,p,We.leftDown),this._drawCorner(e,y,m,We.leftUp),this._drawCorner(e,f,m,We.rightUp),this._drawCorner(e,f,p,We.rightDown)),s.lineTo(d,p)}_getVerticalTextOffset(e){return-e.shapeHeight/2-this._getArrowSize(e)}_calcVertOffset(e){return Math.sign(e.vertOffset)<=0?e.vertOffset:e.vertOffset+e.shapeHeight}}),je.set("PaneRendererSquare",class extends Fe{_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e,n=Math.max(1,Math.floor(i))%2?.5:0,o=this._lineWidth(e)%2?.5:0;let a=Math.round(t.height/2*r);(n+a)%1!=o%1&&(a+=.5);const l=Math.round(t.center*i)+n,h=Math.round((t.y+t.vertOffset)*r)+n,u=l-a,c=h-a,d=l+a,p=h+a;s.rect(u,c,d-u,p-c)}_calcBoundingBox(e){ const t=e.height,s=Math.round(t/2),i=e.center-s,r=e.vertOffset,n=e.y+r-s,o=i,a=i+t,l=n,h=n+t,u=new ve.Point(o,l),c=new ve.Point(a,h);let d=(0,ve.box)(u,c);const p=super._calcBoundingBox(e);return p&&(d=this._unionBox(d,p)),d}}),je.set("PaneRendererTriangleApexUp",class extends ze{_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e,n=t.width,o=t.height,a=Math.round(o/3),l=t.vertOffset-2*a,h=this._lineWidth(e)%2?.5:0,u=Math.max(1,Math.floor(i)),c=u%2?.5:0;let d=Math.round(n*i);d%2!=u%2&&(d+=1);const p=Math.round(t.center*i)+c,_=Math.round((t.y+l)*r),f=p+d/2,m=Math.round((t.y+l+o)*r)+h,y=p-d/2;s.moveTo(p,_),s.lineTo(f,m),s.lineTo(y,m),s.lineTo(p,_)}}),je.set("PaneRendererTriangleApexDown",class extends ze{_drawItemShape(e,t){const{context:s,horizontalPixelRatio:i,verticalPixelRatio:r}=e,n=t.width,o=t.height,a=Math.round(o/3),l=t.vertOffset-a,h=this._lineWidth(e)%2?.5:0,u=Math.max(1,Math.floor(i)),c=u%2?.5:0;let d=Math.round(n*i);d%2!=u%2&&(d+=1);const p=Math.round(t.center*i)+c,_=Math.round((t.y+l)*r)+h,f=p+d/2,m=Math.round((t.y+l+o)*r),y=p-d/2;s.moveTo(y,_),s.lineTo(f,_),s.lineTo(p,m),s.lineTo(y,_)}}),je.set("PaneRendererXCross",class extends Be{_drawItemShapeUsingCSSPixels(e,t){const s=t.width,i=t.height,r=t.center-s/2,n=t.vertOffset,o=t.y-i/2+n;e.moveTo(r,o),e.lineTo(r+s,o+i),e.moveTo(r,o+i),e.lineTo(r+s,o)}_calcBoundingBox(e){const t=e.width,s=e.height,i=e.center-t/2,r=e.vertOffset,n=e.y-s/2+r,o=i,a=i+t,l=n,h=n+s,u=new ve.Point(o,l),c=new ve.Point(a,h);let d=(0,ve.box)(u,c);const p=super._calcBoundingBox(e);return p&&(d=this._unionBox(d,p)),d}});class Ge extends Ue.StudyPaneViewInplaceUpdatable{constructor(e,t,s,i){super(t,s,i),this._renderer=null,this._shapesRenderer=null,this._selectionRenderer=null,this._isMarkersEnabled=(0,a.isFeaturesetEnabled)("source_selection_markers"),this._study=e;const r=e.metaInfo().plots;for(let e=0;ethis._createItem(e,t??null,a,l,n)));let u=this._series.nearestIndex(i.firstBar(),k.PlotRowSearchMode.NearestRight),c=this._series.nearestIndex(i.lastBar(),k.PlotRowSearchMode.NearestLeft);if(void 0===u||void 0===c)return!1;n>0?(u-=n,c+=n):(u+=n,c-=n);const d=this._study.getMinFirstBarIndexForPlot(this._plotName);if(d>c)return!0;u=Math.max(d,u);const p=this._getTranspValue(),f=this._study.properties().childs().styles.childs()[this._plotName].childs(),m=f.color.value(),y=f.textColor?f.textColor.value():void 0,g=m,S=m,b=void 0===y?void 0:y,P=(0,_.ensureNotNull)(this._plotIndex),w=(0,ge.createEmptyStyle)(),I=h??(0,_.ensureNotNull)(r.firstIndex()),x=r.rangeIterator(I,(0,_.ensureNotNull)(r.lastIndex())+1);let C=(0,v.lowerbound)(this._items,I+n,((e,t)=>e.timePointIndex9?s-10:0;i.borderColor=(0,V.generateColor)(i.color,e)}void 0!==t.colors[2]&&(i.textColor=(0,V.generateColor)((0,_.ensureDefined)(t.colors[2]),s))}_updateRenderer(e,t){this._makeSureRendererIsValid();const s=this._model.timeScale(),i={},r=this._getTranspValue(),n=s.barSpacing(),o=this._calculateShapeHeight(n),a=this._study.properties().childs().styles.childs()[this._plotName].childs(),l=a.location.value(),h=this._calculateVerticalOffset(l,o+o/2);i.barSpacing=n,i.items=this._items,i.color=(0,V.generateColor)(a.color.value(),r),i.height=o,i.vertOffset=h,i.visibleItemsRange={startItemIndex:e,endItemIndex:t};const u=a.plottype.value(),c=_e.plotShapesData[u],d=new ne.CompositeRenderer;c&&(this._shapesRenderer?this._shapesRenderer.setData(i):(this._shapesRenderer=this._createRenderer(c.paneRendererClass,i),d.append(this._shapesRenderer))),this._isMarkersEnabled&&null!==this._selectionData&&(this._selectionData.vertOffset=h,d.append(new pe.SelectionRenderer(this._selectionData))),this._renderer=d}_createRenderer(e,t){const s=je.get(e);return new((0,_.ensureDefined)(s))(t)}_getSeriesVal(e,t){const s=(0,ye.barFunction)(e),i=this._series.data().valueAt(t);return null===i?null:s(i)}_getTranspValue(){let e=0;const t=this._study.properties().childs();t.transparency&&(e=t.transparency.value(),e=(0,f.isNumber)(e)?e:50);const s=t.styles.childs()[this._plotName].childs();return s.transparency&&(e=s.transparency.value(),e=(0,f.isNumber)(e)?e:50),(0,fe.clamp)(e,0,100)}_createItem(e,t,s,i,r){const n=this._study.properties().childs().styles.childs()[this._plotName].childs().location.value(),o={price:NaN,timePointIndex:e+r};if((null===t||0===t)&&n!==E.MarkLocation.Absolute)return o;if(null==t)return o;let a=NaN ;switch(n){case E.MarkLocation.AboveBar:{const t=this._getLocationPrice(e,s,r);if(null===t)return o;a=t;break}case E.MarkLocation.BelowBar:{const t=this._getLocationPrice(e,i,r);if(null===t)return o;a=t;break}case E.MarkLocation.Absolute:a=(0,_.ensureNotNull)(t);break;case E.MarkLocation.Top:case E.MarkLocation.Bottom:a=0;break;default:throw new Error("Bad value: "+n)}return{y:NaN,price:a,timePointIndex:e+r}}_dependsOnSeriesData(){const e=this._study.properties().childs().styles.childs()[this._plotName].childs().location.value();return e===E.MarkLocation.AboveBar||e===E.MarkLocation.BelowBar}_getValueForUpdating(e){const t=e.value[this._plotIndex+1];if(null==t)return null;const s=this._study.properties().childs().styles.childs()[this._plotName].childs().location.value();if(0===t&&s!==E.MarkLocation.Absolute)return null;const i=this._study.offset(this._plotName),{hiPlot:r,loPlot:n}=this._hiLoPlots();switch(s){case E.MarkLocation.AboveBar:return this._getLocationPrice(e.index,r,i);case E.MarkLocation.BelowBar:return this._getLocationPrice(e.index,n,i)}return super._getValueForUpdating(e)}_convertItemsToCoordinates(e,t,s,i){this._model.timeScale().fillBarBorders(this._items);const r=this._study.properties().childs().styles.childs()[this._plotName].childs().location.value(),n=e.height()*e.topMargin(),o=e.height()*(1-e.bottomMargin()),a=e.isInverted(),l=a?o:n,h=a?n:o,u=e=>{for(let t=s;t0&&(s=t),s}_hiLoPlots(){let e,t;let s=null;switch(this._series.properties().childs().style.value()){case 2:s="lineStyle";break;case 14:s="lineWithMarkersStyle";break;case 15:s="steplineStyle";break;case 3:s="areaStyle"}return s?(e=this._series.properties().childs()[s].childs().priceSource.value(),t=e):(e="high",t="low"),{hiPlot:e,loPlot:t}}_getLocationPrice(e,t,s){const i=Math.min(e+s,(0,_.ensureNotNull)(this._series.data().last()).index);return this._getSeriesVal(t,i)}}class $e extends Ge{_updateRenderer(e,t){const s=this._study.properties().childs().styles.childs()[this._plotName].childs(),i=this._model.timeScale(),r={},n=this._getTranspValue(),o=i.barSpacing();let a;a=this._plotStyleInfo.size?this._calculateShapeHeight(25,this._plotStyleInfo.size):Math.round(o/2),a=Math.max(a,1);const l=s.location.value(),h=(0,V.generateColor)(s.color.value(),n),u=n>19?n-10:0,c=this._calculateVerticalOffset(l,Math.round(1.5*a)) ;r.barSpacing=o,r.items=this.items(),r.color=h,r.borderColor=(0,V.generateColor)(s.color.value(),u),r.height=a,r.vertOffset=c,r.visibleItemsRange={startItemIndex:e,endItemIndex:t};const d=s.plottype.value(),p=_e.plotShapesData[d],_=this._plotStyleInfo.text;if(void 0!==_&&""!==_.trim()){let e=_.replace(/\\n/gm,"\n");e=(0,de.cleanButAmpersand)(e,!0),r.text=e,r.fontSize=12;const t=s.textColor?s.textColor.value():void 0;r.textColor=t?(0,V.generateColor)(t,n):h}if(this._renderer&&this._shapesRenderer&&this._selectionRenderer)this._shapesRenderer.setData(r),this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&null!==this._selectionData?(this._selectionData.vertOffset=c,this._selectionRenderer.setData(this._selectionData)):this._selectionRenderer.setData(null);else{const e=new ne.CompositeRenderer;this._shapesRenderer=super._createRenderer(p.paneRendererClass,r),e.append(this._shapesRenderer),this._selectionRenderer=new pe.SelectionRenderer(this._selectionData??void 0),this._isMarkersEnabled&&null!==this._selectionData?this._selectionData.vertOffset=c:this._selectionRenderer.setData(null),e.append(this._selectionRenderer),this._renderer=e}}}var Ke,Ye=s(53660),Xe=s.n(Ye),qe=s(72244),Je=s(57268);!function(e){e[e.SimplifiedPaintingMaxFontSize=4]="SimplifiedPaintingMaxFontSize"}(Ke||(Ke={}));class Ze extends Ne{constructor(e,t){super(null,t),this._textWidthCache=new Je.TextWidthCache,this._fontSizeEnsured=0,this._font="",this._ch="",null!==e&&this.setData(e)}setData(e){super.setData(e),this._fontSizeEnsured=(0,_.ensureDefined)(this._height),this._font=(0,xe.makeFont)(this._fontSizeEnsured,e.fontFamily||Oe.CHART_FONT_FAMILY);const t=e.char.slice(0,40);this._ch=Xe()(t)[0]||" "}hitTest(e){const t=(0,qe.interactionTolerance)().series+this._fontSizeEnsured/2;for(const s of this._items){if(new ve.Point(s.center,s.y+s.vertOffset).subtract(e).length()<=t)return new we.HitTestResult(we.HitTarget.Regular)}return null}_drawItemShape(e,t){const s=t.center,i=t.vertOffset>0?1:-1,r=Math.trunc(this._fontSizeEnsured/6),n=t.y+t.vertOffset-i*Math.round(this._fontSizeEnsured/2)+(i>0?r:-this._fontSizeEnsured);let o;o=t.style&&void 0!==t.style.color?t.style.color:this._color;const{context:a,horizontalPixelRatio:l,verticalPixelRatio:h}=e;a.font!==this._font&&(a.font=this._font);const u=this._textWidthCache.measureText(a,this._ch);if(this._fontSizeEnsured<=4/l){a.save();const e=Math.max(1,Math.floor(l));let i=Math.max(1,Math.floor(u*l));i%2!=e%2&&(i+=i>1?-1:1);const r=Math.round(n*h)+(t.vertOffset>=0?0:-i);return a.fillStyle=o,a.fillRect(Math.round(s*l)+(l%2?.5:0)-i/2,r,i,i),void a.restore()}(0,Ve.drawScaled)(a,l,h,(()=>{a.fillStyle=o,a.textAlign="center",a.textBaseline="top",a.fillText(this._ch,s,n)}))}_startPath(e,t,s){}_endPath(e){}}class Qe extends Ge{constructor(){super(...arguments),this._charRenderer=new Ze(null)}_updateRenderer(e,t){const s=this._getTranspValue(),i=this._model.timeScale().barSpacing();let r;const n=this._study.properties().childs().styles.childs()[this._plotName].childs() ;r=this._plotStyleInfo.size?this._calculateShapeHeight(50,this._plotStyleInfo.size):Math.round(i);const o=n.location.value(),a=(0,V.generateColor)(n.color.value(),s),l=this._calculateVerticalOffset(o,r),h={items:this.items(),barSpacing:i,char:(0,_.ensureDefined)(n.char?.value()??this._plotStyleInfo.char),height:r,vertOffset:l,color:a,visibleItemsRange:{startItemIndex:e,endItemIndex:t}},u=this._plotStyleInfo.text;if(void 0!==u&&""!==u.trim()){let e=u.replace(/\\n/gm,"\n");e=(0,de.cleanButAmpersand)(e,!0),h.text=e,h.fontSize=12;const t=n.textColor?n.textColor.value():void 0;h.textColor=t?(0,V.generateColor)(t,s):a}this._charRenderer.setData(h);const c=new ne.CompositeRenderer;c.append(this._charRenderer),this._isMarkersEnabled&&null!==this._selectionData&&(this._selectionData.vertOffset=l,c.append(new pe.SelectionRenderer(this._selectionData))),this._renderer=c}}var et=s(55482);class tt{constructor(e,t,s,i){this.left=NaN,this.center=NaN,this.right=NaN,this.y=NaN,this.height=NaN,this.timePointIndex=e,this.price=t,this.origHeight=s,this.isUp=i,this.style={}}}function st(e){return Math.round(e/4)}function it(e){return Math.round(e/2)}class rt extends oe.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){const t=this._data,s=it(t.barSpacing),i=Math.round(s/2),r=Math.round(s),n=st(t.barSpacing),o=t.visibleItemsRange?.startItemIndex??0,a=t.visibleItemsRange?.endItemIndex??t.items.length;if(o>=a)return null;for(const s of t.items.slice(o,a)){if(!s)continue;if(!Number.isFinite(s.center)||!Number.isFinite(s.y))continue;const t=Math.abs(s.height),o=s.isUp?-1:1,a=t+r,l=s.y-o*n,h=l-o*a,u=s.center-i,c=s.center+i;if(u=_))for(const e of r.items.slice(p,_)){if(!Number.isFinite(e.center)||!Number.isFinite(e.y))continue;const n=e.isUp?-1:1,p=Math.round(Math.abs(e.height)*s),_=Math.round(e.center*t)+d,f=Math.round((e.y-n*o)*s)+d;i.beginPath(),i.translate(_,f);const m=(e.style&&e.style.color)??(e.isUp?r.colorup:r.colordown);a?(i.moveTo(0,0),i.lineTo(-u,-u*n),i.moveTo(0,0),i.lineTo(u,-u*n),i.moveTo(0,0),i.lineTo(0,-p*n),i.moveTo(-u,-p*n),i.lineTo(u,-p*n),i.lineWidth=l,i.strokeStyle=m,i.stroke()):(i.moveTo(0,0),p0,{hiPlot:r,loPlot:n}=this._hiLoPlots(),o=this._study.offset(this._plotName),a=Math.min(s+o,(0,_.ensureNotNull)(this._series.data().last()).index);if(i){const e=this._getSeriesVal(n,a);if(null!==e)return e}else{const e=this._getSeriesVal(r,a);if(null!==e)return e}return null}_updateItem(e,t){const s=this._getValueForUpdating(e),i=e.value[this._plotIndex+1]>0;return this._items[t].price=s??NaN,this._items[t].isUp=i,t+1}_createItem(e,t,s,i,r){const n={center:NaN,origHeight:NaN,timePointIndex:e+r,isUp:!0,height:NaN,price:NaN,left:NaN,right:NaN,y:NaN};if(!t)return n;const o=Math.min(e+r,(0,_.ensureNotNull)(this._series.data().last()).index),a=t>0;let l;if(a){const e=this._getSeriesVal(i,o);if(null===e)return n;l=e}else{const e=this._getSeriesVal(s,o);if(null===e)return n;l=e}return new tt(e+r,l,t,a)}_dependsOnSeriesData(){return!0}_convertItemsToCoordinates(e,t,s,i){this._convertItemsToCoordinatesImpl(e,t,s,i)}_createSelectionDataPoint(e,t,s,i){const r=this._model.timeScale().barSpacing(),n=st(r),o=function(e){return it(e)}(r),a=super._createSelectionDataPoint(e,t,s,i),l=this._items[(0,v.lowerbound)(this._items,t,((e,t)=>e.timePointIndexi){const e=s;s=i,i=e}const r=this._items,n=e.visibleItemsRange?.startItemIndex??0,o=(e.visibleItemsRange?.endItemIndex??r.length)-1;let a=0;for(let e=n;e<=o;e++){ const t=r[e],s=Math.abs(t.origHeight);s>a&&(a=s)}const l=(i-s)/a;for(let e=n;e<=o;e++){const t=r[e],i=Math.abs(t.origHeight);t.height=i*l+s}}}var ot=s(60848);class at extends he.StudyForceOverlayPlotView{constructor(e,t,s,i){super(t,s,i),this._bars=[],this._invalidated=!1,this._isMarkersEnabled=(0,a.isFeaturesetEnabled)("source_selection_markers"),this._selectionData=null,this._ohlcPlotIndexes=new Map,this._study=e,this._colorProvider=(0,le.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),i),this._selectionIndexer=new me.SelectionIndexes(s.timeScale());const r=this._study.metaInfo().plots;for(let e=0;e"target"in e&&e.target===this._plotName));return Boolean(e.find((e=>(0,_.ensureNotNull)(this._model.highlightedPlotInfo()).plotId===e.id)))}_updateImpl(){this._bars.length=0;const e=this._priceScale(),t=this._model.timeScale();if(t.isEmpty()||null===e||e.isEmpty())return;const s=t.visibleBarsStrictRange();if(null===s)return;let i=this._series.nearestIndex(s.firstBar(),k.PlotRowSearchMode.NearestRight);const r=this._series.nearestIndex(s.lastBar(),k.PlotRowSearchMode.NearestLeft);if(void 0===i||void 0===r)return;const n=this._study.getMinFirstBarIndexForPlot(this._plotName);if(n>r)return;i=Math.max(n,i);const o=this._study.data(),a=this._study.firstValue(void 0,this.isForceOverlay());if(null===a)return;const l=o.rangeIterator(i,r),h=(0,_.ensureDefined)(this._study.properties().childs().ohlcPlots).childs()[this._plotName].childs(),u=new Map,c=(e,t)=>{const s=e+"@"+t;if(!u.has(s)){const i=(0,V.generateColor)(e,t);return u.set(s,i),i}return u.get(s)},d=(0,ge.createEmptyStyle)();for(const e of l){let t=e.index;const s=e.value;t=Math.floor(t);let i=!0;const r=new Map;for(let e=1;e<=4;++e){const t=this._ohlcPlotIndexes.get(e);if(void 0===t){i=!1;break}const n=s[t+1];if(null==n){i=!1;break}r.set(e,n)}if(!i)continue;const n=(0,_.ensureDefined)(r.get(1)),o=(0,_.ensureDefined)(r.get(4)),a=(0,_.ensureDefined)(r.get(2)),l=(0,_.ensureDefined)(r.get(3)),u=Math.max(n,a,l,o),p=Math.min(n,a,l,o);let f=(0,_.ensureDefined)(c(h.color.value(),0));const m=this._colorProvider.getPlotPointStyle(s,d);void 0!==m.colors[0]&&(f=(0,_.ensureDefined)(m.colors[0]));const y={open:n,high:u,low:p,close:o,color:f,wickColor:m.colors[4],borderColor:m.colors[3],hollow:null,center:NaN,left:NaN,right:NaN,timePointIndex:Math.round(t)};this._bars.push(y)}e.barPricesToCoordinates(this._bars,a),t.fillBarBorders(this._bars),this._createSelection(a,t)}_createSelection(e,t){const s=this._priceScale();if(null===s)return;if(this._selectionData={points:[],bgColors:[], visible:!0,hittestResult:we.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()},!this.isPlotHighlighted()&&(!this._model.selection().isSelected(this._study)||this._study.hasHighlightedPlots()))return void this._selectionIndexer.clear();const i=(0,_.ensureNotNull)(this._model.paneForSource(this._study)).height(),r=(0,_.ensureDefined)(this._ohlcPlotIndexes.get(4)),n=this._selectionIndexer.indexes();for(let o=0;othis._colorPlotIndex=this._colorPlotIndex??{type:1};for(let t=0;t{null===this._bandAKey&&s.id===e&&(this._bandAKey=i),null===this._bandBKey&&s.id===t&&(this._bandBKey=i)}))}}var Tt=s(32137),Rt=s(96532),At=s(40394),Ot=s(68657),Dt=s(37032),Nt=s(82708),Bt=s(40180);class Ft extends Bt.StudyPriceAxisView{isPlotHighlighted(){if(!this._source.hasHighlightedPlots())return!1;const e=this._source.metaInfo().plots.filter((e=>"target"in e&&e.target===this._data?.plotName));return Boolean(e.find((e=>(0,_.ensureNotNull)(this._model.highlightedPlotInfo()).plotId===e.id)))}}var kt=s(46396),Et=s(83014);class Lt extends Et.AbstractBarColorer{ constructor(e,t){super(),this._rgbaFromInteger=(0,yt.rgbaFromIntegerCached)(),this._study=e,this._plotIndex=t}applyBarStyle(e,t,s,i){if(t)return s;const r=this._study.properties().childs();if(!r.visible.value())return s;const n=this._study.metaInfo(),o=this._study.data();if(!o||0===o.size())return s;const a=n.plots[this._plotIndex],l=this._getOffset();if(this._study.getMinFirstBarIndexForPlot(a.id)>e+l)return s;if(0===r.styles.childs()[a.id].childs().display.value())return s;const h=o.valueAt(e-l);if(null===h)return s;let u=h[this._plotIndex+1];if(null==u)return s;if(u=Math.round(u),n.isRGB)s.barColor=this._rgbaFromInteger(u),s.upColor=s.barColor,s.downColor=s.barColor;else{const e=n.plots[this._plotIndex];if("palette"in e){const t=e.palette,i=r.palettes.childs()[t],o=(0,_.ensureDefined)(n.palettes?.[t]),a=o.valToIndex?(0,_.ensureDefined)(o.valToIndex[u]):u,l=i.childs().colors.childs()[a].childs().color.value();s.barColor=l,s.upColor=l,s.downColor=l}}return s}firstColoredBar(e){let t=e;for(const s of this._backColorers)t=Math.min(t,s.firstColoredBar(e)??1/0);const s=this._getOffset();t=Math.min(t,e+s);const i=this._getBars().firstIndex(),r=Math.max(t,i??-1/0),n=this._study.metaInfo().plots[this._plotIndex];return Math.max(this._study.getMinFirstBarIndexForPlot(n.id),r)}_getBars(){return this._study.series().bars()}_getOffset(){const e=this._study.metaInfo().plots[this._plotIndex];return this._study.offset(e.id)}}var Ht=s(96375),Wt=s(58456),zt=s(66235);class Ut extends ct.PanePriceAxisView{constructor(e,t,s,i){super(e,t,s),this._dataSource=t,this._isForceOverlay=t.metaInfo().isPlotForceOverlay(i)}_position(){const e=this._isForceOverlay?this._chartModel.mainPane():this._chartModel.paneForSource(this._dataSource);if(null===e)return null;const t=this._isForceOverlay?this._chartModel.mainSeries().priceScale():this._dataSource.priceScale();if(null===t)return null;let s=e.priceScalePosition(t);return"overlay"===s&&(s=e.priceScalePosition(e.defaultPriceScale())),"overlay"===s?null:s}}var jt=s(34192),Gt=s(34969);class $t{constructor(e,t){this._study=e,this._valuesProvider=new W.StudyValuesProvider(e,t,!1,!1)}getItems(){const e=this._study.properties().childs(),t=this._valuesProvider.getItems();for(const s of t){const t=s.id,i=(0,_.ensureDefined)(e.styles.childs()[t]).childs().display.value();s.visible=0!==i}return t}getValues(e){const t=this._valuesProvider.getValues(e),s=this._study.plots().lastIndex(),i=this._study.plots().firstIndex();if(null===s||null===i)return null;for(const r of t){const t=e-this._study.offset(r.id);(t>s||t((0,j.isColorerPlot)(e)||(0,j.isDataPlot)(e))&&e.target===t))}function ds(e,t,s){let i=0,r=0;return Math.sign(r)-Math.sign(i)}function ps(e){const t=(0,Ot.combine)((e=>e.map((e=>ps(e.parentSourcesVW().weakReference())))),e);return(0,Ot.accumulate)(((e,t)=>Array.from(new Set(t.concat(e.flat(20))))),t.ownership(),e).ownership()}function _s(e){return"inherit"===e.type&&(e.type="price"),e}function fs(e,t,s,i){{const t=(0,f.isNumber)(i)?i:void 0,r=qt.customFormatters?.studyFormatterFactory?.(e,s,t)??null;if(null!==r)return r}if(null!==t)switch(e.type){case"inherit":case"price":return new Wt.PriceFormatter({priceScale:t});case"volume":return(0,jt.getVolumeFormatter)(Math.log10(t));case"percent":return(0,jt.getPercentageFormatter)(Math.log10(t))}if("inherit"===e.type)return null;const r=(0,f.isNumber)(e.precision)?Math.pow(10,e.precision):void 0;switch(e.type){case"price":return new Wt.PriceFormatter({priceScale:r});case"volume":{let t=e.precision;return void 0===t&&(t=s&&(0,f.isNumber)(s.volume_precision)?s.volume_precision:0),(0,jt.getVolumeFormatter)(t)}case"percent":return(0,jt.getPercentageFormatter)(void 0===r?void 0:Math.log10(r));default:return Jt.logWarn(`Unsupported format type: ${e.type}`),null}}const ms=new Set(["first_visible_bar_time","last_visible_bar_time","subscribeRealtime"]);class ys extends R.PriceDataSource{constructor(e,t,s,i,r,n,o){super(e),this._onStart=new C.Delegate,this._restarting=!1,this._paneViews=[],this._forceOverlaysPaneViews=[],this._legendView=null,this._floatingTooltipView=null,this._priceAxisViews=[],this._forceOverlayPriceAxisViews=[],this._priceAxisViewsBase=[],this._resolvedSymbols={},this._resolvedSymbolsByInput={},this._priceLinesAxisViews=[], this._labelPaneViews=[],this._forceOverlayLabelPaneViews=[],this._ownFirstValue=null,this._formatter=null,this._defaultFormatter=null,this._dataUpdated=new C.Delegate,this._currencySourceSymbolInputProperty=null,this._pineSourceCodeModel=null,this._alertSourceModel=null,this._onHibernationStateChange=new C.Delegate,this._symbolsResolved=new C.Delegate,this._statusChanged=new C.Delegate,this._inputsAnchorsPaneView=null,this._inputsLinesPaneView=null,this._inputsTimeAxisPaneViews=[],this._inputsPriceAxisPaneViews=[],this._sources=new x.WatchedObject([],v.compareTwoCollectionsByIds),this._status=new I.WatchedValue({type:Tt.StudyStatusType.Undefined}),this._compileActiveStatus=new x.WatchedObject(null),this._compileErrorStatus=new x.WatchedObject(null),this._wasCompletedBefore=!1,this._isStarted=!1,this._isSubscribedToSessionId=!1,this._titleStrCache={},this._titleInPartsCache={},this._inputsInPartsCache={},this._children=[],this._graphicsPriceAxisViews=[],this._serverPlotOffsets=new x.WatchedObject({}),this._ongoingDataUpdate=Promise.resolve(),this._studyModified=!1,this._tagsChanged=new C.Delegate,this._turnaround="st0",this._pendingResolveSymbols=new Map,this._onIsActualIntervalChange=new C.Delegate,this._childStudyByRebind=new C.Delegate,this._lastNonEmptyPlotRowCache={},this._startMovingPoint=null,this._processHibernateBound=this.processHibernate.bind(this,1),this._maxOffset=new I.WatchedValue(0),this._currencySourceSymbolInfo=null,this._graphicsPriceRangeGroups=null,this._graphicsViewsReady=!1,this._visibleTimeRangeInputs=null,this._turnaroundCounter=0,this._deferredPinePatchProps=!1,this._propertiesPatched=Promise.resolve(),this._resetPropertiesPatched=Promise.resolve(),this._abortPatchPropsController=new AbortController,this._abortResetPatchPropsController=new AbortController,this._aboutToBeDestroyed=new C.Delegate,this._definitionsViewModel=null,this._plotFormatters=new Map,this._showPineVersionInStatusLine=new I.WatchedValue(!1).spawn(),this._onParentSourcesChanges=new C.Delegate,this._statusChangesSubscriber={},this._calculationTime=new I.WatchedValue(0),this._stateForAlertCache=null,this._idForAlertCache=null,this._idForAlertWV=new I.WatchedValue(""),this._chartApi=e.chartApi(),this._properties=t,this._originalMetaInfo=r,this._metaInfo=new I.WatchedValue(i),this._studyName=(0,Ot.combine)((e=>e.useVersionFromMetaInfo?(0,B.getStudyIdWithVersion)(e):this._getStudyIdWithLatestVersion()),this._metaInfo.weakReference()),this._hideMatches=i.inputs.filter((e=>e.hideWhenPlotsHidden)).map((e=>({id:e.id,plotIds:e.hideWhenPlotsHidden||[]}))),this._series=this._model.mainSeries(),this._series.onIntervalChanged().subscribe(this,this._calcIsActualInterval),this._series.alertCreationAvailable().subscribe(this._updateAlertCreationAvailable.bind(this)),this._showStudyArgumentsProperty=(0,ee.combineProperty)(((e,t)=>e&&t),e.properties().childs().paneProperties.childs().legendProperties.childs().showStudyArguments.weakReference(),this._properties.childs().showLegendInputs.weakReference()), this._model.symbolAliasService()?.onAliasChanged().subscribe(this,(()=>{this._onFormatterPropsChanged(),this.invalidateTitleCache()})),e.collapsed().subscribe(this._processHibernateBound),this._sources.setValue(s),B.StudyMetaInfo.setChildStudyMetaInfoPropertiesSourceId(i,s[0]?.id(),t),s.forEach((e=>{e.setChild(this)})),[this._series,...s].forEach((e=>{e.currencyChanged().subscribe(this,this._onSourceCurrencyChanged),e.unitChanged().subscribe(this,this._onSourceUnitChanged),e.metricChanged().subscribe(this,this._onSourceMetricChanged),e.priceRangeReadyChanged().subscribe(this,this._onSourcePriceRangeReadyChanged),e.formatterChanged().subscribe(this,this._onSourceFormatterChanged),e.priceStepChanged().subscribe(this,this._onSourcePriceStepChanged)})),rs&&this._model.mainSeries().properties().childs().statusViewStyle.childs().symbolTextSource.subscribe(this,(()=>{this.invalidateTitleCache(!0)}));const l=this._properties.childs();for(const e of B.StudyMetaInfo.getSourceInputIds(i))l.inputs.childs()[e]?.subscribe(this,this._onSourceInputChanged);this._plotOffsets=(0,Ot.combine)(((e,t,s,i)=>(i.plots??[]).reduce(((i,r)=>{const n=r.id,o=(e[n]??0)+(s?.childs()[n]?.childs().val.value()??0)+(t??0);return i[n]=o,i}),{})),this._serverPlotOffsets.weakReference(),(0,ee.createWVFromGetterAndSubscription)((()=>this.properties().childs().offset?.childs().val.value()),this.properties().childs().offset??new C.Delegate).ownership(),(0,ee.createWVFromGetterAndSubscription)((()=>this.properties().childs().offsets),this.properties().childs().offsets??new C.Delegate).ownership(),this._metaInfo.weakReference()),this._properties.subscribe(this,this._onPropertiesChanged),l.visible.subscribe(this,this._visibleChanged),l.visible.subscribe(this,(()=>this.processHibernate())),l.intervalsVisibilities.subscribe(this,this._calcIsActualInterval),l.inputs.subscribe(this,this._updateMaxOffsetValue),void 0!==l.offsets&&l.offsets.subscribe(this,this._updateMaxOffsetValue),void 0!==l.offset&&l.offset.subscribe(this,this._updateMaxOffsetValue),this._initializeCurrencySource(),$.hideAllIndicators().subscribe(this,this._visibleChanged);for(let e=0;e{this.processHibernate(),this.invalidateTitleCache(),n&&this._series.invalidateBarColorerCache()}))}for(const e of Object.keys(i.graphics))for(const t of Object.keys(i.graphics[e])){const s=l.graphics.childs()[e]?.childs()[t];s&&s.childs().visible&&(0,_.ensureDefined)(s.childs().visible).subscribe(this,(()=>this.processHibernate()))}this._isActualInterval=(0,Rt.isActualInterval)(this._series.intervalObj().value(),l.intervalsVisibilities),this._initializeStudyInputsPaneViews(),this._handler=e=>this._onData(e),this._valuesProvider=new W.StudyValuesProvider(this,e),this._tableViewValuesProvider=new $t(this,e),this._graphics=new F.LiveStudyGraphics(i.graphics),this._chartApi=e.chartApi(), this._invalidateLastNonEmptyPlotRowCache(),this._data=new D.PlotList((0,zt.studyPlotFunctionMap)(i),zt.studyEmptyPlotValuePredicate),this._createViews(),this._recreatePriceFormattingDependencies(this._series.symbolInfo()),l.precision.subscribe(this,this._onFormatterPropsChanged),this._metaInfo.subscribe((()=>this._onFormatterPropsChanged())),this._showStudyArgumentsProperty.subscribe(this,(()=>this.invalidateTitleCache(!0))),l.inputs.subscribe(this,(()=>this.invalidateTitleCache(!0))),(0,a.isFeaturesetEnabled)("update_study_formatter_on_symbol_resolve")&&e.mainSeries().dataEvents().symbolResolved().subscribe(this,this._recreatePriceFormattingDependencies),e.mainSeries().dataEvents().symbolResolved().subscribe(this,(()=>this.invalidateTitleCache(!0)));const h=new Set;if(this._simplePlotsCount=i.plots.filter(((e,t)=>{if((0,j.isLinePlot)(e))return!0;if((0,j.isOhlcPlot)(e)){const t=e.target;return!h.has(t)&&(h.add(t),!0)}return!1})).length,this.hasBarColorer()&&l.visible.subscribe(this,(()=>e.mainSeries().invalidateBarStylesCache)),this._definitionsViewModel=null,this._updateMaxOffsetValue(),i.inputs.some((e=>ms.has(e.id)))){this._visibleTimeRangeInputs=e.visibleRangeStudiesInputs().spawn();const t=this._visibleTimeRangeInputs.value();let s=null!==t;this._visibleTimeRangeInputs.subscribe((e=>{const t=()=>{this._onVisibleTimeRangeInputsChanged(e),s!==(null!==e)&&(s=null!==e,!s||this._restarting||this.isStarted()||this.start(!0))};this._statusChanged.unsubscribeAll(this._statusChangesSubscriber),this._status.value().type===Tt.StudyStatusType.Loading?this._statusChanged.subscribe(this._statusChangesSubscriber,t,!0):t()})),t&&this._updateVisibleTimeRangeInputs(t,!1)}this._properties.setNameInOwner((0,Kt.propertyPathForSource)(this)),o&&this._pinePatchProps();const u=ps(this.parentSourcesVW().weakReference());this._allOwnerSources=(0,Ot.combine)(((e,t)=>{const s=[];for(;null!==t;)s.push(t),t=t.ownerSource();return s}),u,(0,ee.createWVFromGetterAndSubscription)((()=>this.ownerSource()),this.ownerSourceChanged()).ownership()),this._symbolSource=(0,Ot.combine)((e=>this._firstSourceOrSeries().symbolSource()),this._allOwnerSources.weakReference()),this._properties.onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults)}destroy(){this._signlePerformanceValue?.destroy(),this._aboutToBeDestroyed.fire(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),this._showStudyArgumentsProperty.unsubscribeAll(this),this._model.mainSeries().dataEvents().symbolResolved().unsubscribeAll(this),this._model.symbolAliasService()?.onAliasChanged().unsubscribeAll(this);this.parentSources().forEach((e=>{e.currencyChanged().unsubscribeAll(this),e.unitChanged().unsubscribeAll(this),e.metricChanged().unsubscribeAll(this),e.priceRangeReadyChanged().unsubscribeAll(this),e.formatterChanged().unsubscribeAll(this),e.priceStepChanged().unsubscribeAll(this)})),this._series.properties().childs().statusViewStyle.childs().symbolTextSource.unsubscribeAll(this), this._series.onIntervalChanged().unsubscribeAll(this),this._series.alertCreationAvailable().unsubscribe(this._updateAlertCreationAvailable),this.formatterChanged().unsubscribe(this,this.invalidateTitleCache),$.hideAllIndicators().unsubscribe(this,this._visibleChanged),this._model.collapsed().unsubscribe(this._processHibernateBound),null!==this._currencySourceSymbolInputProperty&&this._currencySourceSymbolInputProperty.unsubscribeAll(this),this._legendView?.destroy(),this._floatingTooltipView?.destroy(),this._pineSourceCodeModel?.get()?.destroy(),this._visibleTimeRangeInputs?.destroy(),this._showPineVersionInStatusLine.destroy(),this._alertStateVersion?.destroy(),this._metaInfo.destroy(),this._studyName.destroy(),this._allOwnerSources.destroy(),this._sources.destroy(),this._symbolSource.destroy(),this._status.destroy(),this._compileActiveStatus.destroy(),this._compileErrorStatus.destroy(),this._plotOffsets.destroy(),this._serverPlotOffsets.destroy(),this._properties.onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),this._properties.destroy(),super.destroy()}setId(e){super.setId(e),this._properties.setNameInOwner((0,Kt.propertyPathForSource)(this))}properties(){return this._properties}propertiesPatched(){return this._propertiesPatched}isDraggable(){return!this._metaInfo.value().linkedToSeries}logs(){return null}logLevelMask(){const e=this._properties.childs().inputs.childs().__log_level.value();if(!(0,f.isNumber)(e)||e<0||e>7)throw new Error(`Value of log level is unexpected, current value is ${e}, but expected values from 0 to 7`);return{error:Boolean(1&e),warning:Boolean(2&e),info:Boolean(4&e)}}setLogLevelMask(e){const t=(Number(e.error)&&1)|(Number(e.warning)&&2)|(Number(e.info)&&4);this._properties.childs().inputs.childs().__log_level.setValue(t)}performance(){return new I.WatchedValue(null)}profilingEnabled(){return!!this._properties.childs().inputs.childs().__profile?.value()}enableProfiling(e){this._properties.childs().inputs.childs().__profile?.setValue(e)}onAboutToBeDestroyed(){return this._aboutToBeDestroyed}priceScale(e){return e?this._model.mainSeries().priceScale():super.priceScale()}lastValueData(e,t,s){const i={noData:!0},r=this.metaInfo().isPlotForceOverlay(e),n=r?this._model.mainSeries().priceScale():this.priceScale();if(this._model.timeScale().isEmpty()||null===n||n.isEmpty()||this.data().isEmpty())return i;const o=this._model.timeScale().visibleBarsStrictRange(),a=this.firstValue(!0,r);if(null===o||null===a)return i;if(!this._properties.childs().visible.value())return i;const l=this._properties.childs().styles,h=this._properties.childs().ohlcPlots;let u,c;if(l&&l.childs()[e]&&(u=l.childs()[e]),h&&h.childs()[e]&&(u=h.childs()[e]),!u||0===u.childs().display.value())return i;const d=this.metaInfo().plots;for(c=0;ce.id()));if(a.length&&(r.parentSources=a),e){let e=this.data();const t=this._model.timeScale(),s=this._seriesDataRangeToSave(e);null!==s&&(e=e.range(s.firstBar(),s.lastBar())),r.data=e.state(),r.data.symbols=this._resolvedSymbols,r.data.graphics=(0,F.saveStudyGraphics)(this.graphics(),t.visibleBarsStrictRange()),r.data.plotOffsets=this._serverPlotOffsets.value()}this.ownerSource()&&(r.ownerSource=this.ownerSource()?.id());for(let e=0;e=0?e:0}}if(r.state?.inputs){const e=r.metaInfo.inputs.find((e=>"ILScript"===e.name));e&&delete r.state.inputs[e.id],delete r.state.inputs.__log_level,delete r.state.inputs.__profile}const l=this.stateCustomFields();return l&&(r.customFields=l),r}stateCustomFields(){const e=this._compileErrorStatus.value();if(e)return{compileErrorDescription:e.errorDescription}}restoreStateCustomFields(e){const t=e.compileErrorDescription;t&&this.setErrorCompilation([(0,_.ensureDefined)(t.editorError)])}restoreData(e){this._invalidateLastNonEmptyPlotRowCache(),this.data().restoreState(e),this._resolvedSymbols=e.symbols??{},this._graphics=e.graphics?(0,F.loadStudyGraphics)(e.graphics):(0,F.emptyStudyGraphics)(),this._postProcessGraphics(),this._serverPlotOffsets.setValue(e.plotOffsets??{}),this._setStatus({type:Tt.StudyStatusType.Completed},!0)}hasStateForAlert(){return!1}stateForAlert(){throw new Error("Not implemented")}async stateForAlertAsync(){throw new Error("Not implemented")}idForAlert(){return super.idForAlert()}hasBarColorer(){return this._metaInfo.value().plots.some(j.isBarColorerPlot)}barColorer(){const e=this._metaInfo.value().plots;let t=null;for(let s=e.length-1;s>=0;s--)if((0,j.isBarColorerPlot)(e[s])){const e=new Lt(this,s);null===t?t=e:t.pushBackBarColorer(e)}return t}isSavedInStudyTemplates(){ return this._metaInfo.value().inputs.every((e=>"bar_time"!==e.type))}restart(e){this._restarting=!0,this.clearData(),(e||(0,a.isFeaturesetEnabled)("stop_study_on_restart"))&&this.stop(),setTimeout(this.start.bind(this),0)}stop(e,t){if(!0===e&&this._children)for(const e of this._children)e.stop(!0);this._stopStudyOnServer(),this.clearData(),this._unsubscribeToSessionId(),this.recalculate()}disconnect(){this._isStarted=!1,this._model.isSnapshot()||(this._resolvedSymbols={},this._resolvedSymbolsByInput={})}sourceId(){return this._id.value()}parentSources(){return this._sources.value()}parentSourcesVW(){return this._sources}symbolSource(){return this._symbolSource.value()}symbolSourceWV(){return this._symbolSource.readonly()}valueAt(e,t){return this.symbolSource().valueAt(e,t)}barsProvider(){return this._firstSourceOrSeries().barsProvider()}ownerSource(){return this.isChildStudy()?this._sources.value()[0]:super.ownerSource()}isChildStudy(){return this._sources.value().length>0}hasChildren(){return this._children.length>0}isStarted(){return this._isStarted}isRestarting(){return this._restarting}isActualInterval(){return this._isActualInterval}onIsActualIntervalChange(){return this._onIsActualIntervalChange}isVisible(){const e=this._properties.childs();if(this._model.collapsed().value()||!e.visible.value()||!this.isActualInterval())return!1;const t=this.metaInfo();if(t.plots.length>0)for(let s=0;se.isHibernated())).map((e=>e.start())));const r=!(this.isHibernationAllowed()&&!this.isVisible())||!0===t;if(this._chartApi&&this._chartApi.isConnected().value()&&r)try{await this._allSymbolsAreResolved(),await this._startAfterSymbolsResolved(e,t)}catch(e){const t=`ERROR: ${this._debugId()} start failed, ${e}`;Jt.logError(t),this._restarting=!1,"TooManyStudies"===e?.cause&&(0,w.showTooManyStudiesNotice)(this._chartApi.getStudyCounter())}r||void 0!==this._inputs||(this._inputs=this._apiInputs())}replaceData(e,t,s){this._invalidateLastNonEmptyPlotRowCache(),this.data().remove(e+1),this.data().addTail(s,t)}inputs(e){const t=(0,n.default)((0,f.clone)(is),e||{});t.skipOptionalEmptySymbolInputs&&(t.keepOptionalSymbolsEmpty=!0);return this._buildInputs(t)}data(){return this._data}moveData(e){this._ongoingDataUpdate=this._ongoingDataUpdate.then((()=>{this._invalidateLastNonEmptyPlotRowCache(),this._moveData(e), this.data().isEmpty()||this._onIndexDiffsApplied(e)}))}plots(){return this.data()}metaInfo(){return this._metaInfo.value()}status(){return this._compileActiveStatus.value()??this._compileErrorStatus.value()??this._status.value()}name(e){const t=this.metaInfo();return e?t.shortDescription?(0,y.decodeHTMLEntities)(t.shortDescription):"Study":t.description?(0,y.decodeHTMLEntities)(t.description):"Study"}title(e,t,s,i,r,n){i=void 0===i?!this._showStudyArgumentsProperty.value():i;const o=JSON.stringify([e,t,s,i,r,n]);if(this._titleStrCache[o])return this._titleStrCache[o];if(this._titleInPartsCache[o])return this._joinTitlesParts(this._titleInPartsCache[o]);const a=this._title(e,t,s,i,r,n);return this._titleStrCache[o]=a,a}titleInParts(e,t,s,i,r){i=void 0===i?!this._showStudyArgumentsProperty.value():i;const n=JSON.stringify([e,t,s,i,r]);if(this._titleInPartsCache[n])return this._titleInPartsCache[n];const o=this._titleInParts(e,t,s,i,r);return this._titleInPartsCache[n]=o,o}inputsInParts(e,t=!0,s,i,r){const n=!this._showStudyArgumentsProperty.value(),o=(0,a.isFeaturesetEnabled)("always_show_study_symbol_input_values_in_legend"),l=n&&o;if(n&&!o&&e===Q.TitleDisplayTarget.StatusLine)return null;const h=JSON.stringify([e,t,s,i,r]);if(this._inputsInPartsCache[h])return this._inputsInPartsCache[h];const u=[],c=this.metaInfo(),d=this._titleInputs((0,Yt.toInputDisplayFlags)(e),i,!0),p=c.inputs.filter((e=>d.hasOwnProperty(e.id)&&(!l||"symbol"===e.type||e?.isAlwaysShownInLegend))).map((e=>{let t=d[e.id];if("symbol"===e.type){const s=this._properties.childs().inputs.child(e.id)?.value();if(s){const e=this._resolvedSymbolsByInput[s];e&&(t=this._model.symbolAliasService()?.getAliasByProName(e.pro_name)?.aliasName??t)}}return{meta:e,value:t}})),m={};if(p.length>0){if(this.isChildStudy())for(let s=0;s=0){const s=this.parentSourceForInput(a);if(s instanceof ys){const n=s.metaInfo(),o=s.title(e,t,{},!0,i,r);if(1===n.plots.length)m[a]=o;else{const e=a.split("$")[1],t=n.plots[parseInt(e)]?.id,s=n.styles&&n.styles[t],i=s&&s.title||t;m[a]=o+": "+i}}}}p.forEach((({meta:e,value:t})=>{let i;i="time"===e.type?new Date(t).toISOString():(0,f.isNumber)(t)?(0,jt.getNumericFormatter)().format(t):m&&m[t.toString()]||t.toString(),s&&s[i.toString()]&&(i=s[i.toString()]),u.push({title:(0,Xt.getTranslatedInputTitle)(e.name),value:i})}))}return this._inputsInPartsCache[h]=u,u}invalidateTitleCache(e){if(this._titleStrCache={},this._titleInPartsCache={},this._inputsInPartsCache={},!0===e&&this._children)for(let t=0;tt.update(e))),this._labelPaneViews.forEach((t=>t.update(e))),this._dataWindowView?.update(e),this._legendView?.update(e),this._statusView?.update(e),this._floatingTooltipView?.update(e),this._priceAxisViews.forEach((t=>t.update(e))),this._priceLinesAxisViews.forEach((t=>t.update(e))),this._inputsLinesPaneView?.update(e),this._inputsAnchorsPaneView?.update(e),this._inputsTimeAxisPaneViews.forEach((t=>t.update(e))),this._inputsPriceAxisPaneViews.forEach((t=>t.update(e)))),i||(this._forceOverlaysPaneViews.forEach((t=>t.update(e))),this._forceOverlayLabelPaneViews.forEach((t=>t.update(e))),this._forceOverlayPriceAxisViews.forEach((t=>t.update(e)))),"data-source-change"===e.type&&e.sourceId===this.id()&&e.clearData&&this._children.forEach((e=>e.updateAllViews({type:"data-source-change",sourceId:e.id(),clearData:!0})))}removeByRemoveAllStudies(){return!0}studyName(){return this._studyName}nearestIndex(e,t,s){return this.data().search(e,t,s)?.index}getMinFirstBarIndexForPlot(e){const t=this._properties.childs(),s=this._metaInfo,i=t.styles.childs()[e]?.child("showLast")?.value()??t.filledAreasStyle.childs()[e]?.child("showLast")?.value()??s.value().styles?.[e]?.showLast??t.ohlcPlots.childs()[e]?.child("showLast")?.value()??s.value().ohlcPlots?.[e]?.showLast??null;if(null===i)return-1/0;const r=this.data().lastIndex();return null===r?-1/0:r-i+1}guiPlotName(e,t){const s=this._metaInfo.value(),i=s.plots.find((e=>e.id===t));if(void 0!==i){const r=(0,j.isOhlcPlot)(i)?s.ohlcPlots?.[i.target]?.title:s.styles?.[t]?.title;return r?(0,y.decodeHTMLEntities)(r):this.title(e)}return this.title(e)}childStudyByRebind(){return this._childStudyByRebind}isPine(){return this._metaInfo.value().isPine()}isStandardPine(){return this._metaInfo.value().isStandardPine()}isLinkedToSeries(){return!0===this._metaInfo.value().linkedToSeries}preferredZOrder(){ return!1===this._metaInfo.value().behind_chart?0:null}defaultPlotIdForAlert(){return this._metaInfo.value().plots?.[0]?.id??null}resolvedSymbolInfoBySymbol(e){return this._resolvedSymbols&&e&&this._resolvedSymbols[this._getSymbolForResolve(e)]||null}hasPendingUnresolvedSymbols(){return this._pendingResolveSymbols.size>0}hasSymbolInputs(){return this._metaInfo.value().inputs.some((e=>"symbol"===e.type))}currency(){if(null!==this._currencySourceSymbolInfo)return(0,Dt.symbolCurrency)(this._currencySourceSymbolInfo);const e=this.metaInfo();return Boolean(e)&&e.is_price_study?this._firstSourceOrSeries().currency():null}currencySourceSymbolInfo(){return this._currencySourceSymbolInfo??this.symbolSource()?.symbolInfo()??null}unit(){const e=this.metaInfo();return Boolean(e)&&e.is_price_study?this._firstSourceOrSeries().unit():null}canOverrideMinTick(){return!1}dataWindowView(){return this._dataWindowView}statusView(){return this._statusView}legendView(){return this._legendView}chartFloatingTooltipView(){return this._floatingTooltipView}pineSourceCodeModel(){return Promise.resolve(null)}alertSourceModel(){return this._alertSourceModel}inputsForAlertState(){return this.inputs({forceTreatSourceInputsAsFake:!0})}sessionId(){return this._firstSourceOrSeries().sessionId()}sessionIdChanged(){return this._firstSourceOrSeries().sessionIdChanged()}getSymbolString(e,t){return""===e?"":(0,Y.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(e,t))}onStatusChanged(){return this._statusChanged}onDataUpdated(){return this._dataUpdated}symbolsResolved(){return this._symbolsResolved}onHibernationStateChange(){return this._onHibernationStateChange}valuesProvider(){return this._valuesProvider}legendValuesProvider(){return new U(this,this.model())}tableViewValuesProvider(){return this._tableViewValuesProvider}statusProvider(e){return new J.StudyStatusProvider(this)}chartFloatingTooltipValuesProvider(){return new Z(this,this.model())}correctScaleMargins(e){if("Volume"===this.metaInfo().shortId){const t=this.model().paneForSource(this);return null!==t&&t.isOverlay(this)&&t.containsMainSeries()?{top:.75,bottom:0}:{top:e.top,bottom:0}}return e}canBeHiddenByGlobalFlag(){return!0}isSourceHidden(){return!this.isVisible()||this.canBeHiddenByGlobalFlag()&&$.hideAllIndicators().value()}wasCompletedBefore(){return this._wasCompletedBefore}paneViews(e){const t=this._model.mainPane();if(this.isSourceHidden())return null;if(!e.hasPriceDataSource(this))return e!==t?null:this._forceOverlaysPaneViews;const s=[],i=this._paneViews.find((e=>{return t=e,(0,P.isObject)(t)&&"isPlotHighlighted"in t&&e.isPlotHighlighted();var t}))??null;return!this._startMovingPoint&&this._wasCompletedBefore&&s.push(...this._paneViews.filter((e=>!e.isForceOverlay?.()&&e!==i))),this._inputsLinesPaneView&&(this._startMovingPoint||this._model.selection().isSelected(this))&&s.push(this._inputsLinesPaneView),this._inputsAnchorsPaneView&&s.push(this._inputsAnchorsPaneView),e===t&&s.push(...this._forceOverlaysPaneViews),i&&s.push(i),s}labelPaneViews(e){ const t=this._model.mainPane();if(this.isSourceHidden()||!e.hasPriceDataSource(this))return this._metaInfo.value().hasForceOverlayPlots()?e!==t?null:this._forceOverlayLabelPaneViews:null;const s=[...this._labelPaneViews];return e===t&&s.push(...this._forceOverlayLabelPaneViews),s}timeAxisViews(){return this._model.selection().isSelected(this)?this._inputsTimeAxisPaneViews:null}priceAxisViews(e,t){if(t!==this.priceScale()&&t===this._model.mainSeries().priceScale()&&!e.hasDataSource(this))return this._forceOverlayPriceAxisViews;const s=this._properties.childs().oldShowLastValue;if(s&&!s.value())return null;let i=this._priceAxisViews.slice();return this._model.selection().isSelected(this)&&(i=i.concat(this._inputsPriceAxisPaneViews)),t===this._model.mainSeries().priceScale()&&(i=i.concat(this._forceOverlayPriceAxisViews)),e.findTargetPriceAxisViews(this,t,i,this._priceLinesAxisViews)}movable(){return null!==this._inputsAnchorsPaneView}startMoving(e,t,s,i){this._startMovingPoint=e}move(e,t,s,i){if(void 0!==e.logical&&null!==this._startMovingPoint){if(Array.isArray(t)){const s=t;this._updateInputValue(e.logical,s[0]),this._updateInputValue(e.logical,s[1])}else this._updateInputValue(e.logical,t);this.updateAllViews((0,H.sourceChangeEvent)(this.id()))}}endMoving(e,t){return this._startMovingPoint=null,{indexesChanged:!1,pricesChanged:!1}}clearData(){this._invalidateLastNonEmptyPlotRowCache(),this._ongoingDataUpdate=this._ongoingDataUpdate.then((()=>{this._clearData(),this._graphics instanceof F.LiveStudyGraphics&&this._graphics?.clear(),this._serverPlotOffsets.setValue({})})),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),this.updateAllViews((0,H.sourceChangeEvent)({sourceId:this.id(),clearData:!0}))}convertYCoordinateToPriceForMoving(e,t){const s=this.priceScale();if(!t||!s||s.isEmpty())return null;const i=t.firstValue();return null===i?null:s.coordinateToPrice(e,i)}processHibernate(e){const t=this.isVisible();if(!this.isStarted()&&t&&(this._sources.value().forEach((e=>{e.processHibernate()})),this.start(void 0,void 0,e),this._onHibernationStateChange.fire(!1)),this.isHibernationAllowed()&&this.isStarted()&&!t){for(const e of this._children)e.processHibernate();this.stop(void 0,e),this._onHibernationStateChange.fire(!0)}}isHibernationAllowed(){return(!this.metaInfo().historyCalculationMayChange||!this.properties().childs().visible.value())&&(!this.hasChildren()||!!this._model.collapsed().value()&&this._children.every((e=>e.isHibernationAllowed())))}isPlotVisibleAt(e,t){let s;const i=this.metaInfo().plots.find((t=>t.id===e));if(s=void 0!==i?(0,j.isOhlcPlot)(i)?this._properties.childs().ohlcPlots.childs()[i.target]:this._properties.childs().styles.childs()[e]:this._properties.childs().ohlcPlots.childs()[e],void 0===s)throw new Error(`Study does not contain ${e} plot`);const r=s.childs().display.value();return null!==r&&(0,O.isPlotVisible)(r,t)}recalculate(){const e=this._model.paneForSource(this);this._model.recalculatePane(e,(0,H.sourceChangeEvent)(this.id())),this._model.updateSource(this)} maxOffset(){return this._maxOffset}onStart(){return this._onStart}onParentSourcesChanges(){return this._onParentSourcesChanges}isHibernated(){return!this.isVisible()&&!this.isStarted()}graphicsViewsReady(){return this._graphicsViewsReady}setLoadingCompilationActive(e){0}setErrorCompilation(e){0}hasCompileError(){return null!==this._compileErrorStatus.value()}turnaround(e){if(!e)return this._turnaround;return function(e,t){let s=t.turnaround,i=[t];for(;i.length>0;){let e=[];const t=[];i.forEach((s=>{const i=se(s.sourceStudies).sort(te);if(i.length>0){e=e.concat(i);const s=i.map((e=>e.turnaround)).join("_");t.push(s)}})),t.length&&(s=t.join("_")+"_"+s),i=e}return e+"_"+s}(this._series.seriesSource().turnaround(),ie(this))}canHaveChildren(){return this._canHaveChildren=this._canHaveChildren??B.StudyMetaInfo.canHaveChildren(this._metaInfo.value()),this._canHaveChildren}setChild(e){-1===this._children.indexOf(e)&&this._children.push(e)}unsetChild(e){const t=this._children.indexOf(e);~t&&this._children.splice(t,1)}children(){return this._children}getAllChildren(){const e=this._children.slice();for(let t=0;te.id()===t))??null}return this._series}priceStep(){return this._priceStep||this._firstSourceOrSeries().priceStep(!1)}recreatePriceFormatter(){this._recreatePriceFormattingDependencies()}setOwnerSource(e){super.setOwnerSource(e),this._recreatePriceFormattingDependencies()}onTagsChanged(){return this._tagsChanged}hasHighlightedPlots(){return(0,N.highlightContainsSource)(this._model.highlightedPlotInfo(),this.id())}getPropertyDefinitionsViewModel(){return null===this._definitionsViewModel?this._getPropertyDefinitionsViewModelClass().then((e=>null===e||this._isDestroyed?null:(null===this._definitionsViewModel&&(this._definitionsViewModel=new e(this._model.undoModel(),this)),this._definitionsViewModel))):Promise.resolve(this._definitionsViewModel)}calculationTime(){return this._calculationTime.readonly()}contextMenuStatName(){return"IndicatorContextMenu"}metaInfoWV(){return this._metaInfo.readonly()}async patchPropertiesAfterResetDefaults(){throw new Error("Not implemented")}_getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}_alertMetaInfo(){return this.metaInfo()}_createStudyOnServer(){if(this._isDestroyed)return!1;this._isStarted=!0,this._incrementTurnaround();const e=(0,_.ensureDefined)(this._inputs);let t;return t=this._chartApi.createStudy(this.sourceId(),this._turnaround,this.isChildStudy()?(0,_.ensureNotNull)(this._sources.value()[0].sourceId()):(0,_.ensureNotNull)(this._series.seriesSource().instanceId()),this._studyName.value(),e,this._handler,this._studySpec()),t?(performance.mark(`calculate_study_${this._id.value()}`),!0):(this._isStarted=!1,t)}_stopStudyOnServer(){this._chartApi&&this._chartApi.isConnected().value()&&this.isStarted()&&(this._chartApi.removeStudy(this.sourceId()), this._setStatus({type:Tt.StudyStatusType.Undefined})),performance.clearMarks(`calculate_study_${this.sourceId()}`),this._isStarted=!1}_modifyStudyOnServer(e,t){this._chartApi.modifyStudy(this.sourceId(),this._turnaround,e,this._handler,t),performance.mark(`calculate_study_${this.sourceId()}`)}_sendNotifyCommand(e,t){this._chartApi.notifyStudy(this.sourceId(),e,t)}_transformData(e){}_plotsDataRange(){const e=this.plots().firstIndex(),t=this.plots().lastIndex();return null!==e&&null!==t?[e,t]:null}_invalidateLastNonEmptyPlotRowCache(){this._lastNonEmptyPlotRowCache={}}_collectDepsForAlert(){throw new Error("Not implemented")}_allInputsAreValid(){if(null===this._visibleTimeRangeInputs?.value())return!1;for(const e of this._metaInfo.value().inputs)if("bar_time"===e.type){const t=e.id;if(null==this._properties.childs().inputs.childs()[t].value())return!1}return!0}async _startAfterSymbolsResolved(e,t){await Promise.all(this._sources.value().map((e=>!e.isStarted()||e.isRestarting()?new Promise((t=>{e.onStart().subscribe(this,t,!0)})):Promise.resolve()))),this.isStarted()&&!this._restarting||(this._restarting=!1,this._allInputsAreValid()&&!this.metaInfo().isTVScriptStub&&(this._inputs=this._apiInputs(),this._createStudyOnServer()&&(this._subscribeToSessionId(),this._onStart.fire(),!0===e&&this._children&&await this._children.map((e=>e.start(!0,t))))))}async _changeInputsImpl(e,t){const s=this._calcSources(),i=this._metaInfo.value(),r=ds(),n=()=>{for(const s of i.inputs){if("source"!==s.type)continue;const i=e[s.id].v,r=t[s.id].v;if(i!==r){(0,_.ensureDefined)(this._properties.childs().inputs.child(s.id)).setValue(r)}}};if(this.isStarted()&&this._chartApi.isConnected().value()&&r>0&&!this._chartApi.canCreateStudy(this._studySpec(!0),!0).success){const e=window.user.pro_plan;return openPaywall({feature:"studyOnStudy",isMaxPlan:"pro_premium_expert"===e||"pro_premium_expert_trial"===e}),void n()}this._inputs=e;let o=!1;const a=Object.values(re.RangeDependentStudyInputNames);for(const s of Object.keys(e))if(JSON.stringify(e[s])!==JSON.stringify(t[s])&&!a.includes(s)){o=!0;break}this._incrementTurnaround(),o&&this.disablePriceRangeReady();try{await this._updateParentSources(s,r,!0),this._modifyStudyOnServer(e,r),this._studyModified=!0}catch(e){Jt.logError(`Error applying parent sources: ${e}`),n()}this.invalidateTitleCache()}_createPriceAxisView(e){const t=this.metaInfo().plots.find((t=>"target"in t&&t.target===e));return void 0!==t&&(0,j.isOhlcPlot)(t)?new Ft(this,{plotName:e}):new Bt.StudyPriceAxisView(this,{plotName:e})}_createPriceLineAxisView(e){return new kt.StudyPriceLineAxisView(this,e)}_createStudyPlotPaneView(e){return new dt.StudyPlotPaneView(this,this._series,this._model,e)}_createViews(){this._priceAxisViewsBase=[],this._forceOverlayPriceAxisViews=[],this._priceLinesAxisViews=[],this._paneViews=[],this._forceOverlaysPaneViews=[],this._labelPaneViews=[],this._forceOverlayLabelPaneViews=[];const e=new Set,t=this.metaInfo(),s=Boolean(t.usePlotsZOrder),i=new Map,r=this._properties.childs() ;if(r.filledAreasStyle&&t.filledAreas)for(let e=0;e{const n=r.bands.childs()[t];if(n&&n.childs().visible.value()){const t=new It(n,this),r=s?(0,_.ensureDefined)(e.zorder):i.size;us(r,i),i.set(r,{paneViews:[t]})}})),r.bandsBackground&&((0,_.assert)(!s,"'usePlotsZOrder' flag does not supported"),i.set(i.size,{paneViews:[new Vt(this)]}));const n=this._paneViews,o=this._forceOverlaysPaneViews;this._createGraphicsPaneViews().then((e=>{for(let t=0;te-t));for(let e=0;e0){const t=(0,_.ensureNotNull)(this.barColorer()).firstColoredBar(e[0].index);null!==t&&this._model.mainSeries().invalidateBarStylesCache(t)}null!==t&&this._postProcessGraphics();const r=this._model.paneForSource(this);if(this._model.recalculatePane(r,(0,H.sourceChangeEvent)({sourceId:this.id(),firstUpdatedTimePointIndex:i??void 0,nonSeriesOnly:0===e.length})),this._updateSources(),e.length){const t=e[e.length-1].index,s=e[0].index;this._dataRangeUpdated.fire({type:"partial",startIndex:s,endIndex:t})}else this.data().isEmpty()&&this._dataRangeUpdated.fire({type:"full"})}_titleInputs(e,t,s){return this.inputs(this._titleInputsOptions(e,t,s))}_titleInputsOptions(e,t,s){return{symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!0,skippedGroups:[],skippedInputs:this._skippedTitleInputs(),noExchanges:t,noResolution:s,priceInputsForDisplay:!0,skipOptionalEmptySymbolInputs:ns,displayMask:e}}_postProcessGraphics(){this._graphicsPriceAxisViews=this._createGraphicsPriceAxisViews(),this._concatPriceAxisViews()}async _createGraphicsPaneViews(){return(0,F.createGraphicsPaneViews)(this,this.model())}_createGraphicsPriceAxisViews(){return(0,F.createGraphicsPriceAxisViews)(this)}_subscribeToSessionId(){!this._isSubscribedToSessionId&&this.hasSymbolInputs()&&(this.sessionIdChanged().subscribe(this,this._onSessionIdChanged),this._isSubscribedToSessionId=!0)}_recreateFormatter(e){let t=e;if(t){const e=this._model.symbolAliasService()?.getAliasByProName(t.pro_name);e&&(t=(0,r.default)(t),(0,n.default)(t,e.formattingOptions??{}))}this._recreatePlotsFormatters(t),this._formatter=this._tryCreateFormatter(t),this._defaultFormatter=this._tryCreateDefaultFormatter(t),this._formatterChanged.fire();const s=this.priceScale();null!==s&&s.updateFormatter(),this.getAllChildren().forEach((e=>{e.recreatePriceFormatter()})),this._model.fullUpdate()}_recreatePriceFormattingDependencies(e){ this._recreateFormatter(e),this._recreatePriceStep()}_title(e,t,s,i,r,n){const o=this._titleInParts(e,t,s,i,r,n);return this._joinTitlesParts(o)}_postProcessPriceRange(e,t){if(e&&e.minValue()===e.maxValue()&&!this.metaInfo().is_price_study){const t=.005*e.minValue();e=new A.PriceRange(e.minValue()-t,e.maxValue()+t)}const s=t.targetPriceScale;return s&&s.isLog()&&e?new A.PriceRange(s.priceToLogical(e.minValue()),s.priceToLogical(e.maxValue())):e}_titleInParts(e,t=!0,i,r,n,o){const l=[g.t(this.name(t),{context:"study"},s(84693))];let h=[];if(!r||(0,a.isFeaturesetEnabled)("always_show_study_symbol_input_values_in_legend")){const s=this._getMTFResolutionInputTitle();null!==s&&s.length>0&&l.push(s);h=(this.inputsInParts(e,t,i,n,o)??[]).map((e=>e.value))}return[l.join(" · "),h]}_seriesDataRangeToSave(e){return this._model.timeScale().visibleExtendedDataRange(e,0)}_getSymbolForResolve(e){return this.getSymbolString(this._getSymbolForApi(e))}_getSymbolForApi(e){return e}_getSymbolObject(e,t){const s={symbol:e},i=this.currency();return null!==this._currencySourceSymbolInputProperty&&null!==this._currencySourceSymbolInfo&&this._getSymbolForApi(this._currencySourceSymbolInputProperty.value())===e&&(s["currency-id"]=i),s.session=this.sessionId(),s}_onSymbolResolved(e,t,s){this._onCurrencyMayChange()}_onSymbolResolvingStart(e,t){}_onSymbolError(){}_setStatus(e,t){const s=this.isFailed();this._status.setValue(e),e.type===Tt.StudyStatusType.Completed?this._wasCompletedBefore=!0:e.type!==Tt.StudyStatusType.Error&&e.type!==Tt.StudyStatusType.Undefined||(this._wasCompletedBefore=!1),t||(this._statusView?.update((0,H.sourceChangeEvent)(this.id())),this._model.updateSource(this),this._statusChanged.fire(this.status())),s!==this.isFailed()&&this._updateAlertCreationAvailable()}_onPropertiesChanged(){this._restarting||(this._inputs?this._tryChangeInputs():this._chartApi&&this._chartApi.isConnected().value()&&this.restart());this._metaInfo.value();this._recreatePaneViews(),(0,Ht.emit)("study_properties_changed",this._id.value())}_lastNonEmptyPlotRow(e){if(!(0,f.isInteger)(e))return Jt.logDebug("_lastNonEmptyPlotRow: incorrect plotIndex"),null;let t=this._lastNonEmptyPlotRowCache[e]??null;if(null!==t)return t;return t=this.data().findLast(((t,s)=>void 0!==s[e]),1e3),null===t?null:(this._lastNonEmptyPlotRowCache[e]=t,t)}_onCurrencyChanged(){"alwaysOff"!==(0,Nt.currencyUnitMetricVisibilityProperty)().value()&&this._model.fullUpdate(),this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()}_apiInputs(){return this.inputs({keepOptionalSymbolsEmpty:!0})}async _tryChangeInputs(){const e=this.isStarted()&&this._chartApi.isConnected().value(),t=this._allInputsAreValid(),s=((0,_.ensureDefined)((0,f.clone)(this._inputs)),this._apiInputs()),i=JSON.stringify(s),r=i!==JSON.stringify(this._inputs);if(e&&t)try{if(await this._allSymbolsAreResolved(),i!==JSON.stringify(this._apiInputs()))return this._tryChangeInputs();if(this._isStopped())return void(r&&this.disablePriceRangeReady());r&&await this._changeInputsImpl(s,(0,_.ensureDefined)((0, f.clone)(this._inputs)))}catch(e){Jt.logError(`ERROR: ${this._debugId()} _tryChangeInputs: cannot modify study, ${e}`)}else if(e&&!t&&this.stop(!0),!e&&t&&this.start(!0),r){const e=this._calcSources(),t=ds(this._metaInfo.value());this._updateParentSources(e,t,!0),this._inputs=s}this._tagsChanged.fire()}_onCurrencyMayChange(){if(null!==this._currencySourceSymbolInputProperty){const e=this.currency();this._updateCurrencySourceSymbolInfo(),e!==this.currency()&&this._onCurrencyChanged()}}_fillPrecalculatedAutoscaleInfo(e){const t=this._metaInfo.value(),s=this.properties().childs(),i=new Set,r=t.filledAreas||[];for(let e=0;e!(0,j.isPlotWithTechnicalValues)(e))).filter((s=>t.isPlotForceOverlay(s.id)?e.targetPriceScale===this._model.mainSeries().priceScale():e.targetPriceScale===this.priceScale()&&!e.forceOverlayOnly)).filter((e=>i.has(e.id)||this.isPlotVisibleAt(e.id,1))).reduce(((t,s)=>this._applyPlotToPrecalculatedAutoscaleInfo(e,t,s)),{fields:[],useMainSeriesRange:!1,baseValueMinMax:null})}_firstSourceOrSeries(){return this._sources.value()[0]??this._series}_skipHistogramBaseOnAutoScale(){return!1}_tryCreateFormatter(e){const t=void 0===e?this.symbolSource().symbolInfo():e;return fs(this._metaInfo.value().format,this._priceScaleByProperties(),t,this.properties().childs().precision.value())}_tryCreateDefaultFormatter(e){return this._tryCreateFormatter(e)}_mergeData(e){return this._invalidateLastNonEmptyPlotRowCache(),this.data().merge(e)}_skippedTitleInputs(){return this._hideMatches.filter((e=>e.plotIds.every((e=>0===this._getPlotDisplayValue(e))))).map((e=>e.id))}_getPlotDisplayValue(e){return this.properties()?.childs()?.styles?.childs()?.[e]?.childs()?.display?.value()}_onStudyError(e){performance.clearMarks(`calculate_study_${this.sourceId()}`),this._handleStudyError(this._createStudyError(e)),this._enablePriceRangeReady()}_onStudyCompleted(e){if(performance.getEntriesByName(`calculate_study_${this.sourceId()}`).length){try{const e=performance.measure(`measure_study_${this.sourceId()}`,`calculate_study_${this.sourceId()}`);this._calculationTime.setValue(e.duration)}catch(e){Jt.logError("Error during measuring study calculation time")}performance.clearMarks(`calculate_study_${this.sourceId()}`),performance.clearMeasures(`measure_study_${this.sourceId()}`)}this._studyModified&&(this.clearData(),this._studyModified=!1),this._setStatus({type:Tt.StudyStatusType.Completed}),this._statusView?.update((0,H.sourceChangeEvent)(this.id()));const t=this._model.paneForSource(this);this._model.recalculatePane(t,(0,H.sourceChangeEvent)(this.id())),this._updateSources();const s=At.InvalidationMask.full();null!==this._model.appliedTimeFrame().value()&&s.lockVisibleTimeRangeOnResize(),this._model.invalidate(s)}_clearData(){this._data.clear(),this._dataRangeUpdated.fire({type:"full"})}_moveData(e){this.data().move(e)}_defaultErrorTitle(){return"Runtime error"} _handleRestoringFactoryDefaults(){const e=this._properties.state();(0,Gt.applyDefaultColorsToPropsState)(e,this._metaInfo.value()),this._properties.merge(e)}_incrementTurnaround(){this._turnaround="st"+ ++this._turnaroundCounter}_checkTurnaround(e){return e===this._turnaround||e===this._model.mainSeries().seriesSource().turnaround()||e===this.turnaround(!0)}_updateMaxOffsetValue(){let e=-1/0;for(const t of this._metaInfo.value().plots)e=Math.max(this.offset(t.id),e);this._maxOffset.setValue(e)}_rightOffsetToUnixTime(e){if(this._series.bars().size()>=e){const t=(0,_.ensureNotNull)(this._series.bars().lastIndex())-e;return(0,_.ensureNotNull)(this._series.bars().valueAt(t))[0]}return null}_concatPriceAxisViews(){this._priceAxisViews=[...this._priceAxisViewsBase,...this._graphicsPriceAxisViews]}_onStudyLoading(e){this._setStatus({type:Tt.StudyStatusType.Loading,startTime:Date.now()}),this._statusView?.update((0,H.sourceChangeEvent)(this.id())),this._model.updateSource(this)}_handleStudyError(e){this.clearData(),this._setStatus(e),this._statusView?.update((0,H.sourceChangeEvent)(this.id())),this._model.updateSource(this)}_createStudyError(e){let t;return t=(0,f.isString)(e)?{error:this._getStudyErrorText(e),title:e.includes("study_not_auth")?"Access error":this._defaultErrorTitle()}:{...e,title:e.title??this._defaultErrorTitle()},(0,Tt.createStudyError)(t,this.symbolSource().symbolInfo()?.exchange)}_updateSources(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())}_unsubscribeToSessionId(){this._isSubscribedToSessionId&&(this.sessionIdChanged().unsubscribe(this,this._onSessionIdChanged),this._isSubscribedToSessionId=!1)}_onSessionIdChanged(){this.restart(!0)}_recreatePriceStep(){let e=null;const t=this._priceScaleByProperties()??this._priceScaleByMetaInfo();null!==t&&(e=1/t),this._priceStep!==e&&(this._priceStep=e,this._priceStepChanged.fire())}_recreatePlotsFormatters(e){this._plotFormatters.clear();const t=this._metaInfo.value(),s=t.format,i=this._priceScaleByProperties(),r=void 0===e?this.symbolSource().symbolInfo():e;for(const[e,n]of Object.entries(t.ohlcPlots??{}))if(n?.format){const t=fs(_s({...s,...n?.format}),i,r,this.properties().childs().precision.value());t&&this._plotFormatters.set(e,t)}for(const[e,n]of Object.entries(t.styles??{}))if(n?.format){const t=fs(_s({...s,...n?.format}),i,r,this.properties().childs().precision.value());t&&this._plotFormatters.set(e,t)}for(const e of t.plots)if((0,j.isOhlcPlot)(e)){const t=this._plotFormatters.get(e.target);t&&this._plotFormatters.set(e.id,t)}}_joinTitlesParts(e){const t=e[1]?e[1].join(", "):"";return e[0]+(t.length>0?" ("+t+")":"")}_getMTFResolutionInputTitle(){const e=this.metaInfo();for(let t=0;ti),(()=>i)).then(this._onDataUnpacked.bind(this,e,t.indexes,s)),this._ongoingDataUpdate}_allSymbolsAreResolved(){const e=this._inputSymbols(),t=[];let s=!1;for(const i of e){const e=this._getSymbolForResolve(i);if(""!==e)if(this._resolvedSymbols[e])s=!0;else{const s=this._resolveSymbol(e,i);t.push(s)}}if(0===t.length){const e=Promise.resolve();return s?e.then((()=>this._symbolsResolved.fire())):e}return Promise.all(t).catch((e=>(this._inputSymbols().includes(e)&&this.stop(!0),this._setStatus({type:Tt.StudyStatusType.Error,errorDescription:{error:Zt}}),this._model.updateSource(this),Promise.reject("Invalid symbol, "+e)))).then((()=>{this._symbolsResolved.fire(),this._recheckLineToolsActuality()}))}_resolveSymbol(e,t){if(""===e)return Promise.resolve();let s=this._pendingResolveSymbols.get(e);return void 0!==s||(s=new Promise(((s,i)=>{this._onSymbolResolvingStart(e,t),this._chartApi.resolveSymbol((0,X.makeNextSymbolId)(),e,(r=>{switch(this._pendingResolveSymbols.delete(e),r.method){case"symbol_resolved":{this._setStatus({type:Tt.StudyStatusType.Undefined});const i=r.params[1];this._resolvedSymbols[e]=i,this._resolvedSymbolsByInput[t]=i,this.invalidateTitleCache(!0),this._onSymbolResolved(e,t,i),s();break}case"symbol_error":if(this._setStatus({type:Tt.StudyStatusType.Error,errorDescription:{error:r.params[1]}}),this._onSymbolError(),r.params[1]===q.permissionDenied&&r.params[2]){if(r.params[2]!==q.SymbolErrorPermissionDeniedReason.Symbol)return void this._resolveSymbol(r.params[2],t).then(s);if(r.params[3])return void this._resolveSymbol(r.params[3],t).then(s)}0,i(t)}}))})),this._pendingResolveSymbols.set(e,s)),s}_recheckLineToolsActuality(){const e=this._model.paneForSource(this);null!==e&&e.sourcesByGroup().lineSourcesForAllSymbols().forEach((e=>{e.ownerSource()===this&&e.calcIsActualSymbol()}))}_sendTelemetryCounter(e,t){void 0===t&&(t=this._getTelemetryAdditionalData());const s={count:1,additional:t};telemetry.sendChartReport(e,s)}_getTelemetryAdditionalData(){let e="";const t=this._metaInfo.value();return t.pine&&t.pine.version&&t.shortId.indexOf("USER")>=0&&(e="_v"+t.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:t.shortId+e}}_onSourceFormatterChanged(){null===this._formatter&&(null!==this._priceScale&&this._priceScale.updateFormatter(),this._formatterChanged.fire())}_onSourcePriceStepChanged(){null===this._priceStep&&this._priceStepChanged.fire()}_bandsFirstValue(e){const t=this._metaInfo.value();if(!t.bands)return null;for(let s=0;s=0?t:e}return e}if(r.isTVScript||r.pine){if("text"===s)return r.defaults.inputs?.text??"";if("pineId"===s)return r.scriptIdPart;if("pineVersion"===s)return r.pine?r.pine.version:"-1";if("color"===e.type&&r.isRGB){const e=i.inputs.childs()[s].value();return(0,V.colorToInteger)(e)}if("price"===e.type){const e=i.inputs.childs()[s].value();return t.priceInputsForDisplay?this.formatter().format(e):e}}return i.inputs.childs()[s].value()}_getStudyIdWithLatestVersion(){return B.StudyMetaInfo.getStudyIdWithLatestVersion(this.metaInfo())}_debugId(){const e=[];e.push(this._id.value());const t=this._metaInfo.value();return e.push(t.fullId),e.push(t.description),JSON.stringify({study:e})}_hasAvailableAlertPlots(){return!1}_hasAlertConditions(){return!1}_hasAlertFunction(){return!1}async _updateParentSources(e,t,s){if(this._sources.value().forEach((e=>e.unsetChild(this))),s&&await Promise.all(e.map((e=>e.isStarted()?Promise.resolve():e.start(!1,!0)))),e.forEach((e=>e.setChild(this))),this._setSources(e),this._recreatePriceFormattingDependencies(),0!==t&&this._sources.value().length<=1){const e=this._firstSourceOrSeries(),t=this._priceScale,s=(0,_.ensureNotNull)(e.priceScale());if(t!==s){const t=this._model.paneForSource(this),i=(0, _.ensureNotNull)(this._model.paneForSource(e));t===i&&i.move(this,s,!0)}}}_calcSources(){const e=this._properties.childs().inputs.state();return B.StudyMetaInfo.getSourceIdsByInputs(this._metaInfo.value().inputs,e).map((e=>{if("high"===e||"open"===e||"low"===e||"close"===e||"hl2"===e||"ohl3"===e||"ohlc4"===e)return null;return this._model.allStudies().find((t=>t.canHaveChildren()&&t.id()===e))??null})).filter(f.notNull)}_isStopped(){return!this.isStarted()}_onDataUnpacked(e,t,s,i){if(this._isDestroyed)return;"nochange"!==t&&this._processPlotOffsets(i),this._transformData(e);const r=this._mergeData(e);null!==i&&(i.indexes_replace?((0,_.assert)("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds))),this._onDataUpdated(e,i,t,r&&r.index),this.priceRangeReady()||this._enablePriceRangeReady(),this._dataUpdated.fire()}_processPlotOffsets(e){if(e&&e.indexes_replace)return;const t=this._serverPlotOffsets.value();this._serverPlotOffsets.setValue(e&&e.offsets||{}),(0,i.default)(t,this._serverPlotOffsets.value())||this.updateAllViews((0,H.sourceChangeEvent)({sourceId:this.id(),clearData:!0})),this._updateMaxOffsetValue()}_applyPlotToPrecalculatedAutoscaleInfo(e,t,s){const i=s.id,r=this._properties.childs().styles.childs()[i],n=(0,j.isShapesPlot)(s)||(0,j.isCharsPlot)(s);t.useMainSeriesRange=t.useMainSeriesRange||(0,j.isArrowsPlot)(s);let o=(0,j.isLinePlot)(s)||(0,j.isOhlcPlot)(s);if(n){const e=(0,_.ensureDefined)(r).childs().location.value(),s=[E.MarkLocation.Absolute,E.MarkLocation.Top,E.MarkLocation.Bottom].indexOf(e)<0;t.useMainSeriesRange=t.useMainSeriesRange||n&&s,o=o||e===E.MarkLocation.Absolute}if(!o)return t;const a={name:i,offset:this.offset(i)},l=r.childs().plottype.value();if((0,j.doesLinePlotStyleSupportFillBreaks)(l)){const i=this._metaInfo.value().plots.indexOf(s),r=this._getMinMaxForPlotThatSupportFillBreaks(i,l,e);t.baseValueMinMax=(0,D.mergeMinMax)(t.baseValueMinMax,r)}if(!this._skipHistogramBaseOnAutoScale()&&[j.LineStudyPlotStyle.Histogram,j.LineStudyPlotStyle.Columns,j.LineStudyPlotStyle.Area].indexOf(l)>=0){const s=(this._metaInfo.value().styles??{})?.[i]?.histogramBase;if(void 0===s)return t;const{startTimePoint:r,endTimePoint:n}=e,o=this.data().minMaxOnRangeCached(r,n,[a]);return(0,f.isNumber)(s)&&null!==o&&(t.baseValueMinMax=(0,D.mergeMinMax)(t.baseValueMinMax,{min:s,max:s}),t.baseValueMinMax=(0,D.mergeMinMax)(t.baseValueMinMax,o)),t}return t.fields.push(a),t}_getFirstValForPlotThatSupportFillBreaks(e,t){const s=this.data().plottableRange(),i=e+1,r=s.search(t,k.PlotRowSearchMode.NearestLeft,i);if(r){if(s.search(t,k.PlotRowSearchMode.NearestRight,i))return r.value[i]}return null}_getMinMaxForPlotThatSupportFillBreaks(e,t,s){const i=this.data().plottableRange(),r=e+1,n=t===j.LineStudyPlotStyle.StepLine||t===j.LineStudyPlotStyle.StepLineWithDiamonds,o=e=>{const t=i.search(e,k.PlotRowSearchMode.NearestLeft,r);if(t){const s=i.search(e,k.PlotRowSearchMode.NearestRight,r);if(s){ const e=t.value[r];if(n)return{min:e,max:e};{const t=s.value[r];return{min:Math.min(e,t),max:Math.max(e,t)}}}}return null},a=Math.floor(s.logicStartPoint),l=Math.ceil(s.logicEndPoint),h=o(a),u=o(l);return(0,D.mergeMinMax)(h,u)}async _onSourceInputChanged(){if(!this.isStarted()){this._calcSources();Qt}}_buildInputs(e){(0,_.assert)(!!e,"options not set");let t={};try{t=this._prepareInputs(e)}catch(e){Jt.logWarn("Failed to prepare study inputs: "+e)}if(e.asObject){const e={};return Object.keys(t).forEach((s=>{null!=t[s]&&(e[s]=t[s])})),e}{const e=[];return Object.keys(t).forEach((s=>{null!=t[s]&&e.push(t[s])})),e}}_prepareInput(e,t){const s=this._prepareInputValue(e,t);return!(e.isFake||t.forceTreatSourceInputsAsFake&&"source"===e.type)||t.fakeInputsForDisplay||t.onlyAtomValues?s:this._createExtendedInput(s,e.type)}_createExtendedInput(e,t){return{v:e,f:!0,t}}_plotsForAlert(){return[]}_formatterStateForAlert(){try{const e=this.formatter();return FormattersSerializer.isSerializable(e)?FormattersSerializer.serialize(e):null}catch{return null}}_calcIsActualInterval(){const e=this._isActualInterval;this._isActualInterval=(0,Rt.isActualInterval)(this._series.intervalObj().value(),this._properties.childs().intervalsVisibilities),e!==this._isActualInterval&&(this._onIsActualIntervalChange.fire(),this._visibleChanged(),this.processHibernate())}_visibleChanged(){this._series.invalidateBarColorerCache()}_getNonPriceParent(){const e=this._sources.value();for(const t of e)if(t instanceof ys){const e=t.metaInfo();return e.is_price_study&&"Compare@tv-basicstudies"!==e.id?t._getNonPriceParent():t}return null}_updateInputValue(e,t){const s=this._properties.childs().inputs.childs();if(s[t.id])if("price"===t.type)s[t.id].setValue(e.price);else if("time"===t.type){const i=this._model.timeScale().indexToTimePoint(e.index);null!==i&&s[t.id].setValue(1e3*i)}}_initializeStudyInputsPaneViews(){}_updateCurrencySourceSymbolInfo(){null!==this._currencySourceSymbolInputProperty&&(this._currencySourceSymbolInfo=this._resolvedSymbolsByInput[this._currencySourceSymbolInputProperty.value()]??null)}_initializeCurrencySource(){const e=this.metaInfo(),t="symbolInputSymbolSource"===e.symbolSource?.type&&e.symbolSource?.inputId,s=e.inputs.find((e=>e.id===t));if("string"==typeof t&&"symbol"===s?.type&&e.is_price_study){const e=this._properties.childs().inputs.childs()[t];void 0!==e&&(e.subscribe(this,this._onCurrencyMayChange),this._currencySourceSymbolInputProperty=e)}}_recreatePaneViews(){this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),this._createViews(),this.recalculate(),this.updateAllViews((0,H.sourceChangeEvent)(this.id()))}async _pinePatchProps(){throw new Error("Not implemented")}_areStudyInputsModified(e){if(0===Object.keys(e).length)return!1;if(void 0===this._oldStudyInputs)return!0;const t=Object.keys(this._oldStudyInputs);(0,_.assert)(t.length===Object.keys(e).length,"keys quantity should be equal");for(const s of t)if((0,_.assert)(e.hasOwnProperty(s),`key '${s}' should exist in study inputs`),(0, _.ensureDefined)(this._oldStudyInputs)[s]!==e[s])return!0;return!1}_onVisibleTimeRangeInputsChanged(e){null!==e?this._updateVisibleTimeRangeInputs(e):this.isStarted()&&this._chartApi.isConnected().value()&&this.stop(!0)}_updateVisibleTimeRangeInputs(e,t=!0){const s={first_visible_bar_time:e.firstVisibleBarTime,last_visible_bar_time:e.lastVisibleBarTime,subscribeRealtime:e.subscribeRealtime},i=this.metaInfo().inputs,r=[];for(const e of i)s.hasOwnProperty(e.id)&&r.push(e.id);const n=this.properties().childs().inputs;for(const e of r)n.childs()[e].setValueSilently(s[e]);t&&r.length>0&&n.fireChanged()}_getStudyErrorText(e){const t=e.split(":",2)[0];return decodeURIComponent(t)}_priceScaleByProperties(){if("default"===this.properties().childs().precision.value())return null;const e=parseInt(this.properties().childs().precision.value());return isFinite(e)?Math.pow(10,e):null}_priceScaleByMetaInfo(){const e=this.metaInfo().format,t="inherit"!==e.type?e.precision:void 0,s=(0,f.isNumber)(t)?Math.pow(10,t):void 0;if("price"===e.type||"percent"===e.type)return s||100;if("volume"===e.type){if(void 0===e.precision){const e=this.series().symbolInfo();if(null!==e&&(0,f.isNumber)(e.volume_precision))return Math.pow(10,e.volume_precision)}return 1}return"inherit"===e.type||Jt.logWarn("Unsupported format type: "+e.type),null}_inputSymbols(){return this.metaInfo().inputs.filter((e=>"symbol"===e.type)).map((e=>(0,_.ensureDefined)(this._properties.childs().inputs.child(e.id)).value()))}_studySpec(e){return{id:this._metaInfo.value().id,child:e??this.isChildStudy(),fundamental:!1}}_onFormatterPropsChanged(){this._recreatePriceFormattingDependencies()}_setSources(e){this.invalidateTitleCache(),this._sources.setValue(e),this._onParentSourcesChanges.fire()}async _awaitForMetaInfo(){const e={resolver:()=>{}},t=()=>e.resolver();try{await Promise.race([new Promise(((e,t)=>{setTimeout((()=>t(new Error("Timeout"))),3e3)})),await new Promise((s=>{e.resolver=s,this.metaInfoWV().subscribe(t)}))])}catch(e){throw e}finally{this.metaInfoWV().unsubscribe(t)}}}},30220:(e,t,s)=>{s.d(t,{plotShapesData:()=>r});var i=s(91599);const r={shape_arrow_down:{guiName:i.t(null,void 0,s(4458)),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown",icon:"arrow_down"},shape_arrow_up:{guiName:i.t(null,void 0,s(62061)),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup",icon:"arrow_up"},shape_circle:{guiName:i.t(null,void 0,s(94408)),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle",icon:"circle"},shape_cross:{guiName:i.t(null,void 0,s(88180)),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross",icon:"cross"},shape_diamond:{guiName:i.t(null,void 0,s(81248)),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond",icon:"diamond"},shape_flag:{guiName:i.t(null,void 0,s(71527)),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag",icon:"flag"},shape_label_down:{ guiName:i.t(null,void 0,s(62458)),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown",icon:"label_down"},shape_label_up:{guiName:i.t(null,void 0,s(64157)),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup",icon:"label_up"},shape_square:{guiName:i.t(null,void 0,s(16215)),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square",icon:"square"},shape_triangle_down:{guiName:i.t(null,void 0,s(71745)),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown",icon:"triangle_down"},shape_triangle_up:{guiName:i.t(null,void 0,s(99688)),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup",icon:"triangle_up"},shape_xcross:{guiName:i.t(null,void 0,s(10222)),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross",icon:"x_cross"}}}}]);