(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[62402],{310085:t=>{t.exports={}},83436:(t,e,s)=>{"use strict";s.d(e,{Icon:()=>o});var i=s(50959);const o=i.forwardRef(((t,e)=>{const{icon:s="",title:o,ariaLabel:a,ariaLabelledby:r,ariaHidden:n,...l}=t,h=!!(o||a||r);return i.createElement("span",{...l,ref:e,role:"img","aria-label":a,"aria-labelledby":r,"aria-hidden":n||!h,title:o,dangerouslySetInnerHTML:{__html:s}})}))},780792:(t,e,s)=>{"use strict";s.d(e,{AbstractIndicator:()=>n});var i=s(201089),o=s(541558),a=s(876332);s(673747);const r=(0,i.getLogger)("GUI.Blocks.AbstractIndicator");class n{constructor(t){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1,this._tooltipType="custom",this._lastTooltipText="",this._quoteSession=t.quoteSession}getValue(){return this._value}getTooltipText(){return this._labelMap[this._value]||""}getLabel(){return this._labelMap[this._value]||""}getElement(){return this._el}update(t,e){this._updateValue(t,e),this._render()}setTooltipEnabled(t=!1){this._showTooltip!==t&&(this._showTooltip=t,this._renderTooltip())}enableShortMode(){!0!==this._shortMode&&(this._shortMode=!0,this._render())}disableShortMode(){!1!==this._shortMode&&(this._shortMode=!1,this._render())}isShortModeEnabled(){return this._shortMode}start(){!this._subscribed&&this._symbolName&&(this._quoteSession||(this._quoteSession=(0,a.getQuoteSessionInstance)("simple")),this._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)}stop(){this._subscribed&&this._quoteSession&&this._symbolName&&(this._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)}setSessionStatusIcon(t){this._sessionStatusIcon!==t&&(this._sessionStatusIcon=t,this._render())}_init(t){this._el=t.el?t.el:document.createElement("span"),this._el.innerHTML="",this._classMap=t.classMap,this._iconClassMap=t.iconClassMap,this._labelMap=t.labelMap,this._showTooltip=t.showTooltip,this._classSuffix=t.classSuffix,this._symbolName=t.symbol,this._sessionStatusIcon=t.sessionStatusIcon,this._onValueChange=t.onValueChange,t.tooltipType&&(this._tooltipType=t.tooltipType),this._quoteSessionGUID=(0,o.guid)(),!0===t.short&&this.enableShortMode(),t.data&&this._updateValue(t.data)}_clearClasses(){Object.values(this._classMap).map((t=>{this._el.classList.remove(`${t}`),this._el.classList.remove(`${t}${this._classSuffix}`)}))}_render(){this._renderClasses(),this._renderTooltip(),this._renderLabel()}_renderLabel(){this._el.textContent=this.getLabel()}_updateValue(t,e){var s;const i=this._getValueFromData(t);(e||i!==this._value)&&(this._value=i,null===(s=this._onValueChange)||void 0===s||s.call(this,this._value))}_renderClasses(){const t=this._el.classList;t.add(this._componentClass,this._componentClass+this._classSuffix);const e=this._classMap[this._value];for(const s in this._classMap){const i=this._classMap[s];i&&(i===e?(t.add(i,i+this._classSuffix), this._sessionStatusIcon&&t.add(i+"__withIcon")):(t.remove(i,i+this._classSuffix),this._sessionStatusIcon&&t.remove(i+"__withIcon")))}!e&&this._value&&r.logWarn(`no className for status ${this._value}`)}_renderTooltip(){const t=this._showTooltip?this.getTooltipText():"";t!==this._lastTooltipText&&(this._lastTooltipText=t,this._el.setAttribute("title",t),"custom"===this._tooltipType&&this._el.classList.toggle("apply-common-tooltip",this._showTooltip))}_getQuoteSessionId(){return`${this._quoteSessionPrefix}.${this._quoteSessionGUID}`}}},583912:(t,e,s)=>{"use strict";s.d(e,{linking:()=>p});var i=s(12481),o=s(650151),a=s(401580),r=(s(244842),s(223699)),n=s(444331),l=s(201089),h=s(62802),u=s(588948),d=s(776734),c=s(707621),_=s(912445);const b=(0,l.getLogger)("Linking");class m{constructor(t,e,s){this.watchedSymbol=new a.WatchedValue,this.seriesShortSymbol=new a.WatchedValue,this.proSymbol=new a.WatchedValue,this.ensuredProSymbol=new a.WatchedValue,this.watchedInterval=new a.WatchedValue,this.watchedIntraday=new a.WatchedValue,this.watchedSeconds=new a.WatchedValue,this.watchedTicks=new a.WatchedValue,this.watchedDataFrequencyResolution=new a.WatchedValue,this.watchedRange=new a.WatchedValue,this.watchedSupportedResolutions=new a.WatchedValue,this.watchedSupportedChartStyles=new a.WatchedValue,this.symbolNamesList=new a.WatchedValue,this._chartWidgetCollection=null,this._chartWidgetBindingState=0,this._activeChartWidget=null,this._linkingGroupCharts=null,this._boundChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._muted=!1,this.updateBoundChartWidget=()=>{const t=this._chartToBind();t!==this._boundChartWidget&&(null===t?this.unbindFromChartWidget():this.bindToChartWidget(t))},this._updateAllGroupChartWidgets=()=>{var t;null===(t=this._destroySymbolIntervalPropertySubscriptions)||void 0===t||t.call(this);const e=(0,o.ensureNotNull)(this._linkingGroupCharts).value(),s=[],i=[];for(const t of e){const e=t.symbolWV().spawn(),o=t.resolutionWV().spawn();e.subscribe(this._updateSymbolByProperty.bind(this,t)),o.subscribe(this._updateIntervalByProperty.bind(this,t)),s.push(e),i.push(o)}this._destroySymbolIntervalPropertySubscriptions=()=>{s.forEach((t=>t.destroy())),i.forEach((t=>t.destroy())),this._destroySymbolIntervalPropertySubscriptions=void 0};const a=this.watchedSymbol.value();e.length>1&&this._needApplySymbol(a)&&!this._muted&&this._setGroupSymbol(a);const r=this.watchedInterval.value();e.length>1&&this._needApplyInterval(r)&&!this._muted&&this._setGroupInterval(r),this.updateBoundChartWidget()},this._groupIndex=t;const i=(t,e)=>{t.subscribe((t=>{s()===this&&e.setValue(t)}),{callWithLast:!0})};i(this.watchedSymbol,e.watchedSymbol),i(this.seriesShortSymbol,e.seriesShortSymbol),i(this.proSymbol,e.proSymbol),i(this.ensuredProSymbol,e.ensuredProSymbol),i(this.watchedInterval,e.watchedInterval),i(this.watchedIntraday,e.watchedIntraday),i(this.watchedSeconds,e.watchedSeconds),i(this.watchedTicks,e.watchedTicks), i(this.watchedDataFrequencyResolution,e.watchedDataFrequencyResolution),i(this.watchedRange,e.watchedRange),i(this.watchedSupportedResolutions,e.watchedSupportedResolutions),i(this.watchedSupportedChartStyles,e.watchedSupportedChartStyles),i(this.symbolNamesList,e.symbolNamesList),this.watchedSymbol.subscribe((t=>{this._boundChartWidget&&this._boundChartWidget.hasModel()&&this._mainSeries().symbolSameAsCurrent(t)||this.proSymbol.setValue(t)}),{callWithLast:!0})}mute(t){this._muted=t}bindToChartWidgetCollection(t){this.unbindFromChartWidgetCollection(),this._chartWidgetCollection=t,this._activeChartWidget=t.activeChartWidget.spawn(),this._activeChartWidget.subscribe(this.updateBoundChartWidget),this._linkingGroupCharts=t.linkingGroupsCharts(this._groupIndex).spawn(),this._linkingGroupCharts.subscribe(this._updateAllGroupChartWidgets),this.updateBoundChartWidget(),this._updateAllGroupChartWidgets()}unbindFromChartWidgetCollection(){var t,e,s;this.unbindFromChartWidget(),this._chartWidgetCollection=null,null===(t=this._activeChartWidget)||void 0===t||t.destroy(),this._activeChartWidget=null,null===(e=this._linkingGroupCharts)||void 0===e||e.destroy(),this._linkingGroupCharts=null,null===(s=this._destroySymbolIntervalPropertySubscriptions)||void 0===s||s.call(this)}bindToChartWidget(t){if(this.unbindFromChartWidget(),this._boundChartWidget=t,t.hasModel())return void this._onChartModelCreated(t.model());t.modelCreated().subscribe(this,this._onChartModelCreated,!0),this._chartWidgetBindingState=1;const e=t.properties().childs().mainSeriesProperties.childs();this.watchedSymbol.setValue(e.symbol.value()),this.watchedInterval.setValue(e.interval.value()),this._boundChartWidget.linkingGroupIndex().subscribe(this.updateBoundChartWidget)}unbindFromChartWidget(){const t=this._boundChartWidget;if(null!==t){switch(this._chartWidgetBindingState){case 1:t.modelCreated().unsubscribeAll(this);break;case 2:this.watchedSymbol.unsubscribe(this._watchedSymbolListenerBound);const e=this._mainSeries().dataEvents();e.symbolResolved().unsubscribeAll(this),e.symbolError().unsubscribeAll(this),this.watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this.watchedSymbol.writeLock}t.linkingGroupIndex().unsubscribe(this.updateBoundChartWidget),this._boundChartWidget=null,this._chartWidgetBindingState=0}}boundChartWidget(){return this._boundChartWidget}_mainSeries(){if(!this._boundChartWidget)throw new Error("ChartWidget is undefined");return this._boundChartWidget.model().mainSeries()}_watchedSymbolListener(t){this._needApplySymbol(t)&&!this._muted&&(this._setGroupSymbol(t),this._sendSnowplowAnalytics())}_updateSymbolByProperty(t,e){const s=this._symbolLock();s&&this._needApplySymbol(e)&&!this._muted&&this._setGroupSymbol(e),(s||t===this._boundChartWidget)&&this.watchedSymbol.setValue(e)}_watchedIntervalListener(t){const e=r.Interval.normalize(t);e&&this._needApplyInterval(e)&&!this._muted&&this._setGroupInterval(e)}_updateIntervalByProperty(t,e){const s=this._intervalLock(),i=r.Interval.normalize(e) ;s&&i&&this._needApplyInterval(i)&&!this._muted&&this._setGroupInterval(i),(s||t===this._boundChartWidget)&&this.watchedInterval.setValue(null!=i?i:e)}_sendSnowplowAnalytics(){if(window.user.do_not_track)return;const t=this._mainSeries(),e=()=>{t.dataEvents().symbolResolved().unsubscribe(this,s)},s=s=>{(0,d.getTracker)().then((t=>{if(null===t)return;const e=(0,o.ensureNotNull)(this._chartWidgetCollection),i=e.layout.value(),a=e.metaInfo.uid.value()||"";t.trackChartSymbols(s.pro_name,s.type,i,a)})),t.dataEvents().symbolError().unsubscribe(this,e)};t.dataEvents().symbolResolved().subscribe(this,s,!0),t.dataEvents().symbolError().subscribe(this,e,!0)}_updateSeriesSymbolInfo(){this.seriesShortSymbol.setValue((0,o.ensureNotNull)(this._boundChartWidget).getSymbol(!0));const t=this._mainSeries().symbolInfo();if(t){const e=t.pro_name||!1;this.proSymbol.setValue(e||this.watchedSymbol.value()),this.ensuredProSymbol.setValue(this.proSymbol.value()),t.aliases&&this.symbolNamesList.setValue(t.aliases);let s=(0,c.allChartStyles)();(0,n.isCloseBasedSymbol)(t)&&(s=s.filter((t=>(0,n.isSingleValueBasedStyle)(t)))),this.watchedSupportedChartStyles.setValue(s),this.watchedIntraday.setValue(!!t.has_intraday),this.watchedSeconds.setValue(!!t.has_seconds),this.watchedTicks.setValue(!(0,n.isCloseBasedSymbol)(t)&&!!t["is-tickbars-available"]),this.watchedRange.setValue(!(0,n.isCloseBasedSymbol)(t));const i=t.data_frequency?t.data_frequency:void 0;this.watchedDataFrequencyResolution.setValue(i)}else this.watchedIntraday.setValue(!1),this.watchedSeconds.setValue(!1),this.watchedTicks.setValue(!1),this.watchedRange.setValue(!1),this._mainSeries().isFailed()&&this.ensuredProSymbol.setValue(this.proSymbol.value())}_onChartModelCreated(t){if(!this._boundChartWidget)throw new Error("ChartWidget is undefined");this._chartWidgetBindingState=2,this.watchedSymbol.setValue(this._boundChartWidget.symbolWV().value()),this.watchedSymbol.subscribe(this._watchedSymbolListenerBound);const e=t.mainSeries().dataEvents();e.symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),e.symbolError().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),this.watchedInterval.setValue(this._boundChartWidget.resolutionWV().value()),this.watchedInterval.subscribe(this._watchedIntervalListenerBound),this._boundChartWidget.readOnly()&&(this.watchedSymbol.writeLock=!0)}_chartToBind(){var t;const e=this._chartWidgetCollection;return null===e?null:e.activeChartWidget.value().linkingGroupIndex().value()===this._groupIndex?e.activeChartWidget.value():null!==this._boundChartWidget&&this._boundChartWidget.linkingGroupIndex().value()===this._groupIndex?this._boundChartWidget:null!==(t=e.getAll().find((t=>t.linkingGroupIndex().value()===this._groupIndex)))&&void 0!==t?t:null}_symbolLock(){var t;return!!(null===(t=this._chartWidgetCollection)||void 0===t?void 0:t.lock.symbol.value())}_intervalLock(){var t;return!!(null===(t=this._chartWidgetCollection)||void 0===t?void 0:t.lock.interval.value())}_chartsForLock(t){ return(0===t?this._symbolLock():this._intervalLock())?(0,o.ensureNotNull)(this._linkingGroupCharts).value():this._boundChartWidget?[this._boundChartWidget]:[]}_setGroupSymbol(t){this.mute(!0),this._symbolLock()?(0,o.ensureNotNull)(this._chartWidgetCollection).setSymbol(t,this._groupIndex):(0,o.ensureNotNull)(this._boundChartWidget).setSymbol(t),this.mute(!1)}_needApplySymbol(t){const e=this._chartsForLock(0),s=e.find((e=>e.hasModel()&&e.model().mainSeries().symbolInfo()&&e.model().mainSeries().symbolSameAsResolved(t)));if(s){const t=s.model().mainSeries();if(e.every((e=>t.symbolSameAsResolved(e.symbolWV().value()))))return!1}return e.some((e=>e.symbolWV().value()!==t))}_setGroupInterval(t){this.mute(!0),this._intervalLock()?(0,o.ensureNotNull)(this._chartWidgetCollection).setResolution(t,this._groupIndex):(0,o.ensureNotNull)(this._boundChartWidget).setResolution(t),this.mute(!1)}_needApplyInterval(t){return this._chartsForLock(1).some((e=>!r.Interval.isEqual(e.resolutionWV().value(),t)))}}const p=new class{constructor(){this._watchedSymbol=new a.WatchedValue,this._seriesShortSymbol=new a.WatchedValue,this._proSymbol=new a.WatchedValue,this._ensuredProSymbol=new a.WatchedValue,this._watchedInterval=new a.WatchedValue,this._watchedIntraday=new a.WatchedValue,this._watchedSeconds=new a.WatchedValue,this._watchedTicks=new a.WatchedValue,this._watchedDataFrequencyResolution=new a.WatchedValue,this._watchedRange=new a.WatchedValue,this._watchedSupportedResolutions=new a.WatchedValue,this._watchedSupportedChartStyles=new a.WatchedValue([]),this._symbolNamesList=new a.WatchedValue,this._chartWidgetCollection=null,this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._searchChartsLoadDebounced=null,this._selfEmit=!1,this._preventFeedBySymbol=!1,this._feedBySymbolDebounceCounter=0,this._linkingGroups=new Map,this._activeLinkingGroup=new a.WatchedValue,this._activeLinkingGroupIndex=null,this._updateLinkingGroups=()=>{(0,o.ensureNotNull)(this._chartWidgetCollection).allLinkingGroups().value().forEach((t=>this._linkingGroup(t))),this._linkingGroups.forEach((t=>t.updateBoundChartWidget()))},this._activeLinkingGroup.setValue(this._linkingGroup(null));const t=(t,e)=>{t.subscribe((t=>e().setValue(t)),{callWithLast:!0})};t(this._watchedSymbol,(()=>this._activeLinkingGroup.value().watchedSymbol)),t(this._seriesShortSymbol,(()=>this._activeLinkingGroup.value().seriesShortSymbol)),t(this._proSymbol,(()=>this._activeLinkingGroup.value().proSymbol)),t(this._ensuredProSymbol,(()=>this._activeLinkingGroup.value().ensuredProSymbol)),t(this._watchedInterval,(()=>this._activeLinkingGroup.value().watchedInterval)),t(this._watchedIntraday,(()=>this._activeLinkingGroup.value().watchedIntraday)),t(this._watchedSeconds,(()=>this._activeLinkingGroup.value().watchedSeconds)),t(this._watchedTicks,(()=>this._activeLinkingGroup.value().watchedTicks)),t(this._watchedDataFrequencyResolution,(()=>this._activeLinkingGroup.value().watchedDataFrequencyResolution)), t(this._watchedRange,(()=>this._activeLinkingGroup.value().watchedRange)),t(this._watchedSupportedResolutions,(()=>this._activeLinkingGroup.value().watchedSupportedResolutions)),t(this._watchedSupportedChartStyles,(()=>this._activeLinkingGroup.value().watchedSupportedChartStyles)),t(this._symbolNamesList,(()=>this._activeLinkingGroup.value().symbolNamesList));const e=t=>{this._watchedSymbol.setValue(t.watchedSymbol.value()),this._seriesShortSymbol.setValue(t.seriesShortSymbol.value()),this._proSymbol.setValue(t.proSymbol.value()),this._ensuredProSymbol.setValue(t.ensuredProSymbol.value()),this._watchedInterval.setValue(t.watchedInterval.value()),this._watchedIntraday.setValue(t.watchedIntraday.value()),this._watchedSeconds.setValue(t.watchedSeconds.value()),this._watchedTicks.setValue(t.watchedTicks.value()),this._watchedDataFrequencyResolution.setValue(t.watchedDataFrequencyResolution.value()),this._watchedRange.setValue(t.watchedRange.value()),this._watchedSupportedResolutions.setValue(t.watchedSupportedResolutions.value()),this._watchedSupportedChartStyles.setValue(t.watchedSupportedChartStyles.value()),this._symbolNamesList.setValue(t.symbolNamesList.value())};this._activeLinkingGroup.subscribe(e),e(this._activeLinkingGroup.value()),(0,_.setMuteLinkingGroup)(((t,e)=>{this._linkingGroup(t).mute(e)}))}get symbol(){return this._watchedSymbol}get proSymbol(){return this._proSymbol.readonly()}get ensuredProSymbol(){return this._ensuredProSymbol.readonly()}get symbolNamesList(){return this._symbolNamesList.readonly()}get seriesShortSymbol(){return this._seriesShortSymbol.readonly()}get interval(){return this._watchedInterval}get intraday(){return this._watchedIntraday.readonly()}get seconds(){return this._watchedSeconds.readonly()}get ticks(){return this._watchedTicks.readonly()}get range(){return this._watchedRange.readonly()}get supportedResolutions(){return this._watchedSupportedResolutions.readonly()}get supportedChartStyles(){return this._watchedSupportedChartStyles.readonly()}get preventFeedBySymbol(){return this._preventFeedBySymbol}get dataFrequencyResolution(){return this._watchedDataFrequencyResolution.readonly()}activeLinkingGroup(){return this._activeLinkingGroup.readonly()}getChartWidget(){return this.activeLinkingGroup().value().boundChartWidget()}bindToChartWidgetCollection(t){var e;null===(e=this._chartWidgetCollection)||void 0===e||e.onAboutToBeDestroyed.unsubscribeAll(this),this._unbindFromChartWidgetCollection(),this._chartWidgetCollection=t,this._chartWidgetCollection.onAboutToBeDestroyed.subscribe(this,this._unbindFromChartWidgetCollection),this._chartWidgetCollection.allLinkingGroups().subscribe(this._updateLinkingGroups),this._updateLinkingGroups(),this._activeLinkingGroupIndex=t.activeLinkingGroup().spawn(),this._activeLinkingGroupIndex.subscribe((t=>{this._activeLinkingGroup.setValue(this._linkingGroup(t))}),{callWithLast:!0}),this._linkingGroups.forEach((e=>e.bindToChartWidgetCollection(t)))}bindToSearchCharts(t){this.unbindFromSearchCharts(),this._searchCharts=t, t.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),t.loadingSymbol.subscribe((t=>{!1===t&&(this._feedBySymbolDebounceCounter=0)})),this._watchedSymbol.subscribe(this._onSymbolLinkBound)}unbindFromSearchCharts(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)}setPreventFeedBySymbol(t){this._preventFeedBySymbol=t}setSymbolAndLogInitiator(t,e,s){(this.symbol.value()!==t||s)&&(b.logInfo(`Change linking symbol to ${t}, initiator: ${e}`),this.symbol.setValue(t,s))}_onSearchBySymbol(t){if(!t.resolved_symbol)throw new Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(t.resolved_symbol),this._selfEmit=!1}_onSymbolLink(t){if(!this._selfEmit){if(!this._searchCharts){const t="No search charts defined";throw b.logError(t),new Error(t)}this._preventFeedBySymbol||this._loadSearchCharts(t)}}_loadSearchCharts(t){if(!this._searchCharts){const t="No search charts defined";throw b.logError(t),new Error(t)}if(this._searchChartsLoadDebounced)return void(this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced(t)));const e=t=>this._searchCharts?(!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=(0,i.default)(e,2e3),this._searchChartsLoadDebounced(t)):this._searchChartsLoadDebounced=null,this._searchCharts.feedBySymbol.call(this._searchCharts,t)):()=>{};!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=(0,i.default)(e,2e3),this._searchChartsLoadDebounced(t)):this._searchCharts.feedBySymbol(t)}_linkingGroup(t){let e=this._linkingGroups.get(t);if(void 0===e){const s={watchedSymbol:this._watchedSymbol,seriesShortSymbol:this._seriesShortSymbol,proSymbol:this._proSymbol,ensuredProSymbol:this._ensuredProSymbol,watchedInterval:this._watchedInterval,watchedIntraday:this._watchedIntraday,watchedSeconds:this._watchedSeconds,watchedTicks:this._watchedTicks,watchedDataFrequencyResolution:this._watchedDataFrequencyResolution,watchedRange:this._watchedRange,watchedSupportedResolutions:this._watchedSupportedResolutions,watchedSupportedChartStyles:this._watchedSupportedChartStyles,symbolNamesList:this._symbolNamesList};e=new m(t,s,(()=>this._activeLinkingGroup.value())),this._linkingGroups.set(t,e),this._chartWidgetCollection&&e.bindToChartWidgetCollection(this._chartWidgetCollection)}return e}_unbindFromChartWidgetCollection(){var t;null!==this._chartWidgetCollection&&(null===(t=this._activeLinkingGroupIndex)||void 0===t||t.destroy(),this._activeLinkingGroupIndex=null,this._linkingGroups.forEach((t=>t.unbindFromChartWidgetCollection())),this._chartWidgetCollection.allLinkingGroups().unsubscribe(this._updateLinkingGroups),this._chartWidgetCollection=null)}};{const t=(0, u.getFreshInitData)().symbolInfo,e=t?t.pro_symbol:h.getValue("editchart.model.symbol",window.DEFAULT_SYMBOL);p.setSymbolAndLogInitiator(e,"initial data")}window.TradingViewApi||(window.TradingViewApi={linking:p})},49437:(t,e,s)=>{"use strict";const{getLogger:i}=s(201089),o=i("TVLocalStorage");var a=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){delete this.isAvailable,delete this.localStorage}this._updateLength();try{this._report()}catch(t){}};a.prototype._report=function(){if(this.isAvailable){const t=10,e=[];for(let t=0;te.length-t.length));const s=e.slice(0,t);e.sort(((t,e)=>e.key.length-t.key.length));const i=e.slice(0,t);o.logNormal(`Total amount of keys in Local Storage: ${this.length}`),o.logNormal(`Top ${t} keys with longest values: ${JSON.stringify(s)}`),o.logNormal(`Top ${t} longest key names: ${JSON.stringify(i)}`);try{navigator.storage.estimate().then((t=>{o.logNormal(`Storage estimate: ${JSON.stringify(t)}`)}))}catch(t){}}},a.prototype.length=0,a.prototype.isAvailable=!1,a.prototype.localStorage={"tvlocalstorage.available":"false"},a.prototype._updateLength=function(){if(this.isAvailable)this.length=this.localStorage.length;else{var t,e=0;for(t in this.localStorage)this.localStorage.hasOwnProperty(t)&&e++;this.length=e}},a.prototype.key=function(t){return this.isAvailable?this.localStorage.key(t):Object.keys(this.localStorage)[t]},a.prototype.getItem=function(t){return this.isAvailable?this.localStorage.getItem(t):void 0===this.localStorage[t]?null:this.localStorage[t]},a.prototype.setItem=function(t,e){this.isAvailable?this.localStorage.setItem(t,e):this.localStorage[t]=e,this._updateLength()},a.prototype.removeItem=function(t){this.isAvailable?this.localStorage.removeItem(t):delete this.localStorage[t],this._updateLength()},a.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()};var r=function(t){this.storage=t};r.prototype.getItem=function(t){return Promise.resolve(this.storage.getItem(t))},r.prototype.setItem=function(t,e){return Promise.resolve(this.storage.setItem(t,e))},window.TVLocalStorage=new a,window.TVLocalStorageAsync=new r(window.TVLocalStorage),t.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},224743:(t,e,s)=>{"use strict";s.d(e,{globalCloseDelegate:()=>i,globalCloseMenu:()=>o});const i=new(s(707957).Delegate);function o(){i.fire()}},707621:(t,e,s)=>{"use strict";s.d(e,{allChartStyles:()=>r});var i=s(244842),o=s(125226);const a=(0,s(638456).onWidget)();function r(){return function(){const t=[0,1,9,13,2,14,15,3,16,10];return t.push(12),a||t.push(17),a||t.push(18),(0,o.isFeatureEnabled)("vpsession_chart_type")&&!a&&t.push(20),a||t.push(19),t}().concat(function(){const t=[8];return i.enabled("japanese_chart_styles")&&(t.push(4,7,5,6),t.push(11)),t}())}},624444:(t,e,s)=>{ "use strict";s.d(e,{PriceFormatter:()=>n});var i=s(305138),o=s(998454),a=s(389137),r=s(839878);class n{constructor(t={}){this.type="price";const{minMove2:e,fractional:s,variableMinTick:n,ignoreMinMove:l,ignoreLocaleNumberFormat:h}=t,u=!t.minMove||l?1:t.minMove,d=(0,a.isNumber)(t.priceScale)&&(0,a.isInteger)(t.priceScale)?t.priceScale:100,c=(0,r.calculateDecimal)(d,u,s,e),_={...t,minMove:u,priceScale:d,fractionalLength:c};if(d<0)throw new TypeError("invalid base");this._priceScale=d,this._minMove=u,this._minMove2=e,this._fractional=s,this._variableMinTick=n,this._ignoreMinMove=l,this._fractionalLength=c,this._ignoreLocaleNumberFormat=h,this._implementation=s?new o.FractionalPriceFormatterImpl(_):new i.DecimalPriceFormatterImpl(_)}isFractional(){return!!this._fractional}state(){return{minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale,variableMinTick:this._variableMinTick,ignoreMinMove:this._ignoreMinMove,fractional:this._fractional}}formatChange(t,e,s){return this._implementation.formatImpl(t-e,{...s,variableMinTickDataPrice:Math.min(Math.abs(t),Math.abs(e))})}format(t,e){return this._implementation.formatImpl(t,e)}parse(t,e){return this._implementation.parse(t,e)}hasForexAdditionalPrecision(){return this._implementation.hasForexAdditionalPrecision()}static serialize(t){return t.state()}static deserialize(t){return new n(t)}}},960337:(t,e,s)=>{"use strict";s.d(e,{createGoProDialog:()=>n});var i=s(638456);const o=new Set,a=[],r=new Promise((t=>{window.addEventListener("load",(()=>{setTimeout((()=>{t()}),3e3)})),setTimeout((()=>{t()}),3e3)}));async function n(t){var e;if(await r,a.forEach((e=>{e(t.feature)})),o.has(t.feature))return;if((0,i.isSymphonyEmbed)()){const e=await Promise.all([s.e(43387),s.e(69749),s.e(16600),s.e(10890),s.e(96384),s.e(44581)]).then(s.bind(s,750801));t.actionsOverride=e.symphonyActions,t.hideLimitTable=!0}const n=await Promise.all([s.e(29178),s.e(66681),s.e(32662),s.e(43387),s.e(14),s.e(36827),s.e(37657),s.e(34422),s.e(63244),s.e(95069),s.e(92469),s.e(36748),s.e(85317),s.e(49542),s.e(97485),s.e(10890),s.e(55980),s.e(18612),s.e(70490),s.e(24306),s.e(90385),s.e(59255),s.e(84450),s.e(42198),s.e(8145),s.e(37161),s.e(5246)]).then(s.bind(s,877671));await(null===(e=window.pro)||void 0===e?void 0:e.ensureValidShopConf()),n.renderGoproDialog(t)}window.TradingView.createGoProDialog=n},392896:(t,e,s)=>{"use strict";s.d(e,{paidAccountCheck:()=>a});var i=s(49437);const o=(0,s(201089).getLogger)("PaidAccountCheck");async function a(t){const{onlyCheck:e,successButtonText:a,isNeedCancelButton:r}=t,n=window.user,l=i.TVLocalStorage.getItem("previous_username");if(n&&window.is_authenticated&&!n.is_pro&&l){const{getProfile:t}=await s.e(90254).then(s.bind(s,411858));try{const i=await t(l);if(Boolean(i.pro_plan)){if(e)return l;{const{showWrongAccountDialog:t}=await Promise.all([s.e(67469),s.e(12019)]).then(s.bind(s,984799));return t({userName:l,isNeedCancelButton:r,successButtonText:a})}}}catch(t){o.logError(t.message)}}return!1}},337779:(t,e,s)=>{"use strict";function i(t){ return t.reduce((function(t,e,s){return~t.indexOf(e)||t.push(e),t}),[])}s.r(e),s.d(e,{uniq:()=>i})}}]);