diff --git a/charting_library/ar-tv-chart.9df149da.html b/charting_library/ar-tv-chart.e16a61a3.html similarity index 99% rename from charting_library/ar-tv-chart.9df149da.html rename to charting_library/ar-tv-chart.e16a61a3.html index 19a741c7..c7927fce 100644 --- a/charting_library/ar-tv-chart.9df149da.html +++ b/charting_library/ar-tv-chart.e16a61a3.html @@ -1 +1 @@ -
\ No newline at end of file + \ No newline at end of file diff --git a/charting_library/bundles/library.5e4de6f63fd663aa30f2.js b/charting_library/bundles/library.82060f30e329cfb5852a.js similarity index 73% rename from charting_library/bundles/library.5e4de6f63fd663aa30f2.js rename to charting_library/bundles/library.82060f30e329cfb5852a.js index 573aba29..4f8838d0 100644 --- a/charting_library/bundles/library.5e4de6f63fd663aa30f2.js +++ b/charting_library/bundles/library.82060f30e329cfb5852a.js @@ -21,97 +21,97 @@ var t=U;t<0&&(t=0),t>e&&(t=e),W.setValue(z[t].chartWidget)}}function Ue(){for(va });var i=new Set;e.charts.forEach((function(e){e.chartId&&i.add(e.chartId)})),e.charts.forEach((function(e){if(!e.chartId){var t=We((function(e){return i.has(e)}));i.add(t),e.chartId=t}})),K=lt(e.layout||"s");for(var s=0;sthis._size.h||i
{for(let s=i.length;s--;){if(!_[s].visible)continue;const r=i[s]
-;e.fillText(r.label,l/t,r.coord+_[s].yCorrection)}}),e.restore()}_hasAlertLabel(){return!1}_showCurrenciesContextMenu(){if(!this._currencyMenuEnabled)return;Object(h.trackEvent)("GUI","Currency conversion");v(Object(r.t)("Currencies"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"aWqZ"))).currencyActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).currencyInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).currencyLabelElement()).then(e=>{this._destroyed?e.close():this._currencyMenu=e})}_showUnitsContextMenu(){if(!this._unitMenuEnabled)return;Object(h.trackEvent)("GUI","Unit conversion");v(Object(r.t)("Units"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"hpdS"))).unitActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).unitInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).unitLabelElement()).then(e=>{this._destroyed?e.close():this._unitMenu=e})}_onFontSizeChanged(){this._currencyLabelWidth=null,this._currencyFontSize=0,this._updateCurrencyLabelFont(),this.onOptimalWidthNeedToBeRecalculated()}_mouseOrTouchMoveEvent(e){if(!this._priceScale)return;this.dataSourceAtPoint(e.localX,e.localY)?this._setCursorClassName("pointer"):this._setResizeCursor()}_mouseDownOrTouchStartEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state();this._mouseDown=!0,this._undoModel.startScalePrice(t,this.priceScale(),e.localY)}_mouseEnterOrTouchStartEvent(e){this._setResizeCursor()}_pressedMouseOrTouchMoveEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._undoModel.scalePriceTo(t,i,e.localY)}_mouseUpOrTouchEndEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._mouseDown=!1,this._undoModel.endScalePrice(t,i),this.restoreDefaultCursor()}_mouseClickOrTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t&&this._undoModel.selectionMacro(e=>{e.selection().isSelected(t)||(e.clearSelection(),e.addSourceToSelection(t))})}_mouseLeaveOrTouchEndEvent(e){this._setCursorClassName("")}_mouseDoubleClickOrDoubleTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t?this._pane.processDoubleClickOnSource(t):(this.reset(),Object(h.trackEvent)("GUI","Double click price scale"))}_contextMenuOrTouchContextMenuEvent(e){if(this._options.contextMenuEnabled){const t=this.dataSourceAtPoint(e.localX,e.localY);if(null!==t&&this._options.contextMenu.source){return void this._undoModel.model().selectionMacro(i=>{i.selection().isSelected(t)||(i.clearSelection(),i.addSourceToSelection(t)),this._pane.showContextMenuForSelection(e)})}
-this._options.contextMenu.general&&S.ContextMenuManager.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"}).then(t=>t.show(e))}}_setResizeCursor(){const e=this.priceScale();e.isPercentage()||e.isIndexedTo100()?this._setCursorClassName(""):this._zoomAvailable()&&this._setCursorClassName("ns-resize")}_setCursorClassName(e){let t="";e&&(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t)}_zoomAvailable(){return!this.priceScale().isEmpty()&&this._undoModel.model().zoomEnabled()&&this._options.pressedMouseMoveScale}}},"y/Xm":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyOverlayBase",(function(){return y}));var s=i("Eyy1"),r=i("qFKp"),n=i("GVHu"),o=i("XPit"),a=i("n5al"),l=i("tc+8"),c=i.n(l),h=i("5fI3"),u=i("Kxc7"),d=i("wOSo"),p=i("BZtw"),_=i("pPtI"),m=i("k9/m");const f=r.CheckMobile.any()&&!1,g=u.enabled("uppercase_instrument_names"),v=u.enabled("study_overlay_compare_legend_option"),b=u.enabled("secondary_series_extend_time_scale");function S(e,t){return null==e[t]}class y extends n.Study{constructor(e,t,i,s){t.hasChild("currencyId")||t.addChild("currencyId",new c.a(null)),t.hasChild("unitId")||t.addChild("unitId",new c.a(null)),super(e,t,i,s),this._seriesSource=null,this.m_data=new m.PlotList(Object(o.seriesPlotFunctionMap)(),S),this._quotesProvider=new d.a,f&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate),this.properties().childs().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().childs().unitId.subscribe(this,this._onUnitChanged),this.properties().childs().allowExtendTimeScale.subscribe(this,this._onAllowExtendTimeScaleChanged),this._onAllowExtendTimeScaleChanged()}symbol(){const e=this.properties().childs().inputs.childs().symbol.value(),t=this.symbolInfo(),i=t?t.name:e;return g?i.toUpperCase():i}setSymbol(e){this._properties.inputs.symbol.setValue(e)}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this._properties.inputs.symbol.value();return e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null}data(){return null===this._seriesSource?super.data():this._seriesSource.data().bars()}symbolResolved(){return this.symbolsResolved()}quotes(){return this._quotesProvider.quotes()}currency(){return this._properties.currencyId.value()||null}setCurrency(e){this._properties.currencyId.setValue(e)}isConvertedToOtherCurrency(){return Object(a.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this._properties.unitId.value()||null}setUnit(e){this._properties.unitId.setValue(e)}isConvertedToOtherUnit(){return Object(a.isConvertedToOtherUnit)(this.symbolInfo())}symbolSource(){return this}state(e,t){const i=super.state(e,t);return i}symbolTitle(e,t){return this.title(!0,{},!1,e)}title(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return g?r.toUpperCase():r}titleInParts(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return[g?r.toUpperCase():r]}isStarted(){
-return null===this._seriesSource?super.isStarted():this._seriesSource.isStarted()}sourceId(){return null===this._seriesSource?super.sourceId():Object(s.ensureNotNull)(this._seriesSource.instanceId())}moveData(e){null===this._seriesSource?super.moveData(e):this._seriesSource.moveData(e)}_resolvedSymbolKey(e,t,i){const s=null!=t?t:this.currency(),r=null!=i?i:this.unit();return e+(null===s?"":"_#_"+s)+(null===r?"":"_#_"+r)}_addSymbolToMap(e,t){var i,s;const r=this._resolvedSymbolKey(e,null!==(i=Object(a.symbolCurrency)(t))&&void 0!==i?i:void 0,null!==(s=Object(a.symbolUnit)(t))&&void 0!==s?s:void 0);this._resolvedSymbols[r]=t}_onCurrencyChanged(){this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()}_onUnitChanged(){this.isStarted()&&this._tryChangeInputs(),this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return null!==s&&(t["unit-id"]=s),t}_onSymbolResolved(e,t){super._onSymbolResolved(e,t),f&&this._setQuotesSymbol(e),this.setCurrency(Object(a.symbolCurrency)(t)),this.setUnit(Object(a.symbolUnit)(t)),this.model().realignLineTools()}_setQuotesSymbol(e){const t=this.symbolInfo(),i=Object(a.extractSymbolNameFromSymbolInfo)(t,e);this._quotesProvider.setQuotesSessionSymbol(i)}_createStudyOnServer(){null===this._seriesSource?super._createStudyOnServer():this._modifyStudyOnServer(Object(s.ensureDefined)(this._inputs))}_modifyStudyOnServer(e){null===this._seriesSource?super._modifyStudyOnServer(e):(this._seriesSource.modifySeries(Object(h.decodeExtendedSymbol)(e.symbol),Object(_.getServerInterval)(this._series.properties().interval.value())),this._seriesSource.isStarted()||this._seriesSource.start())}_stopStudyOnServer(){null===this._seriesSource?super._stopStudyOnServer():this._seriesSource.stop()}_titleInParts(e,t,i,s){const r=this.properties().childs().inputs.childs().symbol.value(),n=this.symbolInfo();let o;if(n){if(o=n.name,v){const e=this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value();"description"===e?o=n.description:"ticker-and-description"===e&&(o=`${n.name}, ${n.description}`)}if(!s&&n.exchange&&0!==n.exchange.length)return[o,[n.exchange]]}else o=r;return[o]}_onAllowExtendTimeScaleChanged(){const e=this.isStarted();if(e&&this.stop(!0),b&&this.properties().childs().allowExtendTimeScale.value()){this._seriesSource=new p.SeriesDataSource(this._model.chartApi(),"st_o_");const e=this._seriesSource.dataEvents();e.seriesError().subscribe(this,e=>{this._onStudyError(e)}),e.loading().subscribe(this,this._onStudyLoading),e.completed().subscribe(this,(e,t)=>{this._onStudyCompleted(t)}),e.dataUpdated().subscribe(this,()=>{const e=this._model.paneForSource(this);this._model.recalculatePane(e),this._updateSources(),this.priceRangeReady()||this._enablePriceRangeReady()})}else{if(null!==this._seriesSource){const e=this._seriesSource.dataEvents();e.seriesError().unsubscribeAll(this),e.loading().unsubscribeAll(this),e.completed().unsubscribeAll(this),e.dataUpdated().unsubscribeAll(this),
-this._seriesSource.destroy()}this._seriesSource=null}e&&this.start(!0)}}},yMne:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return n}));var s=i("J2xC");const r=parseInt(s["css-value-header-toolbar-height"]),n=3},yUly:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"SvjA",7)).then(({TrendBasedFibTimePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 3}name(){return"Trend-Based Fib Time"}migrateVersion(e,t,i){}processErase(e,t){var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"u52p"))).TrendBasedFibTimeDefinitionsViewModel}static createProperties(e){var t=new r("linetooltrendbasedfibtime",e,!1,{range:[1,11]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,l.version=1,t.LineToolTrendBasedFibTime=l},yfAl:function(e,t,i){"use strict";i.r(t);var s=i("aO4+"),r=i("Eyy1"),n=i("txPx"),o=i("aIyQ"),a=i.n(o),l=i("e3/o"),c=i("Y7w9"),h=i("GxN8"),u=i("7ktv"),d=i("MWAT"),p=i("CW80"),_=i("s1Gx");const m=new Map([["trading",e=>Object(p.isTrading)(e)],["drawing",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["drawingsForAllSymbols",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["phantom",e=>Object(p.isLineTool)(e)&&e.isPhantom()],["restRowSources",e=>!Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)],["leftPriceScale",(e,t)=>"left"===g(e,t)],["rightPriceScale",(e,t)=>"right"===g(e,t)],["overlayPriceScale",(e,t)=>"overlay"===g(e,t)]]),f=new Map([["trading","visibleSorted"],["drawing","visibleSorted"],["drawingsForAllSymbols","allSorted"],["phantom","visibleSorted"],["restRowSources","visibleSorted"],["leftPriceScale","visibleSorted"],["rightPriceScale","visibleSorted"],["overlayPriceScale","visibleSorted"]]);function g(e,t){const i=e.priceScale();return null===i?"overlay":t.priceScalePosition(i)}class v{constructor(e){this._groupedSources=new Map,this._sources=null,this._pane=e}clear(){this._groupedSources.clear(),this._sources=null}destroy(){this.clear()}all(){return this._groupedSources.has("visibleSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("visibleSorted"))}allIncludingHidden(){return this._groupedSources.has("allSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("allSorted"))}
-allExceptSpecialSources(){if(!this._groupedSources.has("exceptSpecial")){const e=this.allIncludingHidden().filter(e=>e.zorder()<_.specialZOrderBase);this._groupedSources.set("exceptSpecial",e)}return Object(r.ensureDefined)(this._groupedSources.get("exceptSpecial"))}tradingSources(){return this._getSourcesByGroupType("trading")}lineSources(){return this._getSourcesByGroupType("drawing")}lineSourcesForAllSymbols(){return this._getSourcesByGroupType("drawingsForAllSymbols")}phantomSources(){return this._getSourcesByGroupType("phantom")}allExceptLineAndTradingSources(){return this._getSourcesByGroupType("restRowSources")}hitTestSources(){if(!this._groupedSources.has("hitTest")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources());this._groupedSources.set("hitTest",e)}return Object(r.ensureDefined)(this._groupedSources.get("hitTest"))}generalSources(){if(!this._groupedSources.has("general")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources());this._groupedSources.set("general",Object(_.sortSources)(e))}return Object(r.ensureDefined)(this._groupedSources.get("general"))}leftPriceScalesSources(){return this._getSourcesByGroupType("leftPriceScale")}rightPriceScalesSources(){return this._getSourcesByGroupType("rightPriceScale")}overlayPriceScaleSources(){return this._getSourcesByGroupType("overlayPriceScale")}_getSourcesByGroupType(e){const t=Object(r.ensureDefined)(f.get(e));return this._groupedSources.has(t)?this._groupedSources.has(e)||this._groupSources(e):(this._sortSources(),this._groupSources(e)),Object(r.ensureDefined)(this._groupedSources.get(e))}_sortSources(){null===this._sources&&(this._sources=this._pane.dataSources());const e=Object(_.sortSources)(this._sources),t=e.filter(e=>!Object(p.isLineTool)(e)||e.isActualSymbol()&&e.isActualCurrency()&&e.isActualUnit());this._groupedSources.set("allSorted",e),this._groupedSources.set("visibleSorted",t)}_groupSources(e){const t=Object(r.ensureDefined)(f.get(e)),i=m.get(e);if(void 0!==i){const s=Object(r.ensureDefined)(this._groupedSources.get(t)).filter(e=>i(e,this._pane));this._groupedSources.set(e,s)}}}var b=i("1Wlv"),S=i("FaJS"),y=i("Qb4w");i.d(t,"PaneBase",(function(){return P}));const w=Object(n.getLogger)("Chart.Pane");function C(e,t,i){e.setMargins({top:t,bottom:i})}class P{constructor(e,t,i,s){this.m_dataSources=[],this._sourceAlertSubscriptions=new Map,this.m_mainDataSource=null,this._cachedOrderedSources=new v(this),this._sourcesById=new Map,this._dataSourcesCollectionChanged=new a.a,this._sourcePropertiesChanged=new a.a,this._sourcesZOrderChanged=new a.a,this._tagsChanged=new a.a,this._stretchFactor=1e3,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._rightPriceScales=[],this._leftPriceScales=[],this._lockedPriceScale=null,this._currentPriceScaleRatio=null,this._onPriceScalesChanged=new a.a,this._isRecalculatingScales=!1,this._priceDataSources=[],this._bulkActionsActive=0,
-this._priceScaleSelectionStrategy=Object(d.createPriceScaleSelectionStrategy)(i.properties().priceScaleSelectionStrategyName.value()),this._id=null!=s?s:Object(l.randomHashN)(6)}id(){return this._id}bulkActionMacro(e){this._bulkActionsActive+=1,e(),this._bulkActionsActive-=1,0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}sourcesByGroup(){return this._cachedOrderedSources}dataSourceForId(e){return this._sourcesById.get(e)||null}changeSourceId(e,t){Object(r.assert)(this.hasDataSource(e)),this._sourcesById.delete(e.id()),e.setId(t),this._sourcesById.set(t,e)}movePriceScale(e,t,i){const s=this.priceScalePosition(e);if(s!==t)this.removePriceScale(e),this._placePriceScale(e,t,i),e.invalidateMargins(),this._invalidateSourcesCache();else if(void 0!==i&&"overlay"!==s){const t="left"===s?this._leftPriceScales:this._rightPriceScales,r=t.indexOf(e);t.splice(r,1),t.splice(i,0,e)}}isEmpty(){return null===this.m_mainDataSource}recalculatePriceScale(e){if(!e)return;const t=e.sourcesForAutoscale();if((e.isAutoScale()||e.priceRangeShouldBeRecalculatedOnce())&&t&&t.length>0&&!this.timeScale().isEmpty()){const t=this.timeScale().visibleBarsStrictRange();e.recalculatePriceRange(t)}e.updateAllViews()}onSourceTagsChanged(){this._tagsChanged.fire()}getZOrderMinMax(){const e=this.sourcesByGroup().all();if(0===e.length)return{minZOrder:0,maxZOrder:0};let t=1/0,i=-1/0;for(const s of e)if(!Object(_.isSpeciallyZOrderedSource)(s)){const e=s.zorder();t=Math.min(t,e),i=Math.max(i,e)}return{minZOrder:t,maxZOrder:i}}insertDataSource(e,t,i){t||(t=this.findSuitableScale(e)),this._addSourceToCollections(e);let s=!1;(e===this.model().mainSeries()||null===this.m_mainDataSource)&&(this.m_mainDataSource=e,s=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),t.invalidateMargins(),e.onTagsChanged&&e.onTagsChanged().subscribe(this,this.onSourceTagsChanged),e.setZorder(i),s&&this._processMainSourceChange(),this._tagsChanged.fire(),e instanceof u.PriceDataSource&&this.recalculatePriceScale(t),this._invalidateSourcesCache()}addDataSource(e,t,i){let s=e.zorder();i||(Object(p.isLineTool)(e)?(s=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=s)):s=this.getZOrderMinMax().minZOrder-1),this.insertDataSource(e,t,s)}removeDataSource(e,t,i){const s=this.m_dataSources.indexOf(e);if(-1===s)return void w.logDebug("removeDataSource: invalid data source");this._removeSourceFromCollections(s,!!i),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null);const r=e.priceScale();this._removeSourceFromPriceScale(e),e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,this.onSourceTagsChanged),e instanceof u.PriceDataSource&&!t&&this._processMainSourceChange(),this._tagsChanged.fire(),r&&e instanceof u.PriceDataSource&&this.recalculatePriceScale(r),this._invalidateSourcesCache()}hasDataSource(e){return this._sourcesById.has(e.id())}dataSources(){return this.m_dataSources}priceDataSources(){
-return this._priceDataSources}replaceSource(e,t,i){const s=this.m_mainDataSource===e,r=e.zorder();this.insertDataSource(t,i,r),this.removeDataSource(e,s),this._sourcesById.set(t.id(),t),s&&(this.m_mainDataSource=t,this._processMainSourceChange())}isOverlay(e){const t=e.priceScale();return null===t||"overlay"===this.priceScalePosition(t)}updateAllViews(){for(const e of this.m_dataSources)e.updateAllViews();for(const e of this.model().customSources())e.updateViewsForPane(this)}priceScalePosition(e){return this._leftPriceScales.includes(e)?"left":this._rightPriceScales.includes(e)?"right":"overlay"}createPriceScaleAtPosition(e,t){const i=this.properties().childs().axisProperties.state();i.autoScale=!0;const s=new b.PriceScale(this.model().properties().scalesProperties,i);return s.setHeight(this.height()),C(s,this._defaultTopMargin(),this._defaultBottomMargin()),this._placePriceScale(s,e,t),s}removePriceScale(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this),e===this._lockedPriceScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null);const t=this._leftPriceScales.indexOf(e);-1!==t&&(this._leftPriceScales[t].invalidateMargins(),this._leftPriceScales.splice(t,1));const i=this._rightPriceScales.indexOf(e);if(-1!==i&&(this._rightPriceScales[i].invalidateMargins(),this._rightPriceScales.splice(i,1)),null===e.mainSource()){const t=e.dataSources().length;0!==t&&w.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+t)}this._onPriceScalesChanged.fire()}move(e,t,i){const s=e.priceScale();this._removeSourceFromPriceScale(e),t.addDataSource(e),e.setPriceScale(t),t.invalidateMargins(),this._processMainSourceChange(),this._invalidateSourcesCache(),e.isIncludedInAutoScale()&&(null!==s&&this.recalculatePriceScale(s),this.recalculatePriceScale(t)),this._onPriceScalesChanged.fire()}setZOrder(e,t){e.setZorder(t),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}setZOrders(e){e.forEach((e,t)=>{t.setZorder(e)}),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire(),this.model().lightUpdate()}containsMainSeries(){return this._sourcesById.has(this.model().mainSeries().id())}applyPriceScaleRatio(e,t){var i;null!==this._lockedPriceScale&&this._lockedPriceScale!==e||this._currentPriceScaleRatio===t||!this.isMainPane()||null===this._lockedPriceScale&&e!==(null===(i=this.mainDataSource())||void 0===i?void 0:i.priceScale())||(this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e),!0,!0),null!==this._lockedPriceScale?this._tryToApplyNewPriceScaleRatio():e.isLog()||this.model().mainSeriesScaleRatioPropertyOnChanged())}sendToBack(e){this._batchReorder(e,0,c.moveBefore)}bringToFront(e){const t=this.sourcesByGroup().allExceptSpecialSources().length-1;this._batchReorder(e,t,c.moveAfter)}sendBackward(e){const t=this.sourcesByGroup().allIncludingHidden(),i=t.indexOf(e[0]);if(0===i)this.bringToFront(e);else{
-const s=t[i-1];this.insertBefore(e,s)}}bringForward(e){const t=this.sourcesByGroup().allExceptSpecialSources(),i=t.indexOf(e[e.length-1]);if(i===t.length-1)this.sendToBack(e);else{const s=t[i+1];this.insertAfter(e,s)}}insertAfter(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveAfter)}insertBefore(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveBefore)}priceScaleSelectionStrategy(){return this._priceScaleSelectionStrategy}findTargetPriceAxisViews(e,t,i,s){if(Object(h.a)(e)&&this.model().paneForSource(e)!==this)return[];const r=e.priceScale();if(t===r)return i;if(null===r)return[];if("overlay"===this.priceScalePosition(r))return t===this.defaultPriceScale()?i:[];const n=this.priceScalePosition(t);if(n!==this.priceScalePosition(r))return[];const o="left"===n?this.leftPriceScales():this.rightPriceScales();return o.indexOf(t) this._size.h||i {for(let s=i.length;s--;){if(!_[s].visible)continue;const r=i[s];e.fillText(r.label,l/t,r.coord+_[s].yCorrection)}}),e.restore()}_hasAlertLabel(){return!1}_showCurrenciesContextMenu(){if(!this._currencyMenuEnabled)return;Object(h.trackEvent)("GUI","Currency conversion");v(Object(r.t)("Currencies"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"aWqZ"))).currencyActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).currencyInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).currencyLabelElement()).then(e=>{this._destroyed?e.close():this._currencyMenu=e})}_showUnitsContextMenu(){if(!this._unitMenuEnabled)return;Object(h.trackEvent)("GUI","Unit conversion")
+;v(Object(r.t)("Units"),()=>async function(e,t,s){return(await Promise.all([i.e("react"),i.e(1),i.e(2),i.e(3),i.e(6),i.e(7),i.e(8),i.e(9),i.e(23),i.e(24),i.e(41),i.e(68),i.e(86),i.e(0),i.e(5),i.e(4),i.e(37),i.e("currency-label-menu")]).then(i.bind(null,"hpdS"))).unitActions(e,t,s)}(this._undoModel,Object(s.ensureNotNull)(this._currencyLabel).unitInfo(),this.priceScale()),Object(s.ensureNotNull)(this._currencyLabel).unitLabelElement()).then(e=>{this._destroyed?e.close():this._unitMenu=e})}_onFontSizeChanged(){this._currencyLabelWidth=null,this._currencyFontSize=0,this._updateCurrencyLabelFont(),this.onOptimalWidthNeedToBeRecalculated()}_mouseOrTouchMoveEvent(e){if(!this._priceScale)return;this.dataSourceAtPoint(e.localX,e.localY)?this._setCursorClassName("pointer"):this._setResizeCursor()}_mouseDownOrTouchStartEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state();this._mouseDown=!0,this._undoModel.startScalePrice(t,this.priceScale(),e.localY)}_mouseEnterOrTouchStartEvent(e){this._setResizeCursor()}_pressedMouseOrTouchMoveEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._undoModel.scalePriceTo(t,i,e.localY)}_mouseUpOrTouchEndEvent(e){if(!this._zoomAvailable())return;const t=this._pane.state(),i=this.priceScale();this._mouseDown=!1,this._undoModel.endScalePrice(t,i),this.restoreDefaultCursor()}_mouseClickOrTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t&&this._undoModel.selectionMacro(e=>{e.selection().isSelected(t)||(e.clearSelection(),e.addSourceToSelection(t))})}_mouseLeaveOrTouchEndEvent(e){this._setCursorClassName("")}_mouseDoubleClickOrDoubleTapEvent(e){const t=this.dataSourceAtPoint(e.localX,e.localY);t?this._pane.processDoubleClickOnSource(t):(this.reset(),Object(h.trackEvent)("GUI","Double click price scale"))}_contextMenuOrTouchContextMenuEvent(e){if(this._options.contextMenuEnabled){const t=this.dataSourceAtPoint(e.localX,e.localY);if(null!==t&&this._options.contextMenu.source){return void this._undoModel.model().selectionMacro(i=>{i.selection().isSelected(t)||(i.clearSelection(),i.addSourceToSelection(t)),this._pane.showContextMenuForSelection(e)})}this._options.contextMenu.general&&S.ContextMenuManager.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"}).then(t=>t.show(e))}}_setResizeCursor(){const e=this.priceScale();e.isPercentage()||e.isIndexedTo100()?this._setCursorClassName(""):this._zoomAvailable()&&this._setCursorClassName("ns-resize")}_setCursorClassName(e){let t="";e&&(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this._cell.classList.remove(this._currentCursorClassName),t&&this._cell.classList.add(t),this._currentCursorClassName=t)}_zoomAvailable(){return!this.priceScale().isEmpty()&&this._undoModel.model().zoomEnabled()&&this._options.pressedMouseMoveScale}}},"y/Xm":function(e,t,i){"use strict";i.r(t),i.d(t,"StudyOverlayBase",(function(){return y}))
+;var s=i("Eyy1"),r=i("qFKp"),n=i("GVHu"),o=i("XPit"),a=i("n5al"),l=i("tc+8"),c=i.n(l),h=i("5fI3"),u=i("Kxc7"),d=i("wOSo"),p=i("BZtw"),_=i("pPtI"),m=i("k9/m");const f=r.CheckMobile.any()&&!1,g=u.enabled("uppercase_instrument_names"),v=u.enabled("study_overlay_compare_legend_option"),b=u.enabled("secondary_series_extend_time_scale");function S(e,t){return null==e[t]}class y extends n.Study{constructor(e,t,i,s){t.hasChild("currencyId")||t.addChild("currencyId",new c.a(null)),t.hasChild("unitId")||t.addChild("unitId",new c.a(null)),super(e,t,i,s),this._seriesSource=null,this.m_data=new m.PlotList(Object(o.seriesPlotFunctionMap)(),S),this._quotesProvider=new d.a,f&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate),this.properties().childs().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().childs().unitId.subscribe(this,this._onUnitChanged),this.properties().childs().allowExtendTimeScale.subscribe(this,this._onAllowExtendTimeScaleChanged),this._onAllowExtendTimeScaleChanged()}symbol(){const e=this.properties().childs().inputs.childs().symbol.value(),t=this.symbolInfo(),i=t?t.name:e;return g?i.toUpperCase():i}setSymbol(e){this._properties.inputs.symbol.setValue(e)}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this._properties.inputs.symbol.value();return e&&this._resolvedSymbols[this._resolvedSymbolKey(e)]||null}data(){return null===this._seriesSource?super.data():this._seriesSource.data().bars()}symbolResolved(){return this.symbolsResolved()}quotes(){return this._quotesProvider.quotes()}currency(){return this._properties.currencyId.value()||null}setCurrency(e){this._properties.currencyId.setValue(e)}isConvertedToOtherCurrency(){return Object(a.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this._properties.unitId.value()||null}setUnit(e){this._properties.unitId.setValue(e)}isConvertedToOtherUnit(){return Object(a.isConvertedToOtherUnit)(this.symbolInfo())}symbolSource(){return this}state(e,t){const i=super.state(e,t);return i}symbolTitle(e,t){return this.title(!0,{},!1,e)}title(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return g?r.toUpperCase():r}titleInParts(e,t,i,s){const r=this._titleInParts(e,t,i,s).join(", ");return[g?r.toUpperCase():r]}isStarted(){return null===this._seriesSource?super.isStarted():this._seriesSource.isStarted()}sourceId(){return null===this._seriesSource?super.sourceId():Object(s.ensureNotNull)(this._seriesSource.instanceId())}moveData(e){null===this._seriesSource?super.moveData(e):this._seriesSource.moveData(e)}_resolvedSymbolKey(e,t,i){const s=null!=t?t:this.currency(),r=null!=i?i:this.unit();return e+(null===s?"":"_#_"+s)+(null===r?"":"_#_"+r)}_addSymbolToMap(e,t){var i,s;const r=this._resolvedSymbolKey(e,null!==(i=Object(a.symbolCurrency)(t))&&void 0!==i?i:void 0,null!==(s=Object(a.symbolUnit)(t))&&void 0!==s?s:void 0);this._resolvedSymbols[r]=t}_onCurrencyChanged(){this.isStarted()&&this._tryChangeInputs(),this._currencyChanged.fire()}_onUnitChanged(){this.isStarted()&&this._tryChangeInputs(),
+this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return null!==s&&(t["unit-id"]=s),t}_onSymbolResolved(e,t){super._onSymbolResolved(e,t),f&&this._setQuotesSymbol(e),this.setCurrency(Object(a.symbolCurrency)(t)),this.setUnit(Object(a.symbolUnit)(t)),this.model().realignLineTools()}_setQuotesSymbol(e){const t=this.symbolInfo(),i=Object(a.extractSymbolNameFromSymbolInfo)(t,e);this._quotesProvider.setQuotesSessionSymbol(i)}_createStudyOnServer(){null===this._seriesSource?super._createStudyOnServer():this._modifyStudyOnServer(Object(s.ensureDefined)(this._inputs))}_modifyStudyOnServer(e){null===this._seriesSource?super._modifyStudyOnServer(e):(this._seriesSource.modifySeries(Object(h.decodeExtendedSymbol)(e.symbol),Object(_.getServerInterval)(this._series.properties().interval.value())),this._seriesSource.isStarted()||this._seriesSource.start())}_stopStudyOnServer(){null===this._seriesSource?super._stopStudyOnServer():this._seriesSource.stop()}_titleInParts(e,t,i,s){const r=this.properties().childs().inputs.childs().symbol.value(),n=this.symbolInfo();let o;if(n){if(o=n.name,v){const e=this._model.mainSeries().properties().statusViewStyle.symbolTextSource.value();"description"===e?o=n.description:"ticker-and-description"===e&&(o=`${n.name}, ${n.description}`)}if(!s&&n.exchange&&0!==n.exchange.length)return[o,[n.exchange]]}else o=r;return[o]}_onAllowExtendTimeScaleChanged(){const e=this.isStarted();if(e&&this.stop(!0),b&&this.properties().childs().allowExtendTimeScale.value()){this._seriesSource=new p.SeriesDataSource(this._model.chartApi(),"st_o_");const e=this._seriesSource.dataEvents();e.seriesError().subscribe(this,e=>{this._onStudyError(e)}),e.loading().subscribe(this,this._onStudyLoading),e.completed().subscribe(this,(e,t)=>{this._onStudyCompleted(t)}),e.dataUpdated().subscribe(this,()=>{const e=this._model.paneForSource(this);this._model.recalculatePane(e),this._updateSources(),this.priceRangeReady()||this._enablePriceRangeReady()})}else{if(null!==this._seriesSource){const e=this._seriesSource.dataEvents();e.seriesError().unsubscribeAll(this),e.loading().unsubscribeAll(this),e.completed().unsubscribeAll(this),e.dataUpdated().unsubscribeAll(this),this._seriesSource.destroy()}this._seriesSource=null}e&&this.start(!0)}}},yMne:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return n}));var s=i("J2xC");const r=parseInt(s["css-value-header-toolbar-height"]),n=3},yUly:function(e,t,i){"use strict";var s=i("Ss5c").LineDataSource,r=i("5rJj"),n=i("j3hX"),o=n.LineToolWidthsProperty,a=n.LineToolColorsProperty;class l extends s{constructor(e,t){super(e,t||l.createProperties()),this.version=l.version,i.e("lt-pane-views").then(i.t.bind(null,"SvjA",7)).then(({TrendBasedFibTimePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}levelsCount(){return l.LevelsCount}pointsCount(){return 3}name(){return"Trend-Based Fib Time"}migrateVersion(e,t,i){}processErase(e,t){
+var i="level"+t,s=this.properties()[i].visible;e.setProperty(s,!1,"Erase level line")}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"u52p"))).TrendBasedFibTimeDefinitionsViewModel}static createProperties(e){var t=new r("linetooltrendbasedfibtime",e,!1,{range:[1,11]});return l._configureProperties(t),t}static _configureProperties(e){s._configureProperties(e);for(var t=[e.child("trendline").child("linewidth")],i=[e.child("trendline").child("color")],r=1;r<=l.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new o(t))}}l.LevelsCount=11,l.version=1,t.LineToolTrendBasedFibTime=l},yfAl:function(e,t,i){"use strict";i.r(t);var s=i("aO4+"),r=i("Eyy1"),n=i("txPx"),o=i("aIyQ"),a=i.n(o),l=i("e3/o"),c=i("Y7w9"),h=i("GxN8"),u=i("7ktv"),d=i("MWAT"),p=i("CW80"),_=i("s1Gx");const m=new Map([["trading",e=>Object(p.isTrading)(e)],["drawing",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["drawingsForAllSymbols",e=>Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)&&!e.isPhantom()],["phantom",e=>Object(p.isLineTool)(e)&&e.isPhantom()],["restRowSources",e=>!Object(p.isLineTool)(e)&&!Object(p.isTrading)(e)],["leftPriceScale",(e,t)=>"left"===g(e,t)],["rightPriceScale",(e,t)=>"right"===g(e,t)],["overlayPriceScale",(e,t)=>"overlay"===g(e,t)]]),f=new Map([["trading","visibleSorted"],["drawing","visibleSorted"],["drawingsForAllSymbols","allSorted"],["phantom","visibleSorted"],["restRowSources","visibleSorted"],["leftPriceScale","visibleSorted"],["rightPriceScale","visibleSorted"],["overlayPriceScale","visibleSorted"]]);function g(e,t){const i=e.priceScale();return null===i?"overlay":t.priceScalePosition(i)}class v{constructor(e){this._groupedSources=new Map,this._sources=null,this._pane=e}clear(){this._groupedSources.clear(),this._sources=null}destroy(){this.clear()}all(){return this._groupedSources.has("visibleSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("visibleSorted"))}allIncludingHidden(){return this._groupedSources.has("allSorted")||this._sortSources(),Object(r.ensureDefined)(this._groupedSources.get("allSorted"))}allExceptSpecialSources(){if(!this._groupedSources.has("exceptSpecial")){const e=this.allIncludingHidden().filter(e=>e.zorder()<_.specialZOrderBase);this._groupedSources.set("exceptSpecial",e)}return Object(r.ensureDefined)(this._groupedSources.get("exceptSpecial"))}tradingSources(){return this._getSourcesByGroupType("trading")}lineSources(){return this._getSourcesByGroupType("drawing")}lineSourcesForAllSymbols(){return this._getSourcesByGroupType("drawingsForAllSymbols")}phantomSources(){return this._getSourcesByGroupType("phantom")}allExceptLineAndTradingSources(){return this._getSourcesByGroupType("restRowSources")}hitTestSources(){if(!this._groupedSources.has("hitTest")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources())
+;this._groupedSources.set("hitTest",e)}return Object(r.ensureDefined)(this._groupedSources.get("hitTest"))}generalSources(){if(!this._groupedSources.has("general")){const e=this.allExceptLineAndTradingSources().concat(this.lineSources());this._groupedSources.set("general",Object(_.sortSources)(e))}return Object(r.ensureDefined)(this._groupedSources.get("general"))}leftPriceScalesSources(){return this._getSourcesByGroupType("leftPriceScale")}rightPriceScalesSources(){return this._getSourcesByGroupType("rightPriceScale")}overlayPriceScaleSources(){return this._getSourcesByGroupType("overlayPriceScale")}_getSourcesByGroupType(e){const t=Object(r.ensureDefined)(f.get(e));return this._groupedSources.has(t)?this._groupedSources.has(e)||this._groupSources(e):(this._sortSources(),this._groupSources(e)),Object(r.ensureDefined)(this._groupedSources.get(e))}_sortSources(){null===this._sources&&(this._sources=this._pane.dataSources());const e=Object(_.sortSources)(this._sources),t=e.filter(e=>!Object(p.isLineTool)(e)||e.isActualSymbol()&&e.isActualCurrency()&&e.isActualUnit());this._groupedSources.set("allSorted",e),this._groupedSources.set("visibleSorted",t)}_groupSources(e){const t=Object(r.ensureDefined)(f.get(e)),i=m.get(e);if(void 0!==i){const s=Object(r.ensureDefined)(this._groupedSources.get(t)).filter(e=>i(e,this._pane));this._groupedSources.set(e,s)}}}var b=i("1Wlv"),S=i("FaJS"),y=i("Qb4w");i.d(t,"PaneBase",(function(){return P}));const w=Object(n.getLogger)("Chart.Pane");function C(e,t,i){e.setMargins({top:t,bottom:i})}class P{constructor(e,t,i,s){this.m_dataSources=[],this._sourceAlertSubscriptions=new Map,this.m_mainDataSource=null,this._cachedOrderedSources=new v(this),this._sourcesById=new Map,this._dataSourcesCollectionChanged=new a.a,this._sourcePropertiesChanged=new a.a,this._sourcesZOrderChanged=new a.a,this._tagsChanged=new a.a,this._stretchFactor=1e3,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._rightPriceScales=[],this._leftPriceScales=[],this._lockedPriceScale=null,this._currentPriceScaleRatio=null,this._onPriceScalesChanged=new a.a,this._isRecalculatingScales=!1,this._priceDataSources=[],this._bulkActionsActive=0,this._priceScaleSelectionStrategy=Object(d.createPriceScaleSelectionStrategy)(i.properties().priceScaleSelectionStrategyName.value()),this._id=null!=s?s:Object(l.randomHashN)(6)}id(){return this._id}bulkActionMacro(e){this._bulkActionsActive+=1,e(),this._bulkActionsActive-=1,0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}sourcesByGroup(){return this._cachedOrderedSources}dataSourceForId(e){return this._sourcesById.get(e)||null}changeSourceId(e,t){Object(r.assert)(this.hasDataSource(e)),this._sourcesById.delete(e.id()),e.setId(t),this._sourcesById.set(t,e)}movePriceScale(e,t,i){const s=this.priceScalePosition(e);if(s!==t)this.removePriceScale(e),this._placePriceScale(e,t,i),e.invalidateMargins(),this._invalidateSourcesCache();else if(void 0!==i&&"overlay"!==s){const t="left"===s?this._leftPriceScales:this._rightPriceScales,r=t.indexOf(e)
+;t.splice(r,1),t.splice(i,0,e)}}isEmpty(){return null===this.m_mainDataSource}recalculatePriceScale(e){if(!e)return;const t=e.sourcesForAutoscale();if((e.isAutoScale()||e.priceRangeShouldBeRecalculatedOnce())&&t&&t.length>0&&!this.timeScale().isEmpty()){const t=this.timeScale().visibleBarsStrictRange();e.recalculatePriceRange(t)}e.updateAllViews()}onSourceTagsChanged(){this._tagsChanged.fire()}getZOrderMinMax(){const e=this.sourcesByGroup().all();if(0===e.length)return{minZOrder:0,maxZOrder:0};let t=1/0,i=-1/0;for(const s of e)if(!Object(_.isSpeciallyZOrderedSource)(s)){const e=s.zorder();t=Math.min(t,e),i=Math.max(i,e)}return{minZOrder:t,maxZOrder:i}}insertDataSource(e,t,i){t||(t=this.findSuitableScale(e)),this._addSourceToCollections(e);let s=!1;(e===this.model().mainSeries()||null===this.m_mainDataSource)&&(this.m_mainDataSource=e,s=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),t.invalidateMargins(),e.onTagsChanged&&e.onTagsChanged().subscribe(this,this.onSourceTagsChanged),e.setZorder(i),s&&this._processMainSourceChange(),this._tagsChanged.fire(),e instanceof u.PriceDataSource&&this.recalculatePriceScale(t),this._invalidateSourcesCache()}addDataSource(e,t,i){let s=e.zorder();i||(Object(p.isLineTool)(e)?(s=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=s)):s=this.getZOrderMinMax().minZOrder-1),this.insertDataSource(e,t,s)}removeDataSource(e,t,i){const s=this.m_dataSources.indexOf(e);if(-1===s)return void w.logDebug("removeDataSource: invalid data source");this._removeSourceFromCollections(s,!!i),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null);const r=e.priceScale();this._removeSourceFromPriceScale(e),e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,this.onSourceTagsChanged),e instanceof u.PriceDataSource&&!t&&this._processMainSourceChange(),this._tagsChanged.fire(),r&&e instanceof u.PriceDataSource&&this.recalculatePriceScale(r),this._invalidateSourcesCache()}hasDataSource(e){return this._sourcesById.has(e.id())}dataSources(){return this.m_dataSources}priceDataSources(){return this._priceDataSources}replaceSource(e,t,i){const s=this.m_mainDataSource===e,r=e.zorder();this.insertDataSource(t,i,r),this.removeDataSource(e,s),this._sourcesById.set(t.id(),t),s&&(this.m_mainDataSource=t,this._processMainSourceChange())}isOverlay(e){const t=e.priceScale();return null===t||"overlay"===this.priceScalePosition(t)}updateAllViews(){for(const e of this.m_dataSources)e.updateAllViews();for(const e of this.model().customSources())e.updateViewsForPane(this)}priceScalePosition(e){return this._leftPriceScales.includes(e)?"left":this._rightPriceScales.includes(e)?"right":"overlay"}createPriceScaleAtPosition(e,t){const i=this.properties().childs().axisProperties.state();i.autoScale=!0;const s=new b.PriceScale(this.model().properties().scalesProperties,i);return s.setHeight(this.height()),C(s,this._defaultTopMargin(),this._defaultBottomMargin()),
+this._placePriceScale(s,e,t),s}removePriceScale(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this),e===this._lockedPriceScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null);const t=this._leftPriceScales.indexOf(e);-1!==t&&(this._leftPriceScales[t].invalidateMargins(),this._leftPriceScales.splice(t,1));const i=this._rightPriceScales.indexOf(e);if(-1!==i&&(this._rightPriceScales[i].invalidateMargins(),this._rightPriceScales.splice(i,1)),null===e.mainSource()){const t=e.dataSources().length;0!==t&&w.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+t)}this._onPriceScalesChanged.fire()}move(e,t,i){const s=e.priceScale();this._removeSourceFromPriceScale(e),t.addDataSource(e),e.setPriceScale(t),t.invalidateMargins(),this._processMainSourceChange(),this._invalidateSourcesCache(),e.isIncludedInAutoScale()&&(null!==s&&this.recalculatePriceScale(s),this.recalculatePriceScale(t)),this._onPriceScalesChanged.fire()}setZOrder(e,t){e.setZorder(t),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire()}setZOrders(e){e.forEach((e,t)=>{t.setZorder(e)}),this._invalidateSourcesCache(),0===this._bulkActionsActive&&this._dataSourcesCollectionChanged.fire(),this.model().lightUpdate()}containsMainSeries(){return this._sourcesById.has(this.model().mainSeries().id())}applyPriceScaleRatio(e,t){var i;null!==this._lockedPriceScale&&this._lockedPriceScale!==e||this._currentPriceScaleRatio===t||!this.isMainPane()||null===this._lockedPriceScale&&e!==(null===(i=this.mainDataSource())||void 0===i?void 0:i.priceScale())||(this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e),!0,!0),null!==this._lockedPriceScale?this._tryToApplyNewPriceScaleRatio():e.isLog()||this.model().mainSeriesScaleRatioPropertyOnChanged())}sendToBack(e){this._batchReorder(e,0,c.moveBefore)}bringToFront(e){const t=this.sourcesByGroup().allExceptSpecialSources().length-1;this._batchReorder(e,t,c.moveAfter)}sendBackward(e){const t=this.sourcesByGroup().allIncludingHidden(),i=t.indexOf(e[0]);if(0===i)this.bringToFront(e);else{const s=t[i-1];this.insertBefore(e,s)}}bringForward(e){const t=this.sourcesByGroup().allExceptSpecialSources(),i=t.indexOf(e[e.length-1]);if(i===t.length-1)this.sendToBack(e);else{const s=t[i+1];this.insertAfter(e,s)}}insertAfter(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveAfter)}insertBefore(e,t){const i=this.sourcesByGroup().allIncludingHidden().indexOf(t);this._batchReorder(e,i,c.moveBefore)}priceScaleSelectionStrategy(){return this._priceScaleSelectionStrategy}findTargetPriceAxisViews(e,t,i,s){if(Object(h.a)(e)&&this.model().paneForSource(e)!==this)return[];const r=e.priceScale();if(t===r)return i;if(null===r)return[];if("overlay"===this.priceScalePosition(r))return t===this.defaultPriceScale()?i:[];const n=this.priceScalePosition(t);if(n!==this.priceScalePosition(r))return[]
+;const o="left"===n?this.leftPriceScales():this.rightPriceScales();return o.indexOf(t)