webpackJsonp([29],[function(e,t,i){"use strict";(function(e){function n(e,t){a.call(this),this._linetool=e,this._pointindex=t,this._model=e._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0,this._renderer=new l}function o(e,t){var i,r,s;if(c.call(this),this._model=e,this._properties=t,this._pointAdded=new v,this._pointChanged=new v,this._onRestoringFactoryDefaults=new v,this._onTemplateApplying=new v,this._onTemplateApplied=new v,t.visible&&t.frozen||this._properties.merge(defaults("linetool")),i=defaults("linetoolvisibilities"),t.intervalsVisibilities)for(r in i.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,i.intervalsVisibilities[r]);else this._properties.merge(i);if(this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.symbol||this._properties.merge({symbol:e.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:e.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,o.prototype.calcIsActualSymbol),this._properties.listeners().subscribe(this,this.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(s=0;s<this.pointsCount();s++)this.m_priceAxisViews.push(this.createPriceAxisView(s)),this.m_timeAxisViews.push(new n(this,s));this._properties.visible.listeners().subscribe(this,function(e){e.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0),this._syncStateExclusions=[]}var r=i(6).Point,s=i(169).LineToolPriceAxisView,a=i(170).TimeAxisView,l=i(171).TimeAxisViewRenderer,c=i(28).DataSource,h=i(32),u=i(15),d=u.Interval,p=u.ResolutionKind,_=i(61).getServerInterval,f=i(172).AbbreviatedDateTimeFormatter,m=i(534),y=i(18),g=i(4).getLogger("Chart.LineDataSource"),v=i(8),S=i(2).propertyPages;inherit(n,a),n.prototype.setActive=function(e){this._active=e},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i;this._visible=!1,this._model.timeScale().isEmpty()||(e=this._linetool.axisPoints(),e.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",
t=e[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(t),i=this._model.timeScale().indexToUserTime(t),i&&(this._text=new f(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},n.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var e={text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,visible:this._visible};return this._renderer.setData(e),this._renderer},inherit(o,c),o.prototype.pointAdded=function(){return this._pointAdded},o.prototype.pointChanged=function(){return this._pointChanged},o.PointPriceProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i,t.pointAdded().subscribe(this,function(e){this._pointIndex===e&&this._listeners.fire(this)}),t.pointChanged().subscribe(this,function(e){this._pointIndex===e&&this._listeners.fire(this)})},inherit(o.PointPriceProperty,e),o.prototype.enableCurrentIntervalVisibility=function(){var e,t,i,n,o,r,s,a=d.parse(this._model.mainSeries().interval());a.isSeconds()&&(a.multiplier()<60?(this.properties().intervalsVisibilities.seconds.setValue(!0),e=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsFrom.setValue(e),t=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsTo.setValue(t)):a=new d(p.Minutes,a.multiplier()/60)),a.isMinutes()&&(a.multiplier()<60?(this.properties().intervalsVisibilities.minutes.setValue(!0),e=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesFrom.setValue(e),t=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesTo.setValue(t)):(i=Math.floor(a.multiplier()/60),this.properties().intervalsVisibilities.hours.setValue(!0),n=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),i),this.properties().intervalsVisibilities.hoursFrom.setValue(n),o=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),i),this.properties().intervalsVisibilities.hoursTo.setValue(o))),a.isDays()&&(this.properties().intervalsVisibilities.days.setValue(!0),r=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.daysFrom.setValue(r),s=Math.max(this.properties().intervalsVisibilities.daysTo.value(),a.multiplier()),this.properties().intervalsVisibilities.daysTo.setValue(s)),a.isWeeks()&&this.properties().intervalsVisibilities.weeks.setValue(!0),a.isMonths()&&this.properties().intervalsVisibilities.months.setValue(!0)},o.prototype.getType=function(){return TradingView.className(this.constructor)},o.prototype.getConstructor=function(){return this._constructor||null},o.prototype.isActualSymbol=function(){return this._isActualSymbol},
o.prototype.isActualInterval=function(){return this._isActualInterval},o.prototype.isSavedInChart=function(e){return!this.customization.disableSave},o.prototype.setSavingInChartEnabled=function(e){this.customization.disableSave=!e},o.prototype.showInObjectTree=function(){return this.customization.showInObjectsTree},o.prototype.setShowInObjectsTreeEnabled=function(e){this.customization.showInObjectsTree=e},o.prototype.isSelectionEnabled=function(){return!this.customization.disableSelection},o.prototype.setSelectionEnabled=function(e){this.customization.disableSelection=!e},o.prototype.visibilityKeyByInterval=function(e){var t,i=d.parse(e);return o.IntervalsVisibilities.forEach(function(e){e.kind===i.kind()&&e.from<=i.multiplier()&&e.to>=i.multiplier()&&(t=e.key)}),t},o.prototype.calcIsActualSymbol=function(){var e,t=this._properties.symbol,i=this._model.mainSeries(),n=t.value();this._isActualSymbol=i.symbolSameAsCurrent(n),this._isActualSymbol&&(e=i.symbol(),n!==e&&(g.logWarn('Possible drawing "migrating" detected from "'+n+'" to "'+e+'"'),g.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),g.logWarn(Error().stack)),t.setValue(e)),this.calcIsActualInterval()},o.prototype.calcIsActualInterval=function(){var e,t,i,n,o,r=this._properties,s=this._model.mainSeries(),a=d.parse(s.interval()),l=r.intervalsVisibilities;this._isActualInterval=!1,a.isSeconds()&&a.multiplier()<60&&(e=l.seconds.value(),t=l.secondsFrom.value(),i=l.secondsTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isSeconds()&&a.multiplier()>=60&&(n=Math.floor(a.multiplier()/60),e=l.minutes.value(),t=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=e&&n>=t&&n<=i),a.isMinutes()&&a.multiplier()<60&&(e=l.minutes.value(),t=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isMinutes()&&a.multiplier()>=60&&(o=Math.floor(a.multiplier()/60),e=l.hours.value(),t=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=e&&o>=t&&o<=i),a.isHours()&&(e=l.hours.value(),t=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isDays()&&(e=l.days.value(),t=l.daysFrom.value(),i=l.daysTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isWeeks()&&(this._isActualInterval=l.weeks.value()),a.isMonths()&&(this._isActualInterval=l.months.value()),a.isRange()&&(this._isActualInterval=l.ranges.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},o.PointPriceProperty.prototype.value=function(){var e=this._lineSource.points()[this._pointIndex].price,t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},o.PointPriceProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),
this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},o.PointIndexProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i},inherit(o.PointIndexProperty,e),o.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},o.PointIndexProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._syncMultichartState=function(){var e={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&h.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:e})},o.prototype._createPointProperty=function(e){var t,i=this._properties.points;i.addProperty(e),t=i[e],t.addChild("price",new o.PointPriceProperty(this,e)),t.addChild("bar",new o.PointIndexProperty(this,e))},o.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var e=0;e<this.pointsCount();e++)this._createPointProperty(e)},o.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},o.prototype.symbol=function(){return this._properties.symbol.value()},o.prototype.properties=function(){return this._properties},o.prototype.isSavedInStudyTemplates=function(){return!1},o.prototype.state=function(e){var t=TradingView.className(this.constructor),i={type:t,id:this.id(),state:this.properties().state(),points:this._timePoint,zorder:this.zorder(),linkKey:this.linkKey};return i.state._isActualInterval=this.isActualInterval(),delete i.state.points,e&&(i.indexes=this._points),this.ownerSource()&&(i.ownerSource=this.ownerSource().id()),this.isFixed()&&(i.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(i.version=this.version),this.hasAlert.value()&&(i.alertId=this._alertId),i},o.prototype.template=function(){var e=this.properties().state();return delete e.points,delete e.symbol,delete e.symbolInfo,e},o.prototype.applyTemplate=function(e){delete e.symbolInfo,this._onTemplateApplying.fire(e);var t=this.properties();t.merge(e),t.saveDefaults(),this.propertiesChanged(),this.calcIsActualSymbol(),this.updateAllViews(),this.model().invalidate(new y(y.LIGHT_UPDATE)),this._onTemplateApplied.fire()},o.prototype.restoreFactoryDefaults=function(){this.properties().restoreFactoryDefaults(),this._onRestoringFactoryDefaults.fire(),this.model().updateSource(this)},o.prototype.clearData=function(){this._points=[]},o.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId},o.prototype.stop=function(){this.clearServerPoints(),
this.hasAlert.value()&&TradingView.alertsDispatcher&&TradingView.alertsDispatcher.deleteAlert(this._alertId)},o.prototype.isStarted=function(){return null!==this._currentPointsetId},o.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=null,this.createServerPoints())},o.prototype.tryCreateServerPoints=function(){this.isFixed()||null===this._currentPointsetId&&this.createServerPoints()},o.prototype.normalizePoint=function(e){var t=this._model.timeScale().normalizeBarIndex(e.index);return t.price=e.price,t},o.prototype.normalizePoints=function(){var e,t;for(this._timePoint=[],e=0;e<this._points.length;e++){if(t=this._model.timeScale().normalizeBarIndex(this._points[e].index),!t.time_t){this._timePoint=[];break}t.price=this._points[e].price,this._timePoint.push(t)}},o.prototype.denormalizeTimePoints=function(){var e,t,i=[];for(e=0;e<this._timePoint.length;e++){if(void 0===(t=this._model.timeScale().denormalizeTimePoint(this._timePoint[e]))){i=[];break}i.push({index:t,price:this._timePoint[e].price})}i.length>0&&(this._points=i)},o.prototype.restorePoints=function(e,t,i){this._timePoint=e,this._points=t,i||this.denormalizeTimePoints()},o.prototype.restoreExternalPoints=function(e){if(this.properties().interval.setValue(e.interval),this._timePoint=e.points,this.denormalizeTimePoints(),!this.isActualSymbol())return void this.clearServerPoints();this.createServerPoints()},o.prototype.restorePositionPercents=function(e){this._positionPercents=e},o.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},o.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var e=this.properties().state(this._syncStateExclusions);delete e.interval,h.changeLineStyle({linkKey:this.linkKey,state:e,model:this._model})}},o.prototype.points=function(){var e,t,i=[];for(e=0;e<this._points.length;e++)t=this._points[e],i.push({index:t.index,price:t.price,time:t.time});return this._lastPoint&&i.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time}),this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(i),i},o.prototype.axisPoints=function(){return this.points()},o.prototype.fixedPoints=function(){var e,t,i,n,o=[];if(this._positionPercents&&!this.priceScale().isEmpty())for(e=0;e<this._positionPercents.length;e++)t=this._positionPercents[e],i=this._model.timeScale().width()*t.x,n=this.priceScale().height()*t.y,o.push(new r(i,n));else for(e=0;e<this._fixedPoints.length;e++)o.push(this._fixedPoints[e].clone());return this._lastPoint&&o.push(this._lastPoint.clone()),this._currentMovingPoint&&this._startMovingPoint&&this.correctFixedPoints(o),o},o.prototype._preparePoint=function(e,t){var i=e;return t&&t.shift&&this.points().length>=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},o.prototype.addPoint=function(e,t,i){var n=this._preparePoint(e,t);return this._addPointIntenal(n,t,i)},o.prototype._addPointIntenal=function(e,t,i){
this._points.push(e);var n=this._points.length===this.pointsCount();return n?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),n},o.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},o.prototype.calcPositionPercents=function(){var e,t,i,n;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],e=0;e<this._fixedPoints.length;e++)t=this._fixedPoints[0],i=t.x/this._model.timeScale().width(),n=t.y/this.priceScale().height(),this._positionPercents.push({x:i,y:n});return this._positionPercents},o.prototype.calcMiddlePoint=function(e,t){return new r((e.x+t.x)/2,(e.y+t.y)/2)},o.prototype.getPointByPosition=function(e,t,i,n){return[t,i,n][e]},o.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()},o.prototype.onData=function(e){e.params.customId===this.currentPointsetId()&&this._onPointsetUpdated(e.params.plots)},o.prototype._onPointsetUpdated=function(e){var t,i,n,o,r,s;if(0!==e.length){for(t=0;t<e.length;t++)i=e[t],n=this._timePoint[i.index],o=i.value[0],r=new Date(1e3*i.value[1]),s={index:o,time:r,price:n.price},this._points.length<=i.index?(this._points.push(s),this._pointAdded.fire(this._points.length-1)):(this._points[i.index]=s,this._pointChanged.fire(i.index));this.checkAlert&&this.checkAlert(),this.updateAllViewsAndRedraw()}},o.prototype.startChanging=function(e,t){e<this.m_priceAxisViews.length&&this.m_priceAxisViews[e].setActive(!0),e<this.m_timeAxisViews.length&&this.m_timeAxisViews[e].setActive(!0),this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype.setPoint=function(e,t,i){if(i&&i.shift&&this._properties.snapTo45Degrees){var n=0===e?1:e-1;this._snapPoint45Degree(t,this.points()[n])}this._points[e]=t,this._pointChanged.fire(e),this.normalizePoints()},o.prototype.startMoving=function(e){this.isFixed()&&this.restoreFixedPoints(),this._startMovingPoint=e,this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype.move=function(e){this._currentMovingPoint=e,this.updateAllViews()},o.prototype.correctPoints=function(e){var t,i,n=this._currentMovingPoint.index-this._startMovingPoint.index,o=this._currentMovingPoint.price-this._startMovingPoint.price;if(0===n&&0===o)return!1;for(t=0;t<e.length;t++)i=e[t],i.index+=n,i.price+=o,e[t]=i;return!0},o.prototype.correctFixedPoints=function(e){var t,i=this._currentMovingPoint.subtract(this._startMovingPoint);for(t=0;t<e.length;t++)e[t]=e[t].add(i)},o.prototype.endMoving=function(e){var t,i,n;if(this._properties.interval.setValue(this._model.mainSeries().interval()),t=!1,i=!1,this._currentMovingPoint&&this._startMovingPoint){if(t=this._currentMovingPoint.index!==this._startMovingPoint.index,i=this._currentMovingPoint.price!==this._startMovingPoint.price,
this.isFixed())this.correctFixedPoints(this._fixedPoints);else if(this.correctPoints(this._points))for(n=0;n<this._points.length;n++)this._pointChanged.fire(n);this._startMovingPoint=null,this._currentMovingPoint=null}if(this.isFixed())return this.calcPositionPercents(),void this.updateAllViews();this.normalizePoints(),this.updateAllViews(),t&&!e&&this.createServerPoints(),(i||t)&&this.synchronizeAlert(!this._alertUndoMode)},o.prototype.endChanging=function(e,t){var i;for(this._properties.interval.setValue(this._model.mainSeries().interval()),t||(this.normalizePoints(),this.createServerPoints()),i=0;i<this.m_priceAxisViews.length;i++)this.m_priceAxisViews[i].setActive(!1);for(i=0;i<this.m_timeAxisViews.length;i++)this.m_timeAxisViews[i].setActive(!1);this.synchronizeAlert(!e)},o.prototype.paneViews=function(e){var t,i;if(this.isSourceHidden())return null;for(t=[],i=this._paneViews.length-1;i>=0;--i)t.push(this._paneViews[i]);return t},o.prototype._setPaneViews=function(e){this._paneViews=e,this._model.invalidate(new y(y.LIGHT_UPDATE))},o.prototype.dataWindowView=function(){return null},o.prototype.statusView=function(){return null},o.prototype.isSourceHidden=function(){return!this._properties.visible.value()||h.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol},o.prototype.priceAxisViews=function(e,t){var i,n,o;return this.isSourceHidden()?null:-1!==e.dataSources().indexOf(this)&&t===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i<this.m_priceAxisViews.length?(n=this.m_priceAxisViews.slice(),o=n[i],n.splice(i,1),n.push(o),n):this.m_priceAxisViews):this.m_priceAxisViews:null},o.prototype.timeAxisViews=function(){var e,t,i;return this.isSourceHidden()?null:this._model.lineBeingEdited()===this?(e=this._model.linePointBeingEdited(),e<this.m_timeAxisViews.length?(t=this.m_timeAxisViews.slice(),i=t[e],t.splice(e,1),t.push(i),t):this.m_timeAxisViews):this.m_timeAxisViews},o.prototype.updateAllViews=function(){var e,t,i;if(!this._isActualSymbol)return null;if(!this._properties.visible.value())return null;if(null!==(e=this.paneViews()))for(t=e,i=0;i<t.length;i++)t[i].update();for(t=this.m_priceAxisViews,i=0;i<t.length;i++)t[i].update();for(t=this.m_timeAxisViews,i=0;i<t.length;i++)t[i].update()},o.prototype.setLastPoint=function(e,t){this._lastPoint=this._preparePoint(e,t),this.updateAllViews()},o.prototype.setLastFixedPoint=function(e){this._lastFixedPoint=e,this.updateAllViews()},o.prototype.title=function(){return"Line Tool"},o.prototype.name=function(){return"Line Tool"},o._pointSetId=1,o.prototype.start=function(){this.createServerPoints()},o.prototype.createServerPoints=function(){var e,t,i,n,r,s;if(!this._recursiveGuard&&this._isActualSymbol&&this._model.chartApi().connected()&&(this.clearServerPoints(),!this._model.timeScale().isEmpty()&&(0===this._timePoint.length&&this.normalizePoints(),0!==this._timePoint.length))){for(this._currentPointsetId=++o._pointSetId,e=this._model.mainSeries().symbolId(),t=[],
i=0;i<this._timePoint.length;i++)n=this._timePoint[i],t.push([n.time_t,n.offset]);r=_(this.properties().interval.value()),s=this,this._model.chartApi().createPointset(this.currentPointsetId(),"turnaround",e,r,t,function(e){s.onData(e)})}},o.prototype.clearServerPoints=function(){null!==this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null)},o.prototype.isBeingEdited=function(){return this===this._model.lineBeingEdited()||this===this._model.sourceBeingMoved},o.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()},o.prototype.isLocked=o.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()},o.prototype._tooltipFieldsHash={},o.prototype._tooltipFieldsOrder=["time","price","index","time0","price0","time1","price1","time2","price2","time3","price3","time4","price4","distance","term","pointsPerBar"],o.prototype._tooltipFieldsOrdered=null,o.prototype._formatTooltip=function(){return null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new m(this._tooltipFieldsHash,m.byOrder(this._tooltipFieldsOrder))),this._tooltipFieldsOrdered.array.filter(function(e){return null!==e.value&&""!==e.value}).map(function(e){return"<span>"+e.title+":</span> "+e.value}).join("<br />")},o.prototype.pointToScreenPoint=function(e){var t,i,n,o,s,a=this._model.timeScale(),l=this.priceScale(),c=this.ownerSource().firstValue();return!l||l.isEmpty()||a.isEmpty()||null==c?[new r(0,0),new r(0,0)]:(t=a.indexToCoordinate(e.index,!0),i=e.price,n=l.priceToCoordinate(i,c,!0),o=new r(t,n),t=a.indexToCoordinate(e.index,!1),n=l.priceToCoordinate(i,c,!1),s=new r(t,n),[o,s])},o.prototype.screenPointToPoint=function(e){var t,i=this._model.timeScale(),n=this.priceScale(),o=i.coordinateToIndex(e.x),r=this.ownerSource().firstValue();if(null!==r&&isFinite(r))return t=n.coordinateToPrice(e.y,r),{price:t,index:o}},o.prototype.tags=function(){return[this._constructor]},o.prototype._snapPoint45Degree=function(e,t,i){var n,o,r,s,a,l,c,h,u,d=this._model.timeScale(),p=d.indexToCoordinate(t.index),_=d.indexToCoordinate(e.index)-p,f=this.m_priceScale,m=t.price,y=e.price,g=this.ownerSource().firstValue(),v=f.priceToCoordinate(m,g),S=f.priceToCoordinate(y,g)-v,b=Math.round(Math.atan2(_,S)/Math.PI*4);2===Math.abs(b)?i||(e.price=m):0===Math.abs(b)||4===Math.abs(b)?i||(e.index=t.index):0===Math.abs(b)||4===Math.abs(b)?i||(e.index=t.index):(n=Math.sqrt(_*_+S*S),o=_<0?-1:1,r=S<0?-1:1,s=Math.max(Math.abs(S),Math.abs(_)),a=s*Math.sqrt(2),l=a/n,s/=l,c=Math.round(d.coordinateToIndex(p+s*o)),h=Math.abs(d.indexToCoordinate(c)-p),u=f.coordinateToPrice(v+h*r,g),e.index=c,e.price=u)},o.prototype.createPriceAxisView=function(e){return new s(this,{pointIndex:e})},o.prototype.version=1,o.prototype.alertId=function(){return this._alertId},o.prototype.setAlert=function(e,t){},o.prototype.flushAlert=function(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)},
o.prototype._processAlertHanders=function(e){var t,i,n,o=this;("unsubscribe"!==(e="subscribe"===e?"subscribe":"unsubscribe")||o._alertCallbacks)&&(i="subscribe"===e?"on":"off",t=o.properties(),n=o._alertCallbacks||{flush:o.flushAlert.bind(o),hovered:function(e,t){t?o._model.setHoveredSource(o):o._model.hoveredSource()===o&&o._model.setHoveredSource(null)},selected:function(e,t){t&&o._model.setSelectedSource(o)},synchronizeSilently:function(e){o.synchronizeAlert(!1)}},o._alertCallbacks||(o._alertCallbacks=n),o.getAlert().done(function(r){r&&(r[i]("destroy",n.flush),r[i]("change:hovered",n.hovered),r[i]("change:selected",n.selected),t.extendLeft&&t.extendLeft[e](o,n.synchronizeSilently),t.extendRight&&t.extendRight[e](o,n.synchronizeSilently))}))},o.prototype.editAlert=function(){},o.prototype.getAlert=function(e){var t,i=this;return e=e||{},t=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:t.resolve.bind(t),error:t.reject.bind(t),fromCache:e.fromCache}):g.logError("[Alerts] Can't get alert without alerts dispatcher"),t.promise()},o.prototype.synchronizeAlert=function(e){var t=this;t.hasAlert.value()&&setTimeout(function(){function i(){t._alertUndoMode=!0,s.undoToCheckpoint(t._undoCheckpointAlert),setTimeout(function(){t._alertUndoMode=!1,t.localAndServerAlersMismatch=!1},0)}function n(e){var i=e.get("description")!==e.defaultDescription(),n=e.get("extra"),o=n.alertSeries(),r=t._model.mainSeries().stateForAlert();"MainSeries"===o.type&&r.actualSymbol===o.actualSymbol&&(n.mainSeries(r),n.alertSeries(r)),e.set("resolution",t.stateForAlert().interval),n.drawing(t),i||e.setDefaultDescription(),t.localAndServerAlersMismatch=!0}function o(e){TradingView.alertsDispatcher.restartAlert(e,{success:function(){t.localAndServerAlersMismatch=!1},error:i,complete:function(){delete t._undoCheckpointAlert}})}var r,s=t._getUndoHistory();t._undoCheckpointAlert||t._alertUndoMode||(r=s.undoStack().pop(),t._undoCheckpointAlert=s.createUndoCheckpoint(),r&&s.undoStack().push(r)),t.getAlert().done(function(t){n(t),e&&o(t)}).fail(i)},0)},o.prototype._getUndoHistory=function(){return this._model._undoModel.undoHistory},o.prototype.stateForAlert=function(){var e,t;if(this.canHasAlert())return e=this.state(),e.id=this.idForAlert(),e.uniqueId=this.idForAlert(),e.title=this.title(),e.interval=this._model.mainSeries().interval(),t=this._getAlertPlots(),t&&(e.plots=t),e},o.prototype._getAlertPlots=function(){return null},o.prototype._linePointsToAlertPlot=function(e,t,i,n){if(2!==e.length)return g.logError("[Drawing Alert] Wrong points"),null;var o=this._model.timeScale();return!o||o.isEmpty()?null:{type:"LinePlot",title:t||this.title(),timestamp:o.indexToTimePoint(0),offset1:e[0].index,offset2:e[1].index,price1:e[0].price,price2:e[1].price,extendBackward:i||!1,extendForward:n||!1}},o.prototype.getAlertIsActive=function(e){this.getAlert({fromCache:!0}).done(function(t){e(!!t&&t.get("active"))}).fail(function(){e(!1)})},o.prototype.geometry=function(){var e=this,t=function(t){
var i=t.x/e._model.timeScale().width(),n=t.y/e.priceScale().height();return new r(i,n)};return this.points().map(function(i){var n=e.pointToScreenPoint(i)[0];return t(n)})},o.prototype.onlyYMoving=function(){return!1},o.prototype.model=function(){return this._model},o.prototype.isForcedDrawPriceAxisLabel=function(){return this.customization.forcePriceAxisLabel},o.prototype.getInputsPropertyPage=function(){return S.LineToolInputsPropertyPage},o.prototype.getVisibilitiesPropertyPage=function(){return S.LineToolVisibilitiesPropertyPage},o.prototype.getSourceIcon=function(){return{type:"loadSvg",svgId:"linetool."+this.getType()}},o.prototype.destroy=function(){this.stop()},t.LineToolPriceAxisView=s,t.LineDataSource=o}).call(t,i(13))},function(e,t,i){"use strict";function n(e,t){function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function o(e,t){var i,n,o={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&(o[i[n]]=e[i[n]]);return o}function r(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((n=n.apply(e,t||[])).next())})}function s(e,t){function i(e){return function(t){return n([e,t])}}function n(i){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[0,s.value]),i[0]){case 0:case 1:s=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){l.label=i[1];break}if(6===i[0]&&l.label<s[1]){l.label=s[1],s=i;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(i);break}s[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],r=0}finally{o=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var o,r,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}var a,l;t.c=n,i.d(t,"a",function(){return l}),t.e=o,t.b=r,t.d=s,a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},l=Object.assign||function(e){var t,i,n,o;for(i=1,n=arguments.length;i<n;i++){t=arguments[i];for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}},function(e,t,i){"use strict";function n(e,t){i.e(6).then(function(t){o.ChartStylesPropertyPage=i(704),o.LineToolABCDPatternStylesPropertyPage=i(705),o.LineToolArcStylesPropertyPage=i(706),
o.LineToolArrowMarkStylesPropertyPage=i(707),o.LineToolBalloonStylesPropertyPage=i(708),o.LineToolBarsPatternStylesPropertyPage=i(709).LineToolBarsPatternStylesPropertyPage,o.LineToolBezierStylesPropertyPage=i(710),o.LineToolBrushStylesPropertyPage=i(711),o.LineToolCalloutStylesPropertyPage=i(712),o.LineToolCircleLinesStylesPropertyPage=i(713),o.LineToolDateAndPriceRangeStylesPropertyPage=i(714),o.LineToolDateRangeStylesPropertyPage=i(715),o.LineToolDisjointAngleStylesPropertyPage=i(716),o.LineToolElliottStylesPropertyPage=i(717),o.LineToolEllipseStylesPropertyPage=i(718),o.LineToolFibChannelStylesPropertyPage=i(719),o.LineToolFibCirclesStylesPropertyPage=i(720),o.LineToolFibRetracementStylesPropertyPage=i(694),o.LineToolFibSpeedResistanceArcsStylesPropertyPage=i(721),o.LineToolFibSpeedResistanceFanStylesPropertyPage=i(722),o.LineToolFibSpiralStylesPropertyPage=i(723),o.LineToolFibTimeZoneStylesPropertyPage=i(724),o.LineToolFibWedgeStylesPropertyPage=i(725),o.LineToolFlatBottomStylesPropertyPage=i(726),o.LineToolGannComplexStylesPropertyPage=i(727).LineToolGannComplexStylesPropertyPage,o.LineToolGannFixedStylesPropertyPage=i(728).LineToolGannFixedStylesPropertyPage,o.LineToolGannFanStylesPropertyPage=i(729),o.LineToolGannSquareStylesPropertyPage=i(730),o.LineToolGhostFeedInputsPropertyPage=i(341).LineToolGhostFeedInputsPropertyPage,o.LineToolGhostFeedStylesPropertyPage=i(341).LineToolGhostFeedStylesPropertyPage,o.LineToolHorzLineInputsPropertyPage=i(342).LineToolHorzLineInputsPropertyPage,o.LineToolHorzLineStylesPropertyPage=i(342).LineToolHorzLineStylesPropertyPage,o.LineToolIconStylesPropertyPage=i(731),o.LineToolInputsPropertyPage=i(691),o.LineToolLineTool5PointsPatternStylesPropertyPage=i(732),o.LineToolNotePropertyPage=i(733),o.LineToolParallelChannelStylesPropertyPage=i(734),o.LineToolPitchfanStylesPropertyPage=i(735),o.LineToolPitchforkStylesPropertyPage=i(736),o.LineToolPolylineStylesPropertyPage=i(737),o.LineToolPredictionStylesPropertyPage=i(738),o.LineToolPriceLabelStylesPropertyPage=i(739),o.LineToolProjectionStylesPropertyPage=i(740),o.LineToolRectangleStylesPropertyPage=i(741),o.LineToolRiskRewardInputsPropertyPage=i(343).LineToolRiskRewardInputsPropertyPage,o.LineToolRiskRewardStylesPropertyPage=i(343).LineToolRiskRewardStylesPropertyPage,o.LineToolTextStylesPropertyPage=i(742),o.LineToolTimeCyclesPropertyPage=i(743),o.LineToolTrendAngleInputsPropertyPage=i(344).LineToolTrendAngleInputsPropertyPage,o.LineToolTrendAngleStylesPropertyPage=i(344).LineToolTrendAngleStylesPropertyPage,o.LineToolTrendBasedFibExtensionStylesPropertyPage=i(744),o.LineToolTrendBasedFibTimeStylesPropertyPage=i(745),o.LineToolTrendLineStylesPropertyPage=i(345),o.LineToolInfoLineStylesPropertyPage=i(345),o.LineToolTrianglePatternStylesPropertyPage=i(746),o.LineToolTriangleStylesPropertyPage=i(747),o.LineToolVertLineInputsPropertyPage=i(346).LineToolVertLineInputsPropertyPage,o.LineToolVertLineStylesPropertyPage=i(346).LineToolVertLineStylesPropertyPage,
o.LineToolCrossLineInputsPropertyPage=i(347).LineToolCrossLineInputsPropertyPage,o.LineToolCrossLineStylesPropertyPage=i(347).LineToolCrossLineStylesPropertyPage,o.LineToolVisibilitiesPropertyPage=i(748),o.StudyCompareInputsPropertyPage=i(749),o.StudyDisplayPropertyPage=i(320).StudyDisplayPropertyPage,o.StudyInputsPropertyPage=i(692).StudyInputsPropertyPage,o.StudyLineDataSourcePropertyPage=i(750),o.StudyOverlayStylesPropertyPage=i(751),o.StudyPivotPointsStandardStylesPropertyPage=i(752),o.StudyStylesPropertyPage=i(320).StudyStylesPropertyPage,s.logNormal("Property pages loaded"),e()}.bind(null,i)).catch(t)}var o,r,s=i(4).getLogger("Chart.DataSourcePropertyPages"),a=i(134).retries;t.propertyPages={},o=t.propertyPages,r=null,t.loadPropertyPages=function(){return null!==r?r:(s.logNormal("Start loading property pages"),r=a(function(){return new Promise(n)},2))}},function(e,t,i){"use strict";function n(e,t,i,n){var o=e?s.defaults:s.factoryDefaults,r=t.startsWith("study_")?TradingView.clone(o("study")):t.startsWith("linetool")?TradingView.clone(o("linetoolvisibilities")):{},a=TradingView.clone(o(t,n));return t.startsWith("study_")&&a.inputs&&delete a.inputs.symbol,"linetoolicon"===t&&e&&(a.icon=s.defaults(t).icon),i.forEach(function(e){delete a[e]}),TradingView.merge(r,a),r}function o(e,t,i,r){void 0===r&&(r=!0),this._defaultName=e;var s;i?s=t:(s=n(r,e,[],null),t&&TradingView.merge(s,t)),a.call(this,s),this._defaultName=e,this._useUserPreferences=r,this.listeners().subscribe(this,o.prototype.onPropertyChanged),this._exclusions=[]}function r(e){o._saveDefaults=e}var s=i(133),a=i(13);inherit(o,a),o._saveDefaults=!1,o.prototype.addExclusion=function(e){this._exclusions.indexOf(e)<0&&this._exclusions.push(e)},o.prototype.restoreFactoryDefaults=function(){var e=n(!1,this._defaultName,this._exclusions,null);this.mergeAndFire(e),this._defaultName.startsWith("study_")||this.saveDefaults(),this.listeners().fire(this)},o.prototype.onPropertyChanged=function(){o._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()},o.prototype.saveDefaults=function(){this._useUserPreferences&&s.saveDefaults(this._defaultName,this.state(this._exclusions))},o.prototype.restoreDefaults=function(e){var t=n(this._useUserPreferences,this._defaultName,this._exclusions,e);this.merge(t),this.listeners().fire(this)},o.prototype.clone=function(e){return new o(this._defaultName,this.state(),e&&e.replaceByState,this._useUserPreferences)},t.DefaultProperty=o,t.saveDefaultProperties=r},function(e,t,i){"use strict";function n(){return C}function o(){return L}function r(e){e=Math.max(m.ERROR,Math.min(m.DEBUG,e)),C=e,d()}function s(e,t){var i,n=0,o=0;for(i=e.length-1;i>=1&&(n+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&(o=8*(1+encodeURIComponent(e[i-1]).length),n+o>t)));i--);return e.slice(i)}function a(e,t,i,n,o){var r={id:y,message:t+"",subSystemId:n,timestamp:+e};y+=1,i.push(r),void 0!==o&&i.length>o&&i.splice(0,1)}function l(e){var t,i=b.reduce(function(e,t){return e.concat(t)},[]);return i.sort(function(e,t){return e.id-t.id}),
"number"==typeof e&&(i=i.slice(-e)),t=i.map(function(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}),s(t,g)}function c(e,t,i,n){var r,s;if((t!==P||n.id!==T)&&(r=new Date,e<=m.NORMAL&&a(r,t,i,n.id,n.maxCount),e<=C&&(!n.highRate||o())&&(!w||n.id.match(w)))){switch(s=r.toISOString()+":"+n.id+":"+t,e){case m.DEBUG:console.debug(s);break;case m.INFO:case m.NORMAL:n.color?console.log("%c"+s,"color: "+n.color):console.log(s);break;case m.WARNING:console.warn(s);break;case m.ERROR:console.error(s)}P=t,T=n.id,x&&clearTimeout(x),x=setTimeout(function(){P=null,T=null,x=NaN},1e3)}}function h(e,t){function i(e){return function(t){return c(e,t,n,o)}}var n,o;return void 0===t&&(t={}),n=[],b.push(n),o=Object.assign(t,{id:e}),{logDebug:i(m.DEBUG),logError:i(m.ERROR),logInfo:i(m.INFO),logNormal:i(m.NORMAL),logWarn:i(m.WARNING)}}function u(){L=!!f&&"true"===localStorage.getItem(S);var e=parseInt(f?localStorage.getItem(v)||"":"");Number.isNaN(e)&&(e=m.WARNING),r(e),I.logNormal("Init with settings - level: "+C+", high-rate: "+L)}function d(){try{f&&(localStorage.setItem(S,L+""),localStorage.setItem(v,C+""))}catch(e){I.logWarn("Cannot save logger state (level: "+C+", high-rate: "+L+") to localStorage: "+e.message)}}function p(){_.performance&&_.performance.now?I.logNormal("Sync logger and perf times, now is "+_.performance.now()):I.logWarn("Perf time is not available")}var _,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LOGLEVEL",function(){return m}),t.getLogLevel=n,t.isHighRateEnabled=o,t.setLogLevel=r,t.getLogHistory=l,t.getLogger=h,i.d(t,"loggingOn",function(){return A}),i.d(t,"loggingOff",function(){return k}),_="undefined"!=typeof window?window:{},f=!1;try{localStorage.getItem(""),f=!0}catch(e){}!function(e){e[e.ERROR=1]="ERROR",e[e.WARNING=2]="WARNING",e[e.INFO=3]="INFO",e[e.NORMAL=4]="NORMAL",e[e.DEBUG=5]="DEBUG"}(m||(m={})),y=0,g=75497472,v="tv.logger.loglevel",S="tv.logger.logHighRate",b=[],w=null,P=null,T=null,x=NaN,C=m.WARNING,L=!1,I=h("logger"),A=_.lon=function(e,t){r(m.DEBUG),I.logNormal("Debug logging enabled"),L=!!e,w=t||null,d()},k=_.loff=function(){r(m.INFO),I.logInfo("Debug logging disabled")},u(),p()},function(e,t,i){var n=i(463),o={},r={},s={},a={init:function(){var e,t,i,l;Object.keys(n).forEach(function(i){e=n[i],t=e.subsets,Array.isArray(t)?t.forEach(function(e){o[e]=1}):t&&Object.keys(t).forEach(function(e){o[e]=1}),o[i]=1}),i=Object.keys(o),i.forEach(function(e){i.forEach(function(i){if(void 0!==(l=n[i])){if(!(t=l.subsets))return;r.hasOwnProperty(e)||(r[e]=[]),Array.isArray(t)&&~t.indexOf(e)?r[e].push(i):e in t&&r[e].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(e){a.disable(e)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(e){a.enable(e)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:o,_setsReverseDependencies:r,
_setsStates:s}},enabled:function(e){var t=function(e){var i,n,o=r.hasOwnProperty(e)?r[e]:[];if(!1===s[e])return!1;for(i=s[e],n=0;n<o.length;++n)i|=t(o[n]);return i};return!!t(e)},enable:function(e){s[e]=!0},disable:function(e){s[e]=!1},setEnabled:function(e,t){s[e]=!!t},_uniqueSets:function(){return Object.keys(o)}};a.init(),e.exports=a},function(e,t,i){"use strict";function n(e,t){return new h(e,t)}function o(e,t){return e.x===t.x&&e.y===t.y}function r(e,t,i){if(0===e&&0===t)throw Error("A and B can not be both equal to zero.");return{A:e,B:t,C:i}}function s(e,t){var i,n,s;if(o(e,t))throw Error("Points should be distinct");return i=e.y-t.y,n=t.x-e.x,s=e.x*t.y-t.x*e.y,r(i,n,s)}function a(e,t){if(o(e,t))throw Error("Points of a segment should be distinct");return[e,t]}function l(e,t){return{edge:e,isPositive:t}}function c(e,t){return l(e,e.A*t.x+e.B*t.y+e.C>0)}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addScaled=function(t,i){return new e(this.x+i*t.x,this.y+i*t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.dotProduct=function(e){return this.x*e.x+this.y*e.y},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.scaled=function(t){return new e(this.x*t,this.y*t)},e.prototype.normalized=function(){return this.scaled(1/this.length())},e.prototype.transposed=function(){return new e(-this.y,this.x)},e.prototype.clone=function(){return new e(this.x,this.y)},e}();t.Point=h,t.point=n,t.equalPoints=o,t.line=r,t.lineThroughPoints=s,t.lineSegment=a,t.halfplane=l,t.halfplaneThroughPoint=c},function(e,t,i){"use strict";function n(e,t){if(!e)throw Error("Assertion failed"+(t?": "+t:""))}function o(e){if(void 0===e)throw Error("Value is undefined");return e}function r(e){if(null===e)throw Error("Value is null");return e}function s(e){return r(o(e))}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=n,t.ensureDefined=o,t.ensureNotNull=r,t.ensure=s},function(e,t,i){"use strict";(function(e){function t(){this._listeners=[]}function n(e){return!e.singleshot}i(4).getLogger("Common.Delegate");t.prototype.subscribe=function(e,t,i){var n={object:e,member:t,singleshot:!!i};this._listeners.push(n)},t.prototype.unsubscribe=function(e,t){var i,n;for(i=0;i<this._listeners.length;++i)if(n=this._listeners[i],n.object===e&&n.member.prototype===t.prototype){this._listeners.splice(i,1);break}},t.prototype.unsubscribeAll=function(e){var t,i;for(t=this._listeners.length-1;t>=0;--t)i=this._listeners[t],i.object===e&&this._listeners.splice(t,1)},t.prototype.destroy=function(){delete this._listeners},t.prototype.fire=function(){var e,t,i,o=this._listeners;for(this._listeners=this._listeners.filter(n),e=o.length,t=0;t<e;++t)i=o[t],i.member.apply(i.object||null,arguments)},"undefined"!=typeof window&&(window.Delegate=t),void 0!==e&&e&&e.exports&&(e.exports=t)}).call(t,i(51)(e))},function(e,t,i){"use strict"
;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HitTestResult",function(){return n});var n=function(){function e(e,t,i){this._result=e,this._data=t,this._eraseMarker=i}return e.prototype.result=function(){return this._result},e.prototype.data=function(){return this._data},e.prototype.eraseMarker=function(){return this._eraseMarker},e.MOVEPOINT_BACKGROUND=1,e.REGULAR=2,e.MOVEPOINT=3,e.CHANGEPOINT=4,e.CUSTOM=5,e.CUSTOM_MOVE=6,e}()},,,function(e,t,i){(function(e){function t(e){return"number"==typeof e&&isFinite(e)}function i(e){return"string"==typeof e?JSON.parse(e):e}function n(e){return null!==e&&void 0!==e&&e.constructor===Function}function o(e){return h(e)&&e.then}function r(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),e.prototype.superclass=t}function s(e,t){for(var i in e.prototype)"function"==typeof e.prototype[i]&&e.prototype.hasOwnProperty(i)&&(e.prototype[i]=function(){throw Error(t+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function a(e,t,i,n){for(var o in i.prototype)if("function"==typeof i.prototype[o]&&!e.prototype[o])throw Error("Interface implementation assertion failed: "+t+" does not implement "+n+"::"+o+" function")}var l,c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},h=function(e){return"object"==typeof e&&null!==e},u=function(e){return h(e)&&-1!==(""+e.constructor).indexOf("function Object")};"undefined"!=typeof window?(l=window.TradingView=window.TradingView||{},window.isNumber=t,window.isFunction=n,window.inherit=r,window.isArray=c):l=this.TradingView=this.TradingView||{},l.isNaN=function(e){return!(e<=0||e>0)},l.isAbsent=function(e){return null===e||void 0===e},l.isExistent=function(e){return null!==e&&void 0!==e},Number.isNaN=Number.isNaN||function(e){return e!=e},l.isSameType=function(e,t){return Number.isNaN(e)||Number.isNaN(t)?Number.isNaN(e)===Number.isNaN(t):{}.toString.call(e)==={}.toString.call(t)},l.isInteger=function(e){return"number"==typeof e&&e%1==0},l.parseBool=function(e){return!0===e||"true"===e},l.isBoolean=function(e){return!0===e||!1===e},l.isString=function(e){return null!==e&&void 0!==e&&e.constructor===String},l.isInherited=function(e,t){return e===t||!(!e||!e.prototype)&&(void 0!==e.prototype.superclass&&null!==e.prototype.superclass&&(e.prototype.superclass===t||l.isInherited(e.prototype.superclass,t)))},l.TypeValidator=function(e){this.m_type=e},l.TypeValidator.prototype.check=function(e){return e.constructor===this.m_type||l.isInherited(e.constructor,this.m_type)},l.PredicateValidator=function(e){this.m_predicate=e},l.PredicateValidator.prototype.check=function(e){return this.m_predicate(e)},l.clone=function(e){var t,i,n;if(!e||"object"!=typeof e)return e;t="function"==typeof e.pop?[]:{};for(i in e)e.hasOwnProperty(i)&&(n=e[i],t[i]=n&&"object"==typeof n?l.clone(n):n);return t},l.deepEquals=function(e,t,i){var o,r,s,a,h;if(i||(i=""),e===t)return[!0,i];if(n(e)&&(e=void 0),n(t)&&(t=void 0),
void 0===e&&void 0!==t)return[!1,i];if(void 0===t&&void 0!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if("object"!=typeof e&&"object"!=typeof t)return[e===t,i];if(Array.isArray(e)&&Array.isArray(t)){if(o=e.length,r=t.length,o!==r)return[!1,i];for(s=0;s<o;s++)if(a=l.deepEquals(e[s],t[s],i+"["+s+"]"),!a[0])return a;return[!0,i]}if(c(e)||c(t))return[!1,i];for(h in e)if(a=l.deepEquals(e[h],t[h],i+"["+h+"]"),!a[0])return a;return[!0,i]},l.merge=function(e,t){for(var i in t)"object"==typeof t[i]&&e.hasOwnProperty(i)?l.merge(e[i],t[i]):e[i]=t[i];return e},l.mergeObj=function(e,t){for(var i in t)t[i].constructor===Object&&e.hasOwnProperty(i)?l.mergeObj(e[i],t[i]):e[i]=t[i];return e},l.mergeWithRules=function(e,t,i,n){var o,r;for(o in t)r=n?n+"."+o:o,i&&r in i?e[o]=i[r](e[o],t[o]):"object"==typeof t[o]&&e.hasOwnProperty(o)?l.merge(e[o],t[o],i,r):e[o]=t[o]},l.sortMultipleFunction=function(){var e=[].slice.call(arguments),t=e.length;return function(i,n){var o,r,s,a,l,c,h;for(h=0;h<t&&(c=0,s=e[h],a="string"==typeof s?s:s.name,o=i[a],r=n[a],"function"==typeof s.fn&&(o=s.fn(o),r=s.fn(r)),l=s.reverse?-1:1,o<r&&(c=-1*l),o>r&&(c=1*l),0===c);h++);return c}},void 0!==e&&e&&e.exports&&(e.exports={inherit:r,clone:l.clone,merge:l.merge,isNumber:t,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:h,isHashObject:u,isPromise:o,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:c,parseBool:l.parseBool,parseJSONorNot:i,deepEquals:l.deepEquals,declareClassAsPureInterface:s,requireFullInterfaceImplementation:a})}).call(t,i(51)(e))},function(e,t,i){"use strict";(function(t){function i(e){if(this._listeners=new t,this._childs=[],this._muteChildChanges=!1,void 0!==e&&null!==e)if(this.isPrimitiveType(e))this._value=e;else for(var i in e)this.addProperty(i,e[i])}i.prototype.merge=function(e,t){var i,n,o,r,s=null;if(t&&(s=[],i=s.length),null==e)return s;if(this.isPrimitiveType(e))return t&&this._value!==e&&s.push(this),this._value=e,s;if(Array.isArray(e))for(n=0;n<e.length;n++)this[n]?(o=this[n].merge(e[n],t),t&&(s=s.concat(o))):(this.addProperty(n,e[n]),t&&s.push(this[n]));else for(r in e)this[r]?(o=this[r].merge(e[r],t),t&&(s=s.concat(o))):(this.addProperty(r,e[r]),t&&s.push(this[r]));return t&&s.length>i&&s.push(this),s},i.prototype.mergeAndFire=function(e){var t=this.merge(e,!0);this._muteChildChanges=!0,t.forEach(function(e){e._muteChildChanges=!0}),t.forEach(function(e){e._muteChildChanges=!1,e.listeners().fire(e)}),this._muteChildChanges=!1,t.length>0&&this.listeners().fire(this)},i.prototype.state=function(e){var t,i,n,o,r,s=this._value;for(void 0===s&&(s={}),t=0;t<this._childs.length;t++)if(i=this._childs[t],!e||-1===e.indexOf(i))if(e){for(n=[],o=0;o<e.length;o++)r=e[o],r.startsWith(i+".")&&n.push(r.substr(i.length+1));s[i]=this[i].state(n)}else s[i]=this[i].state();return s},i.prototype.clone=function(e){return new i(this.state())},i.prototype.isPrimitiveType=function(e){
return!!isNumber(e)||(!!new TradingView.TypeValidator(String).check(e)||TradingView.isBoolean(e))},i.prototype.value=function(){return this._value},i.prototype.listeners=function(){return this._listeners},i.prototype.childCount=function(){return this._childs.length},i.prototype.childNames=function(){return this._childs},i.prototype.child=function(e){return this[e]},i.prototype.setValue=function(e,t){(this._value!==e||t)&&(this._value=e,this._listeners.fire(this))},i.prototype.setValueSilently=function(e){this._value=e},i.prototype.addProperty=function(e,t){var n=new i(t);this[e]=n,this._childs.push(e),n.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.removeProperty=function(e){this[e].listeners().unsubscribe(this,i.prototype.childChanged),delete this[e],this._childs=this._childs.filter(function(t){return t!==e})},i.prototype.hasChild=function(e){return this._childs.indexOf(e)>=0},i.prototype.addChild=function(e,t){this[e]=t,-1===$.inArray(e,this._childs)&&this._childs.push(e),t.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.childChanged=function(e,t){this._muteChildChanges||this.listeners().fire(this)},i.prototype.subscribe=function(e,t){this.listeners().subscribe(e,t,!1)},i.prototype.unsubscribe=function(e,t){this.listeners().unsubscribe(e,t)},i.prototype.unsubscribeAll=function(e){this.listeners().unsubscribeAll(e)},e.exports=i}).call(t,i(8))},,function(e,t,i){"use strict";function n(e){return 0===e.length?1:parseInt(e,10)}var o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ResolutionKind",function(){return s}),i.d(t,"Interval",function(){return c}),o=/^(\d*)([SHDWMR])$/,r=/^(\d+)$/,function(e){e.Seconds="seconds",e.Minutes="minutes",e.Hours="hours",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(s||(s={})),a={},a[s.Seconds]=1e3,a[s.Minutes]=60*a[s.Seconds],a[s.Hours]=60*a[s.Minutes],a[s.Days]=24*a[s.Hours],a[s.Weeks]=7*a[s.Days],l={S:s.Seconds,H:s.Hours,D:s.Days,W:s.Weeks,M:s.Months,R:s.Range},c=function(){function e(t,i){if(this._kind=s.Invalid,void 0===i&&t!==s.Invalid)return e.parse(t);this._kind=this._validateResolutionKind(t),this._multiplier=this._kind!==s.Invalid?i:void 0,0===this._multiplier&&(this._kind=s.Invalid,this._multiplier=void 0)}return e.prototype.kind=function(){return this._kind},e.prototype.multiplier=function(){return this._multiplier},e.prototype.isValid=function(){return this.kind()!==s.Invalid},e.prototype.isDWM=function(){return this.isValid()&&!this.isRange()&&!this.isIntraday()},e.prototype.isIntraday=function(){var e=-1!==[s.Seconds,s.Minutes,s.Hours].indexOf(this.kind());return this.isValid()&&!this.isRange()&&e},e.prototype.isSeconds=function(){return this.kind()===s.Seconds},e.prototype.isMinutes=function(){return this.kind()===s.Minutes},e.prototype.isHours=function(){return this.kind()===s.Hours},e.prototype.isDays=function(){return this.kind()===s.Days},e.prototype.isWeeks=function(){return this.kind()===s.Weeks},e.prototype.isMonths=function(){return this.kind()===s.Months},
e.prototype.isRange=function(){return this.kind()===s.Range},e.prototype.isTimeBased=function(){return!this.isRange()},e.prototype.letter=function(){return this.isValid()&&this.kind()!==s.Minutes?this.kind()[0].toUpperCase():""},e.prototype.value=function(){return this.isValid()?this.kind()===s.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""},e.prototype.isEqualTo=function(t){if(!(t instanceof e))throw Error("Argument is not an Interval");return!(!this.isValid()||!t.isValid())&&(this.kind()===t.kind()&&this.multiplier()===t.multiplier())},e.prototype.inMilliseconds=function(e){var t,i;return void 0===e&&(e=Date.now()),!this.isValid()||this.isRange()?NaN:this.isMonths()?(t=new Date(e),t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1)),+t-e):(i=this.multiplier(),void 0===i?NaN:a[this.kind()]*i)},e.isEqual=function(t,i){return e.parse(t).isEqualTo(e.parse(i))},e.parse=function(t){t=(t+"").toUpperCase().split(",")[0];var i=o.exec(t);return null!==i?new e(l[i[2]],n(i[1])):(i=r.exec(t),null!==i?new e(s.Minutes,n(i[1])):new e(s.Invalid))},e.kind=function(t){return e.parse(t).kind()},e.isValid=function(t){return e.parse(t).isValid()},e.isDWM=function(t){return e.parse(t).isDWM()},e.isIntraday=function(t){return e.parse(t).isIntraday()},e.isSeconds=function(t){return e.parse(t).isSeconds()},e.isMinutes=function(t){return e.parse(t).isMinutes()},e.isHours=function(t){return e.parse(t).isHours()},e.isDays=function(t){return e.parse(t).isDays()},e.isWeeks=function(t){return e.parse(t).isWeeks()},e.isMonths=function(t){return e.parse(t).isMonths()},e.isRange=function(t){return e.parse(t).isRange()},e.isTimeBased=function(t){return e.parse(t).isTimeBased()},e.normalize=function(t){var i=new e(t);return i.isValid()?i.value():null},e.prototype._validateResolutionKind=function(e){return e!==s.Seconds&&e!==s.Minutes&&e!==s.Hours&&e!==s.Days&&e!==s.Weeks&&e!==s.Months&&e!==s.Range&&e!==s.Invalid?s.Invalid:e},e}()},function(e,t,i){"use strict";(function(e){function t(){}function i(e){if(!(this instanceof i))return new i(e);arguments.length>0&&(this._value=e),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(e,t){var i,n,o,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(e=r.hook(e)),r.writeLock)return r._value;if(!t&&r._value===e&&r.hasOwnProperty("_value"))return e;for(r._value=e,i=r._listeners.slice(),n=0,o=0;o<i.length;o++)i[o].once&&(r._listeners.splice(o-n,1),n++),i[o].cb(e);return e},i.prototype.deleteValue=function(){var e,t,i,n=this._owner?this._owner:this;if(n.hasOwnProperty("_value")){if(n.writeLock)return n._value;for(delete n._value,e=n._listeners.slice(),t=0,i=0;i<e.length;i++)e[i].once&&(n._listeners.splice(i-t,1),t++),e[i].cb()}},i.prototype.subscribe=function(e,t){var i,n,o;if("function"!=typeof e)throw new TypeError("callback must be a function");i=!!t&&!!t.once,n=!!t&&!!t.callWithLast,o=this._owner?this._owner:this,n&&o.hasOwnProperty("_value")&&(e(o._value),i)||o._listeners.push({cb:e,owner:this,
once:!!t&&!!t.once})},i.prototype.unsubscribe=function(e){var t,i,n=this._owner?this._owner:this;for(void 0===e&&(e=null),t=n._listeners,i=t.length;i--;)t[i].owner!==this&&n!==this||t[i].cb!==e&&null!==e||t.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var e=this._readonlyInstance=new t;return e.subscribe=this.subscribe.bind(this),e.unsubscribe=this.unsubscribe.bind(this),e.value=this.value.bind(this),e.when=this.when.bind(this),e.spawn=function(){return this.spawn().readonly()}.bind(this),this.destroy&&(e.destroy=this.destroy.bind(this)),e},i.prototype.spawn=function(){var e=new i;return delete e._listeners,e._owner=this._owner||this,e.destroy=function(){this.unsubscribe(),delete this._owner},e},i.prototype.when=function(e){var t,i=this;if(this.value())return void e();t=function(n){n&&(i.unsubscribe(t),e())},i.subscribe(t)},i.prototype.opposite=function(){var e,t;return this._opposite||(e=this,t=new i(!this.value()),this.subscribe(function(e){t.setValue(!e)}),t.subscribe(function(t){e.setValue(!t)}),this._opposite=t),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==e&&e&&e.exports&&(e.exports=i)}).call(t,i(51)(e))},function(e,t,i){"use strict";function n(e,t){var i,n;return null===e?t:null===t?e:(i=Math.min(e.min,t.min),n=Math.max(e.max,t.max),{min:i,max:n})}function o(e,t){for(var i=r(e,t),n=Array(i),o=0,s=0,a=e.length,l=t.length,c=0;o<a&&s<l;)e[o].index<t[s].index?(n[c]=e[o],o++):e[o].index>t[s].index?(n[c]=t[s],s++):(n[c]=t[s],o++,s++),c++;for(;o<a;)n[c]=e[o],o++,c++;for(;s<l;)n[c]=t[s],s++,c++;return n}function r(e,t){for(var i=e.length,n=t.length,o=i+n,r=0,s=0;r<i&&s<n;)e[r].index<t[s].index?r++:e[r].index>t[s].index?s++:(r++,s++,o--);return o}var s,a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PlotRowSearchMode",function(){return h}),i.d(t,"REMOVE_INDEX_MAGIC_NUMBER",function(){return d}),i.d(t,"PlotList",function(){return p}),t.mergeMinMax=n,t.mergePlotRows=o,s=i(7),i.n(s),a=i(78),l=i(4),c=Object(l.getLogger)("Chart.PlotList"),function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(h||(h={})),u=30,d=-2e6,p=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCache=new Map,this._rowSearchCacheWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}return e.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype.first=function(){return this.size()>0?this._items[this._start]:null},e.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},e.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},e.prototype.lastIndex=function(){
return this.size()>0?this._indexAt(this._end-1):null},e.prototype.size=function(){return this._end-this._start},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.contains=function(e){return null!==this._search(e,h.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){var i,n;return this._shareRead?(c.logDebug("add: readonly collection modification attempt"),!1):(i={index:e,value:t},n=this._search(e,h.Exact),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),null===n?(this._items.splice(this._lowerbound(e),0,i),this._start=0,this._end=this._items.length,!0):(this._items[n]=i,!1))},e.prototype.search=function(e,t,i){var n,o,r,s,a;return void 0===t&&(t=h.Exact),n=i?this._rowSearchCacheWithoutEmptyValues:this._rowSearchCache,void 0!==(o=n.get(e))&&void 0!==(r=o.get(t))?r:null===(s=this._search(e,t,i))?null:(a={index:this._indexAt(s),value:this._valueAt(s)},void 0===o&&(o=new Map,n.set(e,o)),o.set(t,a),a)},e.prototype.fold=function(e,t){var i,n,o,r=t;for(i=this._start;i<this._end;++i)n=this._indexAt(i),o=this._valueAt(i),r=e(n,o,r);return r},e.prototype.findFirst=function(e,t){var i,n,o,r=void 0!==t&&Math.min(this._start+t,this._end)||this._end;for(i=this._start;i<r;++i)if(n=this._indexAt(i),o=this._valueAt(i),e(n,o))return{index:n,value:o};return null},e.prototype.findLast=function(e,t){var i,n,o,r=void 0!==t&&Math.max(this._end-t,this._start)||this._start;for(i=this._end-1;i>=r;--i)if(n=this._indexAt(i),o=this._valueAt(i),e(n,o))return{index:n,value:o};return null},e.prototype.each=function(e){var t,i,n;for(t=this._start;t<this._end&&(i=this._indexAt(t),n=this._valueAt(t),!e(i,n));++t);},e.prototype.reduce=function(e,t){var i,n,o,r=t;for(i=this._start;i<this._end;++i)n=this._indexAt(i),o=this._valueAt(i),r=e(r,n,o);return r},e.prototype.range=function(t,i){var n=new e(this._plotFunctions,this._emptyValuePredicate);return n._items=this._items,n._start=this._lowerbound(t),n._end=this._upperbound(i),n._shareRead=!0,n},e.prototype.minMaxOnRangeCached=function(e,t,i){var o,r,s,a,l;if(this.isEmpty())return null;for(o=null,r=0,s=i;r<s.length;r++)a=s[r],l=this._minMaxOnRangeCachedImpl(e,t,a),o=n(o,l);return o},e.prototype.minMaxOnRange=function(e,t,i){var o,r,s,a,l;if(this.isEmpty())return null;for(o=null,r=0,s=i;r<s.length;r++)a=s[r],l=this._minMaxOnRangeImpl(e,t,a),o=n(o,l);return o},e.prototype.merge=function(e){return this._shareRead?(c.logDebug("merge: readonly collection modification attempt"),null):0===e.length?null:this.isEmpty()||e[e.length-1].index<this._items[0].index?this._prepend(e):e[0].index>this._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)},e.prototype.addTail=function(e,t){var i,n,o,r;for(void 0===t&&(t=!1),i=0,t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value),n=i;n<e.length;++n){if(o=e[n],null===(r=this.lastIndex())){
c.logError("Can't add tail to the empty plotlist");break}this.add(r+1,o.value)}this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype.move=function(e){var t,i,n,o,r,s,a;if(this._shareRead)return void c.logDebug("move: readonly collection modification attempt");if(0!==e.length){for(t=this._items.slice(),i=0,n=e;i<n.length;i++)o=n[i],null!==(r=this._bsearch(o.old))&&void 0!==t[r]&&(o.new===d?t[r]=void 0:(t[r]={index:o.new,value:t[r].value},null!==(s=this._bsearch(o.new))&&void 0!==(a=t[s])&&a.index===o.new&&(t[s]=void 0)));this._items=t.filter(function(e){return void 0!==e}).sort(function(e,t){return e.index-t.index}),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._start=0,this._end=this._items.length}},e.prototype.remove=function(e){var t,i;return this._shareRead?(c.logDebug("remove: readonly collection modification attempt"),null):null===(t=this._search(e,h.NearestRight))?null:(i=this._items.splice(t),this._end=this._items.length,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),i.length>0?i[0]:null)},e.prototype.state=function(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},e.prototype.restoreState=function(e){if(!e)return void this.clear();this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype._indexAt=function(e){return this._items[e].index},e.prototype._valueAt=function(e){return this._items[e].value},e.prototype._length=function(){return this._items.length},e.prototype._search=function(e,t,i){var n=this._bsearch(e);if(null===n&&t!==h.Exact)switch(t){case h.NearestLeft:return this._searchNearestLeft(e,i);case h.NearestRight:return this._searchNearestRight(e,i);default:throw new TypeError("Unknown search mode")}if(!i||null===n||t===h.Exact)return n;switch(t){case h.NearestLeft:return this._nonEmptyNearestLeft(n);case h.NearestRight:return this._nonEmptyNearestRight(n);default:throw new TypeError("Unknown search mode")}},e.prototype._nonEmptyNearestRight=function(e){for(var t=Object(s.ensureNotNull)(this._emptyValuePredicate);e<this._end&&t(this._valueAt(e));)e+=1;return e===this._end?null:e},e.prototype._nonEmptyNearestLeft=function(e){for(var t=Object(s.ensureNotNull)(this._emptyValuePredicate);e>=this._start&&t(this._valueAt(e));)e-=1;return e<this._start?null:e},e.prototype._searchNearestLeft=function(e,t){var i,n=this._lowerbound(e);return n>this._start&&(n-=1),i=n!==this._end&&this._indexAt(n)<e?n:null,t&&null!==i?this._nonEmptyNearestLeft(i):i},e.prototype._searchNearestRight=function(e,t){var i=this._upperbound(e),n=i!==this._end&&e<this._indexAt(i)?i:null;return t&&null!==n?this._nonEmptyNearestRight(n):n},e.prototype._bsearch=function(e){var t=this._lowerbound(e);return t===this._end||e<this._items[t].index?null:t},e.prototype._lowerbound=function(e){
return Object(a.lowerbound)(this._items,e,function(e,t){return e.index<t},this._start,this._end)},e.prototype._upperbound=function(e){return Object(a.upperbound)(this._items,e,function(e,t){return t.index>e},this._start,this._end)},e.prototype._plotMinMax=function(e,t,i){var n,o,r,s=null,a=this._plotFunctions.get(i.name);if(void 0===a)throw Error('Plot "'+i.name+'" is not registered');for(n=e;n<t;n++)o=this._items[n].value,void 0===(r=a(o))||null===r||Number.isNaN(r)||(null===s?s={min:r,max:r}:(r<s.min&&(s.min=r),r>s.max&&(s.max=r)));return s},e.prototype._invalidateCacheForRow=function(e){var t=Math.floor(e.index/u);this._minMaxCache.forEach(function(e){return e.delete(t)})},e.prototype._prepend=function(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]},e.prototype._append=function(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]},e.prototype._updateLast=function(e){Object(s.assert)(!this.isEmpty(),"plot list should not be empty");var t=this._items[this._end-1];Object(s.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._rowSearchCache.delete(e.index),this._rowSearchCacheWithoutEmptyValues.delete(e.index),this._items[this._end-1]=e},e.prototype._merge=function(e){return Object(s.assert)(0!==e.length,"plot rows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=o(this._items,e),this._start=0,this._end=this._items.length,e[0]},e.prototype._minMaxOnRangeCachedImpl=function(e,t,i){var o,r,a,l,c,h,d,p,_,f,m,y,g,v,S,b;if(this.isEmpty())return null;for(o=null,r=Object(s.ensureNotNull)(this.firstIndex()),a=Object(s.ensureNotNull)(this.lastIndex()),l=e-i.offset,c=t-i.offset,l=Math.max(l,r),c=Math.min(c,a),h=Math.ceil(l/u)*u,d=Math.max(h,Math.floor(c/u)*u),p=this._lowerbound(l),_=this._upperbound(Math.min(c,h,t)),f=this._plotMinMax(p,_,i),o=n(o,f),m=this._minMaxCache.get(i.name),void 0===m&&(m=new Map,this._minMaxCache.set(i.name,m)),y=Math.max(h+1,l);y<d;y+=u)g=Math.floor(y/u),v=m.get(g),void 0===v&&(S=g*u,b=(g+1)*u-1,v=this._minMaxOnRangeImpl(S,b,i),m.set(g,v)),o=n(o,v);return p=this._lowerbound(d),_=this._upperbound(c),f=this._plotMinMax(p,_,i),o=n(o,f),o},e.prototype._minMaxOnRangeImpl=function(e,t,i){var n=this._lowerbound(e-i.offset),o=Math.min(this._lowerbound(t-i.offset)+1,this._items.length);return this._items[this._end-1]&&this._items[o-1].index>t-i.offset&&(o=n),this._plotMinMax(n,o,i)},e}()},function(e,t,i){"use strict"
;function n(e){this._invalidationLevel=e||n.UPDATE_CURSOR_ONLY,this._invalidatedPanes={}}n.UPDATE_CURSOR_ONLY=1,n.LIGHT_UPDATE=2,n.FULL_UPDATE=3,n.prototype.invalidatePane=function(e,t){this._invalidatedPanes[e]?this._invalidatedPanes[e]=Math.max(this._invalidatedPanes[e],t):this._invalidatedPanes[e]=t},n.prototype.invalidateAll=function(e){this._invalidationLevel=Math.max(this._invalidationLevel,e)},n.prototype.fullInvalidation=function(){return this._invalidationLevel},n.prototype.invalidateForPane=function(e){return this._invalidatedPanes[e]?Math.max(this._invalidatedPanes[e],this._invalidationLevel):this._invalidationLevel},n.prototype.merge=function(e){this.force=this.force||e.force,this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel);for(var t in e._invalidatedPanes)this._invalidatedPanes[t]?this._invalidatedPanes[t]=Math.max(this._invalidatedPanes[t],e._invalidatedPanes[t]):this._invalidatedPanes[t]=e._invalidatedPanes[t]},n.prototype.exclude=function(e){this._invalidationLevel<=e&&(this._invalidationLevel=0);for(var t in this._invalidatedPanes)this._invalidatedPanes[t]<=e&&(this._invalidatedPanes[t]=0)},e.exports=n},function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this._map=$.extend({},this._map,n),t&&(t=this.unpackLevels(t)),r.call(this,e,t,i),this.updateCollectibleProperty()}var o=i(12).isSameType,r=i(3).DefaultProperty,s=i(536);inherit(n,r),n.prototype.state=function(e,i){e=e||[],e.push("__collectibleLines");var n=t.prototype.state.call(this,e);return i?n:this.packLevels(n)},n.prototype.clone=function(){var e=this.state();return this.__collectibleLines&&(e.__collectibleLines=this.__collectibleLines.state()),new n(this._defaultName,e)},n.prototype.merge=function(e,i){var n=t.prototype.merge.call(this,this.unpackLevels(e),i);return this.updateCollectibleProperty(),n},n.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},n.prototype._packLvlTpl=function(){return[]},n.prototype._unpackLvlTpl=function(){return{}},n.prototype._packLvlFill=function(e,t,i,n){return n.push(i[t]),n},n.prototype._unpackLvlFill=function(e,t,i,n){return n[t]=i[e],n},n.prototype._iterateLevels=function(e,t){var i,n,r,s,a;for(i in this._map.prefixes)for(n=(this._map.prefixes[i]||"")+"level",r=this._map.range[0];r<=this._map.range[1];r++)if(e[n+r]&&o(e[n+r],t.typecheck())){s=t.tpl();for(a in this._map.names)s=t.fill(a,this._map.names[a],e[n+r],s);e[n+r]=s}return e},n.prototype.packLevels=function(e){return this._iterateLevels(e,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},n.prototype.unpackLevels=function(e){return this._iterateLevels(e,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},n.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},n.prototype.updateCollectibleProperty=function(){var e,t;this.__collectibleLines&&(e=this,t=[],
this.__collectibleLines._childs.forEach(function(i){var n,o=e.__collectibleLines[i].value(),r=o.split("."),s=e[r[0]];for(n=1;n<r.length&&s;++n)s=s[r[n]];s&&t.push({property:s.color,defaultValue:s.color.value()})}),this.collectibleColors?this.collectibleColors.reloadProperties(t):this.collectibleColors=new s(t))},e.exports=n}).call(t,i(13))},,function(e,t,i){"use strict";function n(e,t){if(!Object(o.isNumber)(e))return"n/a";if(!Object(o.isInteger)(t))throw new TypeError("invalid length");if(t<0||t>16)throw new TypeError("invalid length");return 0===t?""+e:("0000000000000000"+e).slice(-t)}var o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"customFormatters",function(){return a}),i.d(t,"formatterOptions",function(){return l}),t.numberToStringWithLeadingZero=n,i.d(t,"PriceFormatter",function(){return h}),i(11),o=i(12),i.n(o),r=i(4),s=Object(r.getLogger)("Chart.PriceFormatter"),a={dateFormatter:null,timeFormatter:null},l={decimalSign:".",decimalSignFractional:"'"},c={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),secondFraction:$.t("Second fraction part is invalid.")},h=function(){function e(e,t,i,n){if(this.type="price",t||(t=1),Object(o.isNumber)(e)&&Object(o.isInteger)(e)||(e=100),e<0)throw new TypeError("invalid base");if(this._priceScale=e,this._minMove=t,this._minMove2=n,i&&void 0!==n&&n>0&&2!==n&&4!==n&&8!==n)return void s.logDebug("invalid minmove2");this._fractional=i,this.calculateDecimal()}return e.prototype.isFractional=function(){return!!this._fractional},e.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},e.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var e=this._priceScale;for(this._fractional&&this._minMove2&&(e/=this._minMove2);e>1;)e/=10,this._fractionalLength++}},e.prototype.format=function(e,t,i,n){void 0===n&&(n=!0);var o="";return e<0?(o=!0===t?"−":!1===n?"":"-",e=-e):e&&!0===t&&(o="+"),this._fractional?o+this._formatAsFractional(e,i):o+this._formatAsDecimal(e,i)},e.prototype.parse=function(e){return this._fractional?this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e):this._parseAsDecimal(e)},e.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.priceScale,t.minMove,t.fractional,t.minMove2)},e.prototype._formatAsDecimal=function(e,t){var i,o,r,s,a;return t=t||0,i=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,t)*this._priceScale/this._minMove,o=Math.floor(e),r=+(Math.round(e*i)-o*i).toFixed(this._fractionalLength),r>=i&&(r-=i,o+=1),s="",1!==i&&(a=void 0!==this._fractionalLength?this._fractionalLength:NaN,s=l.decimalSign+n(+r.toFixed(this._fractionalLength)*this._minMove,a+t),s=this._removeEndingZeros(s,t)),""+o+s},e.prototype._formatAsFractional=function(e,t){
var i,o,r,s,a,c,h,u,d,p=this._priceScale/this._minMove,_=Math.floor(e),f=t?Math.floor(e*p)-_*p:Math.round(e*p)-_*p;if(f===p&&(f=0,_+=1),i="",t&&(o=(e-_-f/p)*p,o=Math.round(o*Math.pow(10,t)),i=n(o,t),i=this._removeEndingZeros(i,t)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return r="",this._minMove2?(s=["0","5"],a=["0","2","5","7"],c=["0","1","2","3","4","5","6","7"],h=f%this._minMove2,f=(f-h)/this._minMove2,u=n(f,this._fractionalLength),d=2===this._minMove2?s[h]:8===this._minMove2?c[h]:a[h],r=u+l.decimalSignFractional+d):r=n(f*this._minMove,this._fractionalLength),""+_+l.decimalSignFractional+r+i},e.prototype._removeEndingZeros=function(e,t){for(var i=0;i<t&&"0"===e[e.length-1];i++)e=e.substr(0,e.length-1);return e},e.prototype._parseAsDecimal=function(e){var t,i,n=RegExp(/^(\-?)[0-9]+$/),o=n.exec(e);return o?(t=parseFloat(e),{price:t,res:!0,suggest:this.format(t)}):(i=RegExp("^(-?)[0-9]+\\"+l.decimalSign+"[0-9]*$"),o=i.exec(e),o?(t=parseFloat(e.replace(l.decimalSign,".")),{price:t,res:!0,suggest:this.format(t)}):{error:c.custom,res:!1})},e.prototype._patchFractPart=function(e,t){var i={0:0,5:1},n={0:0,2:1,5:2,7:3};return 2===t?void 0===i[e]?-1:i[e]:4===t?void 0===n[e]?-1:n[e]:e},e.prototype._parseAsSingleFractional=function(e){var t,i,n,o,r,s,a=RegExp(/^(\-?)[0-9]+$/),h=a.exec(e);return h?(t=parseFloat(e),{price:t,res:!0,suggest:this.format(t)}):(i=RegExp("^(-?)([0-9]+)\\"+l.decimalSignFractional+"([0-9]+)$"),h=i.exec(e),h?(n=!!h[1],o=parseInt(h[2]),r=this._priceScale,(s=this._patchFractPart(parseInt(h[3]),r))>=r||s<0?{error:c.fraction,res:!1}:(t=o+s/r,n&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:c.custom,res:!1})},e.prototype._parseAsDoubleFractional=function(e){var t,i,n,o,r,s,a,h,u,d=RegExp(/^(\-?)[0-9]+$/),p=d.exec(e);return p?(t=parseFloat(e),{price:t,res:!0,suggest:this.format(t)}):(i=RegExp("^(-?)([0-9]+)\\"+l.decimalSignFractional+"([0-9]+)\\"+l.decimalSignFractional+"([0-9]+)$"),p=i.exec(e),p?(n=!!p[1],o=parseInt(p[2]),r=void 0!==this._minMove2?this._minMove2:NaN,s=this._priceScale/r,a=this._minMove2,h=this._patchFractPart(parseInt(p[3]),s),u=this._patchFractPart(parseInt(p[4]),a),h>=s||h<0?{error:c.fraction,res:!1}:void 0!==a&&u>=a||u<0?{error:c.secondFraction,res:!1}:(t=void 0!==a?o+h/s+u/(s*a):NaN,n&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:c.custom,res:!1})},e}()},,,,function(e,t,i){"use strict";(function(t){var n=i(669).StudyError,o=i(78),r=i(12).inherit,s=1e-10,a=function(){function e(e,t,i,n,o){var r,s=o,a=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(r=0;r<t;++r)n(e.get(r),s)&&(a=r,s=e.get(r));return{index:a,value:s}}function a(e,t){return 100*e/t}function l(e,t,i,n,o){var r,s,a;this._areaRight=e,this._areaLeft=t,this._pivotType=i,this._series=n,this._currentIndex=o.new_var(0),this._currentValue=o.new_var(NaN),this._pivotIndex=o.new_var(-1),this._index=x.n(o),this._isNewBar=o.symbol.isNewBar,r=this._currentIndex.get(1),s=this._currentValue.get(1),a=this._pivotIndex.get(1),this._index>1&&(this._currentIndex.set(r),
this._currentValue.set(s),this._pivotIndex.set(a))}function c(e,t,i){var n,o,r,s,a;this._deviation=e,n=i.new_var(x.high(i)),o=i.new_var(x.low(i)),n.get(2*t+1),o.get(2*t+1),this._pivotHigh=new l(t,t,l.HIGH,n,i),this._pivotLow=new l(t,t,l.LOW,o,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=x.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),s=this._lastVal.get(1),a=this._lastType.get(1),this._index>1&&this.addPivot(r,s,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function h(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function u(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function d(e){u.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function p(e,t){this.timezone=e||"America/New_York",this.session=t||"0000-0000"}function _(e,t,i,n,o,r){this.periodBase=i,this.tickerid=e,this.period=t,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new T.Session,this.other_sessions={},this.script=n,this.ticker=_.parseTicker(e);var s=_.parsePeriod(t);this.resolution=s.resolution,this.interval=s.interval,this.bb_cache={},this.minTick=o,this.periodForInitialRange=r}function f(e,t,i,n,o,r,s,a,l,c){this.body=r,this.symbols=[],this.runner=o,this.inputCallback=a,this.out=s,this.nonseriesOut=c,this.ctx=new h(this.add_sym(e,t,i,l,n)),this.init()}function m(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function y(e){m.feed=e}function g(e){this.runner=new m(e)}function v(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0}function S(e,t){this.period=e,this.generateEmptyBars=!!t}function b(){}var w="undefined"!=typeof window?window:t,P=w.PineJsCalendar?w.PineJsCalendar:i(35),T=i(37),x={};return x.max_series_default_size=10001,x.n=function(e){return e.symbol.index+1},x.nz=function(e,t){return t=t||0,isFinite(e)?e:t},x.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},x.isZero=function(e){return Math.abs(e)<=1e-10},x.toBool=function(e){return isFinite(e)&&!x.isZero(e)},x.eq=function(e,t){return x.isZero(e-t)},x.neq=function(e,t){return!x.eq(e,t)},x.ge=function(e,t){return x.isZero(e-t)||e>t},x.gt=function(e,t){return!x.isZero(e-t)&&e>t},x.lt=function(e,t){return!x.isZero(e-t)&&e<t},x.le=function(e,t){return x.isZero(e-t)||e<t},x.and=function(e,t){return isNaN(e)||isNaN(t)?NaN:x.isZero(e)||x.isZero(t)?0:1},x.or=function(e,t){return isNaN(e)||isNaN(t)?NaN:x.isZero(e)&&x.isZero(t)?0:1},x.not=function(e){return isNaN(e)?NaN:x.isZero(e)?1:0},x.greaterOrEqual=function(e,t){return t-e<s},x.lessOrEqual=function(e,t){return e-t<s},x.equal=function(e,t){return Math.abs(e-t)<s},x.greater=function(e,t){return e-t>s},x.less=function(e,t){return t-e>s},x.max=Math.max,x.min=Math.min,x.pow=Math.pow,x.abs=Math.abs,x.log=Math.log,x.log10=function(e){return Math.log(e)/Math.LN10},
x.sqrt=Math.sqrt,x.sign=function(e){return isNaN(e)?NaN:x.isZero(e)?0:e>0?1:-1},x.exp=Math.exp,x.sin=Math.sin,x.cos=Math.cos,x.tan=Math.tan,x.asin=Math.asin,x.acos=Math.acos,x.atan=Math.atan,x.floor=Math.floor,x.ceil=Math.ceil,x.round=Math.round,x.avg=function(e,t,i,n,o,r){var s,a;if(2===arguments.length)return(e+t)/2;for(s=0,a=0;a<arguments.length;a++)s+=arguments[a];return s/arguments.length},x.open=function(e){return e.symbol.open},x.high=function(e){return e.symbol.high},x.low=function(e){return e.symbol.low},x.close=function(e){return e.symbol.close},x.hl2=function(e){return(e.symbol.high+e.symbol.low)/2},x.hlc3=function(e){return(e.symbol.high+e.symbol.low+e.symbol.close)/3},x.ohlc4=function(e){return(e.symbol.open+e.symbol.high+e.symbol.low+e.symbol.close)/4},x.volume=function(e){return e.symbol.volume},x.updatetime=function(e){return e.symbol.updatetime},x.time=function(e,t,i){return e.symbol.bartime(t,i)},x.period=function(e){return e.symbol.period},x.tickerid=function(e){return e.symbol.tickerid},x.ticker=function(e){return e.symbol.ticker},x.interval=function(e){return e.symbol.interval},x.isdwm=function(e){return e.symbol.isdwm()},x.isintraday=function(e){return!e.symbol.isdwm()},x.isdaily=function(e){return"D"===e.symbol.resolution},x.isweekly=function(e){return"W"===e.symbol.resolution},x.ismonthly=function(e){return"M"===e.symbol.resolution},x.year=function(e){return x.timepart(e.symbol,P.YEAR,arguments[1])},x.month=function(e){return x.timepart(e.symbol,P.MONTH,arguments[1])},x.weekofyear=function(e){return x.timepart(e.symbol,P.WEEK_OF_YEAR,arguments[1])},x.dayofmonth=function(e){return x.timepart(e.symbol,P.DAY_OF_MONTH,arguments[1])},x.dayofweek=function(e){return x.timepart(e.symbol,P.DAY_OF_WEEK,arguments[1])},x.hour=function(e){return x.timepart(e.symbol,P.HOUR_OF_DAY,arguments[1])},x.minute=function(e){return x.timepart(e.symbol,P.MINUTE,arguments[1])},x.second=function(e){return x.timepart(e.symbol,P.SECOND,arguments[1])},x.add_days_considering_dst=function(e,t,i){return P.add_days_considering_dst(P.get_timezone(e),t,i)},x.selectSessionBreaks=function(e,t){var i,n,o,r,s,a;if(x.isdwm(e)||void 0===e.symbol.session.timezone)return[];if(i=_.newBarBuilder(e.symbol.period,e.symbol.session),n=[],o=t.length,i.moveTo(t[o-1]),1===o&&i.sessionStart===t[0])n.push(t[0]);else{for(r=o-2;r>=0;--r)(s=t[r])>=i.sessionStart||(i.moveTo(s),a=t[r+1],n.push(a));n.reverse()}return n},x.iff=function(e,t,i){return x.not(e)?i:t},x.rising=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)>e.get(0))return 0;return 1},x.falling=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)<e.get(0))return 0;return 1},x.timepart=function(e,t,i){var n=P.utc_to_cal(e.timezone,i||e.bartime());return P.get_part(n,t)},x.rsi=function(e,t){return x.isZero(t)?100:x.isZero(e)?0:100-100/(1+e/t)},x.sum=function(e,t,i){var n=i.new_var(),o=x.nz(e.get())+x.nz(n.get(1))-x.nz(e.get(t));return n.set(o),o},x.sma=function(e,t,i){var n=x.sum(e,t,i);return x.na(e.get(t-1))?NaN:n/t},x.rma=function(e,t,i){
var n=x.sum(e,t,i),o=t-1,r=e.get(o),s=i.new_var(),a=s.get(1),l=e.get(),c=x.na(r)?NaN:x.na(a)?n/t:(l+a*o)/t;return s.set(c),c},x.fixnan=function(e,t){var i=t.new_var();return isNaN(e)?i.get(1):(i.set(e),e)},x.tr=function(e,t){var i,n,o;return 1===arguments.length&&(t=e,e=void 0),i=void 0!==e&&!!e,n=t.new_var(x.close(t)),o=n.get(1),i&&isNaN(o)&&(o=x.close(t)),x.max(x.max(x.high(t)-x.low(t),x.abs(x.high(t)-o)),x.abs(x.low(t)-o))},x.atr=function(e,t){var i=t.new_var(x.tr(t));return x.sma(i,e,t)},x.ema=function(e,t,i){var n=x.sum(e,t,i),o=i.new_var(),r=e.get(0),s=e.get(t-1),a=o.get(1),l=x.na(s)?NaN:x.na(a)?n/t:2*(r-a)/(t+1)+a;return o.set(l),l},x.wma=function(e,t,i){var n,o,r=0;for(t=Math.round(t),n=t;n>=0;n--)o=t-n,r+=o*e.get(n);return 2*r/(t*(t+1))},x.vwma=function(e,t,i){var n=i.new_var(x.volume(i)),o=i.new_var(e.get(0)*x.volume(i));return x.sma(o,t,i)/x.sma(n,t,i)},x.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},x.lowestbars=function(t,i,n){return-e(t,i,n,function(e,t){return x.lt(e,t)},Number.MAX_VALUE).index},x.lowest=function(t,i,n){return e(t,i,n,function(e,t){return x.lt(e,t)},Number.MAX_VALUE).value},x.highestbars=function(t,i,n){return-e(t,i,n,function(e,t){return x.gt(e,t)},Number.MIN_VALUE).index},x.highest=function(t,i,n){return e(t,i,n,function(e,t){return x.gt(e,t)},Number.MIN_VALUE).value},x.cum=function(e,t){var i=t.new_var(),n=x.nz(i.get(1))+e;return i.set(n),n},x.accdist=function(e){var t=x.high(e),i=x.low(e),n=x.close(e),o=x.volume(e);return x.cum(n===t&&n===i||t===i?0:o*(2*n-i-t)/(t-i),e)},x.correlation=function(e,t,i,n){var o=x.sma(e,i,n),r=x.sma(t,i,n),s=n.new_var(e.get()*t.get());return(x.sma(s,i,n)-o*r)/Math.sqrt(x.variance2(e,o,i)*x.variance2(t,r,i))},x.stoch=function(e,t,i,n,o){var r=x.highest(t,n),s=x.lowest(i,n);return x.fixnan(a(e.get()-s,r-s),o)},x.tsi=function(e,t,i,n){var o=n.new_var(x.change(e)),r=n.new_var(x.abs(x.change(e))),s=n.new_var(x.ema(o,i,n)),a=n.new_var(x.ema(r,i,n));return x.ema(s,t,n)/x.ema(a,t,n)},x.cross=function(e,t,i){function n(e){return e<0?-1:0===e?0:1}if(isNaN(e)||isNaN(t))return!1;var o=i.new_var(n(e-t));return!isNaN(o.get(1))&&o.get(1)!==o.get()},x.linreg=function(e,t,i){var n,o,r,s,a,l,c=0,h=0,u=0,d=0;for(n=0;n<t;++n)o=e.get(n),r=t-1-n,s=r+1,c+=s,h+=o,u+=s*s,d+=o*s;return a=(t*d-c*h)/(t*u-c*c),l=h/t,l-a*c/t+a+a*(t-1-i)},x.sar=function(e,t,i,n){function o(t,i){var n=f.get();return m.set(t),f.set(i),y.set(e),g.set(n),n}var r,s=x.high(n),a=x.low(n),l=x.close(n),c=n.new_var(s),h=n.new_var(a),u=n.new_var(l),d=u.get(1),p=h.get(1),_=c.get(1),f=n.new_var(),m=n.new_var(),y=n.new_var(),g=n.new_var(),v=g.get(1);if(isNaN(d))return NaN;if(isNaN(v)&&(x.ge(l,d)?(m.set(1),f.set(Math.max(s,_)),v=Math.min(a,p)):(m.set(-1),v=Math.max(s,_),f.set(Math.min(a,p))),y.set(e)),1===m.get()){if(x.gt(s,f.get())&&(f.set(s),y.set(Math.min(y.get()+t,i))),x.le(a,v))return o(-1,a)}else if(x.lt(a,f.get())&&(f.set(a),y.set(Math.min(y.get()+t,i))),x.ge(s,v))return o(1,s);return r=v+y.get()*(f.get()-v),1===m.get()?x.ge(r,a)&&(r=a):x.le(r,s)&&(r=s),g.set(r),r},
x.alma=function(e,t,i,n){var o,r,s,a=Math.floor(i*(t-1)),l=t/n*(t/n),c=[],h=0;for(o=0;o<t;++o)r=Math.exp(-1*Math.pow(o-a,2)/(2*l)),h+=r,c.push(r);for(o=0;o<t;++o)c[o]/=h;for(s=0,o=0;o<t;++o)s+=c[o]*e.get(t-o-1);return s},x.wvap=function(e,t){return e.get()-e.get(1)},x.change=function(e){return e.get()-e.get(1)},x.roc=function(e,t){var i=e.get(t);return 100*(e.get()-i)/i},x.dev=function(e,t,i){var n=x.sma(e,t,i);return x.dev2(e,t,n)},x.dev2=function(e,t,i){var n,o,r,s=0;for(n=0;n<t;n++)o=e.get(n),r=x.abs(o-i),s+=r;return s/t},x.stdev=function(e,t,i){var n=x.variance(e,t,i);return x.sqrt(n)},x.variance=function(e,t,i){var n=x.sma(e,t,i);return x.variance2(e,n,t)},x.variance2=function(e,t,i){var n,o,r,s=0;for(n=0;n<i;n++)o=e.get(n),r=x.abs(o-t),s+=r*r;return s/i},x.percentrank=function(e,t){var i,n,o,r;if(x.na(e.get(t-1)))return NaN;for(i=0,n=e.get(),o=1;o<t;o++)r=e.get(o),x.ge(n,r)&&i++;return 100*i/t},x.createNewSessionCheck=function(e){var t=_.newBarBuilder(e.symbol.period,e.symbol.session);return function(e){return t.indexOfBar(e)===T.POST_SESSION&&(t.moveTo(e),!0)}},x.error=function(e){throw new n(e)},l.LOW=0,l.HIGH=1,l.prototype.isPivotFound=function(){return-1!==this._pivotIndex.get()},l.prototype.pivotIndex=function(){return this._pivotIndex.get()},l.prototype.currentValue=function(){return this._currentValue.get()},l.prototype.pivotType=function(){return this._pivotType},l.prototype.reset=function(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)},l.prototype.isRightSideOk=function(e){return e-this._currentIndex.get()===this._areaRight},l.prototype.isViolate=function(e,t){if(e<1||isNaN(this._currentValue.get()))return!0;var i=this._series.get(this._index-e);return!!isNaN(i)||(i===this._currentValue.get()?t:this._pivotType===l.HIGH?i>this._currentValue.get():i<this._currentValue.get())},l.prototype.processPoint=function(e){this.isViolate(e,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(e))},l.prototype.isRestartNeeded=function(e){return e-this._currentIndex.get()>this._areaRight},l.prototype.update=function(){var e,t;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(e=!0,t=0;t<this._areaLeft;++t)if(this.isViolate(this._currentIndex.get()-1-t,!0)){e=!1;break}e&&this._pivotIndex.set(this._currentIndex.get())}}else-1!==this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),t=0;t<=this._areaRight;++t)this.processPoint(this._index-this._areaRight+t)},c.prototype.addPivot=function(e,t,i){this._lastIndex.set(e),this._lastVal.set(t),this._lastType.set(i)},c.prototype.updatePivot=function(e,t){this._lastIndex.set(e),this._lastVal.set(t)},c.prototype.lastPrice=function(){return this._lastVal.get()},c.prototype.lastIndex=function(){return this._lastIndex.get()},c.prototype.addPoint=function(e,t,i){var n;return isNaN(this._lastVal.get())?void this.addPivot(e,t,i):(n=this._lastVal.get(),
this._lastType.get()===i?void((i===l.HIGH?t>n:t<n)&&this.updatePivot(e,t)):void(Math.abs(n-t)/t>this._deviation&&this.addPivot(e,t,i)))},c.prototype.processPivot=function(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())},x.zigzag=function(e,t,i){return new c(e,t,i).lastPrice()},x.zigzagbars=function(e,t,i){var n=new c(e,t,i);return-1===n.lastIndex()?NaN:n.lastIndex()-x.n(i)},h.prototype.new_sym=function(e,t,i,n){return this.symbol.script.add_sym(e,t,i,void 0,n)},h.prototype.select_sym=function(e){this.symbol=this.symbol.script.get_sym(e)},h.prototype.new_var=function(e){var t,i=this.vars;return i.length<=this.vars_index&&i.push(new u(this.symbol)),t=i[this.vars_index++],arguments.length>0&&t.set(e),t},h.prototype.new_unlimited_var=function(e){var t,i=this.vars;return i.length<=this.vars_index&&i.push(new d(this.symbol)),t=i[this.vars_index++],arguments.length>0&&t.set(e),t},h.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new h(this.symbol)),this.ctx[this.ctx_index++]},h.prototype.prepare=function(e){var t,i;for(this.ctx_index=0,this.vars_index=0,t=0;t<this.vars.length;t++)this.vars[t].prepare(e);for(i=0;i<this.ctx.length;i++)this.ctx[i].prepare(e)},h.prototype.maxAdditionalDepth=function(){var e,t,i=0;for(e=0;e<this.vars.length;e++)t=this.vars[e].mindepth,!isNaN(t)&&t>i&&(i=t);return i},h.prototype.stop=function(){this.symbol=null,this.vars=null},u.prototype.valueOf=function(){return this.get(0)},u.prototype.get=function(e){return isNaN(e)&&(e=0),e=e||0,this.hist?e>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(e):(this.mindepth=x.max(this.mindepth,e),NaN)},u.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},u.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},u.prototype.prepare=function(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},u.prototype.add_hist=function(){var e,t,i;if(!this.hist){for(e=x.na(this.mindepth)?x.max_series_default_size:x.max(this.mindepth+1,1),e=Math.round(e),t=Array(e),i=0;i<e;i++)t[i]=NaN;this.hist=t,this.hist_pos=-1}this.hist_pos=Math.min(this.hist_pos+1,this.hist.length),this.hist_pos===this.hist.length&&(this.hist_pos=this.hist.length-1,this.hist.shift(),this.hist.push(NaN)),this.hist[this.hist_pos]=this.original},u.prototype.adopt=function(e,t,i){var n,o,r,s;return this.hist||(this.mindepth=NaN),n=t.get(),o=e.indexOf(n),0!==i&&(r=t.get(1),x.na(r)||(s=e.indexOf(r),o=o===s?-1:o)),o<0?NaN:this._get(o)},u.prototype.indexOf=function(e){var t,i,n,r;return this.hist?x.na(e)?-1:(t=this.hist.length,i=this.symbol.index+1,n=Math.min(t,i),r=o.upperbound_int(this.hist,e,0,n),0===r?-1:n-r):(this.mindepth=NaN,-1)},r(d,u),d.prototype.add_hist=function(){if(this.hist_pos=this.hist_pos+1,this.hist_pos===this.hist.length){var e=new Float64Array(2*this.hist.length);e.set(this.hist),this.hist=e}
this.hist[this.hist_pos]=this.original},_.parseTicker=function(e){var t=e.indexOf(":");return-1===t?e:e.substr(t+1)},_.parsePeriod=function(e){var t,i,n,o,r,s,a,l;return e+="",t=e.slice(0),i=t.indexOf(",")>=0,i&&(o=t.split(","),n=_.parsePeriod(o[1]),t=o[0]),r=!1,s=!1,a=t[t.length-1],-1==="DWM".indexOf(a)&&("S"===a?s=!0:(r=!0,a="")),l=parseInt(r?t:t.length>1?t.slice(0,t.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:r,isSeconds:s,range:n}},_.newBarBuilder=function(e,t,i){var n=_.parsePeriod(e);return T.newBarBuilder(n.interval+n.resolution,t,i)},_.newSession=function(e,t){var i=P.get_timezone(e);return(new T.Session).init(i,t)},_.prototype.set_symbolinfo=function(e){e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.timezone=P.get_timezone(e.timezone),this.session.init(this.timezone,e.session);for(var t in this.other_sessions)this.other_sessions.hasOwnProperty(t)&&this.other_sessions[t].init(this.timezone,t)},_.prototype.get_session=function(e){if(!e)return this.session;var t=this.other_sessions[e];return t||(t=new T.Session,this.other_sessions[e]=t),t},_.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},_.prototype.enable_dwm_aligning=function(e,t){this.dwm_aligner=_.newBarBuilder(this.period,e,t)},_.prototype.bartime=function(e,t){var i,n,o,r,s=this.time;return e&&(i=e,t&&(i+=t),n=this.bb_cache[i],n||(o=this.get_session(t),n=_.newBarBuilder(e,o),this.bb_cache[i]=n),s=n.alignTime(s)),!this.isdwm()||isNaN(s)?s:(r=P.utc_to_cal(this.timezone,s),this.session.spec.correctTradingDay(r,this.timezone),P.cal_to_utc(this.timezone,r))},_.prototype.lastbar=function(e){var t,i;isNaN(e.time)||(t=e.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0)),i=this.time!==t,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=e.volume,this.updatetime=e.updatetime,this.isNewBar=i,this.isBarClosed=e.isBarClosed,this.isLastBar=e.isLastBar,this.isNewBar&&this.index++,this.script.calc(this))},f.prototype.calc=function(e){var t,i,n=this.ctx,o=this.body;n.prepare(e),t=o.main(n,this.inputCallback),i=this,this.out&&t&&(!isNaN(n.symbol.time)||t.nonseries)&&(t.nonseries?("projection"===t.type&&(t.projectionTime=n.symbol.time),this.nonseriesOut(n.symbol,t)):t.bars?t.bars.forEach(function(e){i.out(n.symbol,e)}):this.out(n.symbol,t))},f.prototype.init=function(){var e=this.ctx,t=this.body;t.init&&t.init(e,this.inputCallback),t.main(e,this.inputCallback)},f.prototype.add_sym=function(e,t,i,n,o){var r=this.runner.add_sym(e,t,i,this,n,o);return this.symbols.push(r),r.isdwm()&&this.symbols.length>1&&r.enable_dwm_aligning(this.symbols[0].session,r.session),r},f.prototype.maxAdditionalDepth=function(){return this.ctx.maxAdditionalDepth()},f.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},f.prototype.get_sym=function(e){return this.symbols[e]},
m.prototype.add_sym=function(e,t,i,n,o,r){var s=new _(e,t,i,n,o,r);return this.symbols.push(s),s},m.prototype.get_sym=function(e){return this.symbols[e]},m.prototype.out=function(e,t){if(this.nonseriesUpdate){var i=$.extend({},this.nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)},m.prototype.start=function(){function e(e,n){var r=m.feed.subscribe(e.tickerid,e.period,e.periodBase,e.periodForInitialRange,function(i){"series"==(i.nonseries?"nonseries":"series")?t.update(n,i):i.lastBar?(t.nonseriesUpdate=i,i.lastBar.isLastBar=!0,t.symbols[0].lastbar(i.lastBar),t.nonseriesUpdate=null):s.nonseriesOut(e,i)},s.onErrorCallback,s.symbolInfo,s.sessionId,s.rangeExtension,o);i.push(r)}var t,i,n,o,r,s=this.host;for(this._script=new f(s.tickerid,s.period,s.periodBase||s.period,s.periodForInitialRange,this,s.body,this.out.bind(this),s.input,s.symbolInfo.minmov/s.symbolInfo.pricescale,s.nonseriesOut),t=this,i=[],n=this.symbols,o=(s.additionalBarsCount||0)+t._script.maxAdditionalDepth(),r=0;r<n.length;r++)e(n[r],r);this.subscription=i},m.prototype.stop=function(){var e,t=this.subscription;if(!t&&!this._script)return void console.warn("Recurring script engine stop happened.");for(e=0;e<t.length;e++)m.feed.unsubscribe(t[e]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null},m.prototype.update=function(e,t){var i,n;if(!t)return void console.error("Unexpected barset = null");i=this.symbols[e],this.isRecalculated?(n=t.bar(t.count()-1),n.isBarClosed=t.isLastBarClosed(),n.isLastBar=!0,i.lastbar(n)):this.barsets[e]||(this.barsets[e]=t,i.set_symbolinfo(t.symbolinfo()),this.recalc())},m.prototype.recalc=function(){var e,t,i,n,o,r,s,a=this.symbols;for(e=0;e<a.length;e++)if(!this.barsets[e])return;for(t=a.length-1;t>=0;t--)for(i=a[t],n=this.barsets[t],o=n.count(),r=0;r<o;r++)s=n.bar(r),s.isLastBar=r===o-1,s.isBarClosed=!s.isLastBar||n.isLastBarClosed(),i.lastbar(s);this.isRecalculated=!0,this.barsets[0]&&this.barsets[0].endOfData&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:this.barsets[0].endOfData,nextTime:this.barsets[0].nextTime})},m.feed={subscribe:function(e,t,i,n){console.error("must be initialized with setupFeed")},unsubscribe:function(e){console.error("must be initialized with setupFeed")}},g.prototype.stop=function(){this.runner.stop()},v.prototype.symbolinfo=function(){return this.info},v.prototype.isLastBarClosed=function(){return this.isBarClosed},v.prototype.setLastBarClosed=function(e){this.isBarClosed=e},v.prototype.bar=function(e){return this.bars[e]},v.prototype.count=function(){return this.bars.length},v.prototype.add=function(e,t){var i=e,n=this.bars,o=n.length,r=i.time,s=0===o?NaN:n[o-1].time;0===o||s<r?n.push(i):s===r?n[o-1]=i:console.error("time order violation, prev: "+new Date(s).toUTCString()+", cur: "+new Date(r).toUTCString()),this.isBarClosed=!!t},S.prototype.init=function(e){this.bb=_.newBarBuilder(this.period,e.symbol.session),this.bbEmptyBars=this.generateEmptyBars?_.newBarBuilder(this.period,e.symbol.session):void 0},
S.prototype.extrapolate=function(e,t){return isNaN(e)||isNaN(t)?void 0:T.extrapolateBarsFrontToTime(this.bbEmptyBars,e,t)},S.prototype.main=function(e){var t=e.symbol.time,i=this.bb.alignTime(t),n=e.new_var(i),o=x.na(i),r=n.get(1),s=x.na(r)?1:x.neq(i,r),a=e.new_var(),l=e.new_var(),c=e.new_var(),h=e.new_var(),u=a.get(1),d=l.get(1),p=c.get(1),_=h.get(1),f=o?NaN:s?x.open(e):u,m=o?NaN:s?x.high(e):x.max(x.high(e),d),y=o?NaN:s?x.low(e):x.min(x.low(e),p),g=o?NaN:x.close(e),v=o?NaN:s?x.volume(e):x.volume(e)+_,S=o?NaN:t,b=e.symbol.isBarClosed&&this.bb.isLastBar(0,t),w=this.generateEmptyBars&&s?this.extrapolate(r,i):void 0,P=e.new_var(x.close(e)),T=P.get(1),C=w instanceof Array?T:NaN;return a.set(f),l.set(m),c.set(y),h.set(v),[i,f,m,y,g,v,S,b,w,C]},b.prototype.main=function(e){return[x.open(e),x.high(e),x.low(e),x.close(e),x.volume(e),x.updatetime(e)]},{Std:x,Series:u,Symbol:_,SymbolInfo:p,StudyEngine:g,BarSet:v,OHLCV:b,BarBuilder:S,setupFeed:y}}();e.exports=a}).call(t,i(98))},function(e,t,i){"use strict";(function(e,t){function n(e){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,e);var t=e.fullId||e.id;TradingView.merge(this,n.parseIdString(t)),this.name=this.id}var o=i(7).assert,r=i(4).getLogger("Chart.Study.MetaInfo"),s=i(162).applyOverridesToStudyDefaults,a=i(163).Version,l=null;n.VERSION_STUDY_ARG_SOURCE=41,n.METAINFO_FORMAT_VERSION_SOS_V2=42,n.VERSION_PINE_PROTECT_TV_4164=43,n.CURRENT_METAINFO_FORMAT_VERSION=45,n.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],n.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies"],n.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],n.FilledArea={},n.FilledArea.TYPE_PLOTS="plot_plot",n.FilledArea.TYPE_HLINES="hline_hline",n.versionOf=function(e){var t="_metainfoVersion"in e&&isNumber(e._metainfoVersion)?e._metainfoVersion:0;return t<0&&r.logError("Metainfo format version cannot be negative: "+t),t>n.CURRENT_METAINFO_FORMAT_VERSION&&r.logWarn("Client doesn't support this version of metainfo format: "+t),t},n.parseIdString=function(e){var t,i,n,o,r={};if(-1===e.indexOf("@"))r.shortId=e,r.packageId="tv-basicstudies",r.id=e+"@"+r.packageId,r.version=1;else if(t=e.split("@"),r.shortId=t[0],i=t[1].split("-"),3===i.length)r.packageId=i.slice(0,2).join("-"),r.id=r.shortId+"@"+r.packageId,r.version=i[2];else if(1===i.length&&"decisionbar"===i[0])r.packageId="les-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1;else{if(1!==i.length)throw Error("unexpected study id:"+e);r.packageId="tv-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1}return r.fullId=r.id+"-"+r.version,"tv-scripting"===r.packageId?(n=r.shortId,0===n.indexOf("Script$")||0===n.indexOf("StrategyScript$")?(o=n.indexOf("_"),r.productId=o>=0?n.substring(0,o):r.packageId):r.productId=r.packageId):r.productId=r.packageId,r},n.getPackageName=function(e){return(/^[^@]+@([^-]+-[^-]+)/.exec(e||"")||[0,"tv-basicstudies"])[1]},n.cutFullId=function(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")},n.cutDollarHash=function(e){var t,i,n=e.indexOf("$"),o=e.indexOf("@");return-1===n?e:(t=e.substr(0,n),
i=o>=0?e.substr(o):"",t+i)},n.cutScriptIdPart=function(e){var t=e.indexOf("$"),i=e.indexOf("@");return t<0&&i>=0?"":e.substring(Math.max(t+1,0),i>=0?i:e.length)},n.hasUserIdSuffix=function(e){return/^USER;[\d\w]+;\d+$/.test(e)},n.isStandardPine=function(e){return/^(Strategy)?Script\$STD;.*@tv-scripting$/.test(e)},n.getSourceIdByInputs=function(e,t){var i,o,r;if(!Array.isArray(e)||!t)return null;for(i=0;i<e.length;++i)if(o=e[i],n.isSourceInput(o)&&"string"==typeof t[o.id])return r=t[o.id],~r.indexOf("$")&&(r=r.split("$")[0]),r;return null},n.getSourceInputIds=function(e){var t,i,o=[],r=e.inputs;for(t=0;t<r.length;++t)i=r[t],n.isSourceInput(i)&&o.push(i.id);return o},n.setChildStudyMetaInfoPropertiesSourceId=function(t,i,o){var r,s,a,l;for(r=0;r<t.inputs.length;++r)s=t.inputs[r],n.isSourceInput(s)&&o instanceof e&&o.inputs&&o.inputs[s.id]&&(a=o.inputs[s.id].value(),a.indexOf("$")>0&&(l=a.replace(/^[^\$]+/,i),o.inputs[s.id].setValue(l)))},n.patchChildStudyMetaInfoState=function(e){function t(e){if("object"==typeof e)for(var i in e)"string"==typeof e[i]&&/^[^\$]+\$\d+$/.test(e[i])?e[i]=e[i].replace(/^[^\$]+/,"{pid}"):t(e[i])}e.state&&t(e.state.inputs),e.state.isChildStudy=!0},n.prototype.parseValue=function(e,t){return"bool"===e?TradingView.parseBool(t):t},n.prototype.defaultInputs=function(){var e,t=[];for(e=0;e<this.inputs.length;e++)t.push(this.inputs[e].defval);return t},n.prototype.state=function(e){var t,i={};for(t in this)this.hasOwnProperty(t)&&(i[t]=this[t],!0!==e&&"id"===t&&(i[t]+="-"+this.version));return i},n.prototype.symbolInputId=function(){var e=this.inputs.filter(function(e){return"symbol"===e.type});return e.length>0?e[0].id:null},n.findStudyMetaInfoByDescription=function(e,t){if(e){for(var i=0;i<e.length;++i)if(e[i].description.toLowerCase()===t.toLowerCase())return e[i];throw Error("unexpected study id:"+t)}throw Error("There is no studies metainfo")},n._findStudyMetaInfo=function(e,t){for(var i=0;i<e.length;i+=1)if(e[i].id===t)return[i,e[i]];return[]},n.findStudyMetaInfo=function(e,t){if(!e)throw new ReferenceError("There is no studies metainfo");var i=n._findStudyMetaInfo(e,t)[1];if(!i)throw new ReferenceError("unexpected study id:"+t);return i},n.isParentSourceId=function(e){return"string"==typeof e&&/^[^\$]+\$\d+$/.test(e)},n.isSourceInput=function(e){return e.id&&(("source"===e.id||"src"===e.id)&&("text"===e.type||"source"===e.type)||"source"===e.type)},n.getChildSourceInputTitles=function(e,t,i){var o,r,s,a,l={};if(t.plots&&t.plots.length&&e.options&&e.options.length)for(o=0;o<e.options.length;++o)r=e.options[o],s=r&&+r.split("$")[1],(a=isFinite(s)&&t.plots[s])&&~n.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type)&&(l[r]=t.styles&&t.styles[a.id]&&t.styles[a.id].title||a.id,i&&(l[r]=i+": "+l[r]));return l},n.removeStudyMetaInfo=function(e,t,i){var o=function(i){return void 0!==(i=void 0!==i?i:n._findStudyMetaInfo(e,t.id)[0])&&(e.splice(i,1),defaults.remove(n.getStudyPropertyRootName(t)),!0)};if(e)return o(i);throw Error("There are no studies metainfo")},n.getStudyPropertyRootName=function(e){
var t="study_"+e.id;return e.pine&&e.pine.version&&(t+="_"+e.pine.version.replace(".","_")),t},n.addOrReplaceStudyMetaInfo=function(e,t){var i,o,s,l,c=new n(t),h=n._findStudyMetaInfo(e,c.id),u=h[0],d=h[1];if(d){if(i=d.pine&&d.pine.version&&a.parse(d.pine.version),null!=(o=c.pine&&c.pine.version&&a.parse(c.pine.version))&&null!=i&&!o.isGreaterOrEqual(i))return c;n.removeStudyMetaInfo(e,c,u)}else n.removeStudyMetaInfo(e,c,u)&&r.logDebug("Study with id="+c.id+" already exists in the model!");return e.push(c),c.defaults&&(s=TradingView.clone(c.defaults),s.precision="default",l=n.getStudyPropertyRootName(c),defaults.create(l,s)),c},n.overrideDefaults=function(e){null!==l&&0!==e.length&&s(l,e,function(e){return TradingView.defaultProperties["study_"+e]||null})},n.setDefaultsOverrides=function(e){l=e},n.createMetaInfoStub=function(e,t){var i,n,r;return o(TradingView.isExistent(e.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(e)),i=e.extra&&"strategy"===e.extra.kind||!0===e.isTVScriptStrategy,n=TVScript.createScriptStudyId(e.scriptIdPart,t,i),r={isTVScriptStubToCompile:!0,id:n,scriptIdPart:e.scriptIdPart,description:e.scriptName,TVScriptSourceCode:e.scriptSource,is_hidden_study:e.extra&&e.extra.is_hidden_study,extra:e.extra,version:t},r.pine={},r.pine.version=TradingView.isExistent(e.version)?e.version:-1,r.pine.access=TVScript.Access.MAP_ID_TO_NAME[e.access],r.pine.userHaveAccess=e.userHaveAccess,!0===i&&(r.isTVScriptStrategy=!0),r},n.isScriptStrategy=function(e){if(e.extra&&e.extra.kind)return e.extra.kind===TVScript.Kinds.STRATEGY;if(!0===e.isTVScriptStrategy)return!0;var t=e.TVScriptSourceCode||e.scriptSource;return!!t&&TVScript.isStrategy(t)},n.replaceWithFullStudyMetaInfoAsync=function(e,t){var i=$.Deferred();return t.isTVScriptStubToCompile||i.resolve(t),i.promise()},n.getOrderedInputIds=function(e){var t,i,n=[],o=e.inputs;for(t=0;t<o.length;++t)i=o[t],n.push(i.id);return n},n.canBeChild=function(e){var t,i,o;if(e&&"string"==typeof e)return!0;if(!e||e.extra&&!n.isAllowedSourceInputsCount(e.extra.sourceInputsCount)||!0===e.canNotBeChild||!1===e.canBeChild||~n.CHILD_STUDY_EXCLUDE_IDS.indexOf(e.id)||e.isTVScriptStrategy||e.TVScriptSourceCode&&TVScript.isStrategy(e.TVScriptSourceCode))return!1;if(e.isTVScriptStubToCompile)return!0;for(t=e.inputs,i=0,o=0;o<t.length;++o)n.isSourceInput(t[o])&&++i;return n.isAllowedSourceInputsCount(i)},n.isAllowedSourceInputsCount=function(e){return 1===e},n.canHaveChildren=function(e){if(e){if(e.isTVScriptStrategy||e.TVScriptSourceCode&&TVScript.isStrategy(e.TVScriptSourceCode))return!1;if(e.id&&!~n.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(e.id)&&Array.isArray(e.plots))for(var t=0;t<e.plots.length;++t)if(~n.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(e.plots[t].type))return!0}return!1},TradingView.StudyMetaInfo=n,void 0!==t&&t&&t.exports&&(t.exports=n)}).call(t,i(13),i(51)(e))},function(e,t,i){"use strict";function n(e,t,i,n,o,r){var s,a,h,u;return Object(l.equalPoints)(e,t)?null:(s=new l.Point(0,0),a=new l.Point(i,n),
o?r?(h=Object(c.intersectLineAndRectangle)(Object(l.lineThroughPoints)(e,t),s,a),Array.isArray(h)?h:null):(u=Object(c.intersectRayAndRectangle)(t,e,s,a),null===u||Object(l.equalPoints)(t,u)?null:Object(l.lineSegment)(t,u)):r?(u=Object(c.intersectRayAndRectangle)(e,t,s,a),null===u||Object(l.equalPoints)(e,u)?null:Object(l.lineSegment)(e,u)):(h=Object(c.intersectLineSegmentAndRectangle)(Object(l.lineSegment)(e,t),s,a),Array.isArray(h)?h:null))}function o(e){return.3*e}function r(e){return 2+.5*e}function s(e){return null!==e&&void 0!==e&&!Object(h.isNaN)(e)}function a(e,t){void 0!==t&&Object(u.setLineStyle)(e,t)}var l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),t.extendAndClipLineSegment=n,t.optimalBarWidth=o,t.selectionTolerance=r,t.coordinateIsValid=s,t.setValidLineStyle=a,l=i(6),i.n(l),c=i(129),i.n(c),h=i(12),i.n(h),u=i(46),i.n(u)},function(e,t,i){"use strict";(function(e){function n(){this._zorder=0,this.m_priceScale=null,this._id=s.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new e(!1)}function o(e){n.call(this),this._isOverlay=null,this._model=e}var r=i(3).DefaultProperty,s=i(33);n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i)},n.prototype.id=function(){return this._id},n.prototype.preferNoScale=function(){return!1},n.prototype.idForAlert=function(){return this._id},n.prototype.setId=function(e){this._id=e},n.prototype.zorder=function(){return this._zorder},n.prototype.setZorder=function(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e)},n.prototype.title=function(){throw Error("Implement this fun in a subclass")},n.prototype.priceScale=function(){return this.m_priceScale},n.prototype.setPriceScale=function(e){this.m_priceScale=e},n.prototype.ownerSource=function(){return this._ownerSource},n.prototype.setOwnerSource=function(e){this._ownerSource=e,e&&this.setPriceScale(e.priceScale())},n.prototype.isSavedInChart=function(e){return!0},n.prototype.isSavedInStudyTemplates=function(){return!0},n.prototype.isRemovedByStudyTemplates=function(){return!0},n.prototype.hasContextMenu=function(){return!0},n.prototype.showInObjectTree=function(){return!0},n.prototype.setUserEditEnabled=function(e){this._userEditEnabled=e},n.prototype.userEditEnabled=function(){return this._userEditEnabled},n.prototype.canBeHidden=function(){return this.userEditEnabled()},n.prototype.isUserDeletable=function(){return this.userEditEnabled()},n.prototype.canHasAlert=function(){return!1},n.prototype.properties=function(){throw Error("Implement this fun in a subclass")},n.prototype.statusView=function(){return null},n.prototype.dataWindowView=function(){return null},n.prototype.legendView=function(){return null},n.prototype.priceAxisViews=function(e,t){return null},n.prototype.updateAllViews=function(){},n.prototype.paneViews=function(e){return null},n.prototype.isChildStudy=function(){return!1},n.prototype.hasChildren=function(){return!1},n.prototype.canHaveChildren=function(){return!1},n.prototype.onClickOutside=function(){},n.prototype.getInputsPropertyPage=function(){
return null},n.prototype.getStylesPropertyPage=function(){return null},n.prototype.getDisplayPropertyPage=function(){return null},n.prototype.getVisibilitiesPropertyPage=function(){return null},n.prototype.getStrategyPropertyPage=function(){return null},n.prototype.getSourceIcon=function(){return null},n.prototype.doesMovingAffectsUndo=function(){return!0},inherit(o,n),o.prototype.isNoScale=function(){return!!this._isOverlay},o.prototype.base=function(){return 0},o.prototype.formatter=function(){return null},o.prototype.model=function(){return this._model},o.prototype.priceRange=function(e,t){return null},o.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},o.prototype.priceLineColor=function(e){return e},t.DataSource=n,t.PriceDataSource=o}).call(t,i(16))},function(e,t,i){"use strict";function n(e,t,i){var n,o,r,l,c;if(t=t||0,!s(e))return i?Object(a.rgbaToString)(Object(a.rgba)(Object(a.parseRgb)(e),Object(a.normalizeAlphaComponent)(1-t/100))):e;if(t<0&&t>100)throw Error("invalid transparency");return n=Object(a.parseRgb)(e),o=n[0],r=n[1],l=n[2],c=Object(a.normalizeAlphaComponent)(1-t/100),Object(a.rgbaToString)([o,r,l,c])}function o(e){return s(e)?e:Object(a.rgbaToString)(Object(a.rgba)(Object(a.parseRgb)(e),Object(a.normalizeAlphaComponent)(1)))}function r(e){var t=Object(a.parseRgb)(e).map(function(e){return e/=255,e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return+(.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3)}function s(e){return 0===e.indexOf("#")}var a;Object.defineProperty(t,"__esModule",{value:!0}),t.generateColor=n,t.resetTransparency=o,t.getLuminance=r,t.isHexColor=s,a=i(24),i.n(a)},function(e,t,i){"use strict";function n(e,t,i){var n=t.subtract(e),o=i.subtract(e),r=o.dotProduct(n)/n.dotProduct(n);return{coeff:r,distance:e.addScaled(n,r).subtract(i).length()}}function o(e,t,i){var o,r,s=n(e,t,i);return 0<=s.coeff&&s.coeff<=1?s:(o=e.subtract(i).length(),r=t.subtract(i).length(),o<r?{coeff:0,distance:o}:{coeff:1,distance:r})}Object.defineProperty(t,"__esModule",{value:!0}),t.distanceToLine=n,t.distanceToSegment=o},function(e,t,i){"use strict";function n(e,t,i){u[e].unsubscribe(i,t)}function o(e,t,i){r(e,t,i)}function r(e,t,i,n){if(u.hasOwnProperty(e)||(u[e]=new h.a),p[e])return void t.call(i);u[e].subscribe(i,t,n)}function s(e){d.push(e)}function a(e){var t,i,n=[];for(t=1;t<arguments.length;t++)n[t-1]=arguments[t];i=[e].concat(n),d.forEach(function(e){e.apply(null,i)}),u.hasOwnProperty(e)&&u[e].fire.apply(u[e],n)}function l(e){p[e]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+e+")"),p[e]=!0,a.apply(null,arguments)}var c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),t.unsubscribe=n,t.on=o,t.subscribe=r,t.subscribeToAll=s,t.emit=a,t.emitOnce=l,c=i(8),h=i.n(c),u={},d=[],p={}},function(e,t,i){"use strict";(function(t,n,o){function r(e){return"cursor"===e||"arrow"===e||"dot"===e}function s(e){!e&&u&&u.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(e,t){return function(t){
e.inFire||(e.inFire=!0,e.fire(t),e.inFire=!1)}}function l(){K||(y.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),y.subscribe(function(e){r(e)&&g.setValue(e)},{callWithLast:!0}),g.subscribe(function(e){e&&TVSettings.setValue("chart.cursorPreference",e)}),u=new c("drawings"),d=new o,p=new o,_=new o,f=new o,d.setValue(!1),p.setValue(!1),_.setValue(!1),f.setValue(!1),y.subscribe(function(){h.emit("onSelectedLineToolChanged")}),K=!0)}var c=i(3).DefaultProperty,h=i(31),u=null,d=null,p=null,_=null,f=null,m=new t,y=new t,g=new t,v=new n,S=new n,b=new n,w=new n,P=new n,T=new n,x=new n,C=new n,L=new n,I=new n,A=new n,k=new n,E=new n,M=new n,V=new n,D=a(v),O=a(S),R=a(b),B=a(w),N=a(P),F=a(T),W=a(x),H=a(C),j=a(L),z=a(I),U=a(A),q=a(k),$=a(E),Y=a(M),G=a(V),K=!1;e.exports={tool:y,cursorTool:g,toolIsCursor:r,resetToCursor:s,init:l,createdLineTool:v,continuedLineTool:S,cancelledLineTool:b,createLineTool:D,continueLineTool:O,cancelLineTool:R,startedMovingLineTool:w,movedLineTool:P,finishedMovingLineTool:T,startMovingLineTool:B,moveLineTool:N,finishMovingLineTool:F,startedChangingLineTool:x,changedLineTool:C,finishedChangingLineTool:L,startChangingLineTool:W,changeLineTool:H,finishChangingLineTool:j,removedLineTool:I,removeLineTool:z,restoredLineTool:M,restoreLineTool:Y,restoredLineToolState:V,restoreLineToolState:G,finishedLineTool:A,finishLineTool:U,changedLineStyle:k,changeLineStyle:q,copiedLineTool:E,copyLineTool:$,properties:function(){return u},hideAllDrawings:function(){return d},hideMarksOnBars:function(){return _},lockDrawings:function(){return p},drawOnAllCharts:function(){return u.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(t,i(16),i(8),i(13))},function(e,t,i){"use strict";function n(){return s.replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function o(){return r(12)}function r(e){var t,i,n="";for(t=0;t<e;++t)i=Math.round(Math.random()*(a.length-1)),n+=a[i];return n}var s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.guid=n,t.randomHash=o,t.randomHashN=r,s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",a="0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"},function(e,t,i){"use strict";(function(t,n,o,r){function s(e,t,i,n){this._study=e,this.m_series=t,this.m_model=i,this._plotName=n,this._visible=!1,this._points=[new ie(0,0)],this._invalidated=!0,this._lineRenderer=new T}function a(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:me.Line,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}function l(e,t,i,n,o){return c(e,t,i,n,pe.getStudyPropertyRootName(e),o)}function c(e,t,i,n,o,r){var s,a,l,c,h,u=d(e,t,i,n);for(r instanceof y&&(s=pe.getSourceInputIds(e),s.length>0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new oe(o,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c<e.inputs.length;++c)h=e.inputs[c],h.isHidden&&(l.addExclusion("inputs."+c),l.addExclusion("inputs."+h.id));return l}function h(e,t,i,n,o,r){
return u(e,t,i,n,o,pe.getStudyPropertyRootName(e),r)}function u(e,t,i,n,o,r,s){var a,l,c,h=p(e,t,i,n,o),u=new oe(r,h,!0);for(u.addExclusion("visible"),u.addExclusion("precision"),u.addExclusion("minTick"),a=t||e,l=0;l<a.inputs.length;++l)c=a.inputs[l],c.isHidden&&(u.addExclusion("inputs."+l),u.addExclusion("inputs."+c.id));return u}function d(e,n,o,r){var s,a,l,c,h,u,d,p,y=i(168);if(pe.versionOf(e)<1)throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");return s=TradingView.clone(defaults("study")),_(s,e),a=pe.getStudyPropertyRootName(e),l=TradingView.clone(defaults(a,r)),e.isTVScript&&e.TVScriptSourceCode!==l.TVScriptSourceCode&&(l=TradingView.clone(TradingView.factoryDefaults(a,r))),TradingView.merge(s,l),n&&(S(!(n instanceof t),"propsState should not be an instance of Property"),TradingView.merge(s,n)),c=TradingView.clone(e),h={},y.mergeInputsObjPart(h,c.defaults.inputs),y.mergeInputsObjPart(h,s.inputs),s.inputs=h,delete c.inputs,delete c.defaults.inputs,u={},TradingView.merge(u,c.defaults),TradingView.merge(u,TradingView.factoryDefaults("study_"+c.id)),TradingView.merge(u,s),TradingView.merge(u,c),delete u.defaults,s=u,d=null!==o?o.model().getStudyShiftColorStartOffset():void 0,p=f(o,e),TradingView.merge(s,m(s,p,d)),n&&TradingView.merge(s.styles,n.styles),s}function p(e,t,n,o,r){var s,a,l,c,h,u,d=i(168);return e.version&&n.version&&e.version!==n.version&&ve.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+n.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults("study_"+e.id)),_(s,e),TradingView.merge(s,n),s=r.updateStudyState(s,e,t),a=TradingView.clone(t||e),a&&pe.versionOf(a)>=1&&(l={},d.mergeInputsObjPart(l,a.defaults.inputs),d.mergeInputsObjPart(l,s.inputs),s.inputs=l,delete a.inputs,delete a.defaults.inputs,c={},TradingView.merge(c,a.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+a.id)),TradingView.merge(c,s),delete a.defaults,TradingView.merge(c,a),s=c),h=null!==o?o.model().getStudyShiftColorStartOffset():void 0,u=f(o,a),TradingView.merge(s,m(s,u,h)),s}function _(e,t){var i,n,o,r;if(t.plots)for(i=0;i<t.plots.length;i++)n=t.plots[i],o=n.id,fe.isColorerPlot(n)||(r=a(),fe.isBarColorerPlot(n)&&(r.transparency=0),r.plottype=n.type,r.title=o,e.styles&&o in e.styles&&TradingView.merge(r,e.styles[o]),e.styles[o]=r)}function f(e,t){var i,n,o,r,s=0;if(e)for(i=0;i<e.dataSources().length;i++)n=e.dataSources()[i],n.metaInfo&&n.metaInfo()&&(o=n.metaInfo().id===t.id,r=(n.metaInfo().pine&&n.metaInfo().pine.version)===(t.pine&&t.pine.version),o&&r&&s++);return s}function m(e,t,i){var n,o;if(!t)return e;for(n in e.styles)(o=e.styles[n].color)&&(e.styles[n].color=ne(o,t,i));return e}function y(e,t,r,s){var a,l,c,h,u,d,p,_,f,m,g=i(120);for(this._titleCache={},this._resolvedSymbols={},this._priceAxisViewsBase=[],this._paneViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],H.call(this,e),this._model=e,this._chartApi=e._chartApi,
this._series=r instanceof TradingView.Series?r:this._model.mainSeries(),r instanceof y&&(this._source=r,this._isChildStudy=!0,this._source.setChild(this)),this._numericFormatter=new ae,this._metaInfo=s,this._properties=t,this._properties.listeners().subscribe(this,this._onPropertiesChanged),this._properties.visible.listeners().subscribe(this,this.visibleChanged),this._properties.visible.listeners().subscribe(this,this.processHibernate),a=0;a<this._metaInfo.plots.length;a++)l=this._metaInfo.plots[a].id,null!=(c=this.properties().styles[l])&&null!=c.visible&&c.visible.listeners().subscribe(this,this.processHibernate);for(h in this._metaInfo.graphics)for(u in this._metaInfo.graphics[h])d=this._properties.graphics[h][u],d.visible&&d.visible.listeners().subscribe(this,this.processHibernate);if(this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments,this._turnaroundCounter=0,this._turnaround="st"+this._turnaroundCounter,this._status="",this._plotFields=[],p=this.metaInfo().plots)for(a=0,_=p.length;a<_;a++)u=p[a].id,this._plotFields.push(u);this._invalidateLastNonEmptyPlotRowCache(),this.m_data=new ce(ge(this._metaInfo)),this._graphics=new J,this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._studyModified=!1,this._tagsChanged=new n,this.createViews(),f=this,this._handler=function(e){f.onData(e)},this._handler.isTVScriptStrategy=this._metaInfo.isTVScriptStrategy,this._createFormatter(),f=this,this._properties.precision.listeners().subscribe(null,function(){f._createFormatter(),f._model.invalidate(new ee(ee.FULL_UPDATE))}),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.inputs.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),o.enabled("update_study_formatter_on_symbol_resolve")&&e.mainSeries().dataEvents().symbolResolved().subscribe(this,y.prototype._createFormatter),f=this,m={},this._simplePlotsCount=s.plots.filter(function(e,t){if(f.isLinePlot(t))return!0;if(f.isOHLCSeriesPlot(t)){var i=f.metaInfo().plots[t].target;return!m[i]&&(m[i]=i,!0)}return!1}).length,this._properties.showInDataWindow.listeners().subscribe(e,g.prototype.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(e.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache),this.onStart=new n,this._childStudyByRebind=new n,this._symbolsResolved=new n}function g(e,t){return e&&e[t]&&e[t].hasOwnProperty("showLast")?e[t].showLast.value():null}
var v=i(7),S=v.assert,b=v.ensureNotNull,w=i(259).unpackNonSeriesData,P=i(166).StudyBarColorer,T=i(109).HorizontalLineRenderer,x=i(508),C=x.BandPaneView,L=x.BandBackgroundPaneView,I=x.HlineFillPaneView,A=i(509).StudyPriceAxisView,k=i(510),E=k.StudyPaneView,M=k.StudyBackgroundPaneView,V=k.StudyPlotShapesPaneView,D=k.StudyPlotCharsPaneView,O=k.StudyPlotArrowsPaneView,R=k.StudyPlotBarsPaneView,B=k.StudyPlotCandlesPaneView,N=i(527),F=N.PlotFillPaneView,W=N.AreaBackgroundPaneView,H=i(28).PriceDataSource,j=i(99),z=i(117).StudyDataWindowView,U=i(528).StudyLegendView,q=i(119),Y=i(529),G=Y.emptyStudyGraphics,K=Y.loadStudyGraphics,Z=Y.saveStudyGraphics,J=Y.LiveStudyGraphics,X=Y.createGraphicsPaneViews,Q=Y.createGraphicsPriceAxisViews,ee=i(18),te=i(268).ChartApiInterface,ie=i(6).Point,ne=i(24).shiftColor,oe=i(3).DefaultProperty,re=i(21).PriceFormatter,se=i(530).VolumeFormatter,ae=i(105).NumericFormatter,le=i(17),ce=le.PlotList,he=le.PlotRowSearchMode,ue=le.mergeMinMax,de=i(212).MarkLocation,pe=i(26),_e=i(31),fe=i(86),me=fe.PlotType,ye=i(2).propertyPages,ge=i(269).studyPlotFunctionMap,ve=i(4).getLogger("Chart.Study");s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){this._visible=!1;var e=this._study.lastValueData(this._plotName,!0);e.noData||(this._visible=!0,this._points=[new ie(0,e.coordinate)],this._color=e.color)},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var e={};return e.width=this.m_model.timeScale().width(),e.height=this._study.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(y,H),TradingView.Study=y,y.prototype.lastValueData=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return x;if(null===(n=this._model.timeScale().visibleBars()))return x;if(!this.properties().visible.value())return x;if(o=this.properties().styles,r=this.properties().ohlcPlots,o&&o[e]&&(s=o[e]),r&&r[e]&&(s=r[e]),!s||!s.visible.value())return x;if(a=this.offset(e),null==(l=this.nearestIndex(n.lastBar()-a,he.NearestLeft))||void 0===l)return x;for(h=this.metaInfo().plots,c=0;c<h.length&&!(h[c].id===e||this.isOHLCClosePlot(c)&&h[c].target===e);c++);if(u=this._lastNonEmptyPlotRow(c),d=null!==u&&n.contains(u.index),p=null!==u?u.value:null,!(_=t||d?p:this.data().valueAt(l))||!isNumber(_[c+1]))return x;for(f={noData:!1},m=null,y=null,v=0;v<h.length;v++)h[v].target===e&&(this.isSelfColorerPlot(v)||this.isOHLCColorerPlot(v))&&(m=v,y=this.metaInfo().palettes[h[v].palette],g=this.properties().palettes[h[v].palette]);return S=_[c+1],i&&(f.price=S),(b=this.firstValue(!0))?(f.text=this.priceScale().formatPrice(S,b),w=s.color.value(),m&&_.length>m+1?(P=_[m+1],void 0!==P&&null!==P?(T=y.valToIndex?y.valToIndex[P]:P,
f.color=g.colors[T].color.value()):f.color=w):f.color=w,f.floatCoordinate=this.priceScale().priceToCoordinate(S,b,!0),f.coordinate=Math.round(f.floatCoordinate),f.item=_,f):x},y.prototype.isFailed=function(){return this._failed},y.prototype.series=function(){return this._series},y.prototype.model=function(){return this._model},y.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},y.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},y.prototype.onTagsChanged=function(){return this._tagsChanged},y.prototype.properties=function(){return this._properties},y.prototype.state=function(e){var t,i,n,o,r=TradingView.className(this.constructor),s={type:r,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof pe?s.metaInfo=TradingView.clone(this.metaInfo().state()):(s.metaInfo=TradingView.clone(this.metaInfo()),s.metaInfo.id=pe.parseIdString(s.metaInfo.id+(s.metaInfo.version?"-"+s.metaInfo.version:"")).fullId),e&&(s.data=this.data().state(),s.data.symbols=this._resolvedSymbols,s.data.graphics=Z(this.graphics()),s.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(s.ownerSource=this.ownerSource().id()),t=0;t<this._metaInfo.inputs.length;t++)"bar_time"===this._metaInfo.inputs[t].type&&(i=this._metaInfo.inputs[t].id,(n=s.state.inputs[i])<0&&(o=this._rightOffsetToUnixTime(-n),s.state.inputs[i]=o&&o>=0?o:0));return this._isChildStudy&&pe.patchChildStudyMetaInfoState(s),s},y.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[fe.isLinePlot,fe.isShapesPlot,fe.isCharsPlot,fe.isArrowsPlot,fe.isOhlcPlot];return t.plots.map(function(e,t){return e.pinePlotIndex=t,e}).filter(function(e){return i.some(function(t){return t(e)})}).map(function(i){var n={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(n.title=t.styles[i.id].title||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(n.ohlcTitle=t.ohlcPlots[i.target].title),n})},y.prototype.isSavedInStudyTemplates=function(){for(var e=0;e<this._metaInfo.inputs.length;e++)if("bar_time"===this._metaInfo.inputs[e].type)return!1;return!0},y.prototype.restoreData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.restoreState(e),this._resolvedSymbols=e.symbols,this._graphics=e.graphics?K(e.graphics):G(),this._postProcessGraphics(),this._plotOffsets=e.plotOffsets},y.prototype.restart=function(){this._restarting=!0,this.clearData(),o.enabled("stop_study_on_restart")&&this.stop(),setTimeout(this.start.bind(this),0)},y.prototype.stop=function(e){if(!0===e&&this._children)for(var t=0;t<this._children.length;++t)this._children[t].stop(!0);this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),
o.enabled("update_study_formatter_on_symbol_resolve")&&this._model.mainSeries().dataEvents().symbolResolved().unsubscribe(this,y.prototype._createFormatter),this._studyId=null,this.clearData(),this._unsubscribeExtendedHours(),this.recalculate()},y.prototype.symbolsResolved=function(){return this._symbolsResolved},y.prototype.resolvedSymbolInfoBySymbol=function(e){return this._resolvedSymbols&&e?this._resolvedSymbols[e]||null:null},y.prototype._resolveSymbol=function(e){var t=function(i,n){this._chartApi.resolveSymbol(this._makeNextSymbolId(),i,function(i){switch(i.method){case"symbol_resolved":this._resolvedSymbols[e]=i.params[1],this.invalidateTitleCache(!0),n.resolve(e);break;case"symbol_error":if("permission denied"===i.params[1]&&i.params[2])switch(i.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(i.params[3])return void t(i.params[3],n);break;default:return void t(i.params[2],n)}n.reject(e)}}.bind(this))}.bind(this),i=$.Deferred();return t(e,i),i.promise()},y.prototype._allSymbolsAreResolved=function(){var e,t,i,n,o=$.Deferred(),r=[];for(e=0;e<this._metaInfo.inputs.length;e++)"symbol"===this._metaInfo.inputs[e].type&&(t=this._metaInfo.inputs[e].id,i=this._properties.inputs[t].value(),this._resolvedSymbols[i]||(n=this._resolveSymbol(i),r.push(n)));return r.length>0?$.when.apply($,r).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),o.resolve("All symbols are resolved now"),this._symbolsResolved.fire()}.bind(this)).fail(function(e){this._status=window.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),o.reject("Invalid symbol, "+e)}.bind(this)):o.resolve("There are no symbols to resolve"),o.promise()},y.prototype._allInputsAreValid=function(){var e,t,i;for(e=0;e<this._metaInfo.inputs.length;e++)if("bar_time"===this._metaInfo.inputs[e].type&&(t=this._metaInfo.inputs[e].id,void 0===(i=this._properties.inputs[t].value())||null==i))return!1;return!0},y.prototype.sourceId=function(){return this._studyId},y.prototype.source=function(){return this._source||this._series},y.prototype.ownerSource=function(){return this._isChildStudy?this._source:H.prototype.ownerSource.call(this)},y.prototype.getAllOwnerSources=function(){for(var e=[],t=this.ownerSource();null!=t;)e.push(t),t=t.ownerSource();return e},y.prototype.isChildStudy=function(){return!!this._isChildStudy},y.prototype.setChild=function(e){e instanceof y&&e.source()===this&&(this._children||(this._children=[]),-1===this._children.indexOf(e)&&this._children.push(e))},y.prototype.unsetChild=function(e){if(e instanceof y&&e.source()===this&&this._children){var t=this._children.indexOf(e);~t&&this._children.splice(t,1)}},y.prototype.hasChildren=function(){return!(!this._children||!this._children.length)},y.prototype.getAllChildren=function(){var e,t,i,n;if(!Array.isArray(this._children))return[];for(e=this._children.slice(),t=0;t<e.length;++t)for(i=e[t].getAllChildren(),n=0;n<i.length;++n)~e.indexOf(i[n])||e.push(i[n]);return e},y.prototype._debugId=function(){var e=[]
;return this._studyId&&e.push(this._studyId),e.push(this._metaInfo.fullId),e.push(this._metaInfo.description),JSON.stringify({study:e})},y.prototype.isStarted=function(){return!!this._studyId},y.prototype.isRestarting=function(){return!!this._restarting},y.prototype.isVisible=function(){var e,t,i;if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)return!0;for(e in this._metaInfo.graphics)for(t in this._metaInfo.graphics[e])if(i=this.properties().graphics[e][t],!i.visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},y.prototype.start=function(e,t){var i,n=this._model.mainSeries();if(!n.isStarted())return void n.dataEvents().completed().subscribe(this,function(){this.start(e,t)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==t||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(e,t)}.bind(this)).fail(function(e){ve.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))},y.prototype._getStudyIdWithLatestVersion=function(){var e=pe.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},y.prototype._startAfterSymbolsResolved=function(e,t){var i,n;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);pe.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=y.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._getStudyIdWithLatestVersion(),this._incrementTurnaround(),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),this.onStart.fire(this._studyId),!0===e&&this._children))for(n=0;n<this._children.length;++n)this._children[n].start(!0,t)}},y._nextSymbolId=0,y.prototype._makeNextSymbolId=function(){return"ss_"+ ++y._nextSymbolId},y._nextStudyId=0,y.makeNextStudyId=function(){return"st"+ ++y._nextStudyId},y.prototype._rightOffsetToUnixTime=function(e){var t;return this._series.bars().size()>=e&&(t=b(this._series.bars().lastIndex())-e,b(this._series.bars().valueAt(t))[TradingView.TIME_PLOT]),null},y.prototype.getSymbolString=function(e){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:e,session:"extended"}):e},y.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},y.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},y.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0,
skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(t,e),this._buildInputs(t)},y.prototype._buildInputs=function(e){var t,i;S(!!e,"options not set"),t={};try{t=this._prepareInputs(e)}catch(e){ve.logWarn("Failed to prepare study inputs: "+e)}return e.asObject?(i={},Object.keys(t).forEach(function(e){null!=t[e]&&(i[e]=t[e])}),i):(i=[],Object.keys(t).forEach(function(e){null!=t[e]&&i.push(t[e])}),i)},y.prototype._prepareInputs=function(e){var t,i,n,r;for(S(!!e,"options not set"),t={},i=0;i<this._metaInfo.inputs.length;i++)n=this._metaInfo.inputs[i],n.isFake&&e.skipFakeInputs||n.isHidden&&e.skipHiddenInputs||"bool"===n.type&&e.skipHiddenInputs&&o.enabled("dont_show_boolean_study_arguments")||(r=this._prepareInput(n,e),t[n.id]=TradingView.clone(r));return t},y.prototype._prepareInput=function(e,t){var i=this._prepareInputValue(e,t);return!e.isFake||t.fakeInputsForDisplay?i:t.onlyAtomValues?i:{v:i,f:!0,t:e.type}},y.prototype._prepareInputValue=function(e,t){var i,n,o,r,s=e.id;return"symbol"===e.type?(i=this._properties.inputs[s].value(),t&&t.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[i]&&(i=this._resolvedSymbols[i].exchange?this._resolvedSymbols[i].name+", "+this._resolvedSymbols[i].exchange:this._resolvedSymbols[i].name):(this._resolvedSymbols&&this._resolvedSymbols[i]&&(n=this._resolvedSymbols[i],i=n.ticker||n.full_name),t&&t.symbolsForChartApi&&(i=this.getSymbolString(i))),i):"bar_time"===e.type?(o=this._properties.inputs[s].value(),o<0&&(r=this._rightOffsetToUnixTime(-o),o=r&&r>=0?r:o),o):this._metaInfo.isTVScript||this._metaInfo.pine?"text"===s?this._metaInfo.defaults.inputs.text:"pineId"===s?this._metaInfo.scriptIdPart:"pineVersion"===s?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[s].value():this._properties.inputs[s].value()},y.prototype._rebindToSource=function(e,t){var i,n,o,r,s,a,l,c,h,u,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,n=null,e===this._model.mainSeries()){for(o=this._model.studiesMetaData(),s=0;s<o.length;++s)if(this._metaInfo.id===o[s].id){r=o[s];break}if(!r)return void ve.logError("Can not find "+this._metaInfo.id+" meta info");delete this._source,delete this._isChildStudy,delete this._ownerSource,this._metaInfo=r.state(!0),i=this._series._seriesId,n=te.REBIND_STUDY_CHILD_TO_STANDALONE}else{if(!(e instanceof y))return ve.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source=e,i=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this._chartApi.rebindStudy(this._studyId,this._turnaround,i,this._studyName,t,this._handler,n)}else{if(!(e instanceof y))return ve.logError("Unable to rebind study to source of this type"),!1;if(a=e.isHibernated(),a&&e.start(),l=!1,this._canCreateStudyWithRebindType(te.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),
l=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,te.REBIND_STUDY_STANDALONE_TO_CHILD)),!l)return a&&e.stop(),!1;this._metaInfo=TradingView.clone(this._metaInfo),this._isChildStudy=!0,this._ownerSource=e,this._source=e,this._source.setChild(this),this._childStudyByRebind.fire()}return c=this.m_priceScale,h=e.priceScale(),c!==h&&(u=this._model.paneForSource(this),d=this._model.paneForSource(e),u===d&&(~c.dataSources().indexOf(this)&&c.removeDataSource(this),h.addDataSource(this),this.setPriceScale(h))),!0},y.prototype.childStudyByRebind=function(){return this._childStudyByRebind},y.prototype._changeInputsImpl=function(e,t){var i,n,o,r,s=this.source(),a=this._properties.inputs&&this._properties.inputs.state(),l=pe.getSourceIdByInputs(this._metaInfo.inputs,a),c=!0;if(l)if("high"===l||"open"===l||"low"===l||"close"===l||"hl2"===l||"ohl3"===l||"ohlc4"===l)s=this._model.mainSeries();else for(i=this._model.dataSources(),n=0;n<i.length;++n)if(i[n]instanceof y&&i[n].sourceId()===l){s=i[n];break}if(s!==this.source()){if(!this._rebindToSource(s,e)&&a){for(o=null,r=null,n=0;n<t.length;++n)if(t[n]!==e[n]&&0===e[n].indexOf(l)){o=this._properties.inputs[a[n].id],r=t[n],c=!1;break}o&&o.setValue(r)}}else this._incrementTurnaround(),this._chartApi.modifyStudy(this._studyId,this._turnaround,e,this._handler);c&&(this._studyModified=c)},y.prototype._incrementTurnaround=function(){this._turnaround="st"+ ++this._turnaroundCounter},y.prototype._tryChangeInputs=function(){var e=TradingView.clone(this._inputs);this.isStarted()&&this._chartApi.connected()?this._allInputsAreValid()?this._allSymbolsAreResolved().done(function(){var t=this.inputs();JSON.stringify(t)!==JSON.stringify(this._inputs)&&(this._changeInputsImpl(t,e),this._inputs=t)}.bind(this)).fail(function(e){ve.logError("ERROR: "+this._debugId()+" _tryChangeInputs: cannot modify study, "+e)}.bind(this)):this.stop():(this.stop(!0),this.start(!0)),this._tagsChanged.fire()},y.prototype.testInputValue=function(e,t){var i,n;return!pe.canBeChild(this._metaInfo)||!pe.isSourceInput(e)||(!(i=this._properties.inputs&&this._properties.inputs[e.id])||(n=y.getInputRebindType(e,i.value(),t),!!this._canCreateStudyWithRebindType(n)))},y.prototype._canCreateStudyWithRebindType=function(e){return e!==te.REBIND_STUDY_STANDALONE_TO_CHILD||this._chartApi.isCanCreateStudy(!0)},y.prototype.changeStyles=function(){var e=null!=this._metaInfo.inputs.filter(function(e){return"symbol"===e.type})[0];!this.isStarted()&&!e||this._restarting||(this._inputs?this._tryChangeInputs():this._chartApi&&this._chartApi.connected()&&this.restart(),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),e&&this.invalidateBarStylesCache(),this.createViews(),this.recalculate(!0),this.updateAllViews())},y.prototype._onPropertiesChanged=function(){this.changeStyles(),_e.emit("study_properties_changed",this._id)},y.prototype._isModifiedStudyInputs=function(e){if(void 0===this._oldStudyInputs)return this._oldStudyInputs=e,!0
;var t=Object.keys(this._oldStudyInputs);return S(t.length===Object.keys(e).length,"keys quantity should be equal"),t.forEach(function(t){S(e.hasOwnProperty(t),"key '"+t+"' should existing in studyInputs"),this._oldStudyInputs[t]!==e[t]&&(this._oldStudyInputs=e)},this),this._oldStudyInputs===e},y.prototype.visibleChanged=function(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()},y.prototype.invalidateBarStylesCache=function(){this.m_data.each(function(e,t){t[TradingView.STYLE_PLOT]=null})},y.prototype.processHibernate=function(){this.isHibernateAllowed()&&(!this._studyId&&this.isVisible()&&this.start(),this._studyId&&!this.isVisible()&&this.stop())},y.prototype.isHibernated=function(){return!this.isVisible()&&!this._studyId},y.prototype.isHibernateAllowed=function(){return!this._isChildStudy&&!this.hasChildren()},y.prototype.lastPriceLabelFixedCoordinate=function(e){return this._priceAxisViewsCache[e]._fixedCoordinate},y.prototype.priceLabelText=function(e){var t,i,n,o;return 1===this._simplePlotsCount?this._metaInfo.shortDescription:(t=this._metaInfo.styles,i=this._metaInfo.ohlcPlots,t&&t[e]&&(n=t[e]),i&&i[e]&&(n=i[e]),o=n.title,this._metaInfo.is_price_study?this._metaInfo.shortDescription+":"+o:o)},y.prototype.createPlotLabels=function(e){for(var t=0;t<e.length;t++)this._paneViews.push(new j(this._model,this,e[t],"priceLabelText","showStudyPlotLabels"))},y.prototype.createViews=function(){var e,t,i,n,o,r,a,l,c;if(this._priceAxisViewsBase=[],this._paneViews=[],e={},this._priceAxisViewsCache={},t=[],this.metaInfo().plots)for(i=0;i<this.metaInfo().plots.length;i++)if(!(this.isSelfColorerPlot(i)||this.isTextColorerPlot(i)||this.isBarColorerPlot(i)||this.isOHLCColorerPlot(i)))if(n=this.metaInfo().plots[i].id,this.isBgColorerPlot(i))this._paneViews.push(new M(this,this._series,this._model,n));else if(this.isPlotShapesPlot(i))this._paneViews.push(new V(this,this._series,this._model,n));else if(this.isPlotCharsPlot(i))this._paneViews.push(new D(this,this._series,this._model,n));else if(this.isPlotArrowsPlot(i))this._paneViews.push(new O(this,this._series,this._model,n));else if(this.isOHLCSeriesPlot(i)){if(o=this.metaInfo().plots[i].target,e[o])continue;e[o]=o,this.isOHLCBarsPlot(i)?this._paneViews.push(new R(this,this._series,this._model,o)):this.isOHLCCandlesPlot(i)&&this._paneViews.push(new B(this,this._series,this._model,o)),r=new A(this,{plotIndex:o}),this._priceAxisViewsCache[o]=r,this._priceAxisViewsBase.push(r),t.push(o)}else r=new A(this,{plotIndex:n}),this._priceAxisViewsCache[n]=r,this._priceAxisViewsBase.push(r),this._paneViews.push(new E(this,this._series,this._model,n)),this.properties().styles[n].trackPrice.value()&&this._paneViews.push(new s(this,this._series,this._model,n)),t.push(n);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new C(this._properties.bands[i],this));if(this._properties.bandsBackground&&this._paneViews.push(new L(this)),a=this._paneViews,
X(this).then(function(e){for(var t=0;t<e.length;t++)a.push(e[t])}),this._properties.areaBackground&&this._paneViews.push(new W(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)l=this._metaInfo.filledAreas[i],c=this._properties.filledAreasStyle[l.id],l.type===pe.FilledArea.TYPE_PLOTS||l.palette?this._paneViews.push(new F(this,l,c)):l.type===pe.FilledArea.TYPE_HLINES?this._paneViews.push(new I(this,l,c)):ve.logWarn("Unsupported filledArea type: "+l.type);this.createPlotLabels(t),this._dataWindowView||(this._dataWindowView=new z(this,this._model)),this._legendView||(this._legendView=new U(this,this._model)),this._statusView||(this._statusView=new q(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},y.prototype.recalculate=function(e){var t=this._model.paneForSource(this);this._model.recalculatePane(t,e),this._model.updateSource(this)},y.prototype.data=function(){return this.m_data},y.prototype.metaInfo=function(){return this._metaInfo},y.prototype.status=function(){return this._status},y.prototype.title=function(e,t,i){var n,o;return i=void 0===i?!this._showStudyArgumentsProperty.value():i,n=JSON.stringify([e,t,i]),this._titleCache[n]?this._titleCache[n]:(o=this._title(e,t,i),this._titleCache[n]=o,o)},y.prototype._title=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_,f;if(n=e?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",t=t||{},n=window.t(n),!i&&(o=this.inputsForGUI()||[],o.length>0)){if(r={},this._isChildStudy)for(s=0;s<this._metaInfo.inputs.length;++s)if(a=this._metaInfo.inputs[s],pe.isSourceInput(a)){l=a.id,c=this._properties.inputs[l].value(),c.indexOf("$")>=0&&this._source&&(h=this._source.metaInfo(),u=this._source.title(e,null,!0),1===h.plots.length?r[c]=u:(d=c.split("$")[1],p=h.plots[d].id,_=h.styles&&h.styles[p]&&h.styles[p].title||p,r[c]=u+": "+_));break}f=this,o=o.map(function(e){var i=isNumber(e)?f._numericFormatter.format(e):r&&r[e]||e;return t[i]&&(i=t[i]),i}),n+=" ("+o.join(", ")+")"}return n},y.prototype.invalidateTitleCache=function(e){if(this._titleCache={},!0===e&&this._children)for(var t=0;t<this._children.length;++t)this._children[t].invalidateTitleCache(e)},y.prototype.graphics=function(){return this._graphics},y.prototype.turnaround=function(e){return!0===e?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},y.prototype._checkTurnaround=function(e){return e===this._turnaround||e===this._model.mainSeries().turnaround()||e===this.turnaround(!0)},y.prototype.onData=function(e){var t,i,n,o,r,s=this;switch(e.method){case"study_loading":this._status=window.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),s._loadingStartTime=(new Date).getTime();break;case"study_error":delete this._loadingStartTime,this._failed=!0,
this.clearData(),this._status="","string"==typeof e.params[2]&&(t=e.params[2],i=t.split(":",2)[0],i.length>0&&(this._status=$.t(i))),this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(e.params[1]))return;n="chartSession:"+s._chartApi._sessionid,o=(new Date).getTime()-this._loadingStartTime,ve.logDebug(n+", Study "+this._metaInfo.description+" loading took "+o+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),r=this._model.paneForSource(this),this._model.recalculatePane(r),this._updateSources(),this._model.invalidate(new ee(ee.FULL_UPDATE));break;case"study_deleted":break;case"data_update":if(e.params.customId!==this.sourceId()||!this._checkTurnaround(e.params.turnaround))return;S(!!e.params.nonseries,"data.params.nonseries is missing"),this._onDataUpdate(e.params.plots,e.params.nonseries)}},y.prototype._onDataUpdate=function(e,t){this._studyModified&&(this.clearData(),this._studyModified=!1),w(t.d).then(function(i){"nochange"!==t.indexes&&this._processPlotOffsets(i),this.transformData(e),this._mergeData(e),null!==i&&(i.indexes_replace?(S("nochange"!==t.indexes),this._graphics.replaceIndexesTo(t.indexes)):("nochange"!==t.indexes&&this._graphics.replaceIndexesTo(t.indexes),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._onDataUpdated(e,i,t.indexes)}.bind(this))},y.prototype._onDataUpdated=function(e,t,i){this.hasBarColorer()&&e.length>0&&this._model.mainSeries().invalidateBarStylesCache(e[0].index),null!==t&&this._postProcessGraphics();var n=this._model.paneForSource(this);this._model.recalculatePane(n),this._updateSources()},y.prototype.transformData=function(e){},y.prototype.moveData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(e)},y.prototype.replaceData=function(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(e+1),this.m_data.addTail(i,t)},y.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},y.processPlotOffsets=function(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})},y.prototype._processPlotOffsets=function(e){y.processPlotOffsets(this,e)},y.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(e)},y.prototype._postProcessGraphics=function(){this._priceAxisViews=[].concat(this._priceAxisViewsBase,Q(this))},y.prototype._getNonPriceParent=function(){var e,t;if(this._nonPriceParent)return this._nonPriceParent;for(e=this.source();e instanceof y;){if(t=e.metaInfo(),!t.is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}},y.prototype.firstValue=function(e){var t,i,n,o,r,s;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?null===(t=this._model.timeScale().visibleBars())?null:(i=t.firstBar(),n=t.lastBar(),0===this.data().size()?null:(r=this,this.data().range(i,n).each(function(t,i){var n,s,a
;for(n=1;n<i.length;++n)if(void 0!==i[n-1]&&null!==i[n-1]&&!r.isSelfColorerPlot(n-1)&&(s=r._metaInfo.plots[n-1].id,a=r.properties().styles[s],a.visible&&a.visible.value()&&!(e&&Math.abs(i[n])<1e-10||void 0===i[n]||null===i[n]||o)))return o=i[n],!0}),this._nonPriceFirstValue=o,o)):this._isChildStudy&&(s=this._getNonPriceParent())&&this.priceScale()===s.priceScale()?void 0!==s._nonPriceFirstValue?s._nonPriceFirstValue:s.firstValue():this._series.firstValue()},y.offset=function(e,t){var i=0;return e._plotOffsets&&void 0!==e._plotOffsets[t]&&(i+=e._plotOffsets[t]),void 0!==e._plotOffsetsMetaInfoOverride[t]?i+=e._plotOffsetsMetaInfoOverride[t]:e.properties().offsets&&void 0!==e.properties().offsets[t]&&(i+=e.properties().offsets[t].val.value()),e.properties().offset&&(i+=e.properties().offset.val.value()),i},y.prototype.offset=function(e){return y.offset(this,e)},y.prototype.priceRange=function(e,t){var i,n,o,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S;if(!TradingView.isInteger(e))return void ve.logDebug("priceRange: incorrect startBar");if(!TradingView.isInteger(t))return void ve.logDebug("priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,n=this,o=n._metaInfo,0===o.plots.length)return null;for(a=[],c=null,h=0;h<o.plots.length;++h)if(!(n.isSelfColorerPlot(h)||n.isTextColorerPlot(h)||n.isBarColorerPlot(h)||n.isBgColorerPlot(h)||n.isOHLCColorerPlot(h))&&(u=o.plots[h].id,n.isOHLCSeriesPlot(h)?(p=o.plots[h].target,d=n.properties().ohlcPlots[p]):d=n.properties().styles[u],d.visible.value()&&(l=null,d.location&&(l=d.location.value()),s||(_=[de.Absolute,de.Top,de.Bottom].indexOf(l)<0,f=n.isPlotShapesPlot(h)||n.isPlotCharsPlot(h),s=f&&_||n.isPlotArrowsPlot(h)),n.isLinePlot(h)||(n.isPlotShapesPlot(h)||n.isPlotCharsPlot(h))&&d.location.value()===de.Absolute||n.isOHLCSeriesPlot(h)))){if(m={name:u,offset:n.offset(u)},y=n.properties().styles[u].plottype.value(),!n.properties().skipHistogramBaseOnAutoScale&&[me.Histogram,me.Columns,me.Area].indexOf(y)>=0){if(g=n.properties().styles[u].histogramBase.value(),!isNumber(g))continue;c=ue(c,{min:g,max:g})}a.push(m)}if(v=n.m_data.minMaxOnRangeCached(e,t,a),v=ue(c,v),s&&(a=[{name:"low",offset:0},{name:"high",offset:0}],S=n.series().data().bars().minMaxOnRangeCached(e,t,a),v=ue(v,S)),null!==v&&(i=new r(v.min,v.max)),o.bands)for(h=0;h<o.bands.length;h++)if(n.properties().bands[h].visible.value()){if(g=n.properties().bands[h].value.value(),!isNumber(g))continue;i?i.apply(g,g):i=new r(g,g)}return this._postProcessPriceRange(i)},y.prototype._postProcessPriceRange=function(e){var t,i;return e&&e.minValue()===e.maxValue()&&(t=.005*e.minValue(),e=new r(e.minValue()-t,e.maxValue()+t)),i=this.priceScale(),i&&i.isLog()&&e?new r(this.priceScale().priceToLogical(e.minValue()),this.priceScale().priceToLogical(e.maxValue())):e},y.prototype.paneViews=function(e){return this.properties().visible.value()?this._paneViews:null},y.prototype.dataWindowView=function(){return this._dataWindowView},y.prototype.legendView=function(){return this._legendView},y.prototype.statusView=function(){
return this._statusView},y.prototype.priceAxisViews=function(e,t){return this._model.paneForSource(this)===e&&t===this.priceScale()&&(this._showLastValueOnPriceScale()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},y.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showStudyLastValue.value()},y.prototype.isLinePlot=function(e){var t=this._metaInfo.plots[e];return fe.isLinePlot(t)},y.isSelfColorerPlot=function(e,t){var i=e._metaInfo.plots[t];return fe.isColorerPlot(i)},y.prototype.isSelfColorerPlot=function(e){return y.isSelfColorerPlot(this,e)},y.prototype.isTextColorerPlot=function(e){var t=this._metaInfo.plots[e];return fe.isTextColorerPlot(t)},y.prototype.isBarColorerPlot=function(e){var t=this._metaInfo.plots[e];return fe.isBarColorerPlot(t)},y.prototype.isBgColorerPlot=function(e){var t=this._metaInfo.plots[e];return fe.isBgColorerPlot(t)},y.prototype.isPlotShapesPlot=function(e){var t=this._metaInfo.plots[e];return fe.isShapesPlot(t)},y.prototype.isPlotCharsPlot=function(e){var t=this._metaInfo.plots[e];return fe.isCharsPlot(t)},y.prototype.isPlotArrowsPlot=function(e){var t=this._metaInfo.plots[e];return fe.isArrowsPlot(t)},y.prototype.isOHLCBarsPlot=function(e){var t=this._metaInfo.plots[e].target,i=this.metaInfo().defaults.ohlcPlots[t];return i&&this.isOHLCSeriesPlot(e)&&fe.isOhlcPlotStyleBars(i)},y.prototype.isOHLCCandlesPlot=function(e){var t=this._metaInfo.plots[e].target,i=this.metaInfo().defaults.ohlcPlots[t];return i&&this.isOHLCSeriesPlot(e)&&fe.isOhlcPlotStyleCandles(i)},y.prototype.isOHLCSeriesPlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcPlot(t)},y.prototype.isOHLCOpenPlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcOpenPlot(t)},y.prototype.isOHLCHighPlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcHighPlot(t)},y.prototype.isOHLCLowPlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcLowPlot(t)},y.prototype.isOHLCClosePlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcClosePlot(t)},y.prototype.isOHLCColorerPlot=function(e){var t=this._metaInfo.plots[e];return fe.isOhlcColorerPlot(t)},y.prototype.isDataOffsetPlot=function(e){var t=this._metaInfo.plots[e];return fe.isDataOffsetPlot(t)},y.prototype.hasBarColorer=function(){for(var e=0;e<this._metaInfo.plots.length;++e)if(this.isBarColorerPlot(e))return!0;return!1},y.prototype.barColorer=function(){var e,t,i=null;for(e=0;e<this._metaInfo.plots.length;++e)this.isBarColorerPlot(e)&&(t=new P(this,e),null==i?i=t:i.pushBackBarColorer(t));if(null==i)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return i},y.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0},y.prototype._createFormatter=function(){var e,t,i;"default"===this.properties().precision.value()?this.metaInfo().defaults&&(e=parseInt(this.metaInfo().defaults.precision)):e=parseInt(this.properties().precision.value()),
isFinite(e)||(e=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1e4),t=this.series().symbolInfo(),0===e?(i=0,t&&t.volume_precision&&(i=t.volume_precision),this._formatter=new se(i)):this._formatter=new re(Math.pow(10,e)),this.priceScale()&&this.priceScale().updateFormatter()},y.prototype.formatter=function(){return this._formatter},y.prototype.nearestIndex=function(e,t){if(!TradingView.isInteger(e))return void ve.logDebug("nearestIndex: incorrect logicalPoint");var i=this._series.data().bars().search(e,t);return null!==i?i.index:void 0},y.prototype._lastNonEmptyPlotRow=function(e){var t,i;return TradingView.isInteger(e)?void 0!==this._lastNonEmptyPlotRowCache[e]?this._lastNonEmptyPlotRowCache[e]:(t=1e3,null===(i=this.data().findLast(function(t,i){return void 0!==i[e]},t))?null:(this._lastNonEmptyPlotRowCache[e]=i,this._lastNonEmptyPlotRowCache[e])):(ve.logDebug("_lastNonEmptyPlotRow: incorrect plotIndex"),null)},y.prototype.updateAllViews=function(){var e;for(e=0;e<this._paneViews.length;e++)this._paneViews[e].update();for(this._dataWindowView.update(),null!==this._legendView&&this._legendView.update(),this._statusView.update(),e=0;e<this._priceAxisViews.length;e++)this._priceAxisViews[e].update()},y.prototype.tags=function(){return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]},y.isPointsBasedStudy=function(e){switch(e){case"VbPFixed@tv-volumebyprice":case"mtp_tsanalysis@mtp-mtpredictor":case"mtp_riskreward@mtp-mtpredictor":case"mtp_decisionpoint@mtp-mtpredictor":case"mtp_ew_main@mtp-mtpredictor":case"mtp_ew_major@mtp-mtpredictor":case"mtp_ew_minor@mtp-mtpredictor":case"mtp_wpt_down1ora@mtp-mtpredictor":case"mtp_wpt_down2orb@mtp-mtpredictor":case"mtp_wpt_down3@mtp-mtpredictor":case"mtp_wpt_down4@mtp-mtpredictor":case"mtp_wpt_down5@mtp-mtpredictor":case"mtp_wpt_downc@mtp-mtpredictor":case"mtp_wpt_up1ora@mtp-mtpredictor":case"mtp_wpt_up2orb@mtp-mtpredictor":case"mtp_wpt_up3@mtp-mtpredictor":case"mtp_wpt_up4@mtp-mtpredictor":case"mtp_wpt_up5@mtp-mtpredictor":case"mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}},y.lineToolNameForPointsBasedStudy=function(e){switch(e){case"VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case"RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case"mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case"mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case"mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case"mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case"mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";case"mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case"mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case"mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case"mtp_wpt_down3@mtp-mtpredictor":
return"LineStudyMtpDownWave3";case"mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case"mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case"mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case"mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";case"mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case"mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case"mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case"mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case"mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+e)}},y.prototype.onExtendedHoursChanged=function(){this.restart()},y.prototype.hasSymbolInputs=function(){for(var e=this._metaInfo.inputs.length;e--;)if("symbol"===this._metaInfo.inputs[e].type)return!0;return!1},y.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.onExtendedHoursChanged().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)},y.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.onExtendedHoursChanged().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)},y.prototype.removeByRemoveAllStudies=function(){return!0},y.prototype.canHaveChildren=function(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!pe.canHaveChildren(this._metaInfo)),this._canHaveChildren},y.getInputRebindType=function(e,t,i){var n=pe.isSourceInput(e);return n&&!~t.indexOf("$")&&~i.indexOf("$")?te.REBIND_STUDY_STANDALONE_TO_CHILD:n&&~t.indexOf("$")&&!~i.indexOf("$")?te.REBIND_STUDY_CHILD_TO_STANDALONE:0},y.prototype.getPlotFields=function(){return this._plotFields},y.prototype.getMinFirstBarIndexForPlot=function(e){var t,i=g(this._properties.styles,e)||g(this._properties.ohlcPlots,e)||g(this._properties.filledAreasStyle,e);return null===i?-1/0:(t=this.data().lastIndex(),null===t?-1/0:t-i+1)},y.prototype.getInputsPropertyPage=function(){return ye.StudyInputsPropertyPage},y.prototype.getStylesPropertyPage=function(){return ye.StudyStylesPropertyPage},y.prototype.getDisplayPropertyPage=function(){return ye.StudyDisplayPropertyPage},y.prototype.isPine=function(){return void 0!==this._metaInfo.pine},y.prototype.isStandardPine=function(){return this.isPine()&&pe.isStandardPine(this._metaInfo.id)},y.prototype._getTelemetryObjectName=function(){return"study"},y.prototype._getTelemetryAdditionalData=function(){var e="";return this._metaInfo.pine&&this._metaInfo.pine.version&&this._metaInfo.shortId.indexOf("USER")>=0&&(e="_v"+this._metaInfo.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:this._metaInfo.shortId+e}},y.prototype._sendTelemetryReport=function(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var n=Object.assign(t,{additional:i});telemetry.sendChartReport(e,n)},y.prototype._sendTelemetryCounter=function(e,t){
this._sendTelemetryReport(e,{count:1},t)},y.prototype._sendTelemetryTiming=function(e,t,i){this._sendTelemetryReport(e,{value:t},i)},y.prototype.destroy=function(){this._legendView&&this._legendView.destroy()},y.prototype.guiPlotName=function(e){var t=this.properties().styles;return t&&t[e]&&t[e].title?t[e].title.value():this.title()},e.exports={Study:y,prepareStudyProperties:l,prepareStudyPropertiesForLoadChart:h,prepareStudyPropsStateForLoadChart:p}}).call(t,i(13),i(8),i(5),i(48).PriceRange)},function(e,t,i){"use strict";function n(e){var t,i,n,o,r,s;if(this._name=e,t=p[e],t||(t={time:[],offset:[]},this._invalid=!0),t.time.length!==t.offset.length&&(t={time:[],offset:[]},this._invalid=!0),!t.time_utc){for(i=t.time,n=t.offset,o=i.length,r=Array(o),s=0;s<o;s++)i[s]*=1e3,n[s]*=1e3,r[s]=i[s]-n[s];t.time_utc=r}this.tz=t}function o(e,t){var i,n,o,r=e.length;if(0===r)return-1;if(isNaN(t))throw Error("Key is NaN");for(i=0,n=r-1,o=s((i+n)/2);;){if(e[o]>t){if((n=o-1)<i)return o}else if(i=o+1,n<i)return o<r-1?o+1:-1;o=s((i+n)/2)}}function r(e){return e%4==0&&e%100!=0||e%400==0}var s,a,l,c,h,u,d,p=i(531).tzData;n.prototype.offset_utc=function(e){return n._offset(this.tz.time_utc,this.tz.offset,e)},n.prototype.offset_loc=function(e){return n._offset(this.tz.time,this.tz.offset,e)},n.prototype.correction_loc=function(e){var t,i,n,r,s=this.tz.time,a=this.tz.offset,l=o(s,e);return l<1?0:(t=a[l],i=a[l-1],n=t-i,n>0&&(r=s[l-1],e-r<=n)?n:0)},n.prototype.is_valid=function(){return!this._invalid},n._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]},s=function(e){return 0|e},a=function(e){return 60*e*1e3},l=function(e){return 1e3*e},c=function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},h=function(e,t){return s(s(e/1e3)-s(t/1e3))},u={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},d={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*s(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=u[t];return t>1&&r(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,n=d.get_day_of_year(e),o=n-i;return Math.ceil(o/7)+1},get_minutes_from_midnight:function(e){return 60*d.get_hours(e)+d.get_minutes(e)},set_hms:function(e,t,i,n,o,r){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(o),d.correct_time(e,r)},correct_time:function(e,t){var i=e.getTime(),n=t.correction_loc(i)
;e.setTime(i+n)},add_days_considering_dst:function(e,t,i){var n,o=e.offset_utc(t),r=this.clone(t);return this.add_date(r,i),n=e.offset_utc(r),r.setTime(r.getTime()+o-n),r},add_date:function(e,t){e.setTime(e.getTime()+t*d.secondsPerDay)},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return e%4!=0||e%100==0&&e%400!=0?365:366},get_part:function(e,t){switch(t){case d.YEAR:return d.get_year(e);case d.MONTH:return d.get_month(e);case d.DAY_OF_MONTH:return d.get_day_of_month(e);case d.WEEK_OF_YEAR:return d.get_week_of_year(e);case d.DAY_OF_WEEK:return d.get_day_of_week(e);case d.HOUR_OF_DAY:return d.get_hours(e);case d.MINUTE:return d.get_minutes(e);case d.DAY_OF_YEAR:return d.get_day_of_year(e);case d.SECOND:return d.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:l,time_minutes_diff:c,time_seconds_diff:h,utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n){var o=new Date(Date.UTC(t,i,n)),r=e.offset_utc(+o);return new Date(o.valueOf()-r)},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new n(e)},shift_day:function(e,t){var i=e-1;return i+=t,i>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},e.exports=d},,function(e,t,i){"use strict";(function(t){var n=i(355).ExchangeSession,o=i(15).Interval,r=i(15).ResolutionKind,s=i(5),a=function(){function e(e,t,i){var n=o.parse(e);return n.kind()===r.Hours?new p(60*n.multiplier()*60,t):n.kind()===r.Minutes?new p(60*n.multiplier(),t):n.kind()===r.Seconds?new p(n.multiplier(),t):n.kind()===r.Range?new p(60*n.multiplier(),t):new _(t,i,n.multiplier(),a(n.kind(),t))}function a(e,t){switch(e){case r.Days:return new T(t);case r.Weeks:return new x(t);case r.Months:return new C(t)}return console.error("unknown dwm resolution: "+e),null}function l(e,t,i,n,o){var r,s,a,l,c,h,u,d=(new I).init("Etc/UTC",e),p=""!==t;return p?(s=i*B[t],r=B.D):(s=60*i*1e3,r=60*d.spec.findSessionEntry(0,0).length()*1e3),a=r/s,l=p?7:7-d.spec.weekEndsCount(),c=l*a,n<c?(h=n/a,o-h*B.D):(u=n/c,o-u*B.W)}function c(e,t,i,n){if("number"!=typeof i||"number"!=typeof t||isNaN(i)||isNaN(t))throw Error("Cannot extrapolate from "+t+" to "+i);return u(e,t,function(e,t){return t>i||n&&e.length>n})}function h(e,t,i){return u(e,t,function(e,t){return e.length>=i})}function u(e,t,i){var n,o,r,s,a,l=t;for(e.moveTo(l),n=[],o=0,r=0;!i(n,l);){if(o>5)throw console.trace(["0x10",new Date(t),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((s=e.indexOfBar(l))===V)l=e.startOfBar(0);else if(s===D)l=e.startOfBar(D);else{if((a=e.startOfBar(s))!==t){if(r&&r===a)throw console.trace(["0x11",new Date(t),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");r=a,o=0,n.push(a)}l=e.startOfBar(s+1)}e.moveTo(l),o++}return n}function d(e){if(isNaN(e))return NaN;var t=this.indexOfBar(e);return t===D&&(this.moveTo(e),t=this.indexOfBar(e)),
t<0?NaN:this.startOfBar(t)}function p(e,t){this.period=e,this.session=t,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function _(e,t,i,n){this.period=i,this.sessionTgt=e,this.sessionSrc=t||e,this.builder=n,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function f(e,t,i){var n=R.clone(i);return t.alignToSessionStart(n,e),R.cal_to_utc(e,n)}function m(e,t){var i=R.get_day_of_week(t)-e.firstDayOfWeek();return i<0?i+7:i}function y(e,t){var i=t+e.firstDayOfWeek();return i>R.SATURDAY?i-R.SATURDAY:i}function g(e,t){var i=R.get_day_of_year(t)-1,n=m(e,t)-i%7;return 0===n?L(i/7):(n>=0&&(n-=7),L((n+i)/7))}function v(e,t,i){var n,o=0;for(n=t;n<i;++n)o+=e.isWeekEnd(y(e,n))?1:0;return o}function S(e,t){var i=new Date(Date.UTC(t,11,31,23,59)),n=R.days_per_year(t)-b(e,i);return e.isWeekEnd(R.get_day_of_week(i))&&n--,n}function b(e,t){var i,n,o=R.get_day_of_year(t)-1,r=m(e,t),s=r-o%7;return s<0&&(s+=7),i=0,o<7-s?i+=v(e,s,r):(n=0===s?0:v(e,s,7),i+=v(e,0,r)+n),i+g(e,t)*e.weekEndsCount()}function w(){}function P(e){this.sessionsSpec=e}function T(e){this.session=e}function x(e){this.session=e}function C(e){this.session=e}function L(e){return 0|e}function I(){}function A(t,i){return!s.enabled("disable_resolution_rebuild")&&o.isDWM(t)?e(t,i,M):null}function k(e,t,i){var n,o,r,s,a=e.length;if(0===a)return-1;for(n=0,o=a-1,r=L((n+o)/2);;){if(0===(s=i(e[r],t))||s>0){if((o=r-1)<n)return r}else if(n=r+1,o<n)return r<a-1?r+1:-1;r=L((n+o)/2)}}function E(e,t){var i=R.utc_to_cal(t.timezone,+e),n=R.get_day_of_week(i),o=R.get_minutes_from_midnight(i),r=t.spec.findSessionEntry(n,o);return r.isOvernight()&&o>r.start()+r.length()&&n===r.dayOfWeek()-1&&(n++,o-=1440),n===r.dayOfWeek()&&o>=r.start()&&o<r.start()+r.length()}var M,V=-1,D=-2,O="undefined"!=typeof window?window:t,R=O.PineJsCalendar?O.PineJsCalendar:i(35),B={S:1e3,D:864e5,W:6048e5,M:2592e6};return p.prototype.alignTime=d,p.prototype.alignTimeIfPossible=function(e){var t=this.alignTime(e);return isNaN(t)?e:t},p.prototype.indexOfBar=function(e){return e<this.sessionStart?V:e>=this.sessionEnd?D:L(R.time_seconds_diff(e,this.sessionStart)/this.period)},p.prototype.startOfBar=function(e){if(e===D)return this.sessionEnd;if(e<0)throw Error("Negative offset is not supported");return this.sessionStart+R.time_seconds(this.period*e)},p.prototype.isLastBar=function(e,t){return t>=this.sessionStart+R.time_seconds(this.period*(e+1)-1)},p.prototype.moveTo=function(e){var t=this.session.timezone,i=R.utc_to_cal(t,e),n=this.session.spec,o=n.alignToSessionStart(i,this.session.timezone);this.sessionStart=R.cal_to_utc(t,i),this.sessionEnd=this.sessionStart+R.time_minutes(o)},_.prototype.alignTime=d,_.prototype.alignTimeIfPossible=function(e){return this.tradingDayToSessionStart(e)},_.prototype.tradingDayToSessionStart=function(e){return this.moveTo(e),this.startOfBar(0)},_.prototype.indexOfBar=function(e){return e<this.periodStart?V:e>=this.periodEnd?D:0},_.prototype.startOfBar=function(e){if(e===D||e>0)return this.periodEnd
;if(e===V)throw Error("PRE_SESSION is not supported");return this.periodStart},_.prototype.isLastBar=function(e,t){return t>=this.periodLastBarStart},_.prototype.moveTo=function(e){var t,i,n,o,r,s,a,l,c=R.utc_to_cal(this.sessionSrc.timezone,e);c=this.sessionSrc.spec.correctTradingDay(c,this.sessionSrc.timezone),t=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(c,t),-1===i&&(i*=this.period),n=L(i/this.period)*this.period,o=R.get_year(c),r=this.sessionTgt.spec,s=this.builder.startOfPeriod(t,n,o),this.periodStart=f(t,r,s),a=n+this.period,l=this.builder.startOfPeriod(t,a,o),this.periodEnd=f(t,r,l),R.add_date(l,-1),this.moveToPrevWorkDay(r,l),this.periodLastBarStart=f(t,r,l),(this.periodLastBarStart<this.periodStart||this.periodLastBarStart===this.periodEnd)&&(this.periodLastBarStart=this.periodStart)},_.prototype.moveToPrevWorkDay=function(e,t){for(;e.isWeekEnd(R.get_day_of_week(t));)R.add_date(t,-1)},w.prototype.indexOfPeriod=function(e){return R.get_day_of_year(e)-1},w.prototype.startOfPeriod=function(e,t,i){var n=R.get_cal(e,i,R.JANUARY,1),o=R.add_days_considering_dst(e,n,t);return R.utc_to_cal(e,+o)},P.prototype.uber=new w,P.prototype.indexOfPeriod=function(e){return this.uber.indexOfPeriod(e)-b(this.sessionsSpec,e)},P.prototype.startOfPeriod=function(e,t,i){function n(e,t){this.weekEnds=v(e,t,7),this.calendarDays=7-t,this.businessDays=this.calendarDays-this.weekEnds}function o(e,t){var i,n=0;for(i=e;i<7&&(s.sessionsSpec.isWeekEnd(y(s.sessionsSpec,i))||!(--t<0));++i)n++;return n}function r(e,t){var i,n,o,r,a,l=0,c=7-s.sessionsSpec.weekEndsCount(),h=t%c,u=e.isIncomplete()?e.businessDays:0,d=h-u;for(d<0&&(d+=c),i=0;i<7&&d>=0;++i)n=s.sessionsSpec.isWeekEnd(y(s.sessionsSpec,i)),l+=n?1:0,d-=n?0:1;return o=e.weekEnds+l,r=L((t-e.businessDays)/(7-s.sessionsSpec.weekEndsCount())),a=o+s.sessionsSpec.weekEndsCount()*r,t+a}var s,a,l,c,h;return t>=S(this.sessionsSpec,i)&&(i++,t=0),s=this,n.prototype.isIncomplete=function(){return 7!==this.calendarDays},a=new Date(Date.UTC(i,R.JANUARY,1)),l=m(this.sessionsSpec,a),c=new n(this.sessionsSpec,l),h=t<c.businessDays?o(l,t):r(c,t),this.uber.startOfPeriod(e,h,i)},T.prototype.indexOfPeriod=function(e){return this.builder().indexOfPeriod(e)},T.prototype.startOfPeriod=function(e,t,i){return this.builder().startOfPeriod(e,t,i)},T.prototype.builder=function(){return this._builder||(this._builder=this.session.spec.hasWeekEnds()?new P(this.session.spec):new w),this._builder},x.prototype.indexOfPeriod=function(e,t){var i=g(this.session.spec,e);return 0===i&&e<this.startOfPeriod(t,0,R.get_year(e))&&(i=-1),i},x.prototype.startOfPeriod=function(e,t,i){var n,o,r=new Date(Date.UTC(i,R.JANUARY,1)),s=m(this.session.spec,r),a=0===s?7*t:7*(t+1)-s,l=R.get_days_per_year(r);return a>l?this.startOfPeriod(e,0,i+L(a/l)):(n=R.get_cal(e,i,R.JANUARY,1),o=R.add_days_considering_dst(e,n,a),R.utc_to_cal(e,+o))},C.prototype.indexOfPeriod=function(e){return R.get_month(e)},C.prototype.startOfPeriod=function(e,t,i){var n;return t<0?(n=L((11-t)/12),i-=n,t+=12*n):t>R.DECEMBER&&(i++,t=R.JANUARY),R.get_cal_utc(i,t,1)
},I.prototype.init=function(e,t){return this.timezone="string"==typeof e?R.get_timezone(e):e,this.spec=new n(t),this},M=(new I).init("Etc/UTC","0000-0000:1234567"),{PRE_SESSION:V,POST_SESSION:D,LASTBAR_SESSION:-3,newBarBuilder:e,Session:I,alignPeriodsBack:l,extrapolateBarsFrontByCount:h,extrapolateBarsFrontToTime:c,lower_bound:k,isTradingNow:E,numberOfFullWeeks:g,numberOfWeekEndsSinceYearStart:b,BusinessDaysBuilder:P,alignExchangeTimeToSessionStartAndReturnUTC:f,createDWMAligner:A}}();e.exports=a}).call(t,i(98))},function(e,t,i){"use strict";function n(e){return""!==e&&h&&void 0!==e&&null!==e?u+e:e}function o(e){return""!==e&&h&&void 0!==e&&null!==e?d+e+_:e}function r(e){return""!==e&&h&&void 0!==e&&null!==e?p+e+_:e}function s(e){return Object(c.getNormalizedScrollLeft)(e,"rtl")}function a(e,t){var i=Object(c.detectScrollType)();if("indeterminate"===i)return 0;switch(i){case"negative":t=e.clientWidth-e.scrollWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}function l(e){var t=f.exec(e);return t?m.test(t[0])?"rtl":"ltr":""}var c,h,u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"IS_RTL",function(){return h}),t.startWithLTR=n,t.forceLTRStr=o,t.forceRTLStr=r,t.getLTRScrollLeft=s,t.getLTRScrollLeftOffset=a,t.detectAutoDirection=l,c=i(472),i.n(c),h="rtl"===document.dir,u="‎",d="‪",p="‫",_="‬",f=/[^\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u200E\u2010-\u2029\u202C\u202F-\u2BFF]/,m=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/},function(e,t,i){"use strict";function n(e,t,i){var n,o,s;for(t=t||e||i||"",n="",o=0;o<c.length;o++)if((s=t.match(c[o]))&&3===s.length){t=s[1],n=s[2];break}Object(r.emit)(t.toLowerCase().replace(" ","_"),{category:e,label:i,value:n})}function o(e,t,i){var o,r,a;if(s.enabled("charting_library_base"))return void n(e,t,i);o=(e?e+":":"")+t,i&&(o+=" "+i),l.logNormal(o),s.enabled("widget")||(r=window._gaq,window._UNIT_TESTS||void 0===r||(a=["_trackEvent",e,t],void 0!==i&&a.push(i),r.push(a)))}var r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.trackEvent=o,r=i(31),s=i(5),i.n(s),a=i(4),l=Object(a.getLogger)("Common.TrackEvent"),c=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],window.TradingView=window.TradingView||{},window.TradingView.trackEvent=o},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"STATUS_OFFLINE",function(){return n}),i.d(t,"STATUS_RESOLVING",function(){return o}),i.d(t,"STATUS_LOADING",function(){return r}),i.d(t,"STATUS_READY",function(){return s}),i.d(t,"STATUS_INVALID_SYMBOL",function(){return a}),i.d(t,"STATUS_SNAPSHOT",function(){return l}),i.d(t,"STATUS_EOD",function(){return c}),i.d(t,"STATUS_PULSE",function(){return h}),i.d(t,"STATUS_DELAYED",function(){return u}),i.d(t,"STATUS_DELAYED_STREAMING",function(){return d}),i.d(t,"STATUS_NO_BARS",function(){return p}),i.d(t,"STATUS_REPLAY",function(){return _}),i.d(t,"STYLE_BARS",function(){return f}),
i.d(t,"STYLE_CANDLES",function(){return m}),i.d(t,"STYLE_LINE",function(){return y}),i.d(t,"STYLE_LINE_TYPE_MARKERS",function(){return g}),i.d(t,"STYLE_LINE_TYPE_STEP",function(){return v}),i.d(t,"STYLE_LINE_TYPE_SIMPLE",function(){return S}),i.d(t,"STYLE_AREA",function(){return b}),i.d(t,"STYLE_RENKO",function(){return w}),i.d(t,"STYLE_KAGI",function(){return P}),i.d(t,"STYLE_PNF",function(){return T}),i.d(t,"STYLE_PB",function(){return x}),i.d(t,"STYLE_HEIKEN_ASHI",function(){return C}),i.d(t,"STYLE_HOLLOW_CANDLES",function(){return L}),i.d(t,"STYLE_BASELINE",function(){return I}),i.d(t,"STYLE_RANGE",function(){return A}),i.d(t,"STYLE_SHORT_NAMES",function(){return k}),i.d(t,"SYMBOL_STRING_DATA",function(){return E}),n=0,o=1,r=2,s=3,a=4,l=5,c=6,h=7,u=8,d=9,p=10,_=11,f=0,m=1,y=2,g=0,v=1,S=2,b=3,w=4,P=5,T=6,x=7,C=8,L=9,I=10,A=11,k={},k[f]="bar",k[m]="candle",k[L]="hollowCandle",k[y]="line",k[b]="area",k[w]="renko",k[x]="pb",k[P]="kagi",k[T]="pnf",k[C]="ha",k[I]="baseline",k[A]="range",E={},E[w]={type:"BarSetRenko@tv-prostudies",basicStudyVersion:15},E[x]={type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:15},E[P]={type:"BarSetKagi@tv-prostudies",basicStudyVersion:15},E[T]={type:"BarSetPnF@tv-prostudies",basicStudyVersion:15},E[C]={type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},E[A]={type:"BarSetRange@tv-basicstudies",basicStudyVersion:72}},function(e,t,i){"use strict";(function(e){function n(t){t||(t={}),this.checkable=t.checkable||!1,this.checked=t.checked||null,this.enabled=void 0===t.enabled||t.enabled,this.visible=t.visible||!0,this.active=!0,this.font=t.font||"Arial",this.icon=t.icon||null,this.iconText=t.iconText||null,this.iconVisibleInMenu=t.iconVisibleMenu||!0,this.deleteButton=t.deleteButton||null,this.shortcut=null,this.setShortCut(t.shortcut,t.doNotBindShortcut),this.statusTip=t.statusTip||null,this.text=t.text||null,this.toolTip=t.toolTip||null,this.htmlclass=t.htmlclass||null,this.statName=t.statName||null,this._callbackContext=t.callbackContext||this,this._callbacks=new e,this.subActions=t.subActions||[]}function o(){n.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function r(e){n.call(this),this.deferred=e}var s=i(189);n.prototype.callbacks=function(){return this._callbacks},n.prototype.callbackContext=function(){return this._callbackContext},n.prototype.setCallbackContext=function(e){this._callbackContext=e},n.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},n.prototype.setChecked=function(e){this.checked=e},n.prototype._toggleChecked=function(){this.checked=!this.checked},n.prototype.setVisible=function(e){this.visible=e},n.prototype.setEnabled=function(e){this.enabled=e},n.prototype.disable=function(){this.setEnabled(!1)},n.prototype.enable=function(){this.setEnabled(!0)},n.prototype.setActive=function(e){this.active!==e&&(this.active=e,this.shortcut&&!this.doNotBindShortcut&&(e?this._bindShortCut():this._unbindShortCut()))},n.prototype.setShortCut=function(e,t){e&&(this.shortcut=e,!0!==t&&this._bindShortCut())
},n.prototype._bindShortCut=function(){s.bind(this.shortcut,function(e){if(e.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},n.prototype._unbindShortCut=function(){s.unbind(this.shortcut)},n.prototype.setIconVisible=function(e){this.iconVisibleInMenu=e},n.prototype.executeCallback=function(e){this._lastEvent=e,this._toggleChecked(),this._callbacks.fire(this)},inherit(o,n),inherit(r,n),t.Action=n,t.ActionSeparator=o,t.ActionPlaceholder=r}).call(t,i(8))},function(e,t,i){"use strict";function n(e){return-1!==v.indexOf(e)}function o(e){return-1!==S.indexOf(e)}function r(e){return e===y.STYLE_RANGE}function s(e){return-1!==b.indexOf(e)}function a(e){return o(e)||s(e)}function l(e){a(e)&&e!==y.STYLE_RANGE&&m.setValue("chart.lastUsedStyle",e)}function c(){var e=m.getInt("chart.lastUsedStyle");return void 0===e?y.STYLE_CANDLES:e}function h(e){return e?y.STYLE_RANGE:y.STYLE_CANDLES}function u(e,t){var i=r(t),n=g.Interval.isRange(e);return!i&&n?h(!0):i&&!n?h(!1):t}function d(e,t){return t?y.SYMBOL_STRING_DATA[e].type+"-"+y.SYMBOL_STRING_DATA[e].basicStudyVersion:y.SYMBOL_STRING_DATA[e].type}function p(e){var t=e.priceAxisProperties,i=t.lockScale.value(),n=e.style.value()===y.STYLE_PNF;(n||i)&&(t.log.setValue(!1),t.percentage.setValue(!1)),t.logDisabled.setValue(!(!n&&!i)),t.percentageDisabled.setValue(!(!n&&!i))}function _(e){return-1!==P.indexOf(e)}function f(e){return w.includes(e)}var m,y,g,v,S,b,w,P;Object.defineProperty(t,"__esModule",{value:!0}),t.isRequiringRestartSeriesStyles=n,t.isRangeBasedStyle=o,t.isRangeStyle=r,t.isTimeBasedStyle=s,t.isValidStyle=a,t.setLastUsedStyle=l,t.getLastUsedStyle=c,t.getDefaultStyle=h,t.getChartStyleByResolution=u,t.chartStyleStudyId=d,t.preparePriceAxisProperties=p,t.hasProjection=_,t.isPriceSourceStyle=f,m=i(49),i.n(m),y=i(40),g=i(15),v=[y.STYLE_RENKO,y.STYLE_KAGI,y.STYLE_PNF,y.STYLE_PB,y.STYLE_HEIKEN_ASHI],S=[y.STYLE_RENKO,y.STYLE_KAGI,y.STYLE_PNF,y.STYLE_PB,y.STYLE_HEIKEN_ASHI,y.STYLE_RANGE],b=[y.STYLE_BARS,y.STYLE_CANDLES,y.STYLE_HOLLOW_CANDLES,y.STYLE_LINE,y.STYLE_AREA,y.STYLE_BASELINE],w=[y.STYLE_LINE,y.STYLE_BASELINE,y.STYLE_AREA],P=[y.STYLE_RENKO,y.STYLE_PB,y.STYLE_KAGI,y.STYLE_PNF]},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"UndoCommand",function(){return n});var n=function(){function e(e,t){void 0===t&&(t=!0),this._customFlags={},this._text=e,this._executeOnPush=t}return e.prototype.text=function(){return this._text},e.prototype.executeOnPush=function(){return this._executeOnPush},e.prototype.customFlag=function(e){return this._customFlags[e]},e.prototype.setCustomFlag=function(e,t){this._customFlags[e]=t},e}()},function(e,t,i){"use strict";function n(e){this.items=e.items,this.height=e.height||e.width,this.width=e.width||e.height,this._color=e.color,this._borderColor=e.borderColor,this._vertOffset=e.vertOffset||0,e.textCache&&(this._textCache=e.textCache,this._textColor=e.textColor,this._textVertOffset=this._vertOffset>0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,
this._textImageHeight=this._textCache.textImageHeight)}var o=i(6).Point,r=i(9).HitTestResult;n.prototype.draw=function(e){this.drawShape(e),this.drawText(e)},n.prototype.drawShape=function(e){throw Error("Not implemented")},n.prototype.drawText=function(e){var t,i,n,o,r,s;if(this._textCache)for(t=0,i=this.items.length;t<i;t++)n=this.items[t],o=n.x,r=n.y+this._vertOffset+this._textVertOffset,s=n.style&&null!=n.style.textColor?n.style.textColor:this._textColor,this._textCache.paintTo(e,s,o,r,"center",this._vertOffset>0?"top":"bottom")},n.prototype.hitTest=function(e,t){var i,n,s,a,l,c,h,u,d,p,_,f,m,y=Math.max(this.height,this.width),g=this._vertOffset,v=this._textVertOffset;for(t=t||r.REGULAR,n=0;n<this.items.length;++n)if(s=this.items[n]){if(i=new o(s.x,s.y+g),i.subtract(e).length()<=y)return new r(t,{});if(this._textCache&&(a=this._textImageWidth/2,l=s.y+g+v,c=g>0?0:-this._textImageHeight,h=g>0?this._textImageHeight:0,u=e.x,d=e.y,p=s.x-a,_=l+c,f=s.x+a,m=l+h,u>p&&u<f&&d>_&&d<m))return new r(t,{})}return null},t.PaneRendererAbstractShape=TradingView.PaneRendererAbstractShape=n},function(e,t,i){"use strict";for(var n={LineToolFibRetracement:i(535).LineToolFibRetracement,LineToolFibChannel:i(537).LineToolFibChannel,LineToolFibSpeedResistanceArcs:i(538).LineToolFibSpeedResistanceArcs,LineToolProjection:i(539).LineToolProjection,LineToolTrendBasedFibExtension:i(540).LineToolTrendBasedFibExtension,LineToolElliott:i(79).LineToolElliott,LineToolFibCircles:i(541).LineToolFibCircles,LineToolTrading:i(173),LineToolVertLine:i(542).LineToolVertLine,LineToolCrossLine:i(543).LineToolCrossLine,LineToolBarsPattern:i(544).LineToolBarsPattern,LineToolTrendBasedFibTime:i(545).LineToolTrendBasedFibTime,LineToolFibTimeZone:i(546).LineToolFibTimeZone,LineToolCircleLines:i(547).LineToolCircleLines,LineToolDateRange:i(548).LineToolDateRange,LineToolPriceRange:i(549).LineToolPriceRange,LineToolDateAndPriceRange:i(550).LineToolDateAndPriceRange,LineToolParallelChannel:i(551).LineToolParallelChannel,LineToolTrendAngle:i(552).LineToolTrendAngle,LineToolTrendLine:i(100).LineToolTrendLine,LineToolInfoLine:i(553).LineToolInfoLine,LineToolArrowMark:i(101).LineToolArrowMark,LineToolExecution:i(272).LineToolExecution,LineToolPitchfan:i(554).LineToolPitchfan,LineToolGannSquare:i(555).LineToolGannSquare,LineToolFibSpeedResistanceFan:i(556).LineToolFibSpeedResistanceFan,LineToolGannComplex:i(557).LineToolGannComplex,LineToolGannFixed:i(558).LineToolGannFixed,LineToolGannFan:i(559).LineToolGannFan,LineToolFibWedge:i(270).LineToolFibWedge,LineToolPitchfork:i(122).LineToolPitchfork,LineToolDisjointAngle:i(560).LineToolDisjointAngle,LineToolFlatBottom:i(561).LineToolFlatBottom,LineToolIcon:i(562).LineToolIcon,LineToolRotatedRectangle:i(563).LineToolRotatedRectangle,LineToolFibSpiral:i(564).LineToolFibSpiral,LineToolHeadAndShoulders:i(565).LineToolHeadAndShoulders,LineToolTriangle:i(566).LineToolTriangle,LineToolTrianglePattern:i(567).LineToolTrianglePattern,LineTool5PointsPattern:i(274).LineTool5PointsPattern,LineToolThreeDrivers:i(568).LineToolThreeDrivers,
LineToolABCD:i(569).LineToolABCD,LineToolRiskReward:i(175).LineToolRiskReward,LineToolPolyline:i(571).LineToolPolyline,LineToolPrediction:i(572).LineToolPrediction,LineToolPriceLabel:i(573).LineToolPriceLabel,LineToolNote:i(276).LineToolNote,LineToolNoteAbsolute:i(276).LineToolNoteAbsolute,LineToolBrush:i(574).LineToolBrush,LineToolArc:i(575).LineToolArc,LineToolCallout:i(576).LineToolCallout,LineToolBalloon:i(577).LineToolBalloon,LineToolText:i(277).LineToolText,LineToolHorzLine:i(578).LineToolHorzLine,LineToolHorzRay:i(579).LineToolHorzRay,LineToolRectangle:i(580).LineToolRectangle,LineToolEllipse:i(581).LineToolEllipse,LineToolTimeCycles:i(582).LineToolTimeCycles,LineToolSineLine:i(583).LineToolSineLine,LineToolGhostFeed:i(584).LineToolGhostFeed,LineToolBezierQuadro:i(585).LineToolBezierQuadro,LineToolBezierCubic:i(586).LineToolBezierCubic,LineToolArrow:i(587).LineToolArrow,LineToolRay:i(588).LineToolRay,LineToolExtended:i(589).LineToolExtended,LineToolSchiffPitchfork:i(590).LineToolSchiffPitchfork,LineToolSchiffPitchfork2:i(591).LineToolSchiffPitchfork2,LineToolInsidePitchfork:i(592).LineToolInsidePitchfork,LineToolTextAbsolute:i(277).LineToolTextAbsolute,LineToolArrowMarkLeft:i(101).LineToolArrowMarkLeft,LineToolArrowMarkRight:i(101).LineToolArrowMarkRight,LineToolArrowMarkUp:i(101).LineToolArrowMarkUp,LineToolArrowMarkDown:i(101).LineToolArrowMarkDown,LineToolFlagMark:i(593).LineToolFlagMark,LineToolCypherPattern:i(594).LineToolCypherPattern,LineToolElliottImpulse:i(79).LineToolElliottImpulse,LineToolElliottTriangle:i(79).LineToolElliottTriangle,LineToolElliottTripleCombo:i(79).LineToolElliottTripleCombo,LineToolElliottCorrection:i(79).LineToolElliottCorrection,LineToolElliottDoubleCombo:i(79).LineToolElliottDoubleCombo,LineToolRiskRewardLong:i(175).LineToolRiskRewardLong,LineToolRiskRewardShort:i(175).LineToolRiskRewardShort,LineToolPosition:i(595).LineToolPosition,LineToolOrder:i(597).LineToolOrder},o=Object.keys(n),r=o.length;r--;)TradingView[o[r]]=n[o[r]];e.exports=n},function(e,t,i){"use strict";var n,o,r,s;i(246),n=i(50),o=n.greaterThan,r=n.lessThan,s=window.CanvasEx=i(84),TradingView.resizeCanvas=function(e,t,i){var n,o,r,s,a,l=e.prop("height"),c=e.prop("width");l&&c&&(l/=window.hidpiCanvasRatio||1,c/=window.hidpiCanvasRatio||1,l<1&&(l=1),c<1&&(c=1),n=$("<canvas>").prop("width",c).prop("height",l),o=n.get(0).getContext("2d"),r=Math.min(c,t),s=Math.min(l,i),r&&s&&o.drawImage(e.get(0),0,0,r,s,0,0,r,s),e.prop("height",i).prop("width",t),a=e.get(0).getContext("2d"),r&&s&&a.drawImage(n.get(0),0,0,r,s,0,0,r,s),n.remove())},s.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,o){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.lineStyle===s.LINESTYLE_DASHED||e.lineStyle===s.LINESTYLE_DOTTED||e.lineStyle===s.LINESTYLE_SPARSE_DOTTED?e.drawDashedLine(e,t,i,n,o):s.drawSolidLine(e,t,i,n,o))},s.drawArrow=function(e,t,i,n,o){
isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.beginPath(),e.moveTo(n,o),e.lineTo(t,i),e.moveTo(t+2,i+2),e.lineTo(t-2,i+2),e.moveTo(t-1,i+1),e.lineTo(t+1,i+1),e.stroke())},s.drawSolidLine=function(e,t,i,n,o){e.beginPath(),e.moveTo(t,i),e.lineTo(n,o),e.stroke()},s.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(e)),"function"==typeof e.setLineDash?e.setLineDash(i):void 0!==e.mozDash?e.mozDash=i:void 0!==e.webkitLineDash&&(e.webkitLineDash=i)},s.drawPoly=function(e,t,i){var n,o;for(e.beginPath(),e.moveTo(t[0].x,t[0].y),n=0;n<t.length;n++)o=t[n],e.lineTo(o.x,o.y);e.closePath(),e.stroke(),i&&e.fill()},s.drawRoundRect=function(e,t,i,n,o,r){e.beginPath(),e.moveTo(t+r,i),e.lineTo(t+n-r,i),e.arcTo(t+n,i,t+n,i+r,r),e.lineTo(t+n,i+o-r),e.arcTo(t+n,i+o,t+n-r,i+o,r),e.lineTo(t+r,i+o),e.arcTo(t,i+o,t,i+o-r,r),e.lineTo(t,i+r),e.arcTo(t,i,t+r,i,r)},s.drawDashedLineHorizontal=function(e,t,i,n){var o,r,a,l,c,h,u;for(e.save(),o=s.computeDashPattern(e),r=0,a=e.lineWidth,l=a/2,e.translate(-l,-l),c=!0,h=t+n;t<h;)u=o[r],c&&e.fillRect(t,i,u,a),c=!c,t+=u,r=r===o.length-1?0:r+1;e.restore()},s.drawDashedLineVertical=function(e,t,i,n){var o,r,a,l,c,h,u;for(e.save(),o=s.computeDashPattern(e),r=0,a=e.lineWidth,l=a/2,e.translate(-l,-l),c=!0,h=i+n;i<h;)u=o[r],c&&e.fillRect(t,i,a,u),c=!c,i+=u,r=r===o.length-1?0:r+1;e.restore()},s.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(e){if(this.font!==e)try{this.font=e}catch(e){}},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID,s.originalSave=CanvasRenderingContext2D.prototype.save,s.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){s.lineStyles.push(this.lineStyle),s.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){s.lineStyles.length>0&&(this.lineStyle=s.lineStyles.pop(),s.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(e,t,i,n,o){e.save();var r=s.computeDashPattern(e);if(e.beginPath(),"function"==typeof e.setLineDash)e.setLineDash(r);else if(void 0!==e.mozDash)e.mozDash=r;else{if(void 0===e.webkitLineDash)return e.dashedLineTo(t,i,n,o,r),e.stroke(),void e.restore();e.webkitLineDash=r}e.moveTo(t,i),e.lineTo(n,o),e.stroke(),e.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(e,t,i,n,s){var a,l,c,h,u,d,p={thereYet:o,cap:Math.min},_={thereYet:o,cap:Math.min};for(t-n>0&&(_.thereYet=r,_.cap=Math.max),e-i>0&&(p.thereYet=r,p.cap=Math.max),this.moveTo(e,t),a=e,l=t,c=0,h=!0;!p.thereYet(a,i)||!_.thereYet(l,n);)u=Math.atan2(n-t,i-e),d=s[c],a=p.cap(i,a+Math.cos(u)*d),l=_.cap(n,l+Math.sin(u)*d),h?this.lineTo(a,l):this.moveTo(a,l),c=(c+1)%s.length,h=!h}),e.exports=s},,function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PriceRange",function(){return s}),n=i(12),i.n(n),o=i(4),r=Object(o.getLogger)("Chart.PriceRange"),s=function(){function e(e,t){var i,n;null!==e&&"object"==typeof e?(i=e,
this._minValue=i.m_minValue,this._maxValue=i.m_maxValue):(n=e,this._minValue=n,void 0!==t&&(this._maxValue=t))}return e.prototype.equals=function(e){return this._minValue===e._minValue&&this._maxValue===e._maxValue},e.prototype.clone=function(){return new e(this._minValue,this._maxValue)},e.prototype.minValue=function(){return this._minValue},e.prototype.setMinValue=function(e){this._minValue=e},e.prototype.maxValue=function(){return this._maxValue},e.prototype.setMaxValue=function(e){this._maxValue=e},e.prototype.length=function(){return this._maxValue-this._minValue},e.prototype.isEmpty=function(){return this._maxValue===this._minValue||this._maxValue!==this._maxValue||this._minValue!==this._minValue},e.prototype.serialize=function(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}},e.prototype.state=function(){return{max:this._maxValue,min:this._minValue}},e.prototype.merge=function(t){return new e(Math.min(this.minValue(),t.minValue()),Math.max(this.maxValue(),t.maxValue()))},e.prototype.apply=function(e,t){this._minValue=Math.min(this._minValue,e),this._maxValue=Math.max(this._maxValue,t)},e.prototype.set=function(e,t){this._minValue=e,this._maxValue=t},e.prototype.scaleAroundCenter=function(e){var t,i,o,s;if(!Object(n.isNumber)(e))return void r.logDebug("PriceRange.scaleAroundCenter: invalid coeff");0!==(t=this._maxValue-this._minValue)&&(i=.5*(this._maxValue+this._minValue),o=this._maxValue-i,s=this._minValue-i,o*=e,s*=e,this._maxValue=i+o,this._minValue=i+s)},e.prototype.shift=function(e){if(!Object(n.isNumber)(e))return void r.logDebug("PriceRange.shift: invalid coeff");this._maxValue+=e,this._minValue+=e},e.prototype.containsStrictly=function(e){return e.minValue()>this._minValue&&e.maxValue()<this._maxValue},e}()},function(e,t,i){"use strict";(function(e,t){var n,o,r,s,a,l;i(71),n=i(322).regExpEscape,o=i(107).TVXWindowEvents,r=i(159).TVLocalStorage,s=i(8),a=["s.tradingview.com","betacdn.tradingview.com"],l=window.TVSettings=function(){function t(e){return M+"."+e}function i(e,t){var i;return i=V[e],window.is_authenticated&&!W||null!=i||(i=V[e]),null==i?t:i}function c(e,t){var n=i(e,void 0);if(null==n)return t;try{return JSON.parse(n)}catch(i){return f(e),t}}function h(e,t){var n=i(e);return null==n?t:!(!n||"false"===n||0==+n)}function u(e,t,n){var o,r=i(e,void 0,n);if(null==r)return t;if(o=parseFloat(r),!isFinite(o))throw new TypeError('"'+r+'" is not float (key: "'+e+'")');return o}function d(e,t,n){var o,r=i(e,void 0,n);if(null==r)return t;if(o=parseInt(r,10),!isFinite(o))throw new TypeError('"'+r+'" is not int (key: "'+e+'")');return o}function p(e,t,i){i=i||{};var n=""+t;return V[e]!==n&&(V[e]=n,y(e)),i.forceFlush&&!R&&(R=setTimeout(function(){R=void 0,g()},E)),l}function _(e,t,i){return p(e,JSON.stringify(t),i),l}function f(e,t){return t=t||{},null!=V[e]&&(delete V[e],y(e)),t.forceFlush&&g(),l}function m(){O=void 0,D.length&&g()}function y(e){if(H)null==V[e]?H.removeValue(e):H.setValue(e,V[e]);else if(!window.is_authenticated||W)try{null==V[e]?r.removeItem(t(e)):r.setItem(t(e),V[e])
}catch(e){}else D.push(e),O||(O=setTimeout(m,k));o.emit("settings",JSON.stringify({key:e,value:V[e]}))}function g(t){var i,n,o,r,s;if(!e.enabled("widget")&&window.is_authenticated&&!W&&0!==D.length){for(i=D,D=[],n={},o=i.length;o--;)r=i[o],s=V[r],void 0===s&&(s=null),n[r]=s;$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(n)},async:!t})}}function v(){return Object.keys(V)}function S(e,t){var i,o=v(t),r=[];for(e=RegExp("^"+n(e).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i=o.length-1;i>=0;i--)e.test(o[i])&&r.push(o[i]),e.lastIndex=0;return r}function b(e){for(var t=0;t<B.length;++t)if(B[t].exec(e))return!0;return!1}function w(){var t,i,n,o,s;for(V={},t=M+".",i=!e.enabled("save_chart_properties_to_local_storage"),n=r.length;n--;)(o=r.key(n))&&o.substring(0,t.length)===t&&(s=o.substring(t.length),i&&!b(s)||(V[s]=r.getItem(o)))}function P(e){var t,i,n,o,s;for(V={},t=0===Object.keys(e).length,i=M+".",n=r.length;n--;)(o=r.key(n))&&o.substring(0,i.length)===i&&(t&&(s=o.substring(i.length),p(s,r.getItem(o))),r.removeItem(o));Object.keys(e).forEach(function(t){V[t]=e[t]+""})}function T(){var e,t,i,n;if(TradingView.onWidget()&&a.includes(window.location.host))for(e="tradingview.",t=r.length;t--;)i=r.key(t),0===i.indexOf(e)&&(n=i.replace(e,M+"."),r.setItem(n,r.getItem(i)),r.removeItem(i))}function x(e){H?P(H.initialSettings||{}):window.is_authenticated&&!W?P(e||{}):(T(),w()),N.fire()}function C(e){H=e}var L,I,A,k,E,M,V,D,O,R,B,N,F=!1,W=e.enabled("cqg_terminal"),H=null;try{F=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(e){}return F?(L={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},I=function(e,t,i){var n=L[e];return null==n?t:n},A=function(){},{loaded:!1,loadedModel:!1,getValue:I,getJSON:I,getBool:I,getFloat:I,getInt:I,setValue:A,setJSON:A,remove:A,keys:function(){return Object.keys(L)},keysMask:function(){return[]},sync:A,onSync:{subscribe:function(){}}}):(k=12e4,E=10,"local"===window.environment&&(k=5e3),M=TradingView.onWidget()?"tradingview-widget":"tradingview",V={},D=[],B=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/],o.on("settings",function(e){var t=JSON.parse(e);null==t.value?delete V[t.key]:V[t.key]=t.value}),N=new s,document.addEventListener("visibilitychange",function(){"hidden"!==document.visibiltyState&&!0!==document.hidden||g()}),window.addEventListener("unload",function(){g(!0)}),{loaded:!1,loadedModel:!1,getValue:i,getJSON:c,getBool:h,getFloat:u,getInt:d,setValue:p,setJSON:_,remove:f,keys:v,keysMask:S,sync:x,onSync:N,setSettingsAdapter:C})}(),void 0!==t&&t&&t.exports&&(t.exports=l)}).call(t,i(5),i(51)(e))},function(e,t,i){"use strict";function n(e,t){return e<=t}function o(e,t){
return e>=t}function r(e,t,i){return Math.min(Math.max(e,t),i)}function s(e){return e<0?-1:e>0?1:0}function a(e){if(e<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function l(e,t,i){return t-e<=i}function c(e,t,i){return Math.abs(e-t)<i}function h(e){return e<=0?(f.logDebug("MathEx.log10: argument less or equal zero"),NaN):Math.log(e)/Math.log(10)}function u(e,t){return e<t?-1:e>t?1:0}function d(e,t){var i,n;if(void 0===t&&(t=u),e.length<1)throw Error("array is empty");for(i=e[0],n=0;n<e.length;++n)t(e[n],i)<0&&(i=e[n]);return i}function p(e,t){var i,n;if(void 0===t&&(t=u),e.length<1)throw Error("array is empty");for(i=e[0],n=0;n<e.length;++n)t(e[n],i)>0&&(i=e[n]);return i}var _,f;Object.defineProperty(t,"__esModule",{value:!0}),t.lessThan=n,t.greaterThan=o,t.clamp=r,t.sign=s,t.isBaseDecimal=a,t.greaterOrEqual=l,t.equal=c,t.log10=h,t.defComparator=u,t.min=d,t.max=p,_=i(4),f=Object(_.getLogger)("Common.MathEx")},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},,,,,,,function(e,t,i){"use strict";var n,o=i(24),r=i(1),s=i(29),a=i(38),l=function(){function e(e){this.setData(e)}return e.prototype.setData=function(e){this._data=r.a({},e)},e.prototype.draw=function(e,t){var i,n,o,r,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P;this._data.visible&&(i=t.fontSize,e.font=t.font,n=t.tickLength,o=t.borderSize,r=t.paddingTop,l=t.paddingBottom,c=t.paddingInner,h=t.paddingOuter,u=Math.ceil(t.widthCache.measureText(e,this._data.text)),d=t.baselineOffset,p=t.fontSize+r+l,_=o+u+c+h+n,f=this._data.coordinate,this._data.fixedCoordinate&&(f=this._data.fixedCoordinate),m=f-Math.floor(i/2)-r-.5,y=m+p,g=t.isLeft?t.width-o-.5:.5,v=g,e.fillStyle=Object(s.resetTransparency)(this._data.background),e.lineWidth=1,this._data.text&&(t.isLeft?(v=g-_,S=g-n,b=v+h):(v=g+_,S=g+n,b=g+o+n+c),e.beginPath(),e.moveTo(g,m),e.lineTo(v,m),e.lineTo(v,y),e.lineTo(g,y),e.fill(),e.beginPath(),e.strokeStyle=this._data.color,e.moveTo(g,f),e.lineTo(S,f),e.stroke(),e.textAlign="left",e.fillStyle=this._data.color,e.fillText(Object(a.startWithLTR)(this._data.text),b,y-l-d)),this._data.secondLine&&(w=Math.ceil(t.widthCache.measureText(e,this._data.secondLine)),P=w+c+h,e.fillStyle=Object(s.resetTransparency)(this._data.background),this._data.text&&(m+=p+1,y+=p+1),t.isLeft?(v=Math.min(v,t.width-n),g=v+P,b=v+h):(g=Math.max(v-P,o),v=g+P,b=g+c),e.beginPath(),e.moveTo(g,m),e.lineTo(v,m),e.lineTo(v,y),e.lineTo(g,y),e.fill(),e.textAlign="left",e.fillStyle=this._data.color,e.fillText(Object(a.startWithLTR)(this._data.secondLine),b,y-l-d)))},e.prototype.height=function(e,t){var i=e.fontSize+e.paddingTop+e.paddingBottom;return this._data.secondLine&&t?2*i+1:i},e}();i.d(t,"a",function(){return n}),n=function(){function e(){this._rendererData={text:"",coordinate:0,
fixedCoordinate:0,color:"#FFF",background:"#000",visible:!1},this._renderer=new l(this._rendererData),this._invalidated=!0}return e.prototype.text=function(){return this._rendererData.text},e.prototype.background=function(){return this._rendererData.background},e.prototype.color=function(){return this.generateTextColor(this.background())},e.prototype.generateTextColor=function(e){return"black"===Object(o.rgbToBlackWhiteString)(Object(o.parseRgb)(e),160)?"white":"black"},e.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.coordinate},e.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.floatCoordinate||this._rendererData.coordinate},e.prototype.update=function(){this._invalidated=!0},e.prototype.height=function(e,t){return void 0===t&&(t=!1),this._renderer.height(e,t)},e.prototype.getFixedCoordinate=function(){return this._rendererData.fixedCoordinate||0},e.prototype.setFixedCoordinate=function(e){this._rendererData.fixedCoordinate=e},e.prototype.isVisible=function(){return this._rendererData.visible},e.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._renderer.setData(this._rendererData),this._renderer},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._rendererData),this._invalidated=!1)},e}()},,function(e,t,i){"use strict";function n(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive}function o(e,t,i,n){var o=t.add(i).scaled(.5),r=o.add(n).scaled(.5),s=l.intersectLineSegments(t,i,r,e);return null===s&&(null===(s=l.intersectLineSegments(i,n,r,e))&&null===(s=l.intersectLineSegments(n,t,r,e)))}function r(e,t,i){return e.x>=t.x&&e.x<=i.x&&e.y>=t.y&&e.y<=i.y}function s(e,t){var i,n,o,r=t.length-1,s=!1,a=e.x,l=e.y;for(i=0;i<t.length;i++)n=t[i],o=t[r],(n.y<l&&o.y>=l||o.y<l&&n.y>=l)&&n.x+(l-n.y)/(o.y-n.y)*(o.x-n.x)<a&&(s=!s),r=i;return s}function a(e,t,i){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)<=i*i}Object.defineProperty(t,"__esModule",{value:!0});var l=i(129);t.pointInHalfplane=n,t.pointInTriangle=o,t.pointInRectangle=r,t.pointInPolygon=s,t.pointInCircle=a},function(e,t,i){"use strict";function n(e){return C.Interval.parse(e).value()}function o(e){var t,i,o,r;return!!C.Interval.isRange(e)||(e=n(e),t=A.linking.supportedResolutions.value(),i=!1,void 0!==t?(o=t.map(n),i=-1!==o.indexOf(e)):i=!0,r=A.linking.intraday.value(),r?i:C.Interval.isDWM(e)&&i)}function r(e){C.Interval.isValid(e)&&(C.Interval.isRange(e)?I.setValue("chart.lastUsedRangeResolution",e):I.setValue("chart.lastUsedTimeBasedResolution",e))}function s(e){var t,i=I.getValue("chart.lastUsedRangeResolution");return void 0!==i&&C.Interval.isRange(i)?i:(t=e.filter(function(e){return C.Interval.isRange(e)}),t.includes("100R")?"100R":t.length>0?t[0]:"100R")}function a(e){var t,i=I.getValue("chart.lastUsedTimeBasedResolution");return void 0!==i&&C.Interval.isTimeBased(i)?i:(t=e.filter(function(e){return C.Interval.isTimeBased(e)}),t.includes("1D")?"1D":t.length>0?t[0]:"1D")}
function l(e){return e?"100R":"1D"}function c(e,t,i){var n=L.isRangeStyle(e),o=C.Interval.isRange(t);return!n&&o?a(i):n&&!o?s(i):t}function h(e){return C.Interval.isRange(e)?"1":e}function u(e){var t=C.Interval.parse(e),i=d(t.kind()),n=t.multiplier();return void 0!==n&&n<=i}function d(e){var t=D[e];return Number.isNaN(t)?1:t}function p(e){return d(C.Interval.kind(e))}function _(e){var t=f(I.getJSON(e,[]));return E()(t.filter(u).map(n))}function f(e){return Array.isArray(e)?e:Object.keys(e)}function m(){var e,t,i,o=[];for(e=0;e<arguments.length;e++)o[e]=arguments[e];return i=(t=[]).concat.apply(t,o),i=E()(i.filter(u).map(n)),y(i)}function y(e){return e.sort(v)}function g(e){var t=new C.Interval(e),i=t.multiplier()||1;return t.kind()===C.ResolutionKind.Minutes&&T(i)?[C.ResolutionKind.Hours,Math.floor(i/60)]:[t.kind(),i]}function v(e,t){var i=g(e),n=i[0],o=i[1],r=g(t),s=r[0],a=r[1];return n!==s?O[n]-O[s]:o-a}function S(){var e=[];return e}function b(e){var t=w(e);return""+t.multiplier+t.shortKind}function w(e){var t=C.Interval.parse(e),i=t.multiplier(),n=t.kind();if(!t.isValid()||void 0===i)throw new TypeError("Can't translate invalid interval");return t.kind()===C.ResolutionKind.Minutes&&T(i)&&(i=Math.floor(i/60),n=C.ResolutionKind.Hours),{multiplier:""+i,shortKind:P(n),hint:i+" "+P(n,i),mayOmitMultiplier:t.isDWM()&&1===i}}function P(e,t){if(t)switch(e){case C.ResolutionKind.Days:return window.t("day",{plural:"days",count:t});case C.ResolutionKind.Weeks:return window.t("week",{plural:"weeks",count:t});case C.ResolutionKind.Months:return window.t("month",{plural:"months",count:t});case C.ResolutionKind.Seconds:return window.t("second",{plural:"seconds",count:t});case C.ResolutionKind.Minutes:return window.t("minute",{plural:"minutes",count:t});case C.ResolutionKind.Hours:return window.t("hour",{plural:"hours",count:t});case C.ResolutionKind.Range:return window.t("range",{plural:"ranges",count:t});default:return e}else switch(e){case C.ResolutionKind.Minutes:return window.t("m",{context:"interval_short"});case C.ResolutionKind.Hours:return window.t("h",{context:"interval_short"});case C.ResolutionKind.Days:return window.t("D",{context:"interval_short"});case C.ResolutionKind.Weeks:return window.t("W",{context:"interval_short"});case C.ResolutionKind.Months:return window.t("Mo",{context:"interval_short"});case C.ResolutionKind.Range:return window.t("R",{context:"interval_short"});default:return""}}function T(e){return e>=60&&!(e%60)}var x,C,L,I,A,k,E,M,V,D,O;Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIntervalString=n,t.isAvailable=o,t.setLastUsedResolution=r,t.getRangeResolution=s,t.getTimeBasedResolution=a,t.getDefaultResolution=l,t.getResolutionByChartStyle=c,t.getServerInterval=h,t.isResolutionMultiplierValid=u,t.getMaxResolutionValue=p,t.getResolutionsFromSettings=_,t.convertResolutionsFromSettings=f,t.mergeResolutions=m,t.sortResolutions=y,t.getCustomResolutions=S,t.getTranslatedResolution=b,t.getTranslatedResolutionModel=w,t.isHour=T,x=i(248),i.n(x),i(11),C=i(15),L=i(42),I=i(49),i.n(I),A=i(62),
k=i(204),E=i.n(k),M={},M[C.ResolutionKind.Seconds]=60,M[C.ResolutionKind.Minutes]=1440,M[C.ResolutionKind.Hours]=24,M[C.ResolutionKind.Days]=365,M[C.ResolutionKind.Weeks]=52,M[C.ResolutionKind.Months]=12,M[C.ResolutionKind.Range]=1e3,M[C.ResolutionKind.Invalid]=NaN,D=M,V={},V[C.ResolutionKind.Seconds]=1,V[C.ResolutionKind.Minutes]=2,V[C.ResolutionKind.Hours]=3,V[C.ResolutionKind.Days]=4,V[C.ResolutionKind.Weeks]=5,V[C.ResolutionKind.Months]=6,V[C.ResolutionKind.Range]=7,V[C.ResolutionKind.Invalid]=8,O=V},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"Linking",function(){return a}),i.d(t,"linking",function(){return l}),n=i(16),o=i.n(n),r=i(5),i.n(r),function(e){e[e.NotBound=0]="NotBound",e[e.BoundToWidget=1]="BoundToWidget",e[e.BoundToModel=2]="BoundToModel"}(s||(s={})),a=function(){function e(){this._watchedSymbol=new o.a,this._seriesShortSymbol=new o.a,this._proSymbol=new o.a,this._watchedInterval=new o.a,this._watchedIntraday=new o.a,this._watchedSupportedResolutions=new o.a,this._symbolNamesList=new o.a,this._chartWidgetBindingState=s.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1,this._preventFeedBySymbol=!1}return Object.defineProperty(e.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preventFeedBySymbol",{get:function(){return this._preventFeedBySymbol},enumerable:!0,configurable:!0}),e.prototype.bindToChartWidget=function(e){var t,i;if(this.unbindFromChartWidget(),this._activeChartWidget=e,t=e.model())return void this._onChartModelCreated(t);e.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=s.BoundToWidget,i=e.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},e.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){case s.BoundToWidget:if(!this._activeChartWidget)throw Error("ChartWidget is undefined")
;this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case s.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().dataEvents().symbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().dataEvents().symbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=s.NotBound},e.prototype.getChartWidget=function(){return this._activeChartWidget},e.prototype.bindToChartWidgetCollection=function(e){var t=this;this._chartWidgetCollection=e,this.unbindFromChartWidget(),e.activeChartWidget.subscribe(function(e){t.unbindFromChartWidget(),t.bindToChartWidget(e)},{callWithLast:!0})},e.prototype.bindToSearchCharts=function(e){this.unbindFromSearchCharts(),this._searchCharts=e,e.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),this._watchedSymbol.subscribe(this._onSymbolLinkBound)},e.prototype.unbindFromSearchCharts=function(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)},e.prototype.setPreventFeedBySymbol=function(e){this._preventFeedBySymbol=e},e.prototype._onSearchBySymbol=function(e){if(!e.resolved_symbol)throw Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(e.resolved_symbol),this._selfEmit=!1},e.prototype._onSymbolLink=function(e){if(!this._selfEmit){if(!this._searchCharts)throw Error("No search charts defined");this._preventFeedBySymbol||this._searchCharts.feedBySymbol(e)}},e.prototype._mainSeries=function(){if(!this._activeChartWidget)throw Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()},e.prototype._properties=function(){return this._mainSeries().properties()},e.prototype._symbolProperty=function(){return this._properties().symbol},e.prototype._intervalProperty=function(){return this._properties().interval},e.prototype._watchedSymbolListener=function(e){(r.enabled("same_data_requery")||this._symbolProperty().value()!==e)&&this._chartWidgetCollection.setSymbol(e)},e.prototype._onSymbolPropertyChange=function(){this._watchedSymbol.setValue(this._symbolProperty().value())},e.prototype._onSymbolResolved=function(e){var t=this._mainSeries().symbolInfo();t&&this._applyValuesFromSymbolInfo(t)},e.prototype._applyValuesFromSymbolInfo=function(e){var t=e.pro_name||r.enabled("trading_terminal")&&(e.full_name||e.name)||"";this._proSymbol.setValue(t),e.aliases&&this._symbolNamesList.setValue(e.aliases)},e.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var e=this._mainSeries().symbolInfo();e?(this._applyValuesFromSymbolInfo(e),
e.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(e.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!e.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},e.prototype._watchedIntervalListener=function(e){(r.enabled("same_data_requery")||this._intervalProperty().value()!==e)&&this._chartWidgetCollection.setResolution(e)},e.prototype._onIntervalPropertyChange=function(){this._watchedInterval.setValue(this._intervalProperty().value())},e.prototype._onChartModelCreated=function(e){var t,i,n;if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._chartWidgetBindingState=s.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated),t=this._symbolProperty(),t.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(t.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound),i=this._mainSeries(),i.dataEvents().symbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(e){return i.symbolSameAsCurrent(e)&&(e=i.symbol()),e},i.dataEvents().symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolError().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().extendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),n=this._intervalProperty(),n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},e}(),window.TradingView=window.TradingView||{},l=new a,window.TradingView.Linking=l},function(e,t,i){"use strict";(function(e,n,o,r){function s(){return{count:TradingView.DEFAULT_BAR_COUNT}}function a(t,o,r){var l,_=i(120);L.call(this,t),this._dataEvents=new oe,this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this.chartWidgetInitialized=new e,this._onStyleChanged=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this._priceScaleChanged=new e,this._onInReplayStateChanged=new e,this._requestOptions=r||s(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new A,this.setProperties(o),this._prevChartStyle=o.style.value(),this.createPaneView(),this._dataWindowView=new d(this,t),this._legendView=new p(this,t),this._statusView=new c(this,t.properties()),this._priceAxisViews=[new u(this,{model:t}),new h(this,{model:t})],this._symbolInfo=null,this._status=a.STATUS_OFFLINE,this._syncModel=null,this._replaySubscriber=null,l=this,this._turnaroundCounter=1,
this._turnaround="s"+this._turnaroundCounter,this._handler=function(e){l.onData(e)},this._haStyle={studyId:Z.chartStyleStudyId(a.STYLE_HEIKEN_ASHI,!0)},this._renkoStyle={studyId:Z.chartStyleStudyId(a.STYLE_RENKO,!0)},this._pbStyle={studyId:Z.chartStyleStudyId(a.STYLE_PB,!0)},this._kagiStyle={studyId:Z.chartStyleStudyId(a.STYLE_KAGI,!0)},this._pnfStyle={studyId:Z.chartStyleStudyId(a.STYLE_PNF,!0)},this._rangeStyle={studyId:Z.chartStyleStudyId(a.STYLE_RANGE,!0)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new D(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new n,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,a.prototype._recreateFormatter),l=this,this.properties().minTick.listeners().subscribe(null,function(){l.m_model.invalidate(new M(M.FULL_UPDATE))}),this._priceLineView=new ne(this),this._baseHorizontalLineView=new ie(this),this._gotoDateResultCleared=!1,this._gotoDateView=null,this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsPrevClosePriceAvailableProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(e){this._extendedHoursChanged.fire(e),this.restart()}),this._dataEvents.extendedHoursNotPermitted().subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==a.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,a.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null,this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,l=i(7).ensureNotNull,c=i(604),h=i(606).ProjectionSeriesPriceAxisView,u=i(279).SeriesPriceAxisView,d=i(280).SeriesDataWindowView,p=i(607).SeriesLegendView,_=i(282),f=_.SeriesAreaPaneView,m=_.SeriesLinePaneView,y=_.SeriesHollowCandlesPaneView,g=_.SeriesCandlesPaneView,v=_.SeriesBarsPaneView,S=_.SeriesHeikenAshiPaneView,b=_.SeriesBaselinePaneView,w=i(283).SeriesWaterlinePaneView,P=i(5),T=i(2).propertyPages,x=i(214).BarsRange,C=i(166).SeriesBarColorer,L=i(28).PriceDataSource,I=i(99),A=i(72).SeriesData,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(18),V=i(609),D=i(21).PriceFormatter,O=i(17),R=O.PlotList,
B=O.PlotRowSearchMode,N=O.mergeMinMax,F=i(26),W=i(259).unpackNonSeriesData,H=i(610).SyncModel,j=i(39).trackEvent,z=i(123).translatedIntervalString,U=i(33),q=i(4),Y=q.getLogger("Chart.Series"),G=q.getLogger("Chart.Series.Updates",{highRate:!0}),K=i(40),Z=i(42),J=i(61),X=J.getServerInterval,Q=J.getResolutionByChartStyle,ee=i(15).Interval,te=i(135),ie=i(611).SeriesHorizontalBaseLinePaneView,ne=i(612).SeriesPriceLinePaneView,oe=i(613).SeriesDataEvents,re=te.getQuoteSessionInstance,se=!P.enabled("hide_series_legend_item"),inherit(a,L),a.prototype.styleStudyInfos=function(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle}},a.prototype.styleStudyInfo=function(e){return this.styleStudyInfos()[e]},a.prototype.priceLineColor=function(e){return this.properties().priceLineColor.value()||e},a.prototype.endOfData=function(){return this._endOfData},a.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},a.prototype._onChangeShowCountdown=function(e){var t=this;e.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){t.isDWM()||(t._priceAxisViews[0].update(),t.m_model.invalidate(new M(M.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},a.prototype.lastValueData=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return p;if(null===(n=this.m_model.timeScale().visibleBars()))return p;if(t){if(null===(s=this.data().bars().last()))return p;o=s.value,r=s.index}else{if(null===(a=this.data().bars().search(n.lastBar(),B.NearestLeft)))return p;o=this.data().bars().valueAt(a.index),r=a.index}return l={noData:!1},c=void 0!==e?o[e]:this._barFunction(o),i&&(l.price=c),h=this.firstValue(),l.text=this.priceScale().formatPrice(c,h),u=this.barColorer(),d=u.barStyle(r,!1),l.color=d.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(c,h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=r,l},a.prototype.prevClose=function(){var e,t;return this.priceScale().isEmpty()||this.data().isEmpty()||!this.quoteData?null:null==(e=this.quoteData.prev_close_price)?null:(t=this.firstValue(),{coordinate:this.priceScale().priceToCoordinate(e,t),floatCoordinate:this.priceScale().priceToCoordinate(e,t,!0),text:this.priceScale().formatPrice(e,t)})},a.prototype._createIsPrevClosePriceAvailableProperty=function(){this._isPrevClosePriceAvailable=new o(!this.isDWM()),this._onRestarted.subscribe(this,function(){this._isPrevClosePriceAvailable.setValue(!this.isDWM())})},a.prototype.isPrevClosePriceAvailable=function(){return this._isPrevClosePriceAvailable},a.prototype._prepareChartApiParams=function(){
return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},a.prototype._nextSymbolId=1,a.prototype._nextSeriesId=1,Object.assign(a,K),a.PERMISSION_DENIED="permission denied",a.PD_REASON_SYMBOL="symbol",a.PD_REASON_EXTENDED_HOURS="extended_hours",a.PD_REASON_GROUP_PERMISSION="group",a.STUDY_NOT_AUTH="study_not_auth",a.prototype.model=function(){return this.m_model},a.prototype.fixLastBar=function(e){},a.prototype.clearData=function(){this.data().clear()},a.prototype.data=function(){return this.m_data},a.prototype.symbolId=function(){return this._symbolId},a.prototype.seriesId=function(){return this._seriesId},a.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},a.prototype.onTagsChanged=function(){return this._tagsChanged},a.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},a.prototype.onIntervalChanged=function(){return this._intervalChanged},a.prototype.onStatusChanged=function(){return this._onStatusChanged},a.prototype.onStyleChanged=function(){return this._onStyleChanged},a.prototype.onRestarted=function(){return this._onRestarted},a.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},a.prototype.status=function(){return this._status},a.prototype.isDWM=function(){var e,t;return null!==this._isDWMCached?this._isDWMCached:(e=new ee(this._properties.interval.value()),e.isDWM()?this._isDWMCached=!0:(t=e.isSeconds()?e.multiplier():60*e.multiplier(),this._isDWMCached=!(t<216e3)),this._isDWMCached)},a.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},a.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._symbolLabelView=new I(this.m_model,this,void 0,"firstShortName","showSymbolLabels");var e=this._properties.style.value();switch(e){case a.STYLE_BARS:this._paneView=new v(this,this.m_model);break;case a.STYLE_CANDLES:this._paneView=new g(this,this.m_model);break;case a.STYLE_LINE:this._paneView=new m(this,this.m_model);break;case a.STYLE_AREA:this._paneView=new f(this,this.m_model);break;case a.STYLE_HEIKEN_ASHI:this._paneView=new S(this,this.m_model);break;case a.STYLE_HOLLOW_CANDLES:this._paneView=new y(this,this.m_model);break;case a.STYLE_BASELINE:this._paneView=new b(this,this.m_model),this._waterlineView=new w(this);break;default:throw Error("Unknown chart style assigned: "+e)}},a.prototype._clearStylePlot=function(e,t){var i,n;0!==e.size()&&(i=t||l(e.firstIndex()),n=l(e.lastIndex())+1,e.range(i,n).each(function(e,t){t[TradingView.STYLE_PLOT]=null}))},a.prototype.invalidateBarStylesCache=function(e){
Y.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)},a.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},a.prototype.barColorer=function(){var e,t,i,n;if(this._barColorerCache)return this._barColorerCache;for(e=null,t=this.m_model.dataSources().length-1;t>=0;t--)i=this.m_model.dataSources()[t],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(n=i.barColorer(),null===e?e=n:e.pushBackBarColorer(n));return null===e?e=new C(this):e.pushBackBarColorer(new C(this)),this._barColorerCache=e,this._barColorerCache},a.prototype.properties=function(){return this._properties},a.prototype._barsState=function(e){var t=e.state();return t.data.forEach(function(e){e.value.splice(7,1)}),t},a.prototype.state=function(e,t){var i=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),n={type:i,id:this.id(),state:this.properties().state(t),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(n.state.symbol=this._symbolInfo.ticker),e&&(n.bars=this._barsState(this.m_data.m_bars),n.nsBars=this._barsState(this.m_data.m_nsBars),n.symbolInfo=this._symbolInfo,n.rtPrice=this.data().lastProjectionPrice),n.boxSize=this.data().boxSize,n.reversalAmount=this.data().reversalAmount,n},a.prototype.restoreData=function(e,t,i,n,o,r){this._status=a.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=n,this.m_data.boxSize=o,o||(this.properties().style.value()===a.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===a.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=r,r||this.properties().style.value()===a.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},a.prototype.setProperties=function(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),this._properties=e,this._properties.symbol.listeners().subscribe(this,a.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,a.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,a.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,a.prototype.changeProperties)},a.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},a.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},a.prototype.changeTimeFrame=function(){j("GUI","Change timeframe")},a.prototype.title=function(){return this.properties().symbol.value()+", "+z(this.properties().interval.value())},
a.prototype.changeProperties=function(e){e!==this._properties.symbol&&e!==this._properties.interval&&e!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},a.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},a.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},a.prototype.onData=function(e){var t,i,n,o,r,s,c,h,u,d,p,_,f,m,y,g,v=this;switch(e.method){case"symbol_resolved":if(e.params[0]!==this._symbolId){Y.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}this.updateSymbolInfo(e.params[1]),this.m_model.updateSource(this),this._dataEvents.fireSymbolResolved(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||j("Symbol",e.params[1].listed_exchange,e.params[1].name),t=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===a.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<t?i.renkoStyle.inputs.merge({boxSize:t}):i.style.value()===a.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<t?i.pnfStyle.inputs.merge({boxSize:t}):i.style.value()===a.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<t&&i.kagiStyle.inputs.merge({reversalAmount:t});break;case"symbol_error":if(e.params[0]!==this._symbolId){Y.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}if(this._setStatus(a.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),(n=e.params[1])===a.PERMISSION_DENIED)switch(e.params[2]){case a.PD_REASON_EXTENDED_HOURS:this._dataEvents.fireExtendedHoursNotPermitted();break;case a.PD_REASON_SYMBOL:this._dataEvents.fireSymbolNotPermitted(e.params[3]);break;case a.PD_REASON_GROUP_PERMISSION:this._dataEvents.fireSymbolGroupNotPermitted(e.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(e.params[2])}else this.m_model.resetTimeScale(),this._dataEvents.fireSymbolError(e);this.m_model.realignLineTools();break;case"series_timeframe":if(e.params[1]!==this._turnaround)break;o=e.params[2],r=e.params[3],s=e.params[4],c=void 0!==s&&s?r:r+10,this.m_model.setTimeViewport(o,c);break;case"series_error":n=e.params[2],delete this._loadingStartTime,P.enabled("charting_library_debug_mode")&&Y.logNormal("Error reason: "+n),this._setStatus(P.enabled("no_bars_status")&&this._symbolInfo?a.STATUS_NO_BARS:a.STATUS_INVALID_SYMBOL),"string"==typeof n&&(n.startsWith("study_not_auth:")?(h=n.split(":",2)[1].split("@",2)[0],h in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this._dataEvents.fireChartTypeNotPermitted(h):"BarSetSpread"===h?this._dataEvents.fireIntradaySpreadNotPermitted():"BarSetRange"===h&&this._dataEvents.fireCustomIntervalNotPermitted()):"resolution_not_entitled"===n?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===n&&this._dataEvents.fireCustomIntervalNotPermitted()),this._seriesLoaded=!0,
this._dataEvents.fireSeriesError(e);break;case"series_loading":if(e.params[1]!==this._turnaround)break;if(e.params[0]!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}this._setStatus(a.STATUS_LOADING),v._loadingStartTime=(new Date).getTime();break;case"series_completed":if(e.params[2]!==this._turnaround)break;if(e.params[0]!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}switch(u="chartSession:"+v._chartApi._sessionid,d=(new Date).getTime()-this._loadingStartTime,Y.logDebug(u+", Series loading took "+d+" ms, eod:"+this._endOfData),delete this._loadingStartTime,p=e.params[1],"pulsed"===p&&(p="delayed"),p){case"streaming":this._setStatus(a.STATUS_READY);break;case"endofday":this._setStatus(a.STATUS_EOD);break;case"delayed":this._setStatus(a.STATUS_DELAYED);break;case"pulsed":this._setStatus(a.STATUS_PULSE);break;case"replay":this._setStatus(a.STATUS_REPLAY)}p.match(/delayed_streaming/)&&this._setStatus(a.STATUS_DELAYED_STREAMING),_=this.m_model.paneForSource(this),_.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new M(M.FULL_UPDATE)),this.m_data.size()&&this._dataEvents.fireTickMarksRangeChanged({start:l(this.data().first()).value[TradingView.TIME_PLOT],end:l(this.data().last()).value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.m_priceScale.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),this.model().resetPriceScale(_,this.priceScale())),this._seriesLoaded=!0,this._dataEvents.fireCompleted(),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(e.params.customId!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}if(e.params.turnaround!==this._turnaround){Y.logNormal("command for old series turnaround. Expected:"+this._turnaround+", actual"+e.params.turnaround);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void Y.logNormal("command comes during symbol/interval changing");Y.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()===a.STATUS_INVALID_SYMBOL)break;e.params.plots.length?(f=this.m_data.bars().size(),m=this.m_data.bars().firstIndex(),y=this.m_data.bars().merge(e.params.plots),(null===m||y.index<m)&&(this._endOfData=!1),g="Merge bars. earliestRow:"+y.index+"} ",g+="bars state:{firstBar:"+l(this.m_data.bars().firstIndex())+",lastBar:"+l(this.m_data.bars().lastIndex())+",size:"+this.m_data.bars().size()+"}",G.logDebug(g),f!==this.bars().size()&&(this._dataEvents.fireBarReceived(y),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):this.m_data.clear(),new Promise(function(t){var i=v.properties().style.value()
;e.params.nonseries&&Z.isRangeBasedStyle(i)?v.parseJapProjBars(e.params.nonseries).then(function(e){v.m_data.m_nsBars=e.nsBars,v.m_data.lastProjectionPrice=e.lastPrice;var i=v.m_data.boxSize!==e.boxSize;v.m_data.boxSize=e.boxSize,v.m_data.reversalAmount=e.reversalAmount,i&&v._boxSizeChanged.fire(v.m_data.boxSize),t()}):(e.params.nonseries||(v.m_data.m_nsBars.clear(),v.m_data.lastProjectionPrice=void 0),t(),t())}).then(function(){v._statusView.invalidate();var e=v.m_model.paneForSource(v);v.m_model.updateAllVolumeStudies(),v.m_model.recalculatePane(e),v.m_model.updateSource(v),v.m_model.updateLineTools(),v.m_model.updateCrossHair()})}this._dataEvents.fireMessageReceived(e)},a.prototype.parseJapProjBars=function(e){var t,i,n,o=new R(E()),r=this.model().timeScale(),s=this.properties().style.value();return new Promise(function(l){e.d&&""!==e.d?W(e.d).then(function(c){var h,u,d,p,_=c.data;for(t=_.price,i=_.boxSize,n=_.reversalAmount,h=_.bars,u=0;h&&u<h.length;u++)d=[],p=e.indexes[h[u].time],d.push(r.points().valueAt(p)),d.push(h[u].open),d.push(h[u].high),d.push(h[u].low),d.push(h[u].close),d.push(h[u].volume),s===a.STYLE_KAGI?d.push(h[u].additionalPrice):s===a.STYLE_PNF&&d.push(h[u].factor),o.add(p,d);l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})}):l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})})},a.prototype.disconnect=function(){this._seriesId&&this._chartApi.removeSeries(this._seriesId),this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=a.STATUS_OFFLINE},a.prototype.isStarted=function(){return!!this._symbolId},a.prototype.restart=function(){var e,t=i(120);this._onRestarted.fire(),this._setStatus(a.STATUS_RESOLVING),this.m_data=new A,this.updateSymbolInfo(null),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),e=this._properties.interval.value(),this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),e),e=X(e),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,t.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},a.prototype._generateTimeframe=function(e,t){var i,n=t.slice(-1),o=e;return"ytd"===t?o+=",YTD":"d"===n?(i=t.slice(0,-1),o+=","+i,P.enabled("daily_timeframe_suffix")&&(o+="D")):"m"===n?(i=t.slice(0,-1),o+=","+i+"M"):"all"===t&&(o+=",ALL"),o},a.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},a.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,
this._willSymbolIntervalChanged()&&(this._setSymbolIntervalDelay&&(Y.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){Y.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+this._properties.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30),Y.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))},a.prototype._willSymbolIntervalChanged=function(){var e=this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval);return this._checkSymbolWillChanged(this._properties.symbol.value())||e},a.prototype._checkSymbolWillChanged=function(e){return!this.symbolSameAsCurrent(e)||P.enabled("same_data_requery")},a.prototype._checkIntervalWillChanged=function(e){return this.m_interval!==e||P.enabled("same_data_requery")},a.prototype._parseInterval=function(e){var t=(e+"").split(",");return{interval:2===t.length?t[0]:e,timeframe:2===t.length?t[1]:0}},a.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},a.prototype._setSymbolInterval=function(e,t,i){var n,o,r,s,l,c,h;this.clearGotoDateResult(),n=ee.isRange(t),n&&this._properties.rangeStyle.inputs.range.setValue(ee.parse(t).multiplier()),o=this._parseInterval(t),r=o.interval,s=o.timeframe,l=this._checkSymbolWillChanged(e),c=this._checkIntervalWillChanged(r),(l||c||i)&&((n||ee.isRange(this.m_interval))&&(this._symbolId=null),this._syncModel=null,this.m_symbol=e,this.m_interval=r,this.m_timeframe=s,this._symbolId&&!l||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==a.STATUS_SNAPSHOT&&(this._setStatus(a.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),c&&(h={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,h),this._pendingTimeRange=h.timeframe&&h.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!l||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler)),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),t),this._predictBars=0,t=X(t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._onBeforeModifySeries(this.getSymbolString(),t),this._seriesId=this._makeNextSeriesId(),t=X(t),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)))))},a.prototype.setDefaultTimeframe=function(e){
this._pendingTimeRange=e},a.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},a.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},a.prototype.symbol=function(){return this.properties().symbol.value()},a.prototype.interval=function(){return this.properties().interval.value()},a.prototype.isIntradayInterval=function(){var e=X(this.interval());return!!/^\d*$/.test(e)&&e<=1440},a.prototype.bars=function(){return this.m_data.m_bars},a.prototype.nsBars=function(){return this.m_data.m_nsBars},a.prototype.open=function(e){return this.m_data.valueAt(e)[TradingView.OPEN_PLOT]},a.prototype.high=function(e){return this.m_data.valueAt(e)[TradingView.HIGH_PLOT]},a.prototype.low=function(e){return this.m_data.valueAt(e)[TradingView.LOW_PLOT]},a.prototype.close=function(e){return this.m_data.valueAt(e)[TradingView.CLOSE_PLOT]},a.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},a.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},a.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},a.prototype.priceRange=function(e,t){var i,n,o,s,a,l,c,h;return TradingView.isInteger(e)?TradingView.isInteger(t)?this.data().isEmpty()?null:this.m_priceScale.isLockScale()&&null!==(i=this._model.mainSeriesScaleRatio())?(n=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/i),o=this.data().search(t,B.NearestLeft),s=(o.value[TradingView.HIGH_PLOT]+o.value[TradingView.LOW_PLOT])/2,new r(s-.5*n,s+.5*n)):(a=this.priceSource(),null!==a?(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:a,offset:0}]),c=this.data().nsBars().minMaxOnRangeCached(e,t,[{name:a,offset:0}])):(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),c=this.data().nsBars().minMaxOnRange(e,t,[{name:"low",offset:0},{name:"high",offset:0}])),l=N(l,c),h=null!==l?l.min===l.max?new r(l.min-.5,l.max+.5):new r(l.min,l.max):new r(-.5,.5),this.priceScale().isLog()?new r(this.priceScale().priceToLogical(h.minValue()),this.priceScale().priceToLogical(h.maxValue())):h):(Y.logDebug("Series.priceRange: incorrect endBar"),null):(Y.logDebug("Series.priceRange: incorrect startBar"),null)},a.prototype.nearestData=function(e,t){if(!TradingView.isInteger(e))return void Y.logDebug("Series.nearestData: incorrect logicalPoint");var i=this.data().search(e,t);return null!==i?i:void 0},a.prototype.nearestIndex=function(e,t){var i=this.nearestData(e,t);return i?i.index:void 0},a.prototype.paneViews=function(e){if(!this.properties().visible.value())return null;var t=[this._baseHorizontalLineView,this._paneView];return this._futureBarsPaneView&&t.push(this._futureBarsPaneView),this._projectionBarsPaneView&&t.push(this._projectionBarsPaneView),null!==this._waterlineView&&t.push(this._waterlineView),t.push(this._priceLineView),t.push(this._symbolLabelView),null!==this._gotoDateView&&t.push(this._gotoDateView),t},a.prototype.dataWindowView=function(){return this._dataWindowView},
a.prototype.legendView=function(){return this._legendView},a.prototype.statusView=function(){return se?this._statusView:null},a.prototype.priceAxisViews=function(e,t){return this.m_model.paneForSource(this)===e&&t===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},a.prototype.base=function(){return this._base},a.prototype.formatter=function(){return this._formatter},a.prototype.purgeSymbolInfo=function(){this._symbolInfo=null,this._isDWMCached=null},a.prototype.symbolInfo=function(){return this._symbolInfo},a.prototype._recreateFormatter=function(){var e,t,i,n;"default"===this.properties().minTick.value()?this._formatter=new D(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(e=this.properties().minTick.value().split(","),t=parseInt(e[0]),i=parseInt(e[1]),n="true"===e[2],this._formatter=new D(t,i,n)),this.priceScale()&&this.priceScale().updateFormatter()},a.prototype.updateSymbolInfo=function(e){var t,i,n=this,o=e&&(e.pro_name||e.full_name||e.name);P.enabled("charting_library_single_symbol_request")&&this.m_symbol?o=this.m_symbol:P.enabled("use_ticker_on_symbol_info_update")&&e&&e.ticker&&(o=e.ticker),this._symbolInfo=e,e&&(this._properties.shortName.setValue(e.name),t=this._properties.symbol.value(),i=o,P.enabled("uppercase_instrument_names")&&(t=t.toUpperCase(),i=i.toUpperCase()),o&&t!==i&&this._properties.symbol.setValue(o)),this._base=e?e.pricescale/e.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),this._quoteSessionSymbol!==o&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+U.guid()),this._unsubscribeQuoteSession(),o&&(this._quoteSessionSymbol=o,re("full").subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(e,t){n.quoteData=e&&e.values||null,t&&t.values&&t.values.current_session&&n.marketStatus.setValue(t.values.current_session)}))),this.checkInterval()},a.prototype.dataPoweredBy=function(){return null},a.prototype._unsubscribeQuoteSession=function(){this._quoteSessionSymbol&&(re("full").unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0)},a.prototype.symbolSameAsCurrent=function(e){if(this.m_symbol===e)return!0;var t=this._symbolInfo;if(t){if(t.full_name===e||t.pro_name===e)return!0;if(t.ticker===e)return!0;if(t.aliases&&-1!==t.aliases.indexOf(e))return!0;if(t.alternatives&&-1!==t.alternatives.indexOf(e))return!0;if(0===e.indexOf("FRA:")&&t.pro_name===e.replace("FRA:","FWB:"))return!0}return!1},a.prototype.updateAllViews=function(){var e,t;for(this._paneView.update(),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),e=this._priceAxisViews.length,t=0;t<e;t++)this._priceAxisViews[t].update();this._futureBarsPaneView&&this._futureBarsPaneView.update(),
this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._waterlineView&&this._waterlineView.update(),this._priceLineView.update(),null!==this._gotoDateView&&this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update(),this._baseHorizontalLineView.update()},a.prototype._setStatus=function(e){this._status=e,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},a.prototype.requestMoreData=function(e){var t,i,n,o;this._status!==a.STATUS_READY&&this._status!==a.STATUS_PULSE&&this._status!==a.STATUS_DELAYED&&this._status!==a.STATUS_DELAYED_STREAMING&&this._status!==a.STATUS_EOD&&this._status!==a.STATUS_REPLAY||this.m_model.timeScale().isEmpty()||null!==(t=this.m_model.timeScale().visibleBars())&&0!==this.bars().size()&&(i=e||t.lastBar()-l(this.data().last()).index,this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(n=l(this.bars().firstIndex()),(o=e||n-t.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,o,this._handler),P.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(a.STATUS_LOADING))))},a.prototype.bindStyleChange=function(){var e=this;Object.keys(a.STYLE_SHORT_NAMES).map(function(e){return a.STYLE_SHORT_NAMES[e]+"Style"}).forEach(function(t){e._properties[t].listeners().subscribe(e,a.prototype.invalidateBarStylesCache)})},a.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.wicks.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.rangeStyle.inputs.phantomBars.listeners().subscribe(this,this.onInputChanged)},a.prototype.createExtendedHoursProperty=function(){function e(){
var e="undefined"!=typeof ProductFeatures&&isProductFeatureEnabled(ProductFeatures.EXTENDED_SESSION),i=t.model().readOnly(),n=t._properties.extendedHours.value(),o=P.enabled("widget");!n||o||i||e||(t._dataEvents.fireExtendedHoursNotPermitted(),n=!1),n&&!t.isIntradayInterval()&&(n=!1),t.extendedHours.setValue(n)}var t=this;t.extendedHours=new o,t._properties.extendedHours.listeners().subscribe(null,e),t._properties.interval.listeners().subscribe(null,e),t.chartWidgetInitialized.subscribe(null,e),e()},a.prototype.setChartStyleWithIntervalIfNeeded=function(e,t){var i,n=t;void 0===t&&(n=Q(e,this._properties.interval.value(),this._model.defaultResolutions())),i=ee.isEqual(n,this._properties.interval.value()),i||this._properties.interval.setValue(n),this._properties.style.setValue(e)},a.prototype.isNeedRestart=function(e){return void 0===e&&(e=this.properties().style.value()),!Z.isRangeStyle(this._prevChartStyle)&&!Z.isRangeStyle(e)&&!(this._prevChartStyle===e||!Z.isRequiringRestartSeriesStyles(this._prevChartStyle)&&!Z.isRequiringRestartSeriesStyles(e))},a.prototype.onChartStyleChanged=function(){this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onStyleChanged.fire(this.properties().style.value()),this.invalidateBarStylesCache()},a.prototype.applyPreferences=function(e){var t=$.extend(!0,{},e);this.m_priceScale.setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),this.setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,this._properties.mergeAndFire(t),this._properties.saveDefaults(),this.createPaneView(),this.invalidateBarStylesCache()},a.prototype.barFunction=function(){return this._barFunction},a.prototype.priceSource=function(){var e=null;switch(this._properties.style.value()){case a.STYLE_LINE:e=this._properties.lineStyle.priceSource.value();break;case a.STYLE_AREA:e=this._properties.areaStyle.priceSource.value();break;case a.STYLE_BASELINE:e=this._properties.baselineStyle.priceSource.value()}return e},a.prototype._updateBarFunction=function(){var e=this.priceSource()||"close";this._barFunction=k(e)},a.prototype.style=function(){return this.properties().style.value()},a.prototype.isRangeBasedStyle=function(){return Z.isRangeBasedStyle(this.style())},a.prototype.onInputChanged=function(){this.restart()},a.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},a.prototype.getSymbolString=function(){var e,t,i;return e=P.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(e={symbol:e,session:"extended"}),a.SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(t=this.styleStudyInfo(this.getStyleShortName()+"Style").studyId,i=this.getInputsProperties(),e={symbol:e,type:t+"!",inputs:i.state()}),
"string"!=typeof e&&(e="="+JSON.stringify(e)),e},a.prototype._getResolvingSymbolString=function(){return this.getSymbolString()},a.prototype.getStyleShortName=function(){var e=this._properties.style.value();if(a.STYLE_SHORT_NAMES.hasOwnProperty(e))return a.STYLE_SHORT_NAMES[e];throw Error("Missed short name for style "+e)},a.prototype.getStyleProperties=function(){return this._properties[this.getStyleShortName()+"Style"]},a.prototype.getInputsProperties=function(){return this.getStyleProperties().inputs||new o},a.prototype.getRealVisibleRange=function(){var e,t,i=this.model().timeScale().visibleBars();return null===i?null:(e=this.data().search(i.firstBar(),B.NearestRight),t=this.data().search(i.lastBar(),B.NearestLeft),null===e||null===t?null:new x(e.index,t.index))},a.prototype.firstValue=function(){var e=this.firstBar();return null===e?null:this._barFunction(e)},a.prototype.firstBar=function(){var e,t,i=this.model().timeScale().visibleBars();return null===i?null:(e=i.firstBar(),t=this.data().search(e,B.NearestRight),null!==t?t.value:null)},a.prototype.sessionsStudy=function(){var e,t,i,n;if(this._sessionsStudy)return this._sessionsStudy;for(e=this.model().paneForSource(this),t=e.dataSources(),i=0;i<t.length;i++)if((n=t[i])instanceof TradingView.Study&&"Sessions"===n.metaInfo().shortId)return this._sessionsStudy=n,this._sessionsStudy;return!1},a.prototype.clearSessionStudy=function(){this._sessionsStudy=null},a.prototype.createSessStudy=function(){if(!this.sessionsStudy()){var e=F.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(e,!1,!0),this._onSessionsStudyCreated.fire()}},a.prototype.checkSessStudy=function(){P.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},a.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},a.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},a.prototype.firstShortName=function(){return V.ticker(this.firstSymbol())},a.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},a.prototype.loadDataTo=function(e){this._turnaround="s"+ ++this._turnaroundCounter;var t=this._properties.interval.value();t=this._generateTimeframe(t,e),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler)},a.prototype.checkInterval=function(){if(this._symbolInfo&&(ee.isMinutes(this.interval())&&!this._symbolInfo.has_intraday&&this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var e=ee.normalize(this._properties.interval.value());-1===this._symbolInfo.supported_resolutions.indexOf(e)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},a.prototype.priceScale=function(){return this.m_priceScale},a.prototype.setPriceScale=function(e){this.m_priceScale!==e&&(this.m_priceScale=e,this._priceScaleChanged.fire(e),this._properties.removeProperty("priceAxisProperties"),
this._properties.addChild("priceAxisProperties",e.properties()),this._properties.priceAxisProperties.childChanged())},a.prototype.priceScaleChanged=function(){return this._priceScaleChanged},a.prototype.setGotoDateResult=function(e){this._gotoDateResultCleared=!1,i.e(25).then(function(t){if(!this._gotoDateResultCleared){var n=i(810).GotoDateView;this._gotoDateView=new n(this,e),this.m_model.updateSource(this)}}.bind(this).bind(null,i)).catch(i.oe)},a.prototype.clearGotoDateResult=function(e){this._gotoDateView=null,this._gotoDateResultCleared=!0};a.prototype.syncModel=function(){var e,t;if(!this._syncModel){if(e=this.symbolInfo(),t=this.interval(),!e||!t)return null;this._syncModel=new H(e,t)}return this._syncModel},a.prototype.turnaround=function(){return this._turnaround},a.prototype.getStylesPropertyPage=function(){return P.enabled("show_chart_property_page")?T.ChartStylesPropertyPage:null},a.prototype.getSourceIcon=function(){return{type:"loadSvg",svgId:"series."+this.properties().style.value()}},a.prototype.isStyleSupported=function(e){return!0},a.prototype.isStyleSupportedForReplay=function(e){return Z.isTimeBasedStyle(e)},a.prototype.isInReplay=function(){return null!==this._replaySubscriber},a.prototype._onBeforeModifySeries=function(e,t){},a.prototype._isExtendedHoursAllowed=function(){return this._symbolInfo&&-1!==["stock","index","futures"].indexOf(this._symbolInfo.type)},a.prototype._getTelemetryAdditionalData=function(e,t){t=void 0===t||t;var i={symbol:this.actualSymbol()};return t&&(i.resolution=this.interval()),void 0!==e&&(i.reason=e),i},a.prototype._sendTelemetryReport=function(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var n=Object.assign(t,{additional:i});telemetry.sendChartReport(e,n)},a.prototype._sendTelemetryCounter=function(e,t){this._sendTelemetryReport(e,{count:1},t)},a.prototype._sendTelemetryTiming=function(e,t,i){this._sendTelemetryReport(e,{value:t},i)},a.prototype.destroy=function(){this._unsubscribeQuoteSession(),this.clearGotoDateResult(),this._legendView.destroy()},a.prototype.dataEvents=function(){return this._dataEvents},TradingView.Series=a,t.Series=a}).call(t,i(8),i(16),i(13),i(48).PriceRange)},,,,function(e,t,i){"use strict";e.exports=i(252)},function(e,t,i){"use strict";function n(){this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=1,this._numericFormatter=new r,this._percentageFormatter=new o}var o=i(70).PercentageFormatter,r=i(105).NumericFormatter;n.prototype.levelsCount=function(){return 0},n.prototype.topByRow=function(e){return e*n.ROW_HEIGHT},n.prototype.rowHeight=function(e){return n.ROW_HEIGHT},n.prototype.canvas=function(){if(!this._canvas){this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0);this._canvas.get(0).getContext("2d").font="12px Verdana"}return this._canvas},n.ROW_HEIGHT=14,n.prototype.points=function(e){
return[e.points()[0],e.points()[1]]},n.prototype.startPoint=function(e,t){return t?e.points()[0]:e.points()[1]},n.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],o=i[1];return t?o.price-n.price:n.price-o.price},n.prototype.sourceIsReady=function(e){return e.points().length>=2},n.prototype._calculateWidth=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P;if(!this.sourceIsReady(e))return null;if(t=this.canvas().get(0).getContext("2d"),t.font="12px Verdana",i=!!e.properties().showPrices&&e.properties().showPrices.value(),n=!!e.properties().coeffsAsPercents&&e.properties().coeffsAsPercents.value(),o=e.properties().showCoeffs.value(),r=e.priceScale(),s=this.points(e),a=s[0],l=s[1],!a||!l)return null;if(c=!1,h=e.properties(),h.reverse&&h.reverse.value()&&(c=h.reverse.value()),u=this.priceRange(e,c),d=this.startPoint(e,c).price,null===(p=e.ownerSource().firstValue()))return 0;for(_=0,f=[],m=1;m<=this.levelsCount();m++)y="level"+m,g=h[y],v=g.coeff.value(),S=d+v*u,b="",o&&(b+=n?this._percentageFormatter.format(Math.round(1e4*v)/100):this._numericFormatter.format(v)),i&&(b+="("+r.formatPrice(S,p)+")"),w=t.measureText(b).width,P={text:b,left:_,width:w+4},f.push(P),_+=P.width;return{totalWidth:_,cells:f}},n.prototype._effectiveState=function(e){var t,i,n,o,r,s,a={},l=e.properties();for(l.showPrices&&(a.showPrices=l.showPrices.value()),l.coeffsAsPercents&&(a.coeffsAsPercents=l.coeffsAsPercents.value()),a.showCoeffs=l.showCoeffs.value(),e.priceScale()&&e.priceScale().formatter().state&&(a.formatter=e.priceScale().formatter().state()),l.reverse&&(a.reverse=l.reverse.value()),a.p1=e.points()[0],a.p2=e.points()[1],3===e.points().length&&(a.p3=e.points()[2]),a.items=[],t=1;t<=this.levelsCount();t++)i="level"+t,n=l[i],o=n.coeff.value(),r=n.color.value(),s={coeff:o,color:r},a.items.push(s);return a},n.prototype._findEmptyRow=function(e){for(var t,i=0;this._rowsToSources[i];)i++;return this._rowsToSources[i]=e,i>=this._actualCapacity&&(this._actualCapacity++,t=this.canvas(),TradingView.resizeCanvas(t,this._actualWidth,n.ROW_HEIGHT*this._actualCapacity)),i},n.prototype._repaintSource=function(e,t,i){var o,r,s=n.ROW_HEIGHT*i.row,a=this.canvas().get(0).getContext("2d");for(a.clearRect(0,s,this._actualWidth,n.ROW_HEIGHT),a.textBaseline="bottom",a.font="12px Verdana",s+=n.ROW_HEIGHT,o=0;o<e.cells.length;o++)r=e.cells[o],a.fillStyle=t.items[o].color,a.fillText(r.text,r.left,s)},n.prototype.removeSource=function(e){var t,i;this._sourcesToRow[e]&&(t=this._sourcesToRow[e].row,i=this.canvas().get(0).getContext("2d"),i.save(),i.clearRect(0,this.topByRow(t),this._actualWidth,n.ROW_HEIGHT),i.restore(),delete this._sourcesToRow[e],delete this._rowsToSources[t])},n.prototype._effectiveStatesEquals=function(e,t){var i,n=function(e,t){return!(!e&&!t)&&(!(!e||t)||(!(e||!t)||(e.minMove!==t.minMove||(e.minMove2!==t.minMove2||(e.fractional!==t.fractional||e.fractionalLength!==t.fractionalLength)))))},o=function(e,t){return!(!e&&!t)&&(!(!e||t)||(!(e||!t)||(e.index!==t.index||e.price!==t.price)))},r=function(e,t){
return e.coeff!==t.coeff||e.color!==t.color};if(e&&!t)return!1;if(!e&&t)return!1;if(e.showPrices!==t.showPrices)return!1;if(e.coeffsAsPercents!==t.coeffsAsPercents)return!1;if(e.showCoeffs!==t.showCoeffs)return!1;if(e.reverse!==t.reverse)return!1;if(n(e.formatter,t.formatter))return!1;if(o(e.p1,t.p1))return!1;if(o(e.p2,t.p2))return!1;if(o(e.p3,t.p3))return!1;if(e.items.length!==t.items.length)return!1;for(i=0;i<e.items.length;i++)if(r(e.items[i],t.items[i]))return!1;return!0},n.prototype.updateSource=function(e){var t,i,o,r,s=e.properties().symbol.value();return this._currentSymbol!==s&&(this._currentSymbol=s,this._sourcesToRow={},this._rowsToSources={}),this._sourcesToRow[e.id()]||(t=this._findEmptyRow(e.id()),this._sourcesToRow[e.id()]={effectiveState:null,row:t}),i=this._sourcesToRow[e.id()].effectiveState,o=this._effectiveState(e),this._effectiveStatesEquals(i,o)||(r=this._calculateWidth(e),r?(this._sourcesToRow[e.id()].effectiveState=o,r.totalWidth>this._actualWidth&&(TradingView.resizeCanvas(this.canvas(),r.totalWidth,n.ROW_HEIGHT*this._actualCapacity),this._actualWidth=r.totalWidth),t=this._sourcesToRow[e.id()],this._repaintSource(r,o,t),this._sourcesToRow[e.id()].effectiveState=o,this._sourcesToRow[e.id()].preparedCells=r):this._sourcesToRow[e.id()].effectiveState=null),this._sourcesToRow[e.id()]},e.exports=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompositeRenderer",function(){return n});var n=function(){function e(){this._renderers=[],this._globalAlpha=1}return e.prototype.setGlobalAlpha=function(e){this._globalAlpha=e},e.prototype.append=function(e){this._renderers.push(e)},e.prototype.insert=function(e,t){this._renderers.splice(t,0,e)},e.prototype.draw=function(e){for(var t=0;t<this._renderers.length;t++)e.save(),e.globalAlpha=this._globalAlpha,this._renderers[t].draw(e),e.restore()},e.prototype.drawBackground=function(e){var t,i;for(e.save(),e.globalAlpha=this._globalAlpha,t=0;t<this._renderers.length;t++)i=this._renderers[t],i.drawBackground&&i.drawBackground(e);e.restore()},e.prototype.hitTest=function(e){var t,i,n=null;for(t=this._renderers.length-1;t>=0;t--)null!==(i=this._renderers[t].hitTest(e))&&(null===n||i.result()>n.result())&&(n=i);return n},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PercentageFormatter",function(){return r}),n=i(1),o=i(21),r=function(e){function t(t){void 0===t&&(t=100);var i=e.call(this,t)||this;return i.type="percentage",i}return n.c(t,e),t.prototype.state=function(){var e=o.PriceFormatter.prototype.state.call(this);return e.percent=!0,e},t.prototype.format=function(t,i,n,o){return e.prototype.format.call(this,t,i,n,o)+"%"},t.serialize=function(e){return e.state()},t.deserialize=function(e){return new t(e.priceScale)},t}(o.PriceFormatter)},function(e,t,i){"use strict";(function(t){function i(){return/on-features-page=1/i.test(window.location.search)}var n=window.TradingView=window.TradingView||{};n.className=function(e){for(var t in this)if(n[t]===e)return t;return null},
n.isOnFeaturePage=i(),n.wrapUrl=function(e){return t.enabled("charting_library_base")&&(e=e.replace("/static/","")),e},n.isMobile=function(){var e=/Android/i.test(navigator.userAgent),t=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),n=/Opera Mini/i.test(navigator.userAgent),o=e||t||i||n;return{Android:function(){return e},BlackBerry:function(){return t},iOS:function(){return i},Opera:function(){return n},any:function(){return o}}}(),n.supportTouch=function(){return Modernizr.touch||n.isMobile.any()},n.onWidget=function(){var e,t,i=["^widgetembed/?$","^cmewidgetembed/?$","^([0-9a-zA-Z-]+)/widgetembed/?$","^([0-9a-zA-Z-]+)/widgetstatic/?$","^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$","^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$","^embed(-static)?/([0-9a-zA-Z]{8})/?$","^widgetpopup/?$","^extension/?$","^chatwidgetembed/?$","^ideaswidgetembed/?$","^ideas-widget/?$","^view-idea-widget/([0-9a-zA-Z]{8})/?$","^user-info-widget/?$","^user-info-widget-get/(.+?)?/?$","^embed-quotes-provider/?$","^idea-popup/?$","^hotlistswidgetembed/?$","^([0-9a-zA-Z-]+)/hotlistswidgetembed/?$","^marketoverviewwidgetembed/?$","^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$","^eventswidgetembed/?$","^tickerswidgetembed/?$","^forexcrossrateswidgetembed/?$","^forexheatmapwidgetembed/?$","^marketquoteswidgetembed/?$","^screenerwidget/?$","^cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/marketquoteswidgetembed/?$","^technical-analysis-widget-embed/$","^singlequotewidgetembed/?$"],n=window.location.pathname.replace(/^\//,"");for(t=i.length-1;t>=0;t--)if(e=RegExp(i[t]),e.test(n))return!0;return!1},n.onOrder=function(){return"/order/"===window.location.pathname},e.exports.CheckMobile=n.isMobile,e.exports.isOnFeaturePage=i,e.exports.onWidget=n.onWidget,e.exports.supportTouch=n.supportTouch}).call(t,i(5))},function(e,t,i){"use strict";function n(){var e=new Map;return c.forEach(function(t,i){e.set(t,o(t))}),e}function o(e){return l[e]}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimePointIndexSearchMode",function(){return a}),t.seriesPlotFunctionMap=n,t.barFunction=o,i.d(t,"SeriesData",function(){return h}),r=i(7),i.n(r),s=i(17),function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(a||(a={})),l={open:function(e){return e[1]},high:function(e){return e[2]},low:function(e){return e[3]},close:function(e){return e[4]},hl2:function(e){return(e[2]+e[3])/2},hlc3:function(e){return(e[2]+e[3]+e[4])/3},ohlc4:function(e){return(e[1]+e[2]+e[3]+e[4])/4}},c=["open","high","low","close","hl2","hlc3","ohlc4"],h=function(){function e(){this.m_bars=new s.PlotList(n()),this.m_nsBars=new s.PlotList(n())}return e.prototype.bars=function(){return this.m_bars},e.prototype.nsBars=function(){return this.m_nsBars},e.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},e.prototype.each=function(e){this.m_bars.each(e),this.m_nsBars.each(e)},e.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},
e.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},e.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},e.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},e.prototype.search=function(e,t){return this.nsBars().isEmpty()?this.bars().search(e,t):this.bars().isEmpty()?this.nsBars().search(e,t):Object(r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t):this.bars().search(e,t)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.plotValueToTimePointIndex=function(e,t,i){var n,o,r,s;if(i===a.FromRight)return n=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e>=o},null!==(o=this.m_bars.findLast(n))?o.index:(r=this.m_nsBars.findLast(n),null!==r?r.index:this.m_bars.firstIndex());if(i===a.FromLeft)return s=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e<=o},null!==(o=this.m_bars.findFirst(s))?o.index:(r=this.m_nsBars.findFirst(s),null!==r?r.index:this.m_bars.lastIndex());throw Error("plotValueToTimePointIndex: unsupported search mode")},e}()},function(e,t,i){"use strict";function n(e,t,i,n,r){Object(l.assert)(o(e),"Unknown line tool: "+e);var s=Object(l.ensureDefined)(h[e]);return"LineToolVbPFixed"===e?new s(t,i,n,r):"LineToolRegressionTrend"===e?new s(t,i,n):["LineStudyMtpAnalysis","LineStudyMtpDecisionPoint","LineStudyMtpRiskReward","LineStudyMtpElliotWaveMain","LineStudyMtpElliotWaveMajor","LineStudyMtpElliotWaveMinor","LineStudyMtpDownWave1OrA","LineStudyMtpDownWave2OrB","LineStudyMtpDownWave3","LineStudyMtpDownWave4","LineStudyMtpDownWave5","LineStudyMtpDownWaveC","LineStudyMtpUpWave1OrA","LineStudyMtpUpWave2OrB","LineStudyMtpUpWave3","LineStudyMtpUpWave4","LineStudyMtpUpWave5","LineStudyMtpUpWaveC"].indexOf(e)>=0?new s(t,i,n):new s(t,i)}function o(e){return e in h}function r(e){return e instanceof c.LineDataSource}function s(e){var t=!1;return t}function a(e){var t=!1;return t}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.createLineTool=n,t.isLineToolName=o,t.isLineTool=r,t.isStudyLineToolName=s,t.isStudyLineTool=a,l=i(7),i.n(l),c=i(0),i.n(c),h=i(45),i.n(h)},,,,,function(e,t,i){"use strict";function n(e,t){return e<t}function o(e,t,i,n,o){var r,s,a;for(void 0===n&&(n=0),void 0===o&&(o=e.length),r=o-n;0<r;)s=r>>1,a=n+s,i(e[a],t)?(n=a+1,r-=s+1):r=s;return n}function r(e,t,i,r){return void 0===i&&(i=0),void 0===r&&(r=e.length),o(e,t,n,i,r)}function s(e,t,i,n,o){var r,s,a;for(void 0===n&&(n=0),void 0===o&&(o=e.length),r=o-n;0<r;)s=r>>1,a=n+s,i(t,e[a])?r=s:(n=a+1,r-=s+1);return n}function a(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=e.length),s(e,t,n,i,o)}Object.defineProperty(t,"__esModule",{value:!0}),t.lowerbound=o,t.lowerbound_int=r,t.upperbound=s,t.upperbound_int=a},function(e,t,i){"use strict";function n(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)])
}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),this.version=o.version,i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function r(e,t){this._constructor="LineToolElliottImpulse";var i=t||new p("linetoolelliottimpulse");o.call(this,e,i)}function s(e,t){this._constructor="LineToolElliottTriangle";var i=t||new p("linetoolelliotttriangle");o.call(this,e,i)}function a(e,t){this._constructor="LineToolElliottTripleCombo";var i=t||new p("linetoolelliotttriplecombo");o.call(this,e,i)}function l(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),this.version=l.version,i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function c(e,t){this._constructor="LineToolElliottCorrection";var i=t||new p("linetoolelliottcorrection");l.call(this,e,i)}function h(e,t){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=t||new p("linetoolelliottdoublecombo");l.call(this,e,i)}var u=i(0).LineDataSource,d=i(41).Action,p=i(3).DefaultProperty,_=i(2).propertyPages;inherit(n,u),n.migrateState=function(e){var t={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])},n.prototype.title=function(){return"Elliott Labels"},n.prototype.name=function(){return"Elliott Labels"},n.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor",{context:"wave"}),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],n.prototype.additionalActions=function(e){var t=new d({text:$.t("Degree")}),i=this;return t.subActions=n.degrees.map(function(t,n){var o=new d({text:t,checkable:!0,checked:i.properties().degree.value()===n});return o.callbacks().subscribe(null,function(){e.setProperty(i.properties().degree,n,"Change Elliott Degree")}),o}),[t]},n.prototype.label=function(e){var t=n.degrees.length-this.properties().degree.value()-1,i=Math.floor(t/3),o=t%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][o],label:this.labelsGroup()[i][e]}},n.prototype.getStylesPropertyPage=function(){return _.LineToolElliottStylesPropertyPage},n.prototype.getDegrees=function(){return n.degrees},inherit(o,n),o.version=3,o.prototype.pointsCount=function(){return 6},o.prototype.migrateVersion=function(e,t,i){if(1===e){
var n=$.extend({},this._timePoint[0]);this._timePoint.unshift(n),this._points.length>0&&(n=$.extend({},this._points[0]),this._points.unshift(n))}},inherit(r,o),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(s,o),s._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],s.prototype.labelsGroup=function(){return s._labelsGroups},inherit(a,o),a._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,n),l.version=3,l.prototype.pointsCount=function(){return 4},l.prototype.migrateVersion=function(e,t,i){if(1===e){var n=$.extend({},this._timePoint[0]);this._timePoint.insert(n,0),this._points.length>0&&(n=$.extend({},this._points[0]),this._points.insert(n,0))}},inherit(c,l),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(h,l),h._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],h.prototype.labelsGroup=function(){return h._labelsGroups},t.LineToolElliott=n,t.LineToolElliottImpulse=r,t.LineToolElliottTriangle=s,t.LineToolElliottTripleCombo=a,t.LineToolElliottCorrection=c,t.LineToolElliottDoubleCombo=h},,function(e,t,i){"use strict";function n(e,t){e.width=t.w,e.height=t.h;var i=e.getContext("2d");i&&i.translate(.5,.5)}function o(e,t){e.width=0,n(e,t)}function r(e,t,i,n,o,r){e.save(),e.translate(-.5,-.5),e.fillStyle=r,e.fillRect(t,i,n,o),e.restore()}function s(e,t){var i=document.createElement("canvas");return e.append(i),n(i,t),i}function a(e,t){return"center"===e.textAlign?0:c.IS_RTL?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"Size",function(){return h}),t.resizeCanvas=n,t.hardResizeCanvas=o,t.clearRect=r,t.addCanvasTo=s,t.calcTextHorizontalShift=a,l=i(14),i.n(l),c=i(38),h=function(){function e(e,t){this.w=e,this.h=t}return e.prototype.equals=function(e){return this.w===e.w&&this.h===e.h},e}()},function(e,t,i){"use strict";function n(e){return new Promise(function(t){i.e(2).then(function(n){var r=i(188).createDialog;t(r(o.a({},a,e)))}.bind(null,i)).catch(i.oe)})}var o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.createConfirmDialog=n,o=i(1),i(11),r={key:13,name:"yes",text:window.t("Yes"),type:"success"},s={method:"close",name:"no",text:window.t("No"),type:"default"},a={actions:[r,s],actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',content:window.t("Are you sure?"),
contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',destroyOnClose:!0,title:window.t("Confirmation"),width:400}},,function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LINESTYLE_SOLID",function(){return n}),i.d(t,"LINESTYLE_DOTTED",function(){return o}),i.d(t,"LINESTYLE_DASHED",function(){return r}),i.d(t,"LINESTYLE_LARGE_DASHED",function(){return s}),i.d(t,"LINESTYLE_SPARSE_DOTTED",function(){return a}),n=0,o=1,r=2,s=3,a=4},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),n=i(12),i.n(n),o=/{(\w+)}/g,r=/{(\d+)}/g,String.prototype.format=function(){var e,t,i,s,a=[];for(e=0;e<arguments.length;e++)a[e]=arguments[e];return t=Object(n.isObject)(a[0]),i=t?o:r,s=t?function(e,t){var i=a[0];return void 0!==i[t]?i[t]:e}:function(e,t){var i=parseInt(t,10),n=a[i];return void 0!==n?n:e},this.replace(i,s)}},function(e,t,i){"use strict";function n(e){return"line"===e.type}function o(e){return"shapes"===e.type}function r(e){return"chars"===e.type}function s(e){return"arrows"===e.type}function a(e){return"dataoffset"===e.type}function l(e){return"ohlc_open"===e.type}function c(e){return"ohlc_high"===e.type}function h(e){return"ohlc_low"===e.type}function u(e){return"ohlc_close"===e.type}function d(e){return l(e)||c(e)||h(e)||u(e)}function p(e){return"colorer"===e.type}function _(e){return"bar_colorer"===e.type}function f(e){return"bg_colorer"===e.type}function m(e){return"text_colorer"===e.type}function y(e){return"ohlc_colorer"===e.type}function g(e){return"ohlc_bars"===e.plottype}function v(e){return"ohlc_candles"===e.plottype}var S,b;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PlotType",function(){return S}),t.isLinePlot=n,t.isShapesPlot=o,t.isCharsPlot=r,t.isArrowsPlot=s,t.isDataOffsetPlot=a,t.isOhlcOpenPlot=l,t.isOhlcHighPlot=c,t.isOhlcLowPlot=h,t.isOhlcClosePlot=u,t.isOhlcPlot=d,t.isColorerPlot=p,t.isBarColorerPlot=_,t.isBgColorerPlot=f,t.isTextColorerPlot=m,t.isOhlcColorerPlot=y,t.isOhlcPlotStyleBars=g,t.isOhlcPlotStyleCandles=v,i.d(t,"PlotSymbolSize",function(){return b}),function(e){e[e.Line=0]="Line",e[e.Histogram=1]="Histogram",e[e.Cross=3]="Cross",e[e.Area=4]="Area",e[e.Columns=5]="Columns",e[e.Circles=6]="Circles",e[e.LineWithBreaks=7]="LineWithBreaks",e[e.AreaWithBreaks=8]="AreaWithBreaks",e[e.StepLine=9]="StepLine"}(S||(S={})),function(e){e.Auto="auto",e.Tiny="tiny",e.Small="small",e.Normal="normal",e.Large="large",e.Huge="huge"}(b||(b={}))},function(e,t,i){"use strict";(function(e,n,o){function r(t,i){var r,a=t._undoModel._chartWidget,l=a.onWidget(),c=!1;c=l?a._options&&!a._options.hideIdeas:!!e.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:c,frozen:!1}):i=new n({visible:c,frozen:!1}),r=this,i.visible.listeners().subscribe(null,function(t){l||a._containsData||!e.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),r._tooltip&&r._tooltip.removeAll()}),s.call(this,t,i),
this.onNeedRepaint=new o,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().tickMarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new h(this._createTooltip.bind(this),this)}var s=i(0).LineDataSource,a=i(12).isNumber,l=i(179).BarsMarksContainerPaneView,c=i(179).BarsMarksContainerRenderer,h=i(621).TooltipRenderer,u=i(15).Interval,d=i(4).getLogger("Chart.BarsMarksContainer");inherit(r,s),r.prototype._constructor="Child class must override this member",r.prototype._initialize=function(e){throw Error("Child class must override this member")},r.prototype.onClicked=function(){throw Error("Child class must override this member")},r.prototype._getData=function(e){throw Error("Child class must override this member")},r.prototype._createTooltip=function(){throw Error("Child class must override this member")},r.prototype.updateDotData=function(e,t){return t},r.prototype.updatePlateData=function(e,t){},r.prototype._plateViewData=function(e){return{}},r.prototype.pinTooltip=function(e,t){this.pinnedTooltips[e]=t},r.prototype.timeScale=function(){return this._model.timeScale()},r.prototype.getIntervalInTicks=function(){var e=this._model.mainSeries().properties().interval.value(),t=u.parse(e);if(!t.isValid())throw new TypeError("Unexpected interval");return t.isRange()?60:t.inMilliseconds()/1e3},r.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),r.prototype.getVisibleTickMarksRange=function(){var e,t;return this.timeScale().isEmpty()?{start:0,end:0}:(e=this.timeScale().visibleBars(),e.lastBar()>this.timeScale().points().firstIndex()&&e.firstBar()<this.timeScale().points().lastIndex()?(t=e.lastBar()<this.timeScale().points().lastIndex()?this.timeScale().indexToTimePoint(e.lastBar()):this._maxDate,e={start:this.timeScale().indexToTimePoint(Math.max(e.firstBar(),this.timeScale().points().firstIndex())),end:t},{start:e.start?e.start:void 0,end:e.end?e.end:void 0}):{start:0,end:0})},r.prototype.getVisibleRangePlates=function(){var e=[],t=this.getVisibleTickMarksRange(),i=this.getIntervalInTicks();return $.each(this._marks,function(n,o){var r=o.tickmark;r>=t.start&&r<=t.end+i&&e.push(o)}),e},r.prototype.getPublishedPlates=function(){var e={},t=this;return is_authenticated?($.each(this.getVisibleRangePlates(),function(i,n){n.is_public&&(t.pinnedTooltips[n.id]||n.user__id===user.id)&&(e[n.id]=n)}),e):e},r.prototype._maxPlatesPerBar=10,r.prototype.filterDisplayedPlates=function(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var n=e[i];return n=n.sort(function(e,t){return t.views_count-e.views_count}),n=n.slice(0,this._maxPlatesPerBar),t.concat(n)}.bind(this),[])},r.prototype._layout=function(e){
switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},r.prototype._theme=function(e){switch(e){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},r.prototype._offset=function(e,t){var i;switch(e){default:case"up":i=t[TradingView.HIGH_PLOT];break;case"down":i=t[TradingView.LOW_PLOT]}return this.priceScale().priceToCoordinate(i,this.ownerSource().firstValue())},r.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},r.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},r.prototype.barWidth=function(){return this.timeScale().barSpacing()},r.prototype.getPlatesViewData=function(){var e,t,i,n,o,r;if(this._model.mainSeries().data().isEmpty())return[];e=this.filterDisplayedPlates(this.getVisibleRangePlates()),t=this,i={},n=this._model.lastHittestData(),e=e.map(function(e){var o,r,s,a,l,c,h=this._getIndex(e.tickmark),u=this._getBar(h);return null!==u&&(o=this._layout(e.direction),r=this._theme(e.direction),s=n&&n.id===e.id,a=this.timeScale().indexToCoordinate(h),l=this._offset(o,u),c=0,h in i||(i[h]={up:0,down:0}),c=i[h][o]++,TradingView.merge({id:e.id,x:a,y:l,order:c,direction:o,theme:r,hovered:s,pinned:!0===t.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e)))}.bind(this)),e=e.filter(function(e){return!!e}),o=e.filter(function(e){return!0===e.hovered});for(r=0;r<e.length;r++)null!=o[0]&&e[r].user__id===o[0].user__id&&(e[r].highlightByAuthor=!0);return e.sort(function(e,t){return e.hovered&&!t.hovered?1:0}),e},r.prototype._getBar=function(e){return this._model.mainSeries().data().valueAt(e)},r.prototype.paneViews=function(e){var t=this;return this._properties.visible.value()?[new l(this,e,function(e){return new c(e.getViewData(),t)})]:[]},r.prototype.dataWindowView=function(){return null},r.prototype.priceAxisViews=function(){return null},r.prototype.statusView=function(){return null},r.prototype.updateAllViews=function(){},r.prototype.pointsCount=function(){return 0},r.prototype.properties=function(){return this._properties},r.prototype._rangeDifference=function(e){return e=$.extend({},e),this._loadedRange&&(e.start<this._loadedRange.start?e.end=this._loadedRange.start:e.end>this._loadedRange.end&&(e.start=this._loadedRange.end)),e},r.prototype._rangeUnion=function(e,t){return e=$.extend({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e},r.prototype._pushGetDataStack=function(e){if(!a(e.start)||!a(e.end))return void d.logError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)},r.prototype.roundRange=function(e){return{
start:Math.round(e.start),end:Math.round(e.end)}},r.prototype.refreshData=function(){this.getData(this._lastRange)},r.prototype.getData=function(e){if(!a(e.start)||!a(e.end))return void d.logError("Wrong range");this._lastRange=e;var e=$.extend({},e);e.end=this._maxDate,this._pushGetDataStack(e)},r.prototype._abortAllRequests=function(){this._requests.forEach(function(e){e.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},r.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=r}).call(t,i(5),i(13),i(8))},function(e,t,i){"use strict";var n=i(288),o={instances:[],createMenu:function(e,t,i){var o=new n(e,t,i);return this.instances.push(o),o},hideAll:function(){for(var e in this.instances)this.instances[e].hide()}};e.exports=o},,,,,,,,,,,function(e,t,i){"use strict";(function(t){function n(e){this._data=e,this._textWidthCache=new l}function o(e,t,i,n,o){this._model=e,this._source=t,this._plotIndex=i,this._getterName=n||"symbol",this._propertyName=o,this._cache={},this._invalidated=!0,this._rendererData={}}var r=i(24),s=r.parseRgb,a=r.rgbToBlackWhiteString,l=i(115),c=i(69).CompositeRenderer,h=i(116).makeFont,u=i(29);n.prototype.hitTest=function(e){return null},n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),e.font=this._data.font,t=this._data.fontSize,i=Math.floor(t/4.5),n=Math.ceil(t/4.5),o=Math.ceil(t/3),r=Math.ceil(this._textWidthCache.measureText(e,this._data.text)),s=Math.round(t/10),a=t+i+n,l=r+2*o,c=this._data.x-.5,"right"===this._data.align&&(c-=l),h=this._data.y-Math.floor(t/2)-i-.5,e.fillStyle=u.resetTransparency(this._data.backColor),e.fillRect(c,h,l,a),e.fillStyle=this._data.color,e.textAlign="left",e.fillText(this._data.text,c+o,h+i+t-s))},o.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var e,i,n,o,r,l,u,d,p=this._rendererData;if(p.visible=!1,p.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(e=this._source.lastValueData(this._plotIndex,t.enabled("price_scale_always_last_bar_value")),!e.noData)){if(i=this._model.paneForSource(this._source),n="right",i.leftPriceScale()===this._source.priceScale()&&(n="left"),o=this._model.properties(),r=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),r&&o.scalesProperties.showLeftScale.value()&&!o.scalesProperties.showRightScale.value()&&(n="left"),!r){if("left"===n&&!o.scalesProperties.showLeftScale.value())return new c;if("right"===n&&!o.scalesProperties.showRightScale.value())return new c}l=e.coordinate,u=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,
this._source.lastPriceLabelFixedCoordinate&&!u&&"showSymbolLabels"===!this._propertyName&&(l=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||l),e.color!==p.backColor&&(p.backColor=this._source.priceLineColor(e.color),d=a(s(p.backColor),160),p.color="black"===d?"white":"black"),p.text=this._source[this._getterName](this._plotIndex),p.visible=""!==p.text,p.align=n,p.x="right"===n?this._model.timeScale().width():0,p.y=l,p.fontSize=this._model.properties().scalesProperties.fontSize.value(),p.font=h(p.fontSize,"Arial","")}},o.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new n(this._rendererData)),this._renderer},e.exports=o}).call(t,i(5))},function(e,t,i){"use strict";function n(){var e,t,i,n;this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=0,this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._currentWidth=400,this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0),this._ctx=this._canvas.get(0).getContext("2d"),this._ctx.font=u.fontSize+"px"+u.font,e=u.fontSize,t=u.lineSpacing,i=e+t,n=3,this._padding=8,this._rowHeight=i*n-t+2*this._padding+2}function o(e,t){this._constructor="LineToolTrendLine";var o=t||new a("linetooltrendline");s.call(this,e,o),e._trendLineStatsCache||(e._trendLineStatsCache=new n),i.e(0).then(function(e){var t=i(770).TrendLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(6).Point,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages,c=i(4).getLogger("Chart.LineToolTrendLine"),h=i(349).TrendLineStatsRenderer,u=i(327).LabelSettings;n.prototype.canvas=function(){return this._canvas},n.prototype.topByRow=function(e){return e*this._rowHeight},n.prototype.rowHeight=function(e){return this._rowHeight},n.prototype.rowWidth=function(e){var t=this._rowsToSources[e];return this._sourcesToRow[t].width},n.prototype.currentWidth=function(){return this._currentWidth},n.prototype._findEmptyRow=function(e){for(var t=0;this._rowsToSources[t];)t++;return this._rowsToSources[t]=e,t>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),c.logDebug("TrendLineCache. Expanging cache to "+this._actualCapacity+" items")),t},n.prototype._effectiveState=function(e){var t,i={};return i.p1=$.extend({},e.points()[0]),i.p2=$.extend({},e.points()[1]),t=e.properties(),i.showBars=t.showBarsRange.value(),i.showTimeRange=t.showDateTimeRange.value(),i.showDistance=t.showDistance.value(),i.showPriceRange=t.showPriceRange.value(),i.showAngle=t.showAngle.value(),i.color=t.textcolor.value(),i.showAngle&&(i.priceRange=e.priceScale().priceRange().state(),i.barSpacing=e._model.timeScale().barSpacing()),i},n.prototype._effectiveStatesEquals=function(e,t){
var i=function(e,t){return!(!e&&!t)&&(!(!e||t)||(!(e||!t)||(e.index!==t.index||e.price!==t.price)))};if(e&&!t)return!1;if(!e&&t)return!1;if(i(e.p1,t.p1))return!1;if(i(e.p2,t.p2))return!1;if(e.color!==t.color)return!1;if(e.showBars!==t.showBars)return!1;if(e.showTimeRange!==t.showTimeRange)return!1;if(e.showDistance!==t.showDistance)return!1;if(e.showPriceRange!==t.showPriceRange)return!1;if(e.showAngle!==t.showAngle)return!1;if(e.showAngle){if(e.priceRange.min!==t.priceRange.min)return!1;if(e.priceRange.max!==t.priceRange.max)return!1;if(e.barSpacing!==t.barSpacing)return!1}return!0},n.prototype.removeSource=function(e){if(this._sourcesToRow[e]){var t=this._sourcesToRow[e].row;this._ctx.save(),this._ctx.clearRect(0,this.topByRow(t),this._currentWidth,this.rowHeight(t)),this._ctx.restore(),delete this._sourcesToRow[e],delete this._rowsToSources[t]}},n.prototype._repaintSource=function(e,t,i){var n,o;this._ctx.save(),this._ctx.translate(0,this.topByRow(t)+.5),i.points[0]=new r(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(t)),n=new h(i,{}),o=n.draw(this._ctx),this._sourcesToRow[e].width=o.width,this._ctx.restore()},n.prototype.updateSource=function(e,t){var i,n,o,r,s,a=e.properties().symbol.value();return this._currentSymbol!==a&&(c.logDebug("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+a),this._currentSymbol=a,this._sourcesToRow={},this._rowsToSources={}),i=e.id(),this._sourcesToRow[i]||(n=this._findEmptyRow(i),this._sourcesToRow[i]={effectiveState:null,row:n}),o=this._sourcesToRow[e.id()].effectiveState,r=this._effectiveState(e),this._effectiveStatesEquals(o,r)||(n=this._sourcesToRow[e.id()],s=t(),this._repaintSource(i,n.row,s),this._sourcesToRow[i].effectiveState=r),this._sourcesToRow[i]},inherit(o,s),o.prototype.stop=function(){s.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Trend Line"},o.prototype.name=function(){return"Trend Line"},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendLineStylesPropertyPage},t.LineToolTrendLine=o},function(e,t,i){"use strict";function n(e,t){var n=t||new h("linetoolarrowmark");n.hasChild("text")||n.addChild("text",new c("")),n.addExclusion("text"),l.call(this,e,n),i.e(0).then(function(t){var n=i(350).TextPaneView,o=i(351).MarkPaneView,r=[new o(this,e,this.image,this.width,this.height,this.offsetX,this.offsetY)],s=this._createTextPaneView(n);null!==s&&r.push(s),this._setPaneViews(r)}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){this._constructor="LineToolArrowMarkLeft",n.call(this,e,t)}function r(e,t){this._constructor="LineToolArrowMarkUp",n.call(this,e,t)}function s(e,t){
this._constructor="LineToolArrowMarkRight",n.call(this,e,t)}function a(e,t){this._constructor="LineToolArrowMarkDown",n.call(this,e,t)}var l=i(0).LineDataSource,c=i(13),h=i(3).DefaultProperty,u=i(2).propertyPages;inherit(n,l),n.prototype.width=21,n.prototype.height=21,n.prototype.offsetX=0,n.prototype.offsetY=0,n.prototype.paneViews=function(e){var t=l.prototype.paneViews.call(this,e);return null!==t&&this._textPaneView&&t.push(this._textPaneView),t},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Arrow Mark"},n.prototype.name=function(){return"Arrow Mark"},n.prototype.getStylesPropertyPage=function(){return u.LineToolArrowMarkStylesPropertyPage},n.prototype._createTextPaneView=function(e){return null},inherit(o,n),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",o.prototype.offsetX=1,o.prototype.offsetY=-10,o.prototype.title=function(){return"Arrow Mark Left"},o.prototype.name=function(){return"Arrow Mark Left"},o.prototype._createTextPaneView=function(e){var t=new e(this,this._model,22,-3,"middle","left");return t.disableSelection(),t},inherit(r,n),r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",r.prototype.offsetX=-9,r.prototype.offsetY=0,r.prototype.title=function(){return"Arrow Mark Up"},r.prototype.name=function(){return"Arrow Mark Up"},r.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,18,"top","center");return t.disableSelection(),t},inherit(s,n),s.prototype.image=new Image,
s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",s.prototype.offsetX=-19,s.prototype.offsetY=-10,s.prototype.title=function(){return"Arrow Mark Right"},s.prototype.name=function(){return"Arrow Mark Right"},s.prototype._createTextPaneView=function(e){var t=new e(this,this._model,-22,-3,"middle","right",!0);return t.disableSelection(),t},inherit(a,n),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},a.prototype.name=function(){return"Arrow Mark Down"},a.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,-23,"bottom","center");return t.disableSelection(),t},s.prototype.version=o.prototype.version=a.prototype.version=r.prototype.version=2,t.LineToolArrowMark=n,t.LineToolArrowMarkLeft=o,t.LineToolArrowMarkRight=s,t.LineToolArrowMarkUp=r,t.LineToolArrowMarkDown=a},,function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineEnd",function(){return n});var n;!function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(n||(n={}))},,function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"NumericFormatter",function(){return o}),n=i(21),o=function(){function e(e){this._precision=e}return e.prototype.format=function(t){return(void 0!==this._precision?t.toFixed(this._precision):e.formatNoE(t)).replace(".",n.formatterOptions.decimalSign)},e.prototype.parse=function(e){var t=e.replace(n.formatterOptions.decimalSign,"."),i=parseFloat(t)
;return this._precision&&(i=+i.toFixed(this._precision)),i},e.formatNoE=function(e){return e>=1e-15&&e<1?e.toFixed(15).replace(/\.?0+$/,""):e+""},e}()},function(e,t,i){"use strict";var n=i(159).TVLocalStorage;i(71),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(e){n.setItem(this.force_prefix+e,"true")},disableFeature:function(e){n.setItem(this.force_prefix+e,"false")},resetFeature:function(e){n.removeItem(this.force_prefix+e)}},TradingView.isFeatureEnabled=function(e){function t(t){var i=Math.random()<=e[t];return n.setItem(o+t,i),i}function i(e){return-1===["address-autocomplete-google-key","black_friday","black_friday_popup","black_friday_mainpage","coinbase_payments","ios_app_info","text_notes","multiple-sos","datawindow","broker_ALOR_dev"].indexOf(e)&&-1===e.indexOf("-maintenance")}var o="featuretoggle.";return function(r){var s,a;return!(!s&&"local"!==window.environment||!i(r))||(!e[r]||-1!==e[r])&&(!!("true"===n.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"true"===user.settings[TradingView.FeatureToggle.force_prefix+r])||!("false"===n.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"false"===user.settings[TradingView.FeatureToggle.force_prefix+r])&&(!!e[r]&&(1===e[r]||(a=n.getItem(o+r),void 0===a||null===a?t(r):"true"===a))))}}(window.featureToggleState||{}),t.FeatureToggle=TradingView.FeatureToggle,t.isFeatureEnabled=TradingView.isFeatureEnabled},function(e,t,i){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TVXWindowEvents",function(){return n}),i(85),function(e){function t(e,t){s[e]||(s[e]=[]),s[e].push(t)}function i(e,t){if(s[e]){var i=s[e].indexOf(t);-1!==i&&(1===s[e].length?delete s[e]:s[e].splice(i,1))}}function n(e){return TVLocalStorage.getItem(r+e)}function o(e,t){void 0===t&&(t=(new Date).valueOf()),t!==TVLocalStorage.getItem(r+e)&&TVLocalStorage.setItem(r+e,t)}var r="tvxwevents.",s={};window.addEventListener("storage",function(e){if(null!==e.newValue){var t=e.key;t&&t.startsWith(r)&&(t=t.substr(r.length),s[t]&&s[t].forEach(function(t){t.call(e.newValue,e.newValue)}))}}),e.on=t,e.off=i,e.current=n,e.emit=o}(n||(n={}))},function(e,t,i){"use strict";function n(e){return"s"===e}function o(e){return!n(e)}var r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"layouts",function(){return l}),t.isSingleLayout=n,t.isMultipleLayout=o,r=i(1),s={s:{title:"1 chart",count:1,sizer:function(e,t,i,n){return{width:t.width-n-n,height:t.height-n-n,top:n,left:n}}}},a={},l=r.a({},s,a)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HorizontalLineRenderer",function(){return r}),n=i(9),o=i(46),i.n(o),r=function(){function e(){this._data=null,this._hitTest=new n.HitTestResult(n.HitTestResult.REGULAR)}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.draw=function(e){var t,i
;null!==this._data&&0!==this._data.points.length&&!1!==this._data.visible&&((t=this._data.points[0].y)<0||t>this._data.height||(i=this._data.width,e.lineCap="square",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&Object(o.setLineStyle)(e,this._data.linestyle),Object(o.drawLine)(e,0,t,i,t)))},e.prototype.hitTest=function(e){return null===this._data||!1===this._data.visible?null:0===this._data.points.length?null:Math.abs(e.y-this._data.points[0].y)<=5?this._hitTest:null},e}()},function(e,t,i){"use strict";function n(e,t){var i=e[0].getBoundingClientRect();t.localX=t.clientX-i.left,t.localY=t.clientY-i.top}var o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MouseEventHandler",function(){return h}),o=i(14),i.n(o),r=i(127),i.n(r),s=i(356),a=i(7),i.n(a),l=2,c=!1,h=function(){function e(e,t,i,n){this._clickCount=0,this._clickTimeoutId=null,this._touchContextMenuTimeout=null,this._lastTouchPosition={x:0,y:0},this._mouseMoveStartPosition=null,this._moveExceededManhattanDistance=!1,this._cancelClick=!1,this._hammerManager=null,this._isDestroyed=!1,this._$target=e,this._handler=t,this._originalPreventDefault=i,this._preventDefault=!n&&i,this._verticalTouchScroll=n,this._init()}return e.prototype.destroy=function(){null!==this._hammerManager&&(this._hammerManager.destroy(),this._hammerManager=null),this._isDestroyed=!0},e.prototype._mouseEnterHandler=function(e){this._$target.off("mousemove.chartgui"),this._$target.on("mousemove.chartgui",this._mouseMoveHandler.bind(this)),Modernizr.touch&&this._mouseMoveHandler(e),this._processEvent(e,this._handler.mouseEnterEvent),this._preventDefaultIfNeeded(e)},e.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null},e.prototype._mouseMoveHandler=function(e){c&&!Modernizr.touch||(this._processEvent(e,this._handler.mouseMoveEvent),this._preventDefaultIfNeeded(e))},e.prototype._mouseMoveWithDownHandler=function(e){var t,i,n,o,r,s,c;void 0===e.button&&(e.button=0),t=!1,this._fixMouseTouchEvent(e,e.originalEvent),i=Modernizr.touch||e.originalEvent.touches,i&&(this._verticalTouchScroll&&(n=Math.abs(.5*(e.pageX-this._lastTouchPosition.x)),o=Math.abs(e.pageY-this._lastTouchPosition.y),n<=o?(t=!0,this._preventDefault=!1):this._preventDefault=this._originalPreventDefault),this._lastTouchPosition.x=e.pageX,this._lastTouchPosition.y=e.pageY),r=Object(a.ensure)(this._mouseMoveStartPosition),s=Math.abs(r.x-e.pageX),c=Math.abs(r.y-e.pageY),this._moveExceededManhattanDistance=this._moveExceededManhattanDistance||s+c>5,this._moveExceededManhattanDistance?(this._cancelClick=!0,i&&this._clearContextMenuTimeout()):i&&(t=!0),e.button===l||t||this._processEvent(e,this._handler.pressedMouseMoveEvent),this._preventDefaultIfNeeded(e)},e.prototype._mouseUpHandler=function(e){void 0===e.button&&(e.button=0),this._fixMouseTouchEvent(e,e.originalEvent),Modernizr.touch&&this._clearContextMenuTimeout(),this._mouseMoveStartPosition=null,c=!1
;var t=e.target.ownerDocument.documentElement;$(t).off("mousemove.chartgui"),$(t).off("mouseup.chartgui"),Modernizr.touch||e.originalEvent.touches?($(t).off("touchmove.chartgui"),$(t).off("touchend.chartgui"),this._mouseLeaveHandler(e)):($(t).off("mousemove.chartgui touchmove.chartgui"),$(t).off("mouseup.chartgui touchend.chartgui")),e.button!==l&&(this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent)),this._preventDefaultIfNeeded(e),Modernizr.touch&&this._mouseLeaveHandler(e)},e.prototype._clearContextMenuTimeout=function(){null!==this._touchContextMenuTimeout&&(clearTimeout(this._touchContextMenuTimeout),this._touchContextMenuTimeout=null)},e.prototype._mouseDownHandler=function(e){void 0===e.button&&(e.button=0),this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._fixMouseTouchEvent(e,e.originalEvent),Modernizr.touch&&(this._lastTouchPosition.x=e.pageX,this._lastTouchPosition.y=e.pageY,this._mouseEnterHandler(e)),this._mouseMoveStartPosition={x:e.pageX,y:e.pageY};var t=e.target.ownerDocument.documentElement;if(Modernizr.touch?($(t).off("touchmove.chartgui"),$(t).off("touchend.chartgui"),$(t).on("touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(t).on("touchend.chartgui",this._mouseUpHandler.bind(this)),this._clearContextMenuTimeout(),this._touchContextMenuTimeout=setTimeout(this._contextMenuHandler.bind(this,e),500)):($(t).off("mousemove.chartgui touchmove.chartgui"),$(t).off("mouseup.chartgui touchend.chartgui"),$(t).on("mousemove.chartgui touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(t).on("mouseup.chartgui touchend.chartgui",this._mouseUpHandler.bind(this))),c=!0,e.button!==l&&(this._processEvent(e,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))),this._preventDefaultIfNeeded(e),this._preventDefault)try{window.focus()}catch(e){}},e.prototype._init=function(){var e=this;this._$target.mouseenter(this._mouseEnterHandler.bind(this)),this._$target.on("touchcancel",this._clearContextMenuTimeout.bind(this)),this._$target.on("touchstartoutside mousedownoutside",function(t){e._handler.mouseDownOutsideEvent&&e._handler.mouseDownOutsideEvent(t,e._$target)}),this._$target.mouseleave(this._mouseLeaveHandler.bind(this)),this._$target.contextMenu&&this._$target.contextMenu(this._contextMenuHandler.bind(this)),Modernizr.touch?(this._$target.on("touchstart.chartgui",this._mouseDownHandler.bind(this)),this._initGestureEvents()):this._$target.on("mousedown.chartgui touchstart.chartgui",this._mouseDownHandler.bind(this))},e.prototype._mouseLeaveHandler=function(e){this._$target.off("mousemove.chartgui touchmove.chartgui"),this._processEvent(e,this._handler.mouseLeaveEvent),this._preventDefaultIfNeeded(e)},e.prototype._contextMenuHandler=function(e){
this._processEvent(e,this._handler.contextMenuEvent),this._preventDefaultIfNeeded(e),this._cancelClick=!0},e.prototype._processEvent=function(e,t){t&&(n(this._$target,e),t.call(this._handler,e,this._$target))},e.prototype._preventDefaultIfNeeded=function(e){this._preventDefault&&e.preventDefault()},e.prototype._initGestureEvents=function(){var e,t=this;[this._handler.gestureStartEvent,this._handler.gestureChangeEvent,this._handler.gestureEndEvent].some(Boolean)&&(e=new s.a,e.load().then(function(e){t._isDestroyed||(t._hammerManager=new e(t._$target.get(0)),t._hammerManager.get("pinch").set({enable:!0}),t._hammerManager.on("pinchstart",function(e){t._handler.gestureStartEvent&&t._handler.gestureStartEvent(e,t._$target),t._clearContextMenuTimeout()}),t._hammerManager.on("pinchmove",function(e){t._handler.gestureChangeEvent&&t._handler.gestureChangeEvent(e,t._$target)}),t._hammerManager.on("pinchend pinchcancel",function(e){t._handler.gestureEndEvent&&t._handler.gestureEndEvent(e,t._$target)}))}))},e.prototype._fixMouseTouchEvent=function(e,t){var i;if(t.touches&&0!==t.touches.length)i=t.touches[0];else{if(!t.changedTouches||0===t.changedTouches.length)return;i=t.changedTouches[0]}e.pageX=i.pageX,e.pageY=i.pageY,e.localX=i.pageX,e.localY=i.pageY,e.clientX=i.clientX,e.clientY=i.clientY},e}()},,,,function(e,t,i){"use strict";var n,o;i.d(t,"a",function(){return o}),n=3e3,o=function(){function e(){var e=this;this._cache=null,this._tryLoad=function(t){e._startLoading().then(t,function(){return setTimeout(function(){return e._tryLoad(t)},n)})}}return e.prototype.load=function(){return this._cache||(this._cache=new Promise(this._tryLoad)),this._cache},e}()},function(e,t,i){"use strict";function n(e){this._maxSize=e||50,this.reset()}var o=/[2-9]/g;n.prototype.measureText=function(e,t,i){var n,r,s=i||o,a=(t+"").replace(s,"0");return this._cache[a]?this._cache[a].width:(this._actualSize===this._maxSize&&(n=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[n],this._oldestTick++,this._actualSize--),0===(r=e.measureText(a).width)&&t.length?0:(this._cache[a]={width:r,tick:this._usageTick},this._tick2Labels[this._usageTick]=a,this._actualSize++,this._usageTick++,r))},n.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},e.exports=n},function(e,t,i){"use strict";function n(e,t,i){return i&&(i+=" "),(i||"")+e+"px "+t}Object.defineProperty(t,"__esModule",{value:!0}),t.makeFont=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyDataWindowView",function(){return d}),n=i(1),o=i(83),i.n(o),r=i(118),s=i(5),i.n(s),a=i(17),l=i(86),c=window.t("n/a"),h=s.enabled("hide_last_na_study_output"),u=function(e){function t(t,i,n,o){var r=e.call(this,t,i)||this;return r.plotId=n,r.plotIndex=o,r}return n.c(t,e),t}(r.DataWindowItem),d=function(e){function t(t,i){var n,o,r,s,a=e.call(this)||this;if(a._invalidated=!0,a._study=t,a._model=i,!(n=t.metaInfo().plots))return a
;for(o=0;o<n.length;++o)a._study.isSelfColorerPlot(o)||a._study.isBarColorerPlot(o)||a._study.isBgColorerPlot(o)||a._study.isDataOffsetPlot(o)||a._study.isOHLCColorerPlot(o)||(r=n[o].id,s=new u(a._study.guiPlotName(r),"",r,o),a._items.push(s));return a.update(),a}return n.c(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype._updateImpl=function(){var e,t,i,n,r,s,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O;for(this._header=this._study.title(!0),this._title=this._study.title(),e=this._study.isVisible()?c:"",t=0,i=this._items;t<i.length;t++)n=i[t],n.setValue(e);if(h&&this._items.length&&this._items[this._items.length-1].setValue(""),!this._model.timeScale().isEmpty()){if(r=this._study.metaInfo().plots,s={},u=this._study.metaInfo().palettes,r&&void 0!==u)for(d=0;d<r.length;d++)p=r[d],(Object(l.isColorerPlot)(p)||Object(l.isOhlcColorerPlot)(p))&&(_=p.target,s[_]={index:d,palette:u[p.palette],paletterProps:this._study.properties().palettes[p.palette]});for(f=this._study.data().size()-1,m=this._model.crossHairSource().appliedIndex(),y=this._study.formatter(),g={},v=0,S=this._items;v<S.length;v++)b=S[v],n=b,w=n.plotId,P=n.plotIndex,T=this._study.offset(w),void 0!==(x=Object(o.isNumber)(m)?this._study.nearestIndex(m-T,a.PlotRowSearchMode.NearestLeft):f)&&(C=g[w],void 0===C&&(C=this._study.getMinFirstBarIndexForPlot(w),Number.isFinite(C)&&(g[w]=C)),C>x||(L=this._study.data().last(),null!==(I=this._study.data().valueAt(x)||(null!==L?L.value:null))&&(A=I[P+1],Object(o.isNumber)(A)&&(n.setValue(y.format(A)),k=this._study.properties().styles[w].color.value(),p=r[P],Object(l.isOhlcPlot)(p)&&(w=p.target||w,k=this._study.properties().ohlcPlots[w].color.value()),E=k,s[w]&&I.length>s[w].index+1&&(M=I[s[w].index+1],V=s[w].palette,void 0!==M&&null!==M&&void 0!==V&&(D=s[w].paletterProps,O=V.valToIndex?V.valToIndex[M]:M,E=D.colors[void 0!==O?O:M].color.value())),n.setColor(E)))))}},t}(r.DataWindowView)},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DataWindowItem",function(){return n}),i.d(t,"DataWindowView",function(){return o}),n=function(){function e(e,t){this._visible=!0,this._title=e,this._value=t}return e.prototype.title=function(){return this._title},e.prototype.setTitle=function(e){this._title=e},e.prototype.text=function(){return this._value},e.prototype.value=function(){return this._value},e.prototype.setValue=function(e){this._value=e},e.prototype.visible=function(){return this._visible},e.prototype.setVisible=function(e){this._visible=e},e.prototype.color=function(){return this._color},e.prototype.setColor=function(e){this._color=e},e}(),o=function(){function e(){this._items=[],this._header="",this._title=""}return e.prototype.header=function(){return this._header},e.prototype.title=function(){return this._title},e.prototype.items=function(){return this._items},e.prototype.update=function(){},e}()},function(e,t,i){"use strict";function n(e,t){
o.call(this,t),this._study=e,this._inputValueReplacements={NONE:"Default"}}var o=i(267);inherit(n,o),n.prototype.color=function(){return this._study.isFailed()||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":o.prototype.color.call(this)},n.prototype.update=function(){this._study.isFailed()?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},e.exports=n},function(e,t,i){"use strict";var n,o=i(7).assert,r=i(24),s=r.rgba,a=r.rgbaToString,l=r.parseRgb,c=i(533),h=i(177).PriceScale,u=i(124),d=i(73),p=d.createLineTool,_=d.isLineToolName,f=d.isStudyLineToolName,m=i(0).LineDataSource,y=i(45).LineToolBarsPattern,g=i(45).LineToolCallout,v=i(635),S=i(34),b=S.Study,w=S.prepareStudyPropsStateForLoadChart,P=S.prepareStudyPropertiesForLoadChart,T=i(285).createStudy,x=i(63).Series,C=i(40),L=i(42),I=i(3).DefaultProperty,A=i(26),k=i(5),E=i(4).getLogger("Chart.Serialization"),M=i(45).LineToolParallelChannel,V=i(45).LineToolTrendAngle,D=i(45).LineToolGhostFeed,O=i(45).LineToolElliott,R=i(28).PriceDataSource,B=i(176).Pane,N=i(18),F=i(29);E=i(4).getLogger("Chart.Serialization"),c.version=2,c.prototype.state=function(e,t){var i,n,o,r={};for(r.panes=[],i=0;i<this.panes().length;i++)r.panes.push(this.panes()[i].state(!0,e,!1,t));return r.timeScale=this.m_timeScale.state(e),n=null,o=this.properties(),r.chartProperties={paneProperties:o.paneProperties.state(),scalesProperties:o.scalesProperties.state(),publishedChartsTimelineProperties:n?n.state(e):void 0,chartEventsSourceProperties:o.chartEventsSourceProperties.state()},o.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=o.chartEventsSourceProperties.state()),r.version=c.version,r.timezone=this.timezone(),r},c.prototype.chartPropertiesTransparencyMigrate=function(e){var t,i,n;e.chartProperties.paneProperties.crossHairProperties&&(n=e.chartProperties.paneProperties.crossHairProperties,F.isHexColor(n.color)&&(i=n.transparency/100,t=l(n.color),n.color=a(s(t,i)))),e.chartProperties.paneProperties.dataWindowProperties&&(n=e.chartProperties.paneProperties.dataWindowProperties,F.isHexColor(n.color)&&(i=n.transparency/100,t=l(n.color),n.color=a(s(t,i))))},c.prototype.resetDeferredStudies=function(){new n(this).reset()},c.prototype._getExceedingChildStudies=function(e){var t,i,n,o,r,s,a,l,c=[];for(t=0;t<e.length;++t)c=c.concat(e[t].sources||[]);for(i=0,n=1,o=[],r={},s=0,a=1e6;c.length&&--a;)l=c[s],(l.ownerSource&&r[l.ownerSource]||!l.ownerSource)&&(r[l.id]=l,c.splice(c.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++i>n&&o.push(l)),s=(s+1)%c.length;return o},c.prototype.restoreState=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;if(new n(this).reset(),i={},!e.panes)return void E.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(e.panes))return void E.logDebug("ChartModel.restoreState: invalid state");if(e.panes.length<1)return void E.logDebug("ChartModel.restoreState: invalid state")
;if(e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties&&(o=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(o,e.chartProperties.scalesProperties),!("showLastValue"in o)||"showSeriesLastValue"in o||"showStudyLastValue"in o||(o.showSeriesLastValueProperty=o.showLastValue,o.showStudyLastValueProperty=o.showLastValue),"showSeriesLastValue"in o&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in o&&(i.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(e.chartProperties.paneProperties),this._properties.scalesProperties.merge(o),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(e.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(e.timeScale,t)),e.timeScale&&this.m_timeScale.restoreState(e.timeScale,t),!this.readOnly()&&(r=this._getExceedingChildStudies(e.panes),r.length))for(s=e.panes.length-1;s>=0;--s){for(a=e.panes[s],l=a.sources.length-1;l>=0;--l)c=a.sources[l],~r.indexOf(c)&&a.sources.splice(l,1);a.sources.length||e.panes.splice(s,1)}for(h=e.panes,this.panes()[0].restoreState(h[0],t,e.version,i),s=1;s<e.panes.length;s++)a=this.panes()[s]||this.createPane(),a.restoreState(e.panes[s],t,e.version,i);for(this._invalidateBarColorerCaches(),u=this.dataSources(),d=0,s=0;s<u.length;s++)p=u[s],TradingView.isInherited(p.constructor,m)&&(d++,p.calcIsActualSymbol());return this._version=e.version,this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.invalidate(new N(N.FULL_UPDATE)),_=TVLocalStorage.getItem("linetools_limit")||1e3,window.is_authenticated&&window.user&&window.user.settings&&(_=window.user.settings.linetools_limit||_),d>_&&d%100==0?{lines_limit_exceeded:!0,line_tools_count:d}:{}},B.prototype.state=function(e,t,i,n){function o(e){return i&&!e.isSavedInStudyTemplates()||!e.state||!e.state()||!e.isSavedInChart(t)||n&&e.isActualSymbol&&!e.isActualSymbol()}var r,s,a={};if(e)for(a.sources=[],r=0;r<this.m_dataSources.length;r++)o(this.m_dataSources[r])||a.sources.push(this.m_dataSources[r].state(t));for(a.leftAxisState=this.m_leftPriceScale.state(),a.leftAxisState.m_isLockScale&&null!==this._lastLeftPriceScaleRatio&&(a.leftPriceScaleRatio=this._lastLeftPriceScaleRatio),a.leftAxisSources=[],r=0;r<this.m_leftPriceScale.dataSources().length;r++)o(this.m_leftPriceScale.dataSources()[r])||a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[r].id());for(a.rightAxisState=this.m_rightPriceScale.state(),
a.rightAxisState.m_isLockScale&&null!==this._lastRightPriceScaleRatio&&(a.rightPriceScaleRatio=this._lastRightPriceScaleRatio),a.rightAxisSources=[],r=0;r<this.m_rightPriceScale.dataSources().length;r++)o(this.m_rightPriceScale.dataSources()[r])||a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[r].id());for(a.overlayPriceScales={},r=0;r<this.m_dataSources.length;r++)s=this.m_dataSources[r],this.isOverlay(s)&&s.isSavedInChart(t)&&(a.overlayPriceScales[s.id()]=s.priceScale().state());return a.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(a.mainSourceId=this.m_mainDataSource.id()),a},B.prototype.sourceById=function(e){for(var t=0;t<this.m_dataSources.length;t++)if(this.m_dataSources[t].id()===e)return this.m_dataSources[t];return null},B.prototype.isESDStudy=function(e){return"Script$TV_EARNINGS@tv-scripting"===e.id||"Script$TV_DIVIDENDS@tv-scripting"===e.id||"Script$TV_SPLITS@tv-scripting"===e.id||"ESD$TV_EARNINGS@tv-scripting"===e.id||"ESD$TV_DIVIDENDS@tv-scripting"===e.id||"ESD$TV_SPLITS@tv-scripting"===e.id},B.prototype.isStudyToSkip=function(e){return!!this.isESDStudy(e)},B.prototype.restoreState=function(e,t,i,n){var o,r,s,a,l,c,u,d,p,_,f,y,g,v,S;if(n=n||{},!e.leftAxisState||!e.rightAxisState)throw Error("invalid state");if(!e.leftAxisSources||!e.rightAxisSources)throw Error("invalid state");if(e.stretchFactor&&(this._stretchFactor=e.stretchFactor),o={},e.sources)for(r=-1!==this.m_dataSources.indexOf(this._model.mainSeries()),this.clearSeries(),this.m_mainDataSource=null,r&&this.m_dataSources.push(this._model.mainSeries()),s=this.getZOrderMinMax(),a=s.minZOrder,l=s.maxZOrder,function(){var t,i,n,o,r,s=e.sources.find(function(t){return t.id===e.mainSourceId});if(void 0===s)return void E.logWarn("There is no main source with id "+e.mainSourceId+", total sources="+e.sources.length);if(!TradingView.isInherited(TradingView[s.type],m))return void E.logNormal("The type of main source is not line tool - fix is unnecessary");for(t=null,i=0;i<e.sources.length;i++)if(n=e.sources[i],!TradingView.isInherited(TradingView[n.type],m)){if(null!==t)return void E.logWarn("Pane contains more than 1 possibly main sources - auto fix cannot be applied");t=n}if(null===t)return void E.logWarn("Pane contains only line tools - possible we need to remove this pane?");o=e.mainSourceId,r=0,e.mainSourceId=t.id,e.sources.forEach(function(e){e.ownerSource===o&&(e.ownerSource=t.id,r+=1)}),E.logNormal("Auto fix broken pane is applied, changed line tools="+r+", changed from="+o+" to="+t.id)}(),c=0;c<e.sources.length;c++)u=e.sources[c],d=u.type,Math.abs(u.zorder)>1e200?(p=a-1,E.logWarn("Datasource zorder has bad value: "+u.zorder+" Resetting it to "+p),u.zorder=p):this.isZOrderAvailable(u.zorder)||r&&"MainSeries"===d&&this._model.mainSeries().zorder()===u.zorder||(u.zorder=l+1),_=u.id,o[_]=u.ownerSource,
d&&("MainSeries"===d?this._restoreMainSeries(u,t,r,n):d.toLowerCase().startsWith("study")?this._restoreStudy(u,t,n):TradingView.isInherited(TradingView[d],m)?this._restoreLineTool(u,t):TradingView[d]&&TradingView[d].createFromState&&this._restoreSpecialSource(u,t)),a=Math.min(a,u.zorder),l=Math.max(l,u.zorder);for(this.m_leftPriceScale.dataSources().splice(0,1/0),this.m_leftPriceScale._hasSeries=!1,f=defaults("chartproperties").paneProperties.leftAxisProperties,TradingView.merge(f,e.leftAxisState),this.m_leftPriceScale.restoreState(f),void 0!==e.leftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=e.leftPriceScaleRatio),c=0;c<e.leftAxisSources.length;c++)(y=this.dataSourceForId(e.leftAxisSources[c]))&&(void 0!==f.m_showSymbolLabels&&y instanceof x&&this.model().properties().scalesProperties.showSymbolLabels.setValue(f.m_showSymbolLabels),y.setPriceScale(this.m_leftPriceScale),this.m_leftPriceScale.addDataSource(y));for(this.m_rightPriceScale.dataSources().splice(0,1/0),this.m_rightPriceScale._hasSeries=!1,f=defaults("chartproperties").paneProperties.rightAxisProperties,TradingView.merge(f,e.rightAxisState),this.m_rightPriceScale.restoreState(f),void 0!==e.rightPriceScaleRatio&&(this._lastRightPriceScaleRatio=e.rightPriceScaleRatio),c=0;c<e.rightAxisSources.length;c++)(y=this.dataSourceForId(e.rightAxisSources[c]))&&(void 0!==f.m_showSymbolLabels&&y instanceof x&&this.model().properties().scalesProperties.showSymbolLabels.setValue(f.m_showSymbolLabels),y.setPriceScale(this.m_rightPriceScale),this.m_rightPriceScale.addDataSource(y));for(c=0;c<this.m_dataSources.length;c++)y=this.m_dataSources[c],-1===this.m_rightPriceScale.dataSources().indexOf(y)&&-1===this.m_leftPriceScale.dataSources().indexOf(y)?(y._isOverlay=!0,g=new h(this._model.properties().scalesProperties),g.setHeight(this.m_height),g.setTopMargin(this.m_rightPriceScale.topMargin()),g.setBottomMargin(this.m_rightPriceScale.bottomMargin()),g.addDataSource(y),e.overlayPriceScales&&e.overlayPriceScales[y.id()]&&(f=e.overlayPriceScales[y.id()],f.m_isAutoScale=!0,f.m_isLog=!1,f.m_isPercentage=!1,f.m_isLockScale=!1,g.restoreState(f)),y.setPriceScale(g)):y._isOverlay=!1;for(_ in o)(v=o[_])&&(y=this.sourceById(_))&&this.sourceById(_).setOwnerSource(this.sourceById(v));if(e.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(e.mainSourceId)),!this.m_mainDataSource)for(c=0;c<this.m_dataSources.length;c++)if(y=this.m_dataSources[c],TradingView.isInherited(y.constructor,R)){this.m_mainDataSource=y;break}for(c=0;c<this.m_dataSources.length;c++)y=this.m_dataSources[c],TradingView.isInherited(y.constructor,m)?(y.ownerSource()||y.setOwnerSource(this.mainDataSource()),y.isFixed()&&y.restoreFixedPoints(),y.fixAfterRestorePriceAxis&&y.fixAfterRestorePriceAxis()):TradingView.isInherited(y.constructor,b)&&(S=y.properties(),S.linkedToSeries&&S.linkedToSeries.value()&&(y.ownerSource()||y.setOwnerSource(this.model().mainSeries())));this._updateMargins(),this._model.onMainSeriesPriceScaleNameChanged(),this._cachedOrderedSoruces=null,
this._cachedHitTestSources=null},B.prototype._restoreMainSeries=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v=e.id,S=e.state,b=e.zorder;if(S&&["candleStyle","hollowCandleStyle","haStyle"].forEach(function(e){S[e]&&(S[e].wickUpColor=S[e].wickUpColor||S[e].wickColor,S[e].wickDownColor=S[e].wickDownColor||S[e].wickColor)}),i||(o=this._model.paneForSource(this._model.mainSeries()),o.removeDataSource(this._model.mainSeries()),this.m_dataSources.push(this._model.mainSeries())),this.m_mainDataSource=this._model.mainSeries(),r=S&&S.style?S.style:void 0,r===x.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":r===x.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),S&&!S.hasOwnProperty("showSessions")&&(S.showSessions=!1),S&&!S.extendedHours&&(S.extendedHours=!1),S&&t&&(S.showCountdown=!1),S&&(t&&!("showSeriesLastValueProperty"in n)&&"showLastValue"in S&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(S.showLastValue),delete S.showLastValue),S)for(s={haStyle:L.chartStyleStudyId(x.STYLE_HEIKEN_ASHI,!0),renkoStyle:L.chartStyleStudyId(x.STYLE_RENKO,!0),pbStyle:L.chartStyleStudyId(x.STYLE_PB,!0),kagiStyle:L.chartStyleStudyId(x.STYLE_KAGI,!0),pnfStyle:L.chartStyleStudyId(x.STYLE_PNF,!0),rangeStyle:L.chartStyleStudyId(x.STYLE_RANGE,!0)},a=this._model.studyVersioning(),l=this._model.mainSeries().styleStudyInfos(),c=Object.keys(C.SYMBOL_STRING_DATA),h=0;h<c.length;h++)r=c[h],u=C.STYLE_SHORT_NAMES[r]+"Style",d=u in e?e[u].studyId:s[u],null!=(r=S[u])&&(p=r.inputs,_=A.parseIdString(d),f=l[u].studyId,m=A.parseIdString(f),y=a.updateStudyInputs(_.id,_.version,m.version,p,null),r.inputs=y);this._model.mainSeries().clearSessionStudy(),this._model.mainSeries().properties().merge(S),this._model.mainSeries()._prevChartStyle=this._model.mainSeries().properties().style.value(),this._model.mainSeries().createPaneView(),this._model.mainSeries().setId(v),t&&this._model.mainSeries().restoreData(e.bars,e.nsBars,e.symbolInfo,e.rtPrice,e.boxSize,e.reversalAmount),void 0!==b&&this._model.mainSeries().setZorder(b),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours),(g=this._model.mainSeries().symbolInfo())&&this._model.mainSeries().dataEvents().fireSymbolResolved(this._model.mainSeries().symbolInfo())},B.prototype._restoreStudy=function(e,t,i){var o,r,s,a,l,c,h,d,p,_;return t&&void 0===e.data&&void 0===e.nonSeriesData&&void 0===e.indexes?void E.logError("Cannot restore (skipping) study without data "+e.id+", "+e.metaInfo.id):(o=e.id,r=e.state,s=e.zorder,a=e.ownerSource,l=TradingView.clone(e.metaInfo),$.extend(l,A.parseIdString(l.id)),this.isStudyToSkip(l)&&!t?void E.logNormal("Skipping study "+l.id):(c=r,h=this._model.studyVersioning(),d=h.patchPropsStateAndMetaInfo(c,l,{
oldShowStudyLastValueProperty:t&&!i.showStudyLastValueProperty}),c=d.propsState,l=d.metaInfo,p=new u(this._model,e,l.shortDescription),p.setId(o),_=this,h.updateMetaInfoAsync(l,t).done(function(i){function r(n){var r,a=P(l,i,c,null,h,n),d=T(_._model,a,n||_._model.mainSeries(),s);d.setId(o),t&&(r=h.patchStudyData(l,e.data,e.nonSeriesData,e.indexes),d.restoreData(r.data,r.nsData,r.indexes)),_._model.replaceStudyStub(p,d)||(p=d),u.add(o,d)}var s,u,d;p.setStatus(""),s=i||new A(l),u=new n(_._model),d=a&&e.state.isChildStudy,d?u.get(a).done(r):r()}).fail(function(e){p.setStatus("error: "+e),p.setFailed(!0)}),p&&this.m_dataSources.push(p),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,p&&void 0!==s&&p.setZorder(s),p))},B.prototype._restoreLineTool=function(e,t,i){var n,r,s,a,l,c,h,d,m,S,b,P,T,x,C,L,E,R,B;if(i=void 0===i||i,O.migrateState(e),v.migrateState(e),n=e.type,r=e.id,s=e.state,a=i?e.zorder:this._newZOrderForLineTool(),o(_(n),"invalid data source type:"+n+" (expected to be a Line Tool)"),l=null,c=TradingView.factoryDefaults("linetool"),f(n)){if(l=this._model.studyVersioning(),e=l.patchPointsBasedStudyState(e),TradingView.merge(c,s),m=e.metaInfo,$.extend(m,A.parseIdString(m.fullId)),!t&&(S=m.productId,!pro.hasPackage(S)))return b=new u(this._model,e,m.shortDescription),b.setId(r),this.m_dataSources.push(b),void 0!==a&&b.setZorder(a),b.setStatus($.t("not authorized")),void b.setFailed(!0);P=l.updateMetaInfo(m),T=P||m,c=w(T,m,c,null,l),t?TradingView.merge(c,{fixedSize:!1}):TradingView.merge(c,{fixedSize:!0}),d=new I("study_"+T.id,c,!0),h=p(n,this._model,d,T,this.mainDataSource())}else x=n.toLowerCase(),TradingView.merge(c,TradingView.factoryDefaults(x)),d=TradingView[n].prototype.createPropertiesObject(x,c),d.merge(s),t?d.merge({fixedSize:!1}):d.merge({fixedSize:!0}),h=new TradingView[n](this._model,d,!0);return h.setId(r),h.linkKey=e.linkKey,C=e.alertId,C&&"function"==typeof h.setAlert&&k.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&h.setAlert(C,{noChartSave:!0}),L=e.indexes?e.indexes:[],L=L.slice(0,e.points.length),h.isFixed()?h.restorePositionPercents(e.positionPercents):h.restorePoints(e.points,L,t),h instanceof y||h instanceof g||h instanceof V||h instanceof D||h instanceof M?h.restoreData(e):t&&h.restoreData&&(E=e,l&&(E.graphics=l.patchPointsBasedStudyData(E.metaInfo,E.graphics)),h.restoreData(E)),R=null==e.version?1:e.version,B=null==h.version?1:h.version,R!==B&&"function"==typeof h.migrateVersion&&h.migrateVersion(R,B,{pane:this,model:this._model,properties:d}),this.m_dataSources.push(h),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==a&&h.setZorder(a),h},B.prototype._restoreSpecialSource=function(e,t){var i,n=TradingView[e.type];n&&n.createFromState&&(i=n.createFromState(e,t,this._model))&&(i.setId(e.id),this.m_dataSources.push(i),i.zorder&&i.setZorder(i.zorder))},c.prototype.studyTemplate=function(e){var t,i,n,o,r={};for(r.panes=[],t=0;t<this.panes().length;t++)i=!0,n=!1,o=!0,r.panes.push(this.panes()[t].state(i,n,o))
;return e&&(r.interval=this.mainSeries().interval()),r.version=c.version,r},c.prototype.restoreStudyTemplate=function(e,t){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),e,t)},c.prototype.theme=function(){var e={};return e.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()},e.mainSourceProperties=this.mainSeries().state().state,delete e.mainSourceProperties.symbol,delete e.mainSourceProperties.interval,delete e.chartProperties.paneProperties.topMargin,delete e.chartProperties.paneProperties.bottomMargin,e.version=c.version,e},c.prototype.restoreTheme=function(e){var t,i,n={hollowCandle:{related:"candle"}};for(t in n)e.mainSourceProperties[t+"Style"]||(i=e.mainSourceProperties[n[t].related+"Style"],e.mainSourceProperties[t+"Style"]=TradingView.clone(i));this._undoModel.chartLoadTheme(this,e)},n=function(){function e(n){var o=t.indexOf(n);return~o?i[o]:this instanceof e?(this._source=n,this._studies={},this._deferreds={},t.push(n),void i.push(this)):new e(n)}var t=[],i=[];return e.prototype.add=function(e,t){this._deferreds[e]&&(this._deferreds[e].resolve(t),delete this._deferreds[e]),this._studies[e]=t},e.prototype.get=function(e){return this._studies[e]?$.Deferred().resolve(this._studies[e]):(this._deferreds[e]||(this._deferreds[e]=$.Deferred()),this._deferreds[e].promise())},e.prototype.reset=function(){var e=t.indexOf(this._source);~e&&(t.splice(e,1),i.splice(e,1))},e}(),e.exports=c},function(e,t,i){"use strict";function n(e){var t,i;return e.isEmpty()?null:null===(t=e.priceRange())?null:(i=t.length(),e.internalHeight()/i)}function o(e,t){var i,o,r;return t.isLog()||e.isEmpty()||t.isEmpty()?null:null===(i=n(t))?null:(o=e.getValidBarSpacing(),r=Math.max(l,i),o/r)}function r(e,t,i){var n,o,r,s;return e.isLog()||null===i||e.isEmpty()?null:null===(n=e.priceRange())||n.isEmpty()?null:(o=e.internalHeight()/(t/i),r=n.length(),o===r?n:(s=(o-r)/2,new a.PriceRange(n.minValue()-s,n.maxValue()+s)))}function s(e,t){var i,n;return e.isLog()||null===t||e.isEmpty()?null:null===(i=e.priceRange())?null:(n=i.length(),e.internalHeight()/n*t)}var a,l;Object.defineProperty(t,"__esModule",{value:!0}),t.scaleRatio=o,t.priceRangeByScaleRatio=r,t.barSpacingByScaleRatio=s,a=i(48),l=1e-10},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfork";var i=t||this.createPropertiesObject("linetoolpitchfork");o.call(this,e,i),this._properties.style.listeners().subscribe(this,n.prototype._recreatePaneView),this._recreatePaneView()}var o=i(0).LineDataSource,r=i(19),s=i(41).Action,a=i(2).propertyPages,l=i(247).LineToolPitchforkStyle,c=null;inherit(n,o),n.prototype.additionalActions=function(){var e,t,i=[],n=["Original","Modified Schiff","Inside","Schiff"];for(e=0;e<4;e++)t=new s({checked:this.properties().style.value()===e,checkable:!0,text:$.t(n[e]),callbackContext:{target:this,value:e}}),t.callbacks().subscribe(null,function(e){
var t=e.callbackContext(),i=t.target,n=t.value;i.properties().style.setValue(n),i.updateAllViews(),i._model.updateSource(i)}),i.push(t);return[i[0],i[3],i[1],i[2]]},n.prototype._recreatePaneView=function(){if(null===c)return void i.e(0).then(function(e){null===c&&(c=i(778)),this._recreatePaneView()}.bind(this).bind(null,i)).catch(i.oe);var e=[];this._properties.style.value()===l.Original?e=[new c.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff?e=[new c.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff2?e=[new c.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===l.Inside&&(e=[new c.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return $.t("Pitchfork")},n.prototype.name=function(){return"Pitchfork"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return a.LineToolPitchforkStylesPropertyPage},t.LineToolPitchfork=n},function(e,t,i){"use strict";function n(e){var t=(""+e).match(/(.*)([DWM])/);return t?t[1]+$.t(t[2],{context:"interval_short"}):e}Object.defineProperty(t,"__esModule",{value:!0}),t.translatedIntervalString=n;i(11)},function(e,t,i){"use strict";(function(t){function n(e,i,n){r.call(this,e),this._origState=i,this._title=n;var a={visible:!0};this._properties=new t(a),this._statusView=new o(this,e.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new s(Math.pow(10,2)),this._failed=!1}var o=i(119),r=i(28).PriceDataSource,s=i(21).PriceFormatter;inherit(n,r),n.prototype.properties=function(){return this._properties},n.prototype.statusView=function(){return this._statusView},n.prototype.state=function(e){return this._origState},n.prototype.setStatus=function(e){this._status=e,this._statusView.setText(this._title+" "+this._status)},n.prototype.formatter=function(){return this._formatter},n.prototype.title=function(){return this._title},n.prototype.isFailed=function(){return this._failed},n.prototype.setFailed=function(e){this._failed=e},n.prototype.start=function(e){},n.prototype.firstValue=function(e){return null},e.exports=n}).call(t,i(13))},function(e,t,i){"use strict";(function(t){function n(e,t,i){this._options=Object.assign({},x,i),this.pane=e,this._isLeft=n.isLeft(t),this._properties=e.chart().properties().scalesProperties,this.jqCell=$(document.createElement("td")),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("price-axis"),this.jqCell.width(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=y(this._dv,new g(16,16)),$(this.canvas).css("position","absolute"),
$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=y(this._dv,new g(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._textWidthCache=new s,this.restoreDefaultCursor(),this.update(),this._mouseEventHandler=new v(this.jqCell,this,!0),this.dialog=this.pane.chart().dialog,this.contextMenu=null,this.actions={},this._isVisible=!0,this.priceScale().onMarksChanged.subscribe(this,this.onMarksChanged)}function o(e){var t=new T(e);return function(e,i){return isNumber(i)&&!e.isLog()?t.format(i):""}}var r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C;i(636),r=i(0).LineDataSource,s=i(115),a=i(41),l=a.Action,c=a.ActionSeparator,h=i(88),u=i(639),d=i(18),p=i(81),_=p.resizeCanvas,f=p.hardResizeCanvas,m=p.clearRect,y=p.addCanvasTo,g=p.Size,v=i(110).MouseEventHandler,S=i(39).trackEvent,b=i(116).makeFont,w=i(181).ActionBinder,P=i(4).getLogger("Chart.PriceAxisWidget"),T=i(193).LimitedPrecisionNumericFormatter,x={contextMenuEnabled:!0},n.prototype._BORDER_SIZE=1,n.prototype._OFFSET_SIZE=1,n.prototype._TICK_LENGTH=3,n.LHS=1,n.RHS=2,n.isLeft=function(e){return e===n.LHS||e!==n.RHS&&(P.logDebug("PriceAxisWidget.isLeft: wrong side"),!1)},n.prototype.destroy=function(){this.actions.reset&&this.actions.reset.setActive(!1),this._mouseEventHandler.destroy()},n.prototype.backgroundColor=function(){return this.pane.chart().properties().paneProperties.background.value()},n.prototype.lineColor=function(){return this._properties.lineColor.value()},n.prototype.textColor=function(){return this._properties.textColor.value()},n.prototype.fontSize=function(){return this._properties.fontSize.value()},n.prototype.baseFont=function(){return b(this.fontSize(),"Arial","")},n.prototype.rendererOptions=function(){var e,t,i;return this._rendererOptions||(this._rendererOptions={isLeft:this._isLeft,width:0,height:0,borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s,_tickmarksCache:new u(11,"Arial","","#000"),color:""}),e=this._rendererOptions,t=!1,e.color!==this.textColor()&&(e.color=this.textColor(),t=!0),e.fontSize!==this.fontSize()&&(i=this.fontSize(),e.fontSize=i,e.font=b(this.fontSize(),"'Trebuchet MS', Tahoma, Arial, sans-serif",""),e.paddingTop=Math.floor(i/3.5),e.paddingBottom=e.paddingTop,e.paddingInner=Math.max(Math.ceil(i/3-e.tickLength/2),0),e.paddingOuter=Math.ceil(i/3),e.baselineOffset=Math.round(i/5),e.widthCache.reset(),t=!0),t&&e._tickmarksCache.reset(e.fontSize,"Arial","",e.color),this.size&&(e.width=this.size.w,e.height=this.size.h),this._rendererOptions},n.prototype.mouseDownEvent=function(e){var i,n;!this.priceScale().isEmpty()&&t.enabled("chart_zoom")&&(i=this.pane.chart().model(),n=this.pane.state(),this._mousedown=!0,this.setCursor("ns-resize"),i.startScalePrice(n,this.priceScale(),e.localY))},
n.prototype.pressedMouseMoveEvent=function(e){var t=this.pane.chart().model(),i=this.pane.state(),n=this.priceScale();t.scalePriceTo(i,n,e.localY)},n.prototype.mouseDownOutsideEvent=function(e){var t,i=this.pane.chart().model(),n=this.pane.state();n&&(t=this.priceScale(),this._mousedown&&(this._mousedown=!1,i.endScalePrice(n,t),this.restoreDefaultCursor()))},n.prototype.mouseUpEvent=function(e){var t=this.pane.chart().model(),i=this.pane.state(),n=this.priceScale();this._mousedown=!1,t.endScalePrice(i,n),this.restoreDefaultCursor()},n.prototype._initActions=function(e){var t,i,o,r,s,a,c,h;this.pane.state()&&(this.actions={},i=this,this.actions.reset=new l({text:$.t("Reset Scale"),shortcut:"Alt+R",statName:"ResetScale"}),this.actions.reset.callbacks().subscribe(this,n.prototype.reset),this.priceScale().mainSource()instanceof TradingView.Series&&(o=function(){t={lockScale:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},r=C(this.priceScale(),this.pane.chart().model().model().mainSeriesScaleRatio()),this.actions.setLockScale=new l({text:$.t("Lock Scale")+" "+r,checkable:!0,checked:this.priceScale().isLockScale(),statName:"ToggleLockScale"}),this._lockScaleBinding=new w(this.actions.setLockScale,this.priceScale().properties().lockScale,this.pane.chart().model(),"Lock Scale",o),this._lockScaleBinding.setValue(this.priceScale().isLockScale())),s=function(){t={autoScale:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setAutoScale=new l({text:$.t("Auto Scale"),checkable:!0,checked:!0,statName:"ToggleAutoScale"}),this._autoScaleBinding=new w(this.actions.setAutoScale,this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",s),this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),a=function(){t={percentage:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setPercentage=new l({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePercantage"}),this.actions.setPercentage.binding=new w(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",a),c=function(){t={indexedTo100:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setIndexedTo100=new l({text:$.t("Indexed to 100",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleIndexedTo100"}),this.actions.setIndexedTo100.binding=new w(this.actions.setIndexedTo100,this.priceScale().properties().indexedTo100,this.pane.chart().model(),"Undo Indexed to 100",c),h=function(){t={log:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setLog=new l({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleLogScale"}),this.actions.setLog.binding=new w(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale",h),this.actions.alignLabels=new l({
text:$.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new w(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"No Overlapping Labels"),this._updateScalesActions())},n.prototype._updateScalesActions=function(){var e=this.priceScale(),t=e.mainSource()instanceof TradingView.Series,i=e.mainSource().properties();this.actions.setPercentage.setEnabled(!(e.isLog()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setIndexedTo100.setEnabled(!(e.isLog()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setLog.setEnabled(!(e.isPercentage()||e.isIndexedTo100()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setAutoScale.setChecked(e.properties().autoScale.value()),this.actions.setAutoScale.setEnabled(!e.properties().autoScaleDisabled.value())},n.prototype.mouseClickEvent=function(e){},n.prototype.mouseDoubleClickEvent=function(e){this.reset(),S("GUI","Double click price scale")},n.prototype.contextMenuEvent=function(e,t){this._options.contextMenuEnabled&&this._createContextMenu().show(e)},n.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},n.prototype.getContextMenuActions=function(){var e,i;return this._initActions(),e=this.pane.chart().actions(),i=[],i.push(this.actions.reset,new c,e.showLeftAxis,e.showRightAxis,new c,this.actions.setAutoScale),this.actions.setLockScale&&i.push(this.actions.setLockScale),i.push(e.scaleSeriesOnly,new c,this.actions.setPercentage,this.actions.setIndexedTo100,this.actions.setLog,new c),t.enabled("fundamental_widget")||i.push(e.showSymbolLabelsAction,e.showSeriesLastValue),i.push(e.showStudyPlotNamesAction,e.showStudyLastValue),t.enabled("countdown")&&i.push(e.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&t.enabled("show_chart_property_page")&&t.enabled("chart_property_page_scales")&&e.scalesProperties&&i.push(new c,e.scalesProperties),i},n.prototype.backLabels=function(e){var t,i,n,o,r,s=[],a=this.priceScale().orderedSources().slice(),l=this.pane,c=l.chart().model(),h=l.state(),u=[],d=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated();if(d&&u.push(d),c.selectedSource()&&u.push(c.selectedSource()),c.hoveredSource()&&u.push(c.hoveredSource()),this.priceScale()===h.defaultPriceScale())for(t=this.pane.state().dataSources(),i=0;i<t.length;i++)h.isOverlay(t[i])&&a.push(t[i]);for(i=0;i<a.length;++i)if(n=a[i],(e||-1===u.indexOf(n))&&(o=n.priceAxisViews(h,n.priceScale())))for(r=0;r<o.length;r++)s.push(o[r]);return s},n.prototype.optimalWidth=function(){var e,t,i,n,o,r,s;if(!this.isVisible())return 0;if(e=0,t=this.rendererOptions(),this.pane.state())for(i=this.ctx,n=this.priceScale().marks(),i.setFont(this.baseFont()),n.length>0&&(e=Math.max(t.widthCache.measureText(i,n[0].label),t.widthCache.measureText(i,n[n.length-1].label))),
o=this.backLabels(!0),r=o.length;r--;)(s=t.widthCache.measureText(i,o[r].text()))>e&&(e=s);return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.paddingInner+t.paddingOuter+e)},n.prototype.setSize=function(e){this.size&&this.size.equals(e)||(this.size=e,_(this.canvas,e),_(this.top_canvas,e),this.jqCell.css({width:e.w,"min-width":e.w,height:e.h}))},n.prototype.update=function(){},n.prototype._hightlightBackground=function(e,t,i){var n,o,r,s,a,l,c;if(i){for(n=t[0].price,o=t[0].price,r=1;r<t.length;r++)n=Math.min(n,t[r].price),o=Math.max(o,t[r].price);s=i.firstValue(),a=this.priceScale().priceToCoordinate(n,s),l=this.priceScale().priceToCoordinate(o,s),c="rgba(109, 158, 235, 0.3)",m(e,1,a,this.size.w-1,l-a,c)}},n.prototype.drawBackground=function(e){var t,i,n,o;if(m(e,0,0,this.size.w,this.size.h,this.backgroundColor()),t=this.pane.chart().model(),(i=t.model().selectedSource())&&i.priceScale()===this.priceScale()&&i instanceof r){if(n=i.axisPoints(),0===n.length)return;this._hightlightBackground(e,n,i.ownerSource())}o=t.model().crossHairSource(),o.startMeasurePoint()&&this._hightlightBackground(e,o.measurePoints(),this.pane.state().mainDataSource())},n.prototype.drawBorder=function(e){var t,i,n;e.save(),e.fillStyle=this.lineColor(),t=this.size.h,this._isLeft?(e.translate(-.5,-.5),i=this.size.w-this._BORDER_SIZE-1,n=this.size.w-1):(e.translate(.5,-.5),i=0,n=i+this._BORDER_SIZE),e.fillRect(i,0,n-i,t),e.restore()},n.prototype.drawTickMarks=function(e){var t,i,n,o,r,s;if(e.save(),e.strokeStyle=this.lineColor(),t=this.priceScale().marks(),e.fillStyle=this.textColor(),e.setFont(this.baseFont()),i=this,e.translate(-.5,-.5),n=this.rendererOptions(),i._isLeft){for(e.fillStyle=i.lineColor(),e.beginPath(),o=this.size.w-i._OFFSET_SIZE-i._BORDER_SIZE-i._TICK_LENGTH,r=t.length;r--;)e.rect(o,t[r].coord,i._TICK_LENGTH,1);for(e.fill(),r=t.length;r--;)n._tickmarksCache.paintTo(e,t[r].label,o-n.paddingInner,t[r].coord,"right")}else{for(e.fillStyle=i.lineColor(),e.beginPath(),s=i._BORDER_SIZE+i._OFFSET_SIZE,r=t.length;r--;)e.rect(s,t[r].coord,i._TICK_LENGTH,1);for(e.fill(),r=t.length;r--;)n._tickmarksCache.paintTo(e,t[r].label,s+i._TICK_LENGTH+n.paddingInner,t[r].coord,"left")}e.restore()},n.prototype._alignLabels=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.size.h/2,m=[],y=this.priceScale().orderedSources().slice(),g=this.pane,v=g.state(),S=this.rendererOptions();if(this.priceScale()===v.defaultPriceScale())for(e=this.pane.state().dataSources(),t=0;t<e.length;t++)v.isOverlay(e[t])&&y.push(e[t]);for(i=this.priceScale().mainSource(),t=0;t<y.length;++t)if(n=y[t],o=n.priceAxisViews(v,n.priceScale())){for(r=0;r<o.length;r++)s=o[r],s.isVisible()&&m.push(s);i===n&&o.length>0&&(f=o[0].floatCoordinate())}for(a=m.filter(function(e){return e.floatCoordinate()<=f}),l=m.filter(function(e){return e.floatCoordinate()>f}),a.sort(function(e,t){return t.floatCoordinate()-e.floatCoordinate()}),a.length&&l.length&&l.push(a[0]),l.sort(function(e,t){return e.floatCoordinate()-t.floatCoordinate()}),c=m.length,t=0;t<c;t++)s=m[t],
s.setFixedCoordinate(s.coordinate());if(h=this.priceScale().properties(),h.alignLabels&&h.alignLabels.value()){for(t=1;t<a.length;t++)s=a[t],u=a[t-1],d=u.height(S,!1),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p>_-d&&s.setFixedCoordinate(_-d);for(r=1;r<l.length;r++)s=l[r],u=l[r-1],d=u.height(S,!0),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p<_+d&&s.setFixedCoordinate(_+d)}},n.prototype.drawBackLabels=function(e){var t,i,n,o;for(e.save(),t=this.backLabels(),i=this.rendererOptions(),n=0;n<t.length;n++)o=t[n],o.renderer().draw(e,i);e.restore()},n.prototype.drawCrossHairLabel=function(e){var t,i,n,o,r,s,a=this.pane.chart().model().model(),l=[],c=a.sourceBeingMoved()||a.lineBeingEdited()||a.lineBeingCreated();for(c&&l.push({source:c,scale:c.priceScale()}),a.selectedSource()&&l.push({source:a.selectedSource(),scale:a.selectedSource().priceScale()}),a.hoveredSource()&&l.push({source:a.hoveredSource(),scale:a.hoveredSource().priceScale()}),l.push({source:a.crossHairSource(),scale:this.priceScale()}),t=this.pane.state(),i=0;i<l.length;i++)if(n=l[i],o=n.source.priceAxisViews(t,n.scale))for(r=0;r<o.length;r++)s=o[r],e.save(),s.renderer().draw(e,this.rendererOptions()),e.restore()},n.prototype.priceScale=function(){var e=this.pane.state(),t=[];return t=this._isLeft?[e.leftPriceScale(),e.rightPriceScale()]:[e.rightPriceScale(),e.leftPriceScale()],null===t[0].mainSource()?null===t[1].mainSource()?t[0]:t[1]:t[0]},n.prototype.isVisible=function(){return this._isVisible},n.prototype.setVisible=function(e){(e=!!e)!==this._isVisible&&(e?this.jqCell.css("display","table-cell"):this.jqCell.css("display","none"),this._isVisible=e)},n.prototype.setAutoScale=function(e){var t=this.pane.state,i=this.priceScale();this.pane.chart().model().setPriceAutoScale(t,i,e)},n.prototype.reset=function(){var e=this.pane.state(),t=this.priceScale();this.pane.chart().model().resetPriceScale(e,t)},n.prototype.hardResetCanvas=function(){this.size&&(f(this.canvas,this.size),f(this.top_canvas,this.size))},n.prototype.paint=function(e){this._isVisible&&e&&(e===d.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this._alignLabels(),this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))},n.prototype.restoreDefaultCursor=function(){this.setCursor("")},n.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ns-resize"!==e||(t="price-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),t&&this.jqCell.addClass(t),this._currentCursorClassName=t,this.jqCell.css("cursor"))},n.prototype.image=function(){var e={};return e.content=this.canvas.toDataURL(),e.contentWidth=this.size.w,e.contentHeight=this.size.h,e},n.prototype.onMarksChanged=function(){var e,t=this.optimalWidth();this._prevOptimalWidth<t&&(e=this,
this.updateTimeout||(this.updateTimeout=setTimeout(function(){e.pane&&e.pane.chart&&e.pane.chart()&&e.pane.chart().model().model().fullUpdate(),e.updateTimeout=null},100))),this._prevOptimalWidth=t},C=o(7),e.exports={PriceAxisWidget:n,scaleRatioForContextMenuTransformer:o}}).call(t,i(5))},,,function(e,t,i){"use strict";function n(){return new Promise(function(e){i.e(20).then(function(t){e(i(332))}.bind(null,i)).catch(i.oe)})}function o(e,t){return n().then(function(i){return i.bindToInput(e,t)})}function r(e){return/[\d,]/.test(e)}function s(e){Object(f.setLastUsedResolution)(e),m.linking.interval.setValue(e)}function a(e){if(!Object(d.globalKeypressMatches)(e))return!1;e.preventDefault();var t=String.fromCharCode(e.charCode);return r(t)&&p.enabled("show_interval_dialog_on_key_press")?Object(_.showChangeIntervalDialog)({callback:s,ownerDocument:e.target&&e.target.ownerDocument},t):p.enabled("symbol_search_hot_key")&&n().then(function(i){i.showDialog({initialValue:t,callback:function(e,t){m.linking.symbol.setValue(e),t&&s(t)},ownerDocument:e.target&&e.target.ownerDocument})}),!0}function l(){u.pushBackListener("symbolEdit",a)}function c(e){return n().then(function(t){return t.showDialog(e)})}function h(e){return n().then(function(t){return t.setSearchRequestDelay(e)})}var u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),t.bindToInput=o,t.activateKeyPressHandler=l,t.showDialog=c,t.setSearchRequestDelay=h,u=i(307),d=i(311),p=i(5),i.n(p),_=i(249),f=i(61),m=i(62)},function(e,t,i){"use strict";function n(e,t,i){function n(e,t,i,n,o,r){var s=0;return e<i?s|=1:e>o&&(s|=2),t<n?s|=4:t>r&&(s|=8),s}for(var o,r,s,a=e[0].x,l=e[0].y,c=e[1].x,h=e[1].y,u=t.x,d=t.y,p=i.x,_=i.y,f=n(a,l,u,d,p,_),y=n(c,h,u,d,p,_),g=!1,v=0;;){if(v>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(v++,!(f|y)){g=!0;break}if(f&y)break;o=f||y,r=void 0,s=void 0,8&o?(r=a+(c-a)*(_-l)/(h-l),s=_):4&o?(r=a+(c-a)*(d-l)/(h-l),s=d):2&o?(s=l+(h-l)*(p-a)/(c-a),r=p):(s=l+(h-l)*(u-a)/(c-a),r=u),o===f?(a=r,l=s,f=n(a,l,u,d,p,_)):(c=r,h=s,y=n(c,h,u,d,p,_))}return g?m.equalPoints(m.point(a,l),m.point(c,h))?m.point(a,l):m.lineSegment(m.point(a,l),m.point(c,h)):null}function o(e,t){var i,n,o=e.A,r=t.A,s=e.B,a=t.B,l=e.C,c=t.C,h=o*a-r*s;return Math.abs(h)<1e-6?null:(i=(s*c-a*l)/h,n=(r*l-o*c)/h,new m.Point(i,n))}function r(e,t,i,n){var o,r=t.subtract(e),s=n.subtract(i),a=r.x*s.y-r.y*s.x;return Math.abs(a)<1e-6?null:(o=e.subtract(i),(o.y*s.x-o.x*s.y)/a)}function s(e,t,i,n){var o,s,a,l=r(e,t,i,n);return null===l?null:(o=t.subtract(e),s=o.scaled(l).add(e),a=y.distanceToSegment(i,n,s),Math.abs(a.distance)<1e-6?l:null)}function a(e,t){return-(e.C+e.B*t)/e.A}function l(e,t){return-(e.C+e.A*t)/e.B}function c(e,t){var i,n,o;for(i=0,n=e;i<n.length;i++)if(o=n[i],m.equalPoints(o,t))return!1;return e.push(t),!0}function h(e,t,i){var n,o,r,s,h,u=t.x,d=t.y,p=i.x,_=i.y;if(0===e.A)return n=-e.C/e.B,d<=n&&n<=_?m.lineSegment(m.point(u,n),m.point(p,n)):null;if(0===e.B)return o=-e.C/e.A,u<=o&&o<=p?m.lineSegment(m.point(o,d),m.point(o,_)):null;switch(r=[],s=function(t){
var i=l(e,t);d<=i&&i<=_&&c(r,new m.Point(t,i))},h=function(t){var i=a(e,t);u<=i&&i<=p&&c(r,new m.Point(i,t))},s(u),h(d),s(p),h(_),r.length){case 0:return null;case 1:return r[0];case 2:return m.equalPoints(r[0],r[1])?r[0]:m.lineSegment(r[0],r[1])}return f.assert(!1,"We should have at most two intersection points"),null}function u(e,t,i,n){var o,r=s(e,t,i,new m.Point(n.x,i.y)),a=s(e,t,new m.Point(n.x,i.y),n),l=s(e,t,n,new m.Point(i.x,n.y)),c=s(e,t,new m.Point(i.x,n.y),i),h=[];return null!==r&&r>=0&&h.push(r),null!==a&&a>=0&&h.push(a),null!==l&&l>=0&&h.push(l),null!==c&&c>=0&&h.push(c),0===h.length?null:(h.sort(function(e,t){return e-t}),o=g.pointInRectangle(e,i,n)?h[0]:h[h.length-1],e.addScaled(t.subtract(e),o))}function d(e,t){return!(e.length>0&&m.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function p(e,t){var i,n,r,s,a,l=[];for(i=0;i<e.length;++i)n=e[i],r=e[(i+1)%e.length],s=m.lineThroughPoints(n,r),g.pointInHalfplane(n,t)?(d(l,n),g.pointInHalfplane(r,t)||null!==(a=o(s,t.edge))&&d(l,a)):g.pointInHalfplane(r,t)&&null!==(a=o(s,t.edge))&&d(l,a);return l.length>=3?l:null}function _(e,t){var i,n,o,r,s,a=e;for(i=0;i<t.length&&null!==a;++i)n=t[i],o=t[(i+1)%t.length],r=t[(i+2)%t.length],s=m.lineThroughPoints(n,o),a=p(a,m.halfplaneThroughPoint(s,r));return a}var f,m,y,g;Object.defineProperty(t,"__esModule",{value:!0}),f=i(7),m=i(6),y=i(30),g=i(60),t.intersectLineSegmentAndRectangle=n,t.intersectLines=o,t.intersectLineSegments=s,t.intersectLineAndRectangle=h,t.intersectRayAndRectangle=u,t.intersectPolygonAndHalfplane=p,t.intersectPolygons=_},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeFormatter",function(){return o}),n=i(21),o=function(){function e(e){this._formatStr=e||"%h:%m:%s"}return e.prototype.format=function(e){return n.customFormatters.timeFormatter?n.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(n.numberToStringWithLeadingZero)(e.getUTCHours(),2)).replace("%m",Object(n.numberToStringWithLeadingZero)(e.getUTCMinutes(),2)).replace("%s",Object(n.numberToStringWithLeadingZero)(e.getUTCSeconds(),2))},e.prototype.formatLocal=function(e){return n.customFormatters.timeFormatter?n.customFormatters.timeFormatter.formatLocal?n.customFormatters.timeFormatter.formatLocal(e):n.customFormatters.timeFormatter.format(e):this._formatStr.replace("%h",Object(n.numberToStringWithLeadingZero)(e.getHours(),2)).replace("%m",Object(n.numberToStringWithLeadingZero)(e.getMinutes(),2)).replace("%s",Object(n.numberToStringWithLeadingZero)(e.getSeconds(),2))},e}()},function(e,t,i){"use strict";var n=i(18),o={_fontHeightCache:{},_parsedColorCache:{}};o._parseColor=function(e){var t,i,n;return this._parsedColorCache[e]?this._parsedColorCache[e]:(t=document.createElement("div"),t.style.color=e,i=t.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||t.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),n={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[e]=n,n)},o.getColorFromProperties=function(e,t){
var i=1-t.value()/100,n=this._parseColor(e.value());return"rgba("+n.r+","+n.g+","+n.b+","+i+")"},o.setColorToProperties=function(e,t,i){var n,o=this._parseColor(e);t.setValue("rgb("+o.r+","+o.g+","+o.b+")"),n=100*(1-o.a),i.setValue(Math.max(0,Math.min(n,100)))},o._parseFont=function(e){var t,i,n=document.createElement("div");return n.style.font=e,t=n.style.fontSize.match(/(\d+)pt/),i=t&&t[0]===n.style.fontSize,{family:n.style.fontFamily,size:i?t[1]:"",bold:"bold"===n.style.fontWeight,italic:"italic"===n.style.fontStyle}},o.getFontFromProperties=function(e,t,i,n){return[i.value()?"bold":"",n.value()?"italic":"",t.value()+"pt",e.value()].join(" ")},o.setFontToProperties=function(e,t,i,n,o){var r=this._parseFont(e);r.family.length>0&&t.setValue(r.family),r.size.length>0&&i.setValue(r.size),n.setValue(r.bold),o.setValue(r.italic)},o.fontHeight=function(e){var t,i;return this._fontHeightCache[e]||(t=document.createElement("span"),t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;",i=t.offsetHeight,document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)),this._fontHeightCache[e]},o.drawPolyHoverOrPress=function(e,t,i,n){n?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},o.repaint=function(e){var t=new n(n.LIGHT_UPDATE);t.force=!0,e.invalidate(t)},o.roundToMinTick=function(e,t){var i=e.mainSource().base(),n=1/i;return n*Math.round(t/n)},e.exports=o},function(e,t,i){"use strict";function n(){clearTimeout(W),clearTimeout(H),clearTimeout(j)}function o(e,t){j=setTimeout(e,t)}function r(e,t){H=setTimeout(e,t)}function s(e,t){W=setTimeout(e,t)}function a(){var e=document.getElementById(z);if(e)return void(U=e);U=document.createElement("div"),U.id=z,document.body.appendChild(U)}function l(){U.innerHTML=""}function c(e){return q.then(function(){l(),U.appendChild(e)})}function h(e,t){var i,n=G.includes(t)?Y[t]:"";(i=e.classList).remove.apply(i,G.map(function(e){return Y[e]}).filter(function(e){return!!e})),n&&!e.classList.contains(n)&&e.classList.add(n)}function u(e,t){var i=K.get(e);return i&&i[t]}function d(e,t,i){var n=K.get(e)||{};n[t]=i,K.set(e,n)}function p(e){var t=e.getAttribute("title");return t&&(d(e,"text",t),e.removeAttribute("title")),u(e,"text")||""}function _(e){var t=p(e),i=e.getBoundingClientRect(),n={h:i.height,w:i.width,x:i.left,y:i.top},o=e.getAttribute("data-color-theme")||"",r=e.classList.contains("common-tooltip-html"),s=parseInt(e.getAttribute("data-tooltip-delay")||""),a={type:"none"};return t&&(a={type:r?"html":"text",data:t}),{above:e.classList.contains("common-tooltip-above"),below:e.classList.contains("common-tooltip-below"),otl:e.classList.contains("common-tooltip-otl"),otr:e.classList.contains("common-tooltip-otr"),vertical:e.classList.contains("common-tooltip-vertical"),hotkey:e.getAttribute("data-tooltip-hotkey"),narrow:e.classList.contains("common-tooltip-narrow"),colorTheme:o,
tooltipDelay:s,rect:n,content:a}}function f(e){var t,i,n,o,r,s,a=b(),l=x(a),c=e.content;switch(c.type){case"element":l.innerHTML="",l.appendChild(c.data);break;case"html":l.innerHTML=c.data;break;case"text":e.hotkey?(i=P(),i.innerText=c.data,l.appendChild(i)):l.innerText=c.data}return e.hotkey&&(n="none"!==c.type,o=w(),r=Object(Z.a)(e.hotkey),s=S(r.keys),o.innerHTML=(t=r.text).format.apply(t,s).replace(/\s\+\s/g,'<span class="'+Q["common-tooltip__plus-sign"]+'">+</span>'),l.classList.add(Q["common-tooltip__body--with-hotkey"]),n&&o.classList.add(Q["common-tooltip__hotkey-block--divider"]),l.appendChild(o)),a}function m(e,t){var i,n,o,r,s,a,l,c,u,d,p,_,f,m,y,g,S=t.rect;S&&(h(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass),i=x(e),i.classList.toggle(Q["common-tooltip__body--width_wide"],!!t.wide),i.classList.toggle(Q["common-tooltip__body--width_narrow"],!!t.narrow),i.classList.toggle(Q["common-tooltip__body--no-buttons"],!0),e.classList.toggle(Q["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),i.style.left=v(0),i.style.width=v(i.clientWidth+2),n=document.body.clientWidth,o=document.body.clientHeight,r=t.vertical,s=r&&S.w<20||!r&&S.h<20,e.classList.toggle(Q["common-tooltip--farther"],s),e.classList.toggle(Q["common-tooltip--vertical"],r),e.classList.toggle(Q["common-tooltip--horizontal"],!r),a=T(e),l="",r?(e.style.left=v(S.x+S.w),e.style.top=v(S.y-(e.offsetHeight-S.h)/2),c=(e.querySelector(":last-child")||i).getBoundingClientRect().right,u=c+ee>n,e.classList.toggle(Q["common-tooltip--direction_reversed"],u),e.classList.toggle(Q["common-tooltip--direction_normal"],!u),l=u?"after":"before",X.IS_RTL?(l=t.otr?"after":l,l=t.otl?"before":l):(l=t.otr?"before":l,l=t.otl?"after":l),a.classList.toggle(Q["common-tooltip__ear-holder--before"],"before"===l),a.classList.toggle(Q["common-tooltip__ear-holder--after"],"after"===l),"after"===l&&(e.style.left="auto",e.style.right=v(n-S.x))):(d=S.x-(i.offsetWidth-S.w)/2,p=n-ee-e.offsetWidth,_=Math.max(ee,Math.min(d,p)),e.style.bottom=v(o-S.y),e.style.left=v(_),u=p<d,e.classList.toggle(Q["common-tooltip--direction_reversed"],u),e.classList.toggle(Q["common-tooltip--direction_normal"],!u),f=i.getBoundingClientRect().top,l=f<ee?"below":"above",l=t.above?"above":l,l=t.below?"below":l,a.classList.toggle(Q["common-tooltip__ear-holder--above"],"above"===l),a.classList.toggle(Q["common-tooltip__ear-holder--below"],"below"===l),"below"===l&&(e.style.bottom="auto",e.style.top=v(S.y+S.h)),m=C(e),y=i.getBoundingClientRect().left,g=Math.round(S.x+S.w/2-(y+i.clientWidth/2)),e.style.left=v(_+g),e.style.width=v(i.clientWidth+m.clientWidth),g=u?Math.max(0,g):Math.min(0,g),m.style.left=v(-g),i.style.left=v(-g)))}function y(e){e.classList.toggle(Q["common-tooltip--hidden"],!1)}function g(e){e.classList.toggle(Q["common-tooltip--hidden"],!0)}function v(e){return Math.floor(e)+"px"}function S(e){return e.map(function(e){return'<span class="'+Q["common-tooltip__hotkey-button"]+'">'+e+"</span>"})}function b(){return re.cloneNode(!0)}function w(){return se.cloneNode(!0)}
function P(){return ae.cloneNode(!0)}function T(e){return e.querySelector("."+Q["common-tooltip__ear-holder"])}function x(e){return e.querySelector("."+Q["common-tooltip__body"])}function C(e){return e.querySelector("."+Q["common-tooltip__button-container"])}function L(e,t){var i,n,o,r,s;return void 0===t&&(t={}),i=B(t),n=i.content,o=N.e(i,["content"]),r=_(e),s=Object.assign(r,o),"none"!==n.type&&(s.content=n),!("none"===s.content.type&&!s.hotkey)&&(I(s),!0)}function I(e){var t=B(e),i=f(t);he={options:t,element:i},c(i).then(function(){n(),ce?V(i):(g(i),s(function(){return V(i)},E(t)))})}function A(e){return p(e)}function k(e){var t,i,n,o=e.target,r=e.currentTarget,s=O(o,r,"apply-common-tooltip"),a=function(t){var i,n,o;if("buttons"in e){if(1&e.buttons)return"continue"}else if(1===e.which)return"continue";if((i=function(){return L(t)})())return n=function(){t.removeEventListener("common-tooltip-update",i),t.removeEventListener("mouseleave",n),t.removeEventListener("mousedown",n),document.removeEventListener("scroll",n),M()},o=function(e){27===e.keyCode&&(document.removeEventListener("keydown",o),n())},t.addEventListener("common-tooltip-update",i),t.addEventListener("mouseleave",n),t.addEventListener("mousedown",n),document.addEventListener("scroll",n),document.addEventListener("keydown",o),"break"};for(t=0,i=s;t<i.length&&(n=i[t],"break"!==a(n));t++);}function E(e){return"number"!=typeof e.tooltipDelay||isNaN(e.tooltipDelay)?le:e.tooltipDelay}function M(){var e,t,i;n(),ce&&he&&(e=he.element,t=he.options,i=function(){e.removeEventListener("mouseleave",i),g(e),o(function(){l(),ce=!1,he=null},le/2)},t.tooltipHideDelay?r(function(){e.querySelector(":hover")?e.addEventListener("mouseleave",i):i()},t.tooltipHideDelay):i())}function V(e){var t,i=Object($.ensureNotNull)(he).options;m(e,i),y(e),ce=!0,i.forceHideOnMove&&(t=function(){document.removeEventListener("mousemove",t),M()},document.addEventListener("mousemove",t))}function D(e){return e&&(e.nodeType===Node.ELEMENT_NODE?e:null)}function O(e,t,i){for(var n=[];e&&e!==t;)e.classList&&e.classList.contains(i)&&n.push(e),e=e.parentElement||D(e.parentNode);return n}function R(e){return"content"in e}function B(e){var t,i,n,o,r;return R(e)?e:(t=e.inner,i=e.html,n=e.text,o=N.e(e,["inner","html","text"]),r={type:"none"},t&&(r={type:"element",data:t}),n&&(r={type:i?"html":"text",data:n}),N.a({content:r},o))}var N,F,W,H,j,z,U,q,$,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se,ae,le,ce,he;Object.defineProperty(t,"__esModule",{value:!0}),N=i(1),F=i(127),W=0,H=0,j=0,z="tooltip-root-element",q=new Promise(function(e){"interactive"===document.readyState?(a(),e()):document.addEventListener("DOMContentLoaded",function(){a(),e()})}),$=i(7),Y={default:"",white:"theme-white","round-shadow":"theme-round-shadow"},G=Object.keys(Y),K=new WeakMap,Z=i(306),J=i(202),X=i(38),i(85),Q=i(473),ee=10,te="common-tooltip-wrapper",
ie='\n\t<div id="'+te+'" class="'+Q["common-tooltip"]+'">\n\t\t<div class="'+Q["common-tooltip__ear-holder"]+'" >\n\t\t\t<div class="'+Q["common-tooltip__body"]+' js-tooltip-body"></div>\n\t\t</div>\n\t\t<div class="'+Q["common-tooltip__button-container"]+'"></div>\n\t</div>\n',ne='\n\t<div class="'+Q["common-tooltip__hotkey-block"]+'"></div>\n',oe='\n\t<div class="'+Q["common-tooltip__hotkey-text"]+'"></div>\n',re=Object(J.b)(ie),se=Object(J.b)(ne),ae=Object(J.b)(oe),t.showOnElement=L,t.show=I,t.updateTooltipText=A,t.hide=M,le=500,ce=!1,he=null,Modernizr.touch||document.addEventListener("mouseover",k,!0)},function(e,t,i){"use strict";function n(e,t,i,n,o){function r(e){return t&&t[e]?t[e]:e}function s(e,t,i,n){var o=r(t[0]);return!!e.hasOwnProperty(o)&&(t.length>1?s(e[o],t.slice(1),i):(e[o]&&e[o].setValue?e[o].setValue(i):e[o]=i,!0))}function a(e){i||y.logWarn("Path `"+e+"` does not exist.")}var l,c,h,u;if(n)for(l in n)c=l.split("."),h=r(c[0]),u=void 0!==o&&o===c[0],0!==c.length&&u&&(c=c.slice(1),h=r(c[0])),0!==c.length&&e.hasOwnProperty(h)?s(e,c,n[l])||a(l):u&&a(l)}function o(e,t,i,o){window.__defaultsOverrides&&n(e,t,i,window.__defaultsOverrides,o)}function r(){var e=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach(function(t){e.test(t)&&o(TradingView.defaultProperties[t],null,!1,t)})}function s(e,t){return t?c(e,t):a(e)}function a(e){var t,i=g(e);return window._UNIT_TESTS||(t=TradingView.clone(TVSettings.getJSON(e,null)))&&TradingView.merge(i,t),i}function l(e){var t,i;return!!e&&(e=""+e,t=RegExp("\\d+"),i=t.exec(e),null!==i&&i[0]===e)}function c(e,t){var i,n,o,r,s=g(e);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(e,null)),e.startsWith("study_")&&i&&l(i.version)&&(n=i.inputs,o=t.updateStudyInputs(i.id,i.version,"last",n,null),i.inputs=o,r=t.updateStudyState(i,i),i=r),TradingView.merge(s,i)),s}var h=i(40),u=i(247).LineToolPitchforkStyle,d=i(203).LineToolBarsPatternMode,p=i(86).PlotType,_=i(161),f=i(103).LineEnd,m=i(323).StatsPosition,y=i(4).getLogger("Chart.Defaults"),g=function(e){var t,i,n,s,a,l,c,y,g={a:function(e,t){return{color:e,visible:t}},b:function(e,t,i){return{coeff:e,color:t,visible:i}},c:function(e,t,i,n,o){return{coeff:e,color:t,visible:i,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===o?1:o}},d:function(e,t,i){return{color:e,width:i,visible:t}},e:function(e,t,i,n,o){return{color:e,visible:t,width:i,x:n,y:o}},f:function(e,t,i,n,o,r){return{coeff1:e,coeff2:t,color:i,visible:n,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===r?1:r}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"ar_AE":t="Asia/Dubai";break;case"au":t="Australia/Sydney";break;case"br":t="America/Sao_Paulo";break;case"ca":t="America/Toronto";break;case"de_DE":case"it":t="Europe/Berlin";break;case"es":t="Europe/Madrid";break;case"fa_IR":t="Asia/Tehran";break;case"fr":case"sv_SE":t="Europe/Paris";break;case"he_IL":case"tr":t="Europe/Athens";break;case"hu_HU":case"pl":t="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":t="Asia/Bangkok"
;break;case"in":t="Asia/Kolkata";break;case"ja":case"kr":t="Asia/Tokyo";break;case"ms_MY":t="Asia/Singapore";break;case"ru":t="Europe/Moscow";break;case"uk":t="Europe/London";break;case"zh_CN":case"zh_TW":t="Asia/Shanghai";break;default:t="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:t,dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#758696",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0,showBarChange:!0,showOnlyPriceSource:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1,barSpacing:_.DEFAULT_BAR_SPACING},mainSeriesProperties:{style:h.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 235, 77, 92, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",baseLineColor:"#B2B5BE",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"#53b987",downColor:"#eb4d5c",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#53b987",borderDownColor:"#eb4d5c",wickColor:"#737375",wickUpColor:"#a9cdd3",wickDownColor:"#f5a6ae",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 169, 220, 195, 1)",wickDownColor:"rgba( 245, 166, 174, 1)"},haStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",
wickDownColor:"rgba( 255, 77, 92, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{}},barStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:h.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},rangeStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",
downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{range:10,phantomBars:!1},inputInfo:{range:{name:"Range"},phantomBars:{name:"Phantom Bars"}}}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0)",transparency:100},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"#585858",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",
reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:61536,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolinfoline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!0,showMiddlePoint:!1,showPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,showDistance:!0,showAngle:!0,statsPosition:m.Center},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1,statsPosition:m.Right},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 106, 168, 79, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",
textcolor:"rgba( 18, 159, 92, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"rgba( 73, 133, 231, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 73, 133, 231, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{counterclockwise:!1,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendTop:!1,extendBottom:!1},linetoolpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardshort:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolriskrewardlong:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolarrow:{clonable:!0,linecolor:"rgba( 111, 136, 198, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,
leftEnd:f.Normal,rightEnd:f.Arrow,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolray:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolextended:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolhorzline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcrossline:{clonable:!0,linecolor:"rgba(6, 160, 227, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(1,"rgba( 0, 85, 219, 1)",!0),level3:g.c(2,"rgba( 0, 85, 219, 1)",!0),level4:g.c(3,"rgba( 0, 85, 219, 1)",!0),level5:g.c(5,"rgba( 0, 85, 219, 1)",!0),level6:g.c(8,"rgba( 0, 85, 219, 1)",!0),level7:g.c(13,"rgba( 0, 85, 219, 1)",!0),level8:g.c(21,"rgba( 0, 85, 219, 1)",!0),level9:g.c(34,"rgba( 0, 85, 219, 1)",!0),level10:g.c(55,"rgba( 0, 85, 219, 1)",!0),level11:g.c(89,"rgba( 0, 85, 219, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltext:{clonable:!0,
color:"rgba( 102, 123, 139, 1)",font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.9)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"rgba( 102, 123, 139, 1)",font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 254, 206, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30},linetoolbrush:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,leftEnd:f.Normal,rightEnd:f.Normal},linetoolpolyline:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolnote:{clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"rgba( 0, 128, 0, 1)"},linetoolthumbdown:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolpricelabel:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 255, 255, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"rgba( 21, 56, 153, 1)",fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",linewidth:1,snapTo45Degrees:!0,transparency:50},linetoolrotatedrectangle:{clonable:!0,color:"rgba( 152, 0, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 142, 124, 195, 0.5)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolarc:{clonable:!0,
color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"rgba( 28, 115, 219, 1)",linewidth:2,sourceBackColor:"rgba( 241, 241, 241, 1)",sourceTextColor:"rgba( 110, 110, 110, 1)",sourceStrokeColor:"rgba( 110, 110, 110, 1)",targetStrokeColor:"rgba( 47, 168, 255, 1)",targetBackColor:"rgba( 11, 111, 222, 1)",targetTextColor:"rgba( 255, 255, 255, 1)",successBackground:"rgba( 54, 160, 42, 0.9)",successTextColor:"rgba( 255, 255, 255, 1)",failureBackground:"rgba( 231, 69, 69, 0.5)",failureTextColor:"rgba( 255, 255, 255, 1)",intermediateBackColor:"rgba( 234, 210, 137, 1)",intermediateTextColor:"rgba( 109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{clonable:!0,color:"rgba( 153, 21, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"rgba( 255, 255, 255, 1)",backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:2,fontsize:12,font:"Verdana",bordercolor:"rgba( 153, 21, 21, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"rgba( 119, 52, 153, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba( 180, 167, 214, 0.5)",transparency:50,showMidline:!1,midlinecolor:"rgba( 119, 52, 153, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"rgba( 80, 145, 204, 1)",clonable:!0,mode:d.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{singleChartOnly:!0,clonable:!0,averageHL:20,variance:50,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Original,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),
level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:g.f(1,8,"rgba( 160, 107, 0, 1)",!0),level2:g.f(1,4,"rgba( 105, 158, 0, 1)",!0),level3:g.f(1,3,"rgba( 0, 155, 0, 1)",!0),level4:g.f(1,2,"rgba( 0, 153, 101, 1)",!0),level5:g.f(1,1,"rgba( 128, 128, 128, 1)",!0),level6:g.f(2,1,"rgba( 0, 101, 153, 1)",!0),level7:g.f(3,1,"rgba( 0, 0, 153, 1)",!0),level8:g.f(4,1,"rgba( 102, 0, 153, 1)",!0),level9:g.f(8,1,"rgba( 165, 0, 0, 1)",!0),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{font:"Verdana",fontSize:12,bold:!1,italic:!1},levels:[g.d("rgba( 128, 128, 128, 1)",!0,1),g.d("rgba( 160, 107, 0, 1)",!0,1),g.d("rgba( 105, 158, 0, 1)",!0,1),g.d("rgba( 0, 155, 0, 1)",!0,1),g.d("rgba( 0, 153, 101, 1)",!0,1),g.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[g.e("rgba( 165, 0, 255, 1)",!1,1,8,1),g.e("rgba( 165, 0, 0, 1)",!1,1,5,1),g.e("rgba( 128, 128, 128, 1)",!1,1,4,1),g.e("rgba( 160, 107, 0, 1)",!1,1,3,1),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,1,1),g.e("rgba( 0, 153, 101, 1)",!0,1,1,2),g.e("rgba( 0, 153, 101, 1)",!1,1,1,3),g.e("rgba( 0, 0, 153, 1)",!1,1,1,4),g.e("rgba( 102, 0, 153, 1)",!1,1,1,5),g.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[g.e("rgba( 160, 107, 0, 1)",!0,1,1,0),g.e("rgba( 160, 107, 0, 1)",!0,1,1,1),g.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,3,0),g.e("rgba( 0, 155, 0, 1)",!0,1,3,1),g.e("rgba( 0, 153, 101, 1)",!0,1,4,0),g.e("rgba( 0, 153, 101, 1)",!0,1,4,1),g.e("rgba( 0, 0, 153, 1)",!0,1,5,0),g.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannfixed:{clonable:!0,fillBackground:!1,arcsBackground:{
fillBackground:!0,transparency:80},reverse:!1,levels:[g.d("rgba( 128, 128, 128, 1)",!0,1),g.d("rgba( 160, 107, 0, 1)",!0,1),g.d("rgba( 105, 158, 0, 1)",!0,1),g.d("rgba( 0, 155, 0, 1)",!0,1),g.d("rgba( 0, 153, 101, 1)",!0,1),g.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[g.e("rgba( 165, 0, 255, 1)",!1,1,8,1),g.e("rgba( 165, 0, 0, 1)",!1,1,5,1),g.e("rgba( 128, 128, 128, 1)",!1,1,4,1),g.e("rgba( 160, 107, 0, 1)",!1,1,3,1),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,1,1),g.e("rgba( 0, 153, 101, 1)",!0,1,1,2),g.e("rgba( 0, 153, 101, 1)",!1,1,1,3),g.e("rgba( 0, 0, 153, 1)",!1,1,1,4),g.e("rgba( 102, 0, 153, 1)",!1,1,1,5),g.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[g.e("rgba( 160, 107, 0, 1)",!0,1,1,0),g.e("rgba( 160, 107, 0, 1)",!0,1,1,1),g.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,3,0),g.e("rgba( 0, 155, 0, 1)",!0,1,3,1),g.e("rgba( 0, 153, 101, 1)",!0,1,4,0),g.e("rgba( 0, 153, 101, 1)",!0,1,4,1),g.e("rgba( 0, 0, 153, 1)",!0,1,5,0),g.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannsquare:{clonable:!0,color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:g.a("rgba( 128, 128, 128, 1)",!1),hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["fans","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),
hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["trendline","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),
level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba( 0, 128, 0, 0.2)",color2:"rgba( 255, 0, 0, 0.2)",linewidth:1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{clonable:!0,color:"rgba( 204, 40, 149, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 204, 40, 149, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolcypherpattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"rgba( 0, 155, 0, 1)",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"rgba( 69, 104, 47, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 69, 168, 47, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!1),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!1),
level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!1),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!1),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltrendbasedfibextension:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),
level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(.382,"rgba( 204, 40, 40, 1)",!0),level3:g.c(.5,"rgba( 149, 204, 40, 1)",!1),level4:g.c(.618,"rgba( 40, 204, 40, 1)",!0),level5:g.c(1,"rgba( 40, 204, 149, 1)",!0),level6:g.c(1.382,"rgba( 40, 149, 204, 1)",!0),level7:g.c(1.618,"rgba( 128, 128, 128, 1)",!0),level8:g.c(2,"rgba( 40, 40, 204, 1)",!0),level9:g.c(2.382,"rgba( 204, 40, 40, 1)",!0),level10:g.c(2.618,"rgba( 149, 40, 204, 1)",!0),level11:g.c(3,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Schiff,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:u.Schiff2,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Inside,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,
linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetool:{frozen:!1,visible:!0},linetoolvisibilities:{intervalsVisibilities:{seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,months:!0,ranges:!0}}},o(TradingView.defaultProperties.chartproperties),r()}for(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"rgba( 4, 150, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"rgba( 83, 143, 31, 1)",backColor:"rgba( 240, 255, 204, 1)",textColor:"rgba( 0, 0, 0, 1)"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(i="rgba( 212, 121, 40, 1)",n=!0,s=1,TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:n,"S1/R1":n,"S2/R2":n,"S3/R3":n,"S4/R4":n,"S5/R5":n},colors:{P:i,"S1/R1":i,"S2/R2":i,"S3/R3":i,"S4/R4":i,"S5/R5":i},widths:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}}}),void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"rgba( 86, 135, 29, 1)",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:g.a("rgba( 255, 0, 0, 1)",!1),level1:g.a("rgba( 0, 128, 0, 1)",!1),level2:g.a("rgba( 0, 0, 255, 1)",!1),level3:g.a("rgba( 255, 0, 255, 1)",!1),level4:g.a("rgba( 0, 128, 255, 1)",!0),level5:g.a("rgba( 255, 0, 0, 1)",!0),level6:g.a("rgba( 0, 128, 0, 1)",!0),level7:g.a("rgba( 0, 0, 255, 1)",!0),level8:g.a("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",
linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(a="study_Overlay@tv-basicstudies",TradingView.defaultProperties[a]={style:h.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 3, 3, 247, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:h.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",
linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),l=e.split("."),c=TradingView.defaultProperties,y=0;y<l.length;y++)c&&(c=c[l[y]]);return c?TradingView.clone(c):{}};s.create=function(e,t){if(t){var i=g(e);TradingView.defaultProperties[e]=$.extend(t,i)}},s.remove=function(e){TradingView.defaultProperties[e]=void 0},TradingView.saveDefaults=function(e,t){TVSettings.setJSON(e,t)},TradingView.factoryDefaults=g,window.applyDefaultOverridesToLinetools=r,window.applyDefaultsOverrides=o,window.applyPropertiesOverrides=n,window.defaults=s,t.applyDefaultOverridesToLinetools=r,t.applyDefaultsOverrides=o,t.applyPropertiesOverrides=n,t.defaults=s,t.factoryDefaults=g,t.saveDefaults=TradingView.saveDefaults},function(e,t,i){"use strict";function n(e,t){var i,n=Promise.reject();for(i=0;i<t;++i)n=n.catch(e);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.retries=n},function(e,t,i){"use strict";function n(e){return void 0===e&&(e="full"),c[e]||o(e,new l.a(e)),c[e]}function o(e,t){void 0===e&&(e="full"),c[e]=t}function r(e){return void 0===e&&(e="full"),c[e]}function s(){var e,t;for(e in c)c.hasOwnProperty(e)&&(t=c[e],void 0!==t&&t.destroy(),delete c[e])}var a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.getQuoteSessionInstance=n,t.setQuoteSessionInstance=o,t.getQuoteSessionNoEnsure=r,t.destroyQuoteSessions=s,a=i(501),l=i.n(a),c={}},function(e,t,i){"use strict";function n(e){this.items=e.items,this._simpleMode=e.simpleMode,this.barSpacing=e.barSpacing,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth,this.lineStyle=e.lineStyle,this.withMarkers=e.withMarkers,this.withSteps=e.withSteps,this.hittest=e.hittest,this.ignorePaletteLineWidth=e.ignorePaletteLineWidth,this.forceLineColor=!!e.forceLineColor}var o=i(6).Point,r=i(30).distanceToSegment,s=i(27),a=i(9).HitTestResult;n.prototype.draw=function(e){e.lineCap="square",e.lineJoin=this.withMarkers?"round":"miter",e.strokeStyle=this.lineColor,e.fillStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,s.setValidLineStyle(e,this.lineStyle),this._simpleMode?this._drawSimpleMode(e):this._drawLines(e)},n.prototype._drawSimpleMode=function(e){var t,i,n,o;if(e.beginPath(),this.walkLine(e,this.items),e.stroke(),this.withMarkers){for(t=this.lineWidth+2,i=2*Math.PI,e.beginPath(),o=this.items.length;o--;)(n=this.items[o])&&(e.moveTo(n.x,n.y),e.arc(n.x,n.y,t,0,i));e.fill()}},n.prototype.walkLine=function(e,t,i,n){var o,r,a,l,c,h,u,d,p,_,f;if(t){for(o=.25*this.barSpacing,u=s.coordinateIsValid,d=0,p=t.length;d<p;d++)if(_=t[d],u(_.y)){a=_,r=d;break}if(void 0!==r&&a)for(f=this.withSteps&&this.lineWidth&&this.lineWidth%2==0?.5:0,d=r,p=t.length;d<p;d++){if(c=t[d],h=t[d+1]||{},u(c.y))if(l&&u(l.y))this.withSteps&&e.lineTo(l.x+f,c.y+f),e.lineTo(c.x+f,c.y+f),i&&!u(h.y)&&e.lineTo(c.x+f,n);else if(h&&u(h.y))i?(d!==r&&e.lineTo(c.x+f,n),e.lineTo(c.x+f,c.y+f)):e.moveTo(c.x+f,c.y+f);else if(i){if(0===d)continue;d!==r&&e.lineTo(c.x-o+f,n),e.lineTo(c.x-o+f,c.y+f),e.lineTo(c.x+o+f,c.y+f),e.lineTo(c.x+o+f,n)}else e.moveTo(c.x-o+f,c.y+f),
e.lineTo(c.x+o+f,c.y+f);l=c}}},n.prototype._drawLines=function(e){function t(t,i,n){a(i.y)&&(a(t.y)?e.lineTo(i.x,i.y):n&&a(n.y)?e.moveTo(i.x,i.y):(e.moveTo(i.x-r,i.y),e.lineTo(i.x+r,i.y)))}var i,n,o,r,a,l,c,h,u,d,p,_,f,m;if(this.items.length){for(r=.25*this.barSpacing,a=s.coordinateIsValid,e.beginPath(),l=this.items[0],l&&e.moveTo(l.x,l.y),c=e.strokeStyle,h=e.lineWidth,u=e.lineStyle,d=1;d<this.items.length;++d)i=this.items[d-1],n=this.items[d],o=this.items[d+1],n.style&&!this.forceLineColor?(p=n.style.color,_=n.style.width,f=n.style.style):(p=this.lineColor,_=this.lineWidth,f=this.lineStyle),this.ignorePaletteLineWidth&&(_=this.lineWidth),m=p!==c||_!==h||f!==u,m&&(c=p,h=_,u=f,e.stroke(),e.beginPath(),e.strokeStyle=p,e.lineWidth=_,s.setValidLineStyle(e,f),e.moveTo(i.x,i.y)),t(i,n,o);e.stroke()}},n.prototype.hitTest=function(e){for(var t,i,n,l,c,h,u,d,p=s.selectionTolerance(this.lineWidth),_=0,f=this.items.length-1;f-_>2;)h=Math.round((f+_)/2),u=this.items[h],u.x<=e.x?_=h:f=h;for(_=Math.max(1,_-1),f=Math.min(this.items.length-1,f+1),d=_;d<=f;++d)if(t=this.items[d-1],i=this.items[d],n=t.x,l=i.x,c=r(new o(n,t.y),new o(l,i.y),new o(e.x,e.y)),c.distance<=p)return this.hittest?this.hittest:new a(a.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=n},,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var e,t;if(this.isAvailable)this.length=this.localStorage.length;else{e=0;for(t in this.localStorage)this.localStorage.hasOwnProperty(t)&&e++;this.length=e}},o.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},n=function(e){this.storage=e},n.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},n.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new n(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},function(e,t,i){(function(e){TradingView.cleanButAmpersand=function(e,t){var i=t?["&amp;"]:["&"];return TradingView.clean(e,t,i)},TradingView.strip_tags=function(e){return e&&e.replace?e.replace(/(<([^>]+)>)/gi,""):e},
TradingView.encodeSpread=function(e){return encodeURIComponent(e)},TradingView.clean=function(e,t,i){var n,o,r,s=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"],["'","&#39;"]],a=e;if(!e||!e.replace)return a;for(n=0;n<s.length;n++)o=s[n][0],r=s[n][1],i&&i.indexOf&&-1!==i.indexOf(t?r:o)||(a=t?a.replace(RegExp(r,"g"),o):a.replace(RegExp(o,"g"),r));return a},void 0!==e&&e&&e.exports&&(e.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand,stripTags:TradingView.strip_tags})}).call(t,i(51)(e))},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MINUTE_SPAN",function(){return n}),i.d(t,"HOUR_SPAN",function(){return o}),i.d(t,"DAY_SPAN",function(){return r}),i.d(t,"WEEK_SPAN",function(){return s}),i.d(t,"MONTH_SPAN",function(){return a}),i.d(t,"YEAR_SPAN",function(){return l}),i.d(t,"DEFAULT_BAR_SPACING",function(){return c}),n=20,o=30,r=40,s=50,a=60,l=70,c=6},function(e,t,i){"use strict";function n(e){var t=e.split(":");return{name:t[0],type:2===t.length?t[1]:null}}function o(e,t,i,o){var r,s,a,l,c,p,_,f,m,y,g,v,S,b,w,P=i.split(".");if(0!==P.length&&0!==P[0].length){if(r=n(P[0]),s=r.name,a=r.type,l=null!==a,c=!l||"plot"===a,p=!l||"band"===a,_=!l||"area"===a,f=!l||"input"===a,m=c?d.getPlotIdByTitle(e,s):null,y=p?d.getBandIndexByName(e,s):null,g=_?d.getFilledAreaIdByTitle(e,s):null,v=f?d.getInputByName(e,s):null,S=t.hasOwnProperty(s),(null!==m?1:0)+(null!==y?1:0)+(null!==g?1:0)+(null!==v?1:0)+(S?1:0)>1)return void h.logWarn("Study '"+e.description+"' has ambiguous identifier '"+s+"'");if(b=P[1],null!==m){if(1===P.length)return void h.logWarn("Path of sub-property of '"+s+"' plot for study '"+e.description+"' must be not empty");w=P.slice(1),u.applyPlotProperty(e,t,m,w,o)}else if(null!==v)u.applyInputValue(t,v,o);else if(null!==y){if(void 0===b)return void h.logWarn("Property name of '"+s+"' band for study '"+e.description+"' must be set");u.applyBandProperty(t,y,b,o)}else if(null!==g){if(void 0===b)return void h.logWarn("Property name of '"+s+"' area for study '"+e.description+"' must be set");u.applyFilledAreaProperty(t,g,b,o)}else S?u.setRootProperty(t,P,o):h.logWarn("Study '"+e.description+"' has no plot or input '"+s+"'")}}function r(e,t){var i,n=e.properties(),r=n.state();for(i in t)t.hasOwnProperty(i)&&o(e.metaInfo(),r,i,t[i]);n.mergeAndFire(r)}function s(e,t,i){var n,r,s,a,l;for(n in e)e.hasOwnProperty(n)&&-1!==(r=n.indexOf("."))&&(s=n.substr(0,r),a=d.getMetaInfoByDescription(t,s),null!==a?(l=i(a.id),null!==l?o(a,l,n.substr(r+1),e[n]):h.logWarn("Cannot apply overrides for study "+s)):h.logWarn("There is no such study "+s))}var a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.applyOverridesToStudy=r,t.applyOverridesToStudyDefaults=s,a=i(7),i.n(a),l=i(86),c=i(4),h=Object(c.getLogger)("Chart.Model.StudyPropertiesOverrider"),function(e){function t(e,t,i){var n,o,r,s;if(void 0===e.plots)return null;for(n=0,o=e.plots;n<o.length;n++)if(r=o[n],
Object(l.isColorerPlot)(r)&&void 0!==t.palettes&&(s=t.palettes[r.palette],r.target===i&&void 0!==s))return s;return null}function i(e,t,i,n,o){if(void 0===e.styles)return void h.logWarn("Study does not have styles");if(null===t&&!isNaN(n)&&n>0)return void h.logWarn("Study plot does not have color #"+n);if(0===n||isNaN(n)){Object(a.ensureDefined)(e.styles[i]).color=o+"",n=0}null!==t&&(Object(a.ensureDefined)(t.colors[n]).color=o+"")}function n(e,n,o,r,s){var a,l,c,d,p;if(void 0===n.styles)return void h.logWarn("Study does not have styles");if("color"===(a=r[0]))return l=t(e,n,o),c=r.length>1?parseInt(r[1]):NaN,void i(n,l,o,c,s);if(void 0===(d=n.styles[o])||!d.hasOwnProperty(a))return void h.logWarn("Study plot does not have property '"+a+"'");if("plottype"===a){if(void 0===(p=u[s+""]))return void h.logWarn("Unsupported plot type for plot: "+s);s=p}d[a]=s}function o(e,t,i,n){var o,r;if(void 0===e.bands)return void h.logWarn("Study does not have bands");if(void 0===(o=e.bands[t])||!o.hasOwnProperty(i))return void h.logWarn("Study band does not have property '"+i+"'");if("plottype"===i){if(void 0===(r=u[n+""]))return void h.logWarn("Unsupported plot type for band: "+n);n=r}o[i]=n}function r(e,t,i,n){if(void 0===e.filledAreasStyle)return void h.logWarn("Study does not have areas");var o=e.filledAreasStyle[t];if(void 0===o||!o.hasOwnProperty(i))return void h.logWarn("Study area does not have property '"+i+"'");o[i]=n}function s(e,t,i){if(void 0===e.inputs||!e.inputs.hasOwnProperty(t))return void h.logWarn("Study does not have input '"+t+"'");e.inputs[t]=i}function c(e,t,i){var n,o,r,s,a;if(0!==t.length){for(n=e,o=0,r=t.slice(0,-1);o<r.length&&(s=r[o],null!=n&&e.hasOwnProperty(s));o++)n=e[s];if(a=t[t.length-1],null==n||!n.hasOwnProperty(a))return void h.logWarn("Study does not have property "+t.join("."));n[a]=i}}var u={line:l.PlotType.Line,histogram:l.PlotType.Histogram,cross:l.PlotType.Cross,area:l.PlotType.Area,columns:l.PlotType.Columns,circles:l.PlotType.Circles,line_with_breaks:l.PlotType.LineWithBreaks,area_with_breaks:l.PlotType.AreaWithBreaks};e.applyPlotProperty=n,e.applyBandProperty=o,e.applyFilledAreaProperty=r,e.applyInputValue=s,e.setRootProperty=c}(u||(u={})),function(e){function t(e,t){var i,n,o;if(void 0===e.inputs)return null;for(t=t.toLowerCase(),i=0,n=e.inputs;i<n.length;i++)if(o=n[i],o.name.toLowerCase()===t)return o.id;return null}function i(e,t){var i,n,o;if(void 0===e.styles)return null;t=t.toLowerCase();for(i in e.styles)if(n=e.styles[i],o=void 0!==n&&void 0!==n.title?n.title:i,o.toLowerCase()===t)return i;return null}function n(e,t){var i,n,o;if(void 0===e.filledAreas)return null;for(t=t.toLowerCase(),i=0,n=e.filledAreas;i<n.length;i++)if(o=n[i],o.title.toLowerCase()===t)return o.id;return null}function o(e,t){if(void 0===e.bands)return null;t=t.toLowerCase();for(var i=0;i<e.bands.length;++i)if(e.bands[i].name.toLowerCase()===t)return i;return null}function r(e,t){var i,n,o;for(t=t.toLowerCase(),i=0,n=e;i<n.length;i++)if(o=n[i],
o.description.toLowerCase()===t||o.shortDescription.toLowerCase()===t)return o;return null}e.getInputByName=t,e.getPlotIdByTitle=i,e.getFilledAreaIdByTitle=n,e.getBandIndexByName=o,e.getMetaInfoByDescription=r}(d||(d={}))},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"Version",function(){return o}),n=i(7),i.n(n),o=function(){function e(e,t){this._major=e,this._minor=t}return e.prototype.major=function(){return this._major},e.prototype.minor=function(){return this._minor},e.prototype.isZero=function(){return 0===this._major&&0===this._minor},e.prototype.toString=function(){return this._major+"."+this._minor},e.prototype.compareTo=function(e){return this._major<e._major?-1:this._major>e._major?1:this._minor<e._minor?-1:this._minor>e._minor?1:0},e.prototype.isLess=function(e){return this.compareTo(e)<0},e.prototype.isLessOrEqual=function(e){return this.compareTo(e)<=0},e.prototype.isEqual=function(e){return 0===this.compareTo(e)},e.prototype.isGreater=function(e){return this.compareTo(e)>0},e.prototype.isGreaterOrEqual=function(e){return this.compareTo(e)>=0},e.parse=function(t){var i,o,r;if(t instanceof e)return new e(t.major(),t.minor());if("number"==typeof t)return Object(n.assert)(Math.floor(t)===t,"Version should not be a float number"),new e(t,0);if("string"==typeof t){if(i=t.split("."),1===i.length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),new e(o,0);if(2===i.length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),r=parseInt(i[1],10),Object(n.assert)(!isNaN(r),"Bad version string: "+t),new e(o,r);throw Error("Bad version string (one dot expected): "+t)}throw Error("Bad version: "+t)},e.ZERO=new e(0,0),e}()},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ResizerDetacherState",function(){return a}),n=i(7),i.n(n),o=i(16),r=i.n(o),s=i(14),i.n(s),a=function(){function e(e){var t=this;this._alive=new r.a,this._body=new r.a,this._width=new r.a,this._height=new r.a,this._fullscreen=new r.a,this._detachable=new r.a,this._fullscreenable=new r.a,this._visible=new r.a,this._availWidth=new r.a,this._availHeight=new r.a,this._owner=new r.a,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),body:this._body.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),fullscreenable:this._fullscreenable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var e=t._owner.value();e&&e.remove&&e.remove()},negotiateWidth:function(e){var i=t._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(e)},negotiateHeight:function(e){var i=t._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(e)},requestFullscreen:function(){var e=t._owner.value();e&&e.requestFullscreen&&e.requestFullscreen()},exitFullscreen:function(){var e=t._owner.value()
;e&&e.exitFullscreen&&e.exitFullscreen()},detach:function(e){var i=t._owner.value();i&&i.detach&&i.detach(e)},attach:function(){var e=t._owner.value();e&&e.attach&&e.attach()}},e&&this.pushOwner(e)}return e.prototype.bridge=function(){return this._bridge},e.prototype.pushOwner=function(e){var t,i,n,o;if(e.alive.value()){for(t=0,i=this._ownersStack;t<i.length;t++)n=i[t],this._unsubscribeOwner(n);o={owner:e},this._ownersStack.push(o),this._subscribeOwner(o)}},e.prototype._subscribeOwner=function(e){var t,i,n=this,o=e.owner;e.deathWatcher||(this._alive.setValue(!0),e.deathWatcher=o.alive.spawn(),e.deathWatcher.subscribe(function(t){t||n._deadHandler(e)})),this._owner.setValue(o),e.subscriptions||(t=e.subscriptions=[],this._visible.setValue(!1),i=function(e,i){if(e){var n=e.spawn();t.push(n),n.subscribe(function(e){i.setValue(e)},{callWithLast:!0})}else i.deleteValue()},i(o.body,this._body),i(o.width,this._width),i(o.height,this._height),i(o.fullscreen,this._fullscreen),i(o.detachable,this._detachable),i(o.fullscreenable,this._fullscreenable),i(o.availWidth,this._availWidth),i(o.availHeight,this._availHeight),i(o.visible,this._visible))},e.prototype._unsubscribeOwner=function(e,t){var i,n,o;if(e.subscriptions){for(i=0,n=e.subscriptions;i<n.length;i++)o=n[i],o.unsubscribe();e.subscriptions=null}t&&e.deathWatcher&&(e.deathWatcher.unsubscribe(),e.deathWatcher=null)},e.prototype._deadHandler=function(e){var t,i=this._ownersStack.indexOf(e);for(Object(n.assert)(-1!==i,"sanitized owner should be in stack"),t=this._ownersStack.length-1;t>=i;t--)this._unsubscribeOwner(this._ownersStack[t],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},e}()},function(e,t,i){"use strict";function n(e){return!d.some(function(t){return e[t]().size>0})}function o(e,t,i,n){var o,r,s,a;if(void 0!==t){o=function(t){var o,r=t.styleId;void 0!==i&&Object(c.assert)(r in i,"Every style used by graphics primitive should be declared in study metainfo"),o=null,e.forEach(function(e,t){t===r&&(o=e[0])}),null===o&&(o={indexes:n,items:[]},e.set(r,[o])),o.items=o.items.concat(t.data)};for(r=0,s=t;r<s.length;r++)a=s[r],o(a)}}function r(e,t,i){var n,o,r,s=null;for(n=0,o=e;n<o.length;n++)r=o[n],r.styleId===i&&(s=r);null===s&&(s={styleId:i,data:[]},e.push(s)),s.data.push(t)}function s(e){var t,i=e.hhistsByTimePointIndex();i.clear(),t=a(e.hhists()),i.set("histBars",t)}function a(e){var t=new Map;return e.forEach(function(e,i){var n,o,r,s,a,c,h=e[0],d=h.indexes;for(n=0,o=h.items;n<o.length;n++)r=o[n],r.firstBarTime<0||r.firstBarTime>=d.length?u.logError("Cannot find index "+r.firstBarTime+" in study timescale indexes"):(s=l.a({},r,{styleId:i}),a=d[r.firstBarTime],c=t.get(a),void 0===c?t.set(a,{indexes:d,items:[s]}):c.items.push(s))}),t}var l,c,h,u,d;i.d(t,"d",function(){return d}),t.c=n,t.b=o,t.a=r,t.e=s,l=i(1),c=i(7),i.n(c),h=i(4),u=Object(h.getLogger)("Chart.StudyGraphics"),
d=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists"]},function(e,t,i){"use strict";function n(){this.backColorers=[]}function o(e){n.call(this),this._series=e}function r(e,t){n.call(this),this._study=e,this._plotIndex=t}var s=i(17).PlotRowSearchMode;n.prototype.barStyle=function(e,t,i){var n,o={};for(n=this.backColorers.length-1;n>=0;n--)this.backColorers[n].applyBarStyle(e,t,o,i);return this.applyBarStyle(e,t,o,i),o},n.prototype.pushBackBarColorer=function(e){this.backColorers.push(e)},n.prototype.applyBarStyle=function(e,t,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(o,n),o.prototype.applyBarStyle=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;switch(i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,o=this._series.properties(),o.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=o.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=o.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:r=o.barStyle.upColor.value(),s=o.barStyle.downColor.value(),a=r,l=s,c=this.findBar(e,!1,n),o.barStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,!1,n),i.barColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l):(i.barColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:r=o.candleStyle.upColor.value(),s=o.candleStyle.downColor.value(),a=o.candleStyle.borderUpColor?o.candleStyle.borderUpColor.value():o.candleStyle.borderColor.value(),l=o.candleStyle.borderDownColor?o.candleStyle.borderDownColor.value():o.candleStyle.borderColor.value(),u=o.candleStyle.wickUpColor?o.candleStyle.wickUpColor.value():o.candleStyle.wickColor.value(),d=o.candleStyle.wickDownColor?o.candleStyle.wickDownColor.value():o.candleStyle.wickColor.value(),c=this.findBar(e,!1,n),o.candleStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,!1,n),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:r=o.hollowCandleStyle.upColor.value(),s=o.hollowCandleStyle.downColor.value(),a=o.hollowCandleStyle.borderUpColor?o.hollowCandleStyle.borderUpColor.value():o.hollowCandleStyle.borderColor.value(),l=o.hollowCandleStyle.borderDownColor?o.hollowCandleStyle.borderDownColor.value():o.hollowCandleStyle.borderColor.value(),u=o.hollowCandleStyle.wickUpColor?o.hollowCandleStyle.wickUpColor.value():o.hollowCandleStyle.wickColor.value(),d=o.hollowCandleStyle.wickDownColor?o.hollowCandleStyle.wickDownColor.value():o.hollowCandleStyle.wickColor.value(),c=this.findBar(e,!1,n),h=this.findPrevBar(e,!1,n),
h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?(i.barColor=r,i.barBorderColor=a,i.barWickColor=u):(i.barColor=s,i.barBorderColor=l,i.barWickColor=d),c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:r=o.haStyle.upColor.value(),s=o.haStyle.downColor.value(),a=o.haStyle.borderUpColor.value(),l=o.haStyle.borderDownColor.value(),u=o.haStyle.wickUpColor.value(),d=o.haStyle.wickDownColor.value(),c=this.findBar(e,t,n),o.haStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,t,n),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_BASELINE:c=this.findBar(e,t,n),_=o.baselineStyle,f=this._series.priceScale(),m=Math.round(f.height()*(Math.abs(100-_.baseLevelPercentage.value())/100)),y=this._series.firstValue(),g=f.coordinateToPrice(m,y),c[TradingView.CLOSE_PLOT]>g?i.barColor=o.baselineStyle.topLineColor.value():i.barColor=o.baselineStyle.bottomLineColor.value()}return i},o.prototype.getSeriesBars=function(e){return e?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(e,t,i){var n=this.getSeriesBars(i).valueAt(e);if(null!==n)return n[t]},o.prototype.findBar=function(e,t,i){return i?i.value:this.getSeriesBars(t).valueAt(e)||[]},o.prototype.findPrevBar=function(e,t,i){var n,o;return i&&i.previousValue?i.previousValue:(n=this._series.bars(),o=n._search(e,s.Exact),null!==o&&o>0?this._series.bars()._valueAt(o-1):[])},inherit(r,n),r.prototype.applyBarStyle=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_,f;return i||(i={}),t?i:(n=this._study.properties(),n.visible.value()?(o=this._study.metaInfo(),(r=this._study.data())&&0!==r.size()?(s=o.plots[this._plotIndex],this._study.getMinFirstBarIndexForPlot(s.id)>e?i:(a=n.styles[s.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(s.id),null===(c=r.valueAt(e-l))?i:null==(h=c[this._plotIndex+1])?i:(h=Math.round(h),u=o.plots[this._plotIndex].palette,d=n.palettes,p=d[u],_=o.palettes[u].valToIndex?o.palettes[u].valToIndex[h]:h,f=p.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i)))):i):i)},t.SeriesBarColorer=o,t.StudyBarColorer=r},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.colorUp=e.colorup,this.colorDn=e.colordown,this.colorBorderUp=e.colorBorderUp,this.colorBorderDown=e.colorBorderDown,this.width=this._calculateWidth(e.barSpacing),this.minHeight=e.minHeight,this.vertOffset=this._calculateVerticalOffset(e.barSpacing)}function o(e,t,i,n){this.x=e,this.y=t,this.height=i,this.isUp=n}var r=i(6).Point,s=i(9).HitTestResult;n.prototype._calculateVerticalOffset=function(e){return Math.round((e||0)/4)},n.prototype._calculateMinHeight=function(e){return this.width||this._calculateWidth(e)},n.prototype._calculateWidth=function(e){var e=e||this.barSpacing;return Math.round(e/2)},n.prototype.draw=function(e){
var t,i,n,o,r,s,a,l=this.width,c=l<4,h=Math.max(parseInt(l/2),1),u=Math.round(this.width/2),d=Math.round(this.width);for(e.translate(1,1),t=0,i=this.items.length;t<i;t++)n=this.items[t],o=n.isUp?-1:1,r=Math.abs(n.height),s=n.y-o*this.vertOffset,e.beginPath(),e.translate(n.x,s),c?(e.moveTo(0,0),e.lineTo(-u,-u*o),e.moveTo(0,0),e.lineTo(u,-u*o),e.moveTo(0,0),e.lineTo(0,-r*o),e.moveTo(-u,-r*o),e.lineTo(u,-r*o),e.lineWidth=h,e.strokeStyle=n.isUp?this.colorUp:this.colorDn,e.stroke()):(e.moveTo(0,0),r<d?(e.lineTo(l,-r*o),e.lineTo(-l,-r*o)):(e.lineTo(l,-d*o),e.lineTo(u,-d*o),e.lineTo(u,-r*o),e.lineTo(-u,-r*o),e.lineTo(-u,-d*o),e.lineTo(-l,-d*o)),e.lineTo(0,0),a=n.isUp?this.colorBorderUp:this.colorBorderDown,e.strokeStyle=a,e.stroke(),e.fillStyle=n.isUp?this.colorUp:this.colorDn,e.fill()),e.translate(-n.x,-s);e.translate(-1,-1)},n.prototype.hitTest=function(e){var t,i,n,o,r,a,l,c,h,u=Math.round(this.width/2),d=Math.round(this.width);for(t=0;t<this.items.length;++t)if((i=this.items[t])&&void 0!==i.x&&null!==i.x&&!TradingView.isNaN(i.x)&&void 0!==i.y&&null!==i.y&&!TradingView.isNaN(i.y)&&(n=Math.abs(i.height),o=i.isUp?-1:1,r=n+d,a=i.y-o*this.vertOffset,l=a-o*r,c=i.x-u,h=i.x+u,c<e.x&&e.x<h&&(i.isUp?a<e.y&&e.y<l:l<e.y&&e.y<a)))return new s(s.REGULAR);return null},inherit(o,r),t.PaneRendererArrowsUpDown=TradingView.PaneRendererArrowsUpDown=n,t.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=o},function(e,t,i){"use strict";function n(e,t){var n,o,r,a,l,c,h,u,d;if(!e)throw Error("No studies metainfo");if(n=i(532),this._studiesMetainfo=e,!t)throw Error("No studies migrations");for(this._studiesMigrations=t,this._migrations={},o=0;o<this._studiesMigrations.length;o++)for(r=this._studiesMigrations[o],a=r.versFrom,l=r.versTo,c=0;c<r.studyMigrations.length;c++)h=r.studyMigrations[c],u=h.studyId,0!==h.rules.length?(d=u in this._migrations?this._migrations[u]:new n(u),d.addMigration(a,l,h.rules),this._migrations[u]=d):s.logError("Study Migration should have at least one convertion rule");this._clientMigrations=[function(e,t){var i,n,o,r,s;if(0===this._studiesMetainfo.length||!e.isTVScript||e.version>=22)return t;for(i={},n=0,o=0;void 0!==(r=t[o]);)s=t[r.id],r.isFake&&(r.id="in_"+n++),i[o]=r,i[r.id]=s,o++;return i}]}var o=i(7).assert,r=i(163).Version,s=i(4).getLogger("Chart.Study.Versioning"),a=i(348),l=i(26);n.prototype.updateMetaInfo=function(e){var t,i,n;if(!e)return e;for(o(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),t=null,i=this._studiesMetainfo,n=0;n<i.length;n++)if(i[n].id===e.id){t=i[n];break}return TradingView.clone(t)},n.prototype.updateMetaInfoAsync=function(e,t){var i,n,o,r,s,a=$.Deferred(),c=a.promise();if(!e)return a.reject("No old metaInfo was given"),c;if(t)return a.resolve(null),c;if(i=e.isTVScript&&e.scriptIdPart&&TVScript.pineType(e.scriptIdPart)===TVScript.PineType.Addon,n=l.versionOf(e),e.isTVScript&&!e.pine&&!i&&n<l.VERSION_PINE_PROTECT_TV_4164);else if((e.isTVScript||e.isTVScriptStubToCompile)&&e.pine&&!i);else{
for(o=null,r=this._studiesMetainfo,s=0;s<r.length;s++)if(r[s].id===e.id){o=r[s];break}o?a.resolve(TradingView.clone(o)):a.resolve(null)}return c},n.prototype.lastVersionOfStudy=function(e){return l.findStudyMetaInfo(this._studiesMetainfo,e).version},n.prototype.updateStudyInputs=function(e,t,i,n,o){var a,l,c,h,u,d,p,_=TradingView.clone(n);if(e in this._migrations&&(a=r.parse(t),"last"===i?(c=this.lastVersionOfStudy(e),l=r.parse(c)):l=r.parse(i),h=this._migrations[e],u=h.updateInputs(a,l,_),_=u),null==o)return _;for(d in o)d in _||(_[d]=o[d]);for(d in _)d in o||(p=_[d],s.logWarn("Extra input detected, studyId="+e+", versionFrom="+t+", inputId="+d+", inputValue="+p+", removing it and continue..."),delete _[d]);return _},n.prototype.updateStudyState=function(e,t,i){var n,o,r,a,c,h,u,d,p,_,f,m,y,g;if(null==e||null==t||null==i)return e;for(e=TradingView.clone(e),n=t.isTVScript||!!t.pine,n||t.version===i.version||(o=i&&i.defaults.inputs,r=this.updateStudyInputs(t.id,t.version,i.version,e.inputs,o),e.inputs=r),a=0;a<this._clientMigrations.length;++a)r=this._clientMigrations[a].call(this,t,e.inputs),Object.keys(r).length===Object.keys(e.inputs).length?e.inputs=r:s.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...");if(c=l.versionOf(t),t.isTVScript&&t.TVScriptSourceCode&&c>=12&&c<=26){for(h={},a=0;a<t.plots.length;++a)u=t.plots[a],d=i.plots[a],h[u.id]=d.id;for(p=Object.keys(e.styles),a=0;a<p.length;++a)_=p[a],f=e.styles[_],delete e.styles[_],m=h[_],e.styles[m]=f;for(y=Object.keys(e.plots),a=0;a<y.length;++a)g=y[a],_=e.plots[g].id,e.plots[g].id=h[_]}return e},n.prototype.patchPointsBasedStudyState=function(e){return n._fixInputsMaxValue(e.state,e.metaInfo),e},n.prototype.patchPointsBasedStudyData=function(e,t){if(!a.isProd())return t;if(!e||!t)return t;var i=TradingView.clone(t);return"VbPFixed@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&n._patchOldVolumeProfiles(0,i),i},n.prototype.patchStudyData=function(e,t,i,o){var r,s,c,h,u,d,p;if(!a.isProd())return{data:t,nsData:i,indexes:o};if(r=TradingView.clone(t),s=TradingView.clone(i),c=TradingView.clone(o),"VbPVisible@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&n._patchOldVolumeProfiles(0,r.graphics),"VbPSessions@tv-volumebyprice"===e.id&&e.version&&e.version<=4&&n._patchOldVolumeProfiles(0,r.graphics),h=l.versionOf(e),e.isTVScript&&e.TVScriptSourceCode&&h>=12&&h<=26)for(u=r.columns,r.columns=[],d=0;d<u.length;++d)p="plot_"+d,r.columns.push(p);return{data:r,nsData:s,indexes:c}},n._patchOldVolumeProfiles=function(e,t){var i,n=t.hhists[e].data,o=[];for(i in n)o=o.concat(n[i]);t.hhists[0].data=o},n._fixInputsOrder=function(e,t){var i,o,r,s,a=l.getOrderedInputIds(t),c=n.splitInputs(e.inputs),h=c.arr,u=c.obj,d=TradingView.merge({},u);for(i=0;i<a.length;++i)o=a[i],null!==(r=n.findInputKeyById(h,o))&&(s=h[r],d[i]=s);e.inputs=d},n.INPUT_MAX_VALUE=1e12,n._verifyInputsMaxValue=function(e){var t,i,o=n.INPUT_MAX_VALUE;if(e.inputs)for(t=0;t<e.inputs.length;t++)i=e.inputs[t],
"integer"===i.type&&i.max&&i.max>o&&s.logWarn("Bad integer input max value in metaInfo id="+e.id+" title="+e.description)},n._fixInputsMaxValue=function(e,t){var i,o,r,s,a,l;if(!TradingView.isAbsent(t)){if(i=n.INPUT_MAX_VALUE,t.inputs)for(o=0;o<t.inputs.length;o++)r=t.inputs[o],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);if(e&&e.inputs){s=n.splitInputs(e.inputs),a=s.arr;for(l in a)r=a[l],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);e.inputs=TradingView.merge(s.obj,s.arr)}}},n.prototype.patchPropsStateAndMetaInfo=function(e,t,i){var o,r,s,a,c,h,u,d,p,_,f,m,y,g,v,S,b,w;if("Script$BOOKER"!==t.productId||t.alerts||delete e.alerts,n._fixInputsOrder(e,t),n._fixInputsMaxValue(e,t),o=n.splitInputs(e.inputs),e.inputs=o.obj,l.versionOf(t)<l.METAINFO_FORMAT_VERSION_SOS_V2&&t.isChildStudy&&(e.isChildStudy=t.isChildStudy),r=60,t.isTVScript&&t.version<r&&("Script$TV_EARNINGS@tv-scripting"!==t.id&&"Script$TV_DIVIDENDS@tv-scripting"!==t.id&&"Script$TV_SPLITS@tv-scripting"!==t.id||delete t.TVScriptSourceCode),"Volume"!==t.id&&"Volume@tv-basicstudies"!==t.id||0!==t.inputs.length||(t.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1e3}],t.plots.push({id:"vol_ma",type:"line"})),"Volume@tv-basicstudies"===t.id&&t.version&&t.version<=46&&(e.styles.vol.transparency=e.transparency||87),"PivotPointsStandard@tv-basicstudies"===t.id&&(0===t.inputs.length?(e.inputs={kind:"Traditional",showHistoricalPivots:!0},t.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===t.inputs.length&&(e.inputs={kind:"Traditional"},t.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===e._hardCodedDefaultsVersion&&(e._hardCodedDefaultsVersion=1,s=e.color,delete e.color,e.levelsStyle={colors:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}})),"CMF"===t.shortId&&2===t.inputs.length&&(e.inputs={length:e.inputs["length fast"]},t.inputs=t.inputs.splice(0,1),t.inputs[0].id="length"),t.defaults&&void 0===t.defaults.precision&&(-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(t.id)?t.defaults.precision=0:t.defaults.precision=4),a=60,t.version<a)for(c=["TV_DIVIDENDS","TV_SPLITS","TV_EARNINGS"],h=6,u=0;u<c.length;u++)t.id.startsWith("Script$"+c[u]+"@tv-scripting")&&(t.fullId="ESD"+t.fullId.substring(h),t.id="ESD"+t.id.substring(h),t.name="ESD"+t.name.substring(h),t.shortId="ESD"+t.shortId.substring(h),t.productId="ESD"+t.productId.substring(h));if(l.versionOf(t)<l.VERSION_PINE_PROTECT_TV_4164&&(d={"StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy":{pineId:"STD;Consecutive%1Ups%1Downs%1Strategy",className:"StrategyScript"},Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2:{pineId:"Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2",className:"Script"}},
t.shortId in d&&(p=d[t.shortId].className+"$"+d[t.shortId].pineId,_={scriptIdPart:d[t.shortId].pineId,fullId:t.fullId.replace(t.shortId,p),id:t.id.replace(t.shortId,p),name:t.name.replace(t.shortId,p),shortId:p},TradingView.merge(t,_),TradingView.merge(e,_)),f=TradingView.StudyMetaInfo.cutScriptIdPart(t.fullId),(m=f.match(/^(USER)(_\d+)(;)(.*)$/))&&(y=m[0],g=m[1]+m[3]+m[2]+m[4],_={scriptIdPart:g,fullId:t.fullId.replace(y,g),id:t.id.replace(y,g),name:t.name.replace(y,g),shortId:t.shortId.replace(y,g)},TradingView.merge(t,_),TradingView.merge(e,_))),"MA"===t.id){switch(v=new l({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),S=new l({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),b=new l({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),w=new l({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}}),e.inputs.type){case"exp":t=v;break;case"simple":t=S;break;case"weighted":t=w;break;case"volume weighted":t=b}e.styles[t.plots[0].id]=e.styles.MovAvg,delete e.styles.MovAvg,delete e.inputs.type}return i.oldShowStudyLastValueProperty&&(e.oldShowLastValue=e.showLastValue),delete e.showLastValue,delete e.showStudyArguments,{propsState:e,metaInfo:t}},n.mergeInputs=function(e,t){n.mergeInputsArrPart(e,t),n.mergeInputsObjPart(e,t)},n.mergeInputsArrPart=function(e,t){var i,o,r=n.splitInputs(t);for(i in r.arr)o=n.findInputKeyById(e,r.arr[i].id),o?TradingView.merge(e[o],r.arr[i]):n.appendInputInfoToArr(e,r.arr[i])},n.mergeInputsObjPart=function(e,t){var i=n.splitInputs(t);TradingView.merge(e,i.obj)},n.appendInputInfoToArr=function(e,t){var i,n,o=-1;for(i in e)n=parseInt(i,10),isNumber(n)&&n>o&&(o=n);e[o+1]=t},n.splitInputs=function(e){var t,i={},n={};for(t in e)isNumber(parseInt(t,10))?i[t]=e[t]:n[t]=e[t];return{arr:i,obj:n}},n.findInputKeyById=function(e,t){var i,n=null;for(i in e)if(isNumber(parseInt(i,10))&&e[i].id===t){n=i;break}return n},n.getInputKeyById=function(e,t){var i=n.findInputKeyById(e,t);if(!i)throw Error("Cannot find input with id: "+t);return i},e.exports=n},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolPriceAxisView",function(){return s}),n=i(1),o=i(7),i.n(o),r=i(58),s=function(e){
function t(t,i){var n=e.call(this)||this;return n._activeBackground="#0F6DBF",n._background="#5592C9",n._active=!1,n._source=t,n._data=i,n}return n.c(t,e),t.prototype.setActive=function(e){this._active=e},t.prototype.setBackground=function(e){this._background=e},t.prototype._updateRendererData=function(e){var t,i,n,o,r,s,a,l;e.visible=!1,t=this._source.model(),t.timeScale()&&!t.timeScale().isEmpty()&&(null===(i=this._source.priceScale())||i.isEmpty()||(t.selectedSource()===this._source||this._source.isForcedDrawPriceAxisLabel())&&null!==t.timeScale().visibleBars()&&(n=this._source.axisPoints(),o=this._data.pointIndex,n.length<=o||(r=n[o],isFinite(r.price)&&(s=this._source.ownerSource(),null!=(a=null!==s?s.firstValue():null)&&(l=this._active?this._activeBackground:this._background,this._data.backgroundProperty&&(l=this._data.backgroundProperty.value()),e.background=l,e.borderColor="#2E84A6",e.color=this.generateTextColor(l),e.coordinate=i.priceToCoordinate(r.price,a),e.text=this._formatPrice(r.price,a),e.visible=!0)))))},t.prototype._formatPrice=function(e,t){return Object(o.ensureNotNull)(this._source.priceScale()).formatPrice(e,t)},t}(r.a)},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeAxisView",function(){return o}),n=i(24),i.n(n),o=function(){function e(){this._text="",this._background="#585858",this._coordinate=0}return e.prototype.text=function(){return this._text},e.prototype.background=function(){return this._background},e.prototype.color=function(){return"black"===Object(n.rgbToBlackWhiteString)(Object(n.parseRgb)(this._background),150)?"white":"black"},e.prototype.coordinate=function(){return this._coordinate},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeAxisViewRenderer",function(){return r}),n=i(46),i.n(n),o=/[1-9]/g,r=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e,t){var i,r,s,a,l,c,h,u,d,p,_,f,m,y;null!==this._data&&!1!==this._data.visible&&0!==this._data.text.length&&(e.font=t.font,(i=Math.round(t.widthCache.measureText(e,this._data.text,o)))<=0||(r=t.paddingHorizontal,s=i+2*r,a=s/2,l=this._data.width,c=this._data.coordinate,h=Math.floor(c-a)+.5,h<0?(c+=Math.abs(0-h),h=Math.floor(c-a)+.5):h+s>l&&(c-=Math.abs(l-(h+s)),h=Math.floor(c-a)+.5),u=h+s,d=.5,p=d+t.borderSize+t.paddingTop+t.fontSize+t.paddingBottom,e.fillStyle=this._data.background,e.lineWidth=1,Object(n.drawRoundRect)(e,h,d,u-h,p-d,1),e.fill(),_=Math.round(this._data.coordinate+1),f=d,m=f+t.borderSize+t.tickLength,e.strokeStyle=this._data.color,e.beginPath(),e.moveTo(_,f),e.lineTo(_,m),e.stroke(),y=p-t.baselineOffset-t.paddingBottom,e.textAlign="left",e.fillStyle=this._data.color,e.fillText(this._data.text,h+r,y)))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"AbbreviatedDateTimeFormatter",function(){return s}),n=i(130),o=i(21),r={1:window.t("Jan"),2:window.t("Feb"),3:window.t("Mar"),4:window.t("Apr"),
5:window.t("May"),6:window.t("Jun"),7:window.t("Jul"),8:window.t("Aug"),9:window.t("Sep"),10:window.t("Oct"),11:window.t("Nov"),12:window.t("Dec")},s=function(){function e(e){void 0===e&&(e=!1),this._dwm=e}return e.prototype.format=function(e){var t=this._formatDate(e);return this._dwm||(t+=" · "+new n.TimeFormatter("%h:%m").format(e)),t},e.prototype.formatLocal=function(e){var t=this._formatDateLocal(e);return this._dwm||(t+=" · "+new n.TimeFormatter("%h:%m").formatLocal(e)),t},e.prototype._formatDate=function(e){var t,i,n;return o.customFormatters&&o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.format(e):(t=Object(o.numberToStringWithLeadingZero)(e.getUTCDate(),2),i=r[e.getUTCMonth()+1],n=(""+e.getUTCFullYear()).substring(2),t+" "+i+" '"+n)},e.prototype._formatDateLocal=function(e){var t,i,n;return o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.formatLocal?o.customFormatters.dateFormatter.formatLocal(e):o.customFormatters.dateFormatter.format(e):(t=Object(o.numberToStringWithLeadingZero)(e.getDate(),2),i=r[e.getMonth()+1],n=(""+e.getFullYear()).substring(2),t+" "+i+" '"+n)},e}()},function(e,t,i){"use strict";function n(e,t){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},o.call(this,e,t)}var o=i(0).LineDataSource;inherit(n,o),n.POINTS_COUNT=1,n.prototype.pointsCount=function(){return n.POINTS_COUNT},n.prototype.hasContextMenu=function(){return!1},n.prototype.state=function(){return null},n.prototype.startMoving=function(){o.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},n.prototype.endMoving=function(){o.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},n.prototype.correctPoints=function(e){var t,i,n,o,r;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,t=this.priceScale(),i=t.mainSource().base(),n=1/i,o=0;o<e.length;o++)r=e[o],this._cursorMoved&&(r.price=this._currentMovingPoint.price),r.price=n*Math.round(r.price/n),e[o]=r},n.prototype.userEditEnabled=function(){return!0},n.prototype.canBeHidden=function(){return!1},n.prototype.isUserDeletable=function(){return!1},n.prototype.showInObjectTree=function(){return!1},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.doesMovingAffectsUndo=function(){return!1},e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolHorzLinePriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,r,s;e.visible=!1,t=this._source.points(),i=this._source.priceScale(),0===t.length||null===i||i.isEmpty()||(n=t[0],isFinite(n.price)&&(o=this._source.ownerSource(),null!=(r=null!==o?o.firstValue():null)&&(s=this._source.properties().linecolor.value(),e.background=s,e.color=this.generateTextColor(s),e.coordinate=i.priceToCoordinate(n.price,r),
e.text=i.formatPrice(n.price,r),e.visible=!0)))},t}(o.a)},function(e,t,i){"use strict";(function(e){function n(t,o){var r,s,c,d,p,_,f,m,y,g=o||new h("linetoolriskreward");a.call(this,t,g),this._properties.addExclusion&&(this._properties.addExclusion("stopLevel"),this._properties.addExclusion("profitLevel")),o.stopLevel||o.profitLevel||(r=t.timeScale().visibleBars(),s=r.firstBar(),c=r.lastBar(),d=t.mainSeries().priceRange(s,c),p=t.mainSeries().priceScale(),p.isLog()&&(_=p.logicalToPrice(d.minValue()),f=p.logicalToPrice(d.maxValue()),d=new e(_,f)),d&&!d.isEmpty()&&(m=Math.round(.2*d.length()*t.mainSeries().base()),g.merge({stopLevel:m,profitLevel:m}))),y=this,g.stopLevel.listeners().subscribe(this,this.recalculate),g.stopLevel.listeners().subscribe(null,function(){y.properties().stopPrice._listeners.fire(y.properties().stopPrice)}),g.profitLevel.listeners().subscribe(this,this.recalculate),g.profitLevel.listeners().subscribe(null,function(){y.properties().targetPrice._listeners.fire(y.properties().targetPrice)}),g.addChild("entryPrice",new n.PriceProperty(this,0)),g.addChild("stopPrice",new n.StopPriceProperty(this)),g.addChild("targetPrice",new n.TargetPriceProperty(this)),g.addProperty("riskSize",250),g.addProperty("qty",0),g.addProperty("amountTarget",g.accountSize.value()),g.addProperty("amountStop",g.accountSize.value()),this._riskInPercentsFormatter=new u(2),this._riskInMoneyFormatter=new u,g.risk.subscribe(this,this._recalculateRiskSize),g.accountSize.subscribe(this,this._recalculateRiskSize),g.riskDisplayMode.subscribe(this,this._recalculateRisk),g.riskDisplayMode.subscribe(this,this._recalculateRiskSize),g.entryPrice.subscribe(this,this._recalculateRiskSize),g.stopPrice.subscribe(this,this._recalculateRiskSize),g.profitLevel.subscribe(this,this._recalculateRiskSize),g.stopLevel.subscribe(this,this._recalculateRiskSize),g.qty.subscribe(this,this._recalculateRiskSize),"percents"===g.riskDisplayMode.value()&&g.risk.value()>100&&g.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["entryPrice","stopPrice","targetPrice","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=n.version,this._entryPriceAxisView=new l(this,{colorProperty:g.linecolor,priceProperty:g.entryPrice}),this._stopPriceAxisView=new l(this,{colorProperty:g.stopBackground,priceProperty:g.stopPrice}),this._profitPriceAxisView=new l(this,{colorProperty:g.profitBackground,priceProperty:g.targetPrice}),i.e(0).then(function(e){var t=i(789).RiskRewardPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i,o;this._constructor="LineToolRiskRewardShort",i=t||new h("linetoolriskrewardshort"),n.call(this,e,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount),
o.accountSize.subscribe(this,this._recalculateAmount),o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}function r(e,t){var i,o;this._constructor="LineToolRiskRewardLong",i=t||new h("linetoolriskrewardlong"),n.call(this,e,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount),o.accountSize.subscribe(this,this._recalculateAmount),o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}var s=i(7).ensureNotNull,a=i(0).LineDataSource,l=i(570).LineToolRiskRewardPriceAxisView,c=i(32),h=i(3).DefaultProperty,u=i(105).NumericFormatter,d=i(2).propertyPages,p=i(352).RiskRewardPointIndex;inherit(n,a),n.prototype.riskFormatter=function(e){return"percents"===e?this._riskInPercentsFormatter:this._riskInMoneyFormatter},n.prototype.getRiskStep=function(e){return"percents"===e?.01:1},n.prototype._roundValue=function(e){return parseFloat(e.toFixed(2))},n.prototype._recalculateRisk=function(){var e=this.properties(),t=e.riskDisplayMode.value(),i=e.riskSize.value(),n=e.accountSize.value(),o=e.risk.value();o="percents"===t?this._roundValue(i/n*100):this._roundValue(n/100*o),this._riskInChange=!0,e.risk.setValue(this.riskFormatter(t).format(o)),this._riskInChange=!1},n.prototype._recalculateRiskSize=function(){var e,t,i,n;this._riskInChange||(e=this.properties(),t=e.risk.value(),i=e.riskDisplayMode.value(),n=e.accountSize.value(),"percents"===i?e.riskSize.setValue(t/100*n):t>n?(e.risk.setValue(n),e.riskSize.setValue(n)):e.riskSize.setValue(t))},n.version=2,n.prototype.i18nCache={title:$.t("Risk/Reward")},n.prototype.lastBarData=function(){var e,t,i,n,o,r=this._model.mainSeries().bars().firstIndex(),a=this._model.mainSeries().bars().lastIndex();return null===r||null===a||isNaN(r)||isNaN(a)?null:(e=this.points(),4===e.length?(t=e[p.ActualClose],t.index<r?null:{closePrice:t.price,index:Math.min(a,t.index)}):(i=e[p.Close],i.index<r?null:(n=Math.min(a,i.index),o=s(this._model.mainSeries().bars().valueAt(n)),{closePrice:o[TradingView.CLOSE_PLOT],index:n})))},n.prototype.migrateVersion=function(e,t,i){var n,o,r,s;1===e&&this._points.length>=1&&(n=[],n.push(this._points[0]),o=this._points[0],o={price:o.price,index:o.index+50},n.push(o),this._points[1]&&n.push(this._points[1]),this._points[2]&&n.push(this._points[2]),this._points=n,this._timePoint.length>=1&&(r=[],o=this._timePoint[0],r.push(o),s={price:o.price,time_t:o.time_t,offset:o.offset+50},r.push(s),this._timePoint[1]&&n.push(this._points[1]),this._timePoint[2]&&n.push(this._points[2]),this._timePoint=r))},n.prototype.checkAlert=function(){this.recalculate()},n.prototype.priceAxisViews=function(e,t){
return this.isSourceHidden()?null:t!==this.priceScale()||this._model.paneForSource(this)!==e?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]},n.prototype.updateAllViews=function(){this.isActualSymbol()&&this._properties.visible.value()&&(c.hideAllDrawings().value()&&this.userEditEnabled()||(a.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},n.prototype.setPoint=function(e,t){switch(e){case 0:t.price=this._roundPrice(t.price),a.prototype.setPoint.call(this,e,t),this.recalculate();break;case 1:this.isActualSymbol()&&this.properties().stopPrice.setValue(this.preparseStopPrice(t.price));break;case 2:this.isActualSymbol()&&this.properties().targetPrice.setValue(this.preparseProfitPrice(t.price));break;case 3:t.price=this._roundPrice(t.price),a.prototype.setPoint.call(this,1,t),this.recalculate()}},n.PriceProperty=function(e,t){a.PointPriceProperty.call(this,e,t)},inherit(n.PriceProperty,a.PointPriceProperty),n.PriceProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},n.StopPriceProperty=function(e){n.PriceProperty.call(this,e,1)},inherit(n.StopPriceProperty,n.PriceProperty),n.StopPriceProperty.prototype.value=function(){var e=this._lineSource.stopPrice(),t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},n.StopPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(t),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},n.TargetPriceProperty=function(e){n.PriceProperty.call(this,e,2)},inherit(n.TargetPriceProperty,n.PriceProperty),n.TargetPriceProperty.prototype.value=function(){var e=this._lineSource.profitPrice(),t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},n.TargetPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(t),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return this.i18nCache.title},n.prototype.name=function(){return"Risk/Reward"},n.prototype.addPoint=function(e){var t,i;return e.price=this._roundPrice(e.price),a.prototype.addPoint.call(this,e,null,!0),t={price:e.price,index:e.index+50},a.prototype._addPointIntenal.call(this,t,null,!0),i=this.calculateActualEntry(e,t),i&&(a.prototype._addPointIntenal.call(this,i,null,!0),
(t=this.findClosePoint(i,t))&&a.prototype._addPointIntenal.call(this,t,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.prototype._roundPrice=function(e){var t=this._model.mainSeries().base();return Math.round(e*t)/t},n.prototype.recalculate=function(){var e,t,i,n,o;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(e=this.properties().targetPrice.value(),t=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],n=this.calculateActualEntry(this.points()[0],this.points()[1]),n&&(i.push(n),(o=this.findClosePoint(n,this.points()[1]))&&i.push(o)),this._points=i,e!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),t!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},n.prototype.start=function(){a.prototype.start.call(this),this.recalculate()},n.prototype.startMoving=function(e){e.price=this._roundPrice(e.price),a.prototype.startMoving.call(this,e)},n.prototype.move=function(e){e.price=this._roundPrice(e.price),a.prototype.move.call(this,e),this.recalculate(),this._entryPriceAxisView.update()},n.prototype.correctPoints=function(e){return!!this.isActualSymbol()&&a.prototype.correctPoints.call(this,[e[0],e[1]])},n.prototype.entryPrice=function(){return this.points()[0].price},n.prototype.findClosePoint=function(e,t){var i,n,o,r=this._model.mainSeries().bars(),a=s(r.firstIndex()),l=Math.max(e.index,a),c=s(r.lastIndex());for(i=l;i<=Math.min(c,t.index);i++)if(n=s(r.valueAt(i)),null!=(o=this.checkStopPrice(n)))return{index:i,price:o};return null},n.prototype.calculateActualEntry=function(e,t){var i,n,o=this._model.mainSeries().bars(),r=s(o.firstIndex()),a=Math.max(e.index,r),l=e.price,c=s(o.lastIndex());for(i=a;i<=Math.min(c,t.index);i++)if(n=s(o.valueAt(i)),n[TradingView.HIGH_PLOT]>=l&&n[TradingView.LOW_PLOT]<=l)return{index:i,price:l};return null},n.prototype.axisPoints=function(){var e,t,i;if(!this._points[p.ActualEntry])return[];if(e=this._points[p.ActualEntry],t=null,4===this._points.length)t=this._points[p.ActualClose];else{if(!(i=this.lastBarData()))return[];t={index:i.index,price:i.closePrice}}return[e,t]},n.prototype.getInputsPropertyPage=function(){return d.LineToolRiskRewardInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return d.LineToolRiskRewardStylesPropertyPage},inherit(o,n),o.prototype.i18nCache={title:$.t("Risk/Reward short")},o.prototype._recalculateQty=function(){var e,t,i,n,o;0!==this.points().length&&(e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),o=Math.floor(n/Math.abs(i-t)),e.qty.setValue(o))},o.prototype._recalculateAmount=function(){var e,t,i,n,o,r,s,a;0!==this.points().length&&(e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),o=e.stopPrice.value(),r=e.targetPrice.value(),s=this._roundValue(t+(i-r)*n),a=this._roundValue(t-(o-i)*n),e.amountTarget.setValue(s),e.amountStop.setValue(a))},
o.prototype.title=function(){return this.i18nCache.title},o.prototype.name=function(){return"Risk/Reward short"},o.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},o.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},o.prototype.calculatePL=function(e){return this.entryPrice()-e},o.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},o.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},o.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.HIGH_PLOT]>=t?this.stopPrice():e[TradingView.LOW_PLOT]<=i?this.profitPrice():null},r.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(r,n),r.prototype._recalculateQty=function(){var e,t,i,n,o;0!==this.points().length&&(e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),o=Math.floor(n/Math.abs(t-i)),e.qty.setValue(o))},r.prototype._recalculateAmount=function(){var e,t,i,n,o,r,s,a;0!==this.points().length&&(e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),o=e.stopPrice.value(),r=e.targetPrice.value(),s=this._roundValue(t+(r-i)*n),a=this._roundValue(t-(i-o)*n),e.amountTarget.setValue(s),e.amountStop.setValue(a))},r.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(e){return e-this.entryPrice()},r.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},r.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},r.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.LOW_PLOT]<=t?this.stopPrice():e[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},r.prototype.title=function(){return this.i18nCache.title},r.prototype.name=function(){return"Risk/Reward long"},t.LineToolRiskReward=n,t.LineToolRiskRewardLong=r,t.LineToolRiskRewardShort=o}).call(t,i(48).PriceRange)},function(e,t,i){"use strict";(function(e){function n(t,i,o){var r,s;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new c(o.properties().scalesProperties,r),this.m_rightPriceScale.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,this.m_rightPriceScale)),s=i.leftAxisProperties.state(),s.autoScale=!0,this.m_leftPriceScale=new c(o.properties().scalesProperties,s),
this.m_leftPriceScale.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,this.m_leftPriceScale)),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=o,this._tagsChanged=new e,this._destroyed=new e,this._leftPriceScaleRatioChanged=new e,this._rightPriceScaleRatioChanged=new e,this._leftPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_timeScale.barSpacingChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale),this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale),i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1}var o=i(272).ExecutionsPositionController,r=i(0).LineDataSource,s=i(48).PriceRange,a=i(28).PriceDataSource,l=i(4).getLogger("Chart.Pane"),c=i(177).PriceScale,h=i(121).scaleRatio,u=i(121).priceRangeByScaleRatio,d=i(121).barSpacingByScaleRatio;n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){var e,t;for(this._leftPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_timeScale.barSpacingChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange),
this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this.m_leftPriceScale.modeChanged().unsubscribeAll(this),this.m_rightPriceScale.modeChanged().unsubscribeAll(this),this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins),e=0;e<this.m_dataSources.length;e++)t=this.m_dataSources[e],t.destroy&&t.destroy();this._destroyed.fire()},n.prototype.setPaneSize=function(e){var t={large:1,medium:.6,small:.3,tiny:.15};if(!t[e])throw Error("Unknown size enum value: "+e);this._stretchFactor=t[e]*n.DEFAULT_STRETCH_FACTOR},n.sortSources=function(e){return e.map(function(e){var t,i,o=e._constructor;return isFunction(e.metaInfo)&&(o=e.metaInfo().id),i=n.sortSourcesPreOrdered[o]||0,t=i>0?1/0:i<0?-1/0:e.zorder(),[e,i,t]}).sort(function(e,t){return e[1]-t[1]||e[2]-t[2]}).map(function(e){return e[0]})},n.prototype._updateMargins=function(){var e,t,i=.01*this._properties.topMargin.value(),n=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(n),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(n),e=0;e<this.m_dataSources.length;e++)(t=this.m_dataSources[e])instanceof TradingView.Study&&this.isOverlay(t)&&"Volume"!==t.metaInfo().shortId&&t.priceScale()&&t.priceScale()!==this.m_leftPriceScale&&t.priceScale()===this.m_rightPriceScale&&(t.priceScale().setTopMargin(i),t.priceScale().setBottomMargin(n),this.recalculatePriceScale(t.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},n.prototype.model=function(){return this._model},n.prototype.width=function(){return this.m_width},n.prototype.height=function(){return this.m_height},n.prototype.setWidth=function(e){this.m_width=e,this.updateAllViews()},n.prototype.setHeight=function(e){var t,i;for(this.m_height=e,this.m_leftPriceScale.setHeight(e),this.m_rightPriceScale.setHeight(e),t=0;t<this.m_dataSources.length;t++)i=this.m_dataSources[t],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(e);this.updateAllViews()},n.prototype.leftPriceScale=function(){return this.m_leftPriceScale},n.prototype.rightPriceScale=function(){return this.m_rightPriceScale},n.prototype.timeScale=function(){return this.m_timeScale},n.prototype.dataSources=function(){return this.m_dataSources},n.prototype.isOverlay=function(e){return e._isOverlay},n.prototype._processMainSourceChange=function(){var e,t,i,o,s,l,c;if(null===this.m_mainDataSource)for(t=0;t<this.m_dataSources.length;t++)if(i=this.m_dataSources[t],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,e=!0;break}if(this.m_mainDataSource&&e){for(o=[],t=0;t<this.m_dataSources.length;t++)i=this.m_dataSources[t],TradingView.isInherited(i.constructor,r)&&o.push(i);for(o=n.sortSources(o),
t=0;t<o.length;t++)this.move(o[t],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(t=0;t<this.m_dataSources.length;t++)if(i=this.m_dataSources[t],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),i.setPriceScale(this.m_rightPriceScale),s=this._model.children(i),c=0;c<s.length;c++)l=s[c],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},n.prototype._newZOrderForLineTool=function(){var e,t,i,n=null;for(e=0;e<this.m_dataSources.length;++e)(t=this.m_dataSources[e])instanceof r&&(i=t.zorder(),(null===n||i>n)&&(n=i));return null===n&&(n=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(e){e.zorder()>n&&e.setZorder(e.zorder()+1)}),n+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(e,t,i){var n;e instanceof r&&!i?(n=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=n)):n=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(e,t,n)},n.prototype.insertDataSource=function(e,t,i){var o,r,s;this.m_dataSources.push(e),o=!1,e===this._model.mainSeries()?(this.m_mainDataSource=e,o=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=e,o=!0),e._isOverlay=!1,null!==t||e.preferNoScale()||this.canHaveMoreNoScaleSources()||(t=this.rightPriceScale()),null===t&&(r=this.m_rightPriceScale.topMargin(),s=this.m_rightPriceScale.bottomMargin(),e.metaInfo&&"Volume@tv-basicstudies"===e.metaInfo().id&&(r=.75,s=0),t=new c(this._model.properties().scalesProperties),t.setHeight(this.m_height),t.setTopMargin(r),t.setBottomMargin(s),e._isOverlay=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),e.onTagsChanged&&e.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),e.setZorder(i),o&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(e.constructor,a)&&this.recalculatePriceScale(t),this.invalidateSourcesCache()},n.prototype.removeDataSource=function(e,t){var i,o=this.m_dataSources.indexOf(e);if(-1===o)return void l.logDebug("removeDataSource: invalid data source");e._isOverlay=!1,this.m_dataSources.splice(o,1),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(e)?(this.m_leftPriceScale.removeDataSource(e),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(e)&&(this.m_rightPriceScale.removeDataSource(e),i=this.m_rightPriceScale),
e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(e.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(e.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(e,t){e.startScale(t)},n.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},n.prototype.endScalePrice=function(e){e.endScale()},n.prototype.startScrollPrice=function(e,t){e.startScroll(t)},n.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},n.prototype.endScrollPrice=function(e){e.endScroll()},n.prototype.setPriceAutoScale=function(e,t){if(e.setMode({autoScale:t}),this.timeScale().isEmpty())return void e.setPriceRange(null);this.recalculatePriceScale(e)},n.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},n.prototype.updateAllViews=function(){for(var e=0;e<this.m_dataSources.length;e++)this.m_dataSources[e].updateAllViews()},n.prototype.defaultPriceScale=function(){var e=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();return void 0===e&&(e=new c(this._model.properties().scalesProperties)),e},n.prototype._priceScaleIsPrice=function(e){var t=e.mainSource();return!!t&&(!!TradingView.isInherited(t.constructor,TradingView.Series)||!!TradingView.isInherited(t.constructor,TradingView.Study)&&t.metaInfo().is_price_study)},n.prototype.findSuitableScale=function(e){if(TradingView.isInherited(e.constructor,TradingView.Study)&&"Volume@tv-basicstudies"===e.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var t=!1;if(TradingView.isInherited(e.constructor,TradingView.Study)?t=e.metaInfo().is_price_study:TradingView.isInherited(e.constructor,TradingView.Series)&&(t=!0),t){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale},n.prototype.mainDataSource=function(){return this.m_mainDataSource},n.prototype.recalculatePriceScale=function(e){var t,i;e&&(t=e.sourcesForAutoscale(),e.isAutoScale()&&t&&t.length>0&&!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),e.recalculatePriceRange(i)),e.updatePaneViews())},n.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBars();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},n.prototype.recalculate=function(){var e,t;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),e=0;e<this.m_dataSources.length;e++)t=this.m_dataSources[e],!this.isOverlay(t)||t instanceof r||this.recalculatePriceScale(t.priceScale());this.updateAllViews(),this._model.updatePane(this)},n.prototype.isEmpty=function(){return null===this.m_mainDataSource},
n.prototype.move=function(e,t,i){var n=this.m_dataSources.slice(),o=null!==t;this.removeDataSource(e,o),this.addDataSource(e,t,i),this.m_dataSources=n,this.invalidateSourcesCache()},n.prototype.dataSourceForId=function(e){for(var t=0;t<this.m_dataSources.length;t++)if(this.m_dataSources[t].id()===e)return this.m_dataSources[t];return null},n.prototype.priceScaleForSource=function(e){return-1!==this.rightPriceScale().dataSources().indexOf(e)?this.rightPriceScale():-1!==this.leftPriceScale().dataSources().indexOf(e)?this.leftPriceScale():null},n.prototype.sourceById=function(e){for(var t=0;t<this.m_dataSources.length;t++)if(this.m_dataSources[t].id()===e)return this.m_dataSources[t];return null},n.prototype.containsMainSeries=function(){return-1!==this.m_dataSources.indexOf(this._model.mainSeries())},n.prototype.priceScaleByName=function(e){return"left"===e?this.m_leftPriceScale:"right"===e?this.m_rightPriceScale:null},n.prototype.priceScaleName=function(e){return e===this.m_leftPriceScale?"left":e===this.m_rightPriceScale?"right":""},n.prototype.hitTestSources=function(){var e,t,i,n,o;if(this._cachedHitTestSources)return this._cachedHitTestSources;for(e=this.orderedSources(),t=[],i=[this._model.crossHairSource()],n=0;n<e.length;n++)o=e[n],TradingView.isInherited(o.constructor,r)?t.push(o):i.push(o);return this._cachedHitTestSources=i.concat(t),this._cachedHitTestSources},n.prototype.orderedSources=function(){var e,t,i,o;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(e=[],t=0,i=this.m_dataSources.length;t<i;t++)o=this.m_dataSources[t],TradingView.isInherited(o.constructor,r)&&!o.isActualSymbol()||e.push(o);return e=n.sortSources(e),this._cachedOrderedSoruces=e,e},n.prototype.createDrawingsCaches=function(){o.recreateOrderedByBarsSourcesCache(this)},n.prototype.clearDrawingCaches=function(){o.clearOrderedByBarsSourcesCache()},n.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null,this._cachedHitTestSources=null,this.m_leftPriceScale.invalidateSourcesCache(),this.m_rightPriceScale.invalidateSourcesCache()},n.prototype.getZOrderMinMax=function(){var e,t,i,n,o=this.orderedSources();if(0===o.length)return{minZOrder:0,maxZOrder:0};for(e=o[0].zorder(),t=o[0].zorder(),i=1;i<o.length;i++)n=o[i],n.zorder()<e&&(e=n.zorder()),n.zorder()>t&&(t=n.zorder());return{minZOrder:e,maxZOrder:t}},n.prototype.isZOrderAvailable=function(e){var t,i;for(t=0;t<this.m_dataSources.length;t++)if(i=this.m_dataSources[t],i.zorder()===e)return!1;return!0},n.prototype.sendToBack=function(e){var t,i=this.getZOrderMinMax().minZOrder,n=Math.abs(e.zorder()-i);for(t=0;t<n;t++)this.changeZOrder(e,-1)},n.prototype.bringToFront=function(e){var t,i=this.getZOrderMinMax().maxZOrder,n=Math.abs(e.zorder()-i);for(t=0;t<n;t++)this.changeZOrder(e,1)},n.prototype.changeZOrder=function(e,t){var i,n,o,r,s,a=this.orderedSources().filter(function(e){return e.showInObjectTree()}),l=0;for(i=0,n=a.length;i<n;i++)if(a[i]===e){l=i;break}l>0&&t<0?(o=a[l-1].zorder(),r=e.zorder(),a[l-1].setZorder(r),
e.setZorder(o)):l<a.length-1&&t>0&&(s=a[l+1].zorder(),r=e.zorder(),a[l+1].setZorder(r),e.setZorder(s)),this.invalidateSourcesCache()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.onDestroyed=function(){return this._destroyed},n.prototype.dumpPriceScale=function(e){var t,i,n,o=e.dataSources(),r=[];for(t=0;t<o.length;t++)if(i=o[t].priceAxisViews(this,e))for(n=0;n<i.length;n++)r.push(i[n].dump());return r},n.prototype.dumpViews=function(){var e,t,i,n,o,r={};for(r.paneViews={},e=this.orderedSources(),t=0;t<e.length;t++)if(i=e[t],r.paneViews[t]=[],n=i.paneViews())for(o=0;o<n.size();o++)r.paneViews[t].push(n.item(t).dump());return r.leftAxis=this.dumpPriceScale(this.m_leftPriceScale),r.rightAxis=this.dumpPriceScale(this.m_rightPriceScale),r},n.prototype.clearSeries=function(){for(var e=this.m_dataSources.length-1;e>=0;e--)TradingView.isInherited(this.m_dataSources[e].constructor,TradingView.Series)&&this.m_dataSources.splice(e,1)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,a)&&e.showInObjectTree()&&!e.isNoScale())}).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,a))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new o(this,this._model.timeScale())),this._executionsPositionController},n.prototype.isLast=function(){var e=this._model.panes();return e[e.length-1]===this},n.prototype.setMaximized=function(e){this._maximized=e},n.prototype.isMaximized=function(){return this._maximized},n.prototype.isMainPane=function(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach(function(i){t||(t=i===e)}),this._isMainPane=t,t},n.prototype.properties=function(){return this._properties},n.prototype._mainSourceVisiblePriceRange=function(e){var t=this.m_timeScale.visibleBars();return null!==t?e.mainSource().priceRange(t.firstBar(),t.lastBar()):new s(-.5,.5)},n.prototype.applyLeftPriceScaleRatio=function(e){this._lastLeftPriceScaleRatio!==e&&(this._setNewPriceRangeByScaleRatio(this.m_leftPriceScale,e,this._mainSourceVisiblePriceRange(this.m_leftPriceScale),!0,!0),this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale)))},n.prototype.applyRightPriceScaleRatio=function(e){this._lastRightPriceScaleRatio!==e&&(this._setNewPriceRangeByScaleRatio(this.m_rightPriceScale,e,this._mainSourceVisiblePriceRange(this.m_rightPriceScale),!0,!0),this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale)))},n.prototype.isLeftPriceScaleLocked=function(){return!this.m_leftPriceScale.isLog()&&this.m_leftPriceScale.isLockScale()},
n.prototype.isRightPriceScaleLocked=function(){return!this.m_rightPriceScale.isLog()&&this.m_rightPriceScale.isLockScale()},n.prototype.leftPriceScaleRatio=function(){return null===this._lastLeftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale)),this._lastLeftPriceScaleRatio},n.prototype.rightPriceScaleRatio=function(){return null===this._lastRightPriceScaleRatio&&(this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale)),this._lastRightPriceScaleRatio},n.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&(this._lastLeftPriceScaleRatio=null,this._lastRightPriceScaleRatio=null,this._model.mainSeriesScaleRatioPropertyOnChanged())},n.prototype._applyOldScaleRatioToPriceScale=function(e,t){if(this._isRecalculatingScales||null===t||void 0===t)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e)),this._isRecalculatingScales=!1},n.prototype._applyOldScaleRatioToTimeScale=function(e,t){if(this._isRecalculatingScales||null===t||void 0===t)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(e,t),this._isRecalculatingScales=!1},n.prototype._tryToApplyNewLeftPriceScaleRatio=function(e){if(this._lastLeftPriceScaleRatio===e||this.m_leftPriceScale.isLog())return!1;this._leftPriceScaleRatioChanged.fire(this._lastLeftPriceScaleRatio,e),this._lastLeftPriceScaleRatio=e},n.prototype._tryToApplyNewRightPriceScaleRatio=function(e){if(this._lastRightPriceScaleRatio===e||this.m_rightPriceScale.isLog())return!1;this._rightPriceScaleRatioChanged.fire(this._lastRightPriceScaleRatio,e),this._lastRightPriceScaleRatio=e},n.prototype._recalculatePriceScaleByScaleRatio=function(){this.isMainPane()&&(this.m_leftPriceScale.mainSource()&&(this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))),this.m_rightPriceScale.mainSource()&&(this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))))},n.prototype._recalculateTimeScaleByLeftScaleRatio=function(){this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))},n.prototype._recalculateTimeScaleByRightScaleRatio=function(){this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))},n.prototype._setNewPriceRangeByScaleRatio=function(e,t,i,n,o){var r=u(e,this.m_timeScale.barSpacing(),t)
;e.setPriceRange(null!==r?r:i,n,o)},n.prototype._setMinMaxPriceRange=function(e,t){var i=u(e,this.m_timeScale.maxBarSpacing(),t),n=u(e,this.m_timeScale.minBarSpacing(),t);null!==i&&e.setMaxPriceRange(i),null!==n&&e.setMinPriceRange(n)},n.prototype._onLeftPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_leftPriceScale,this._lastLeftPriceScaleRatio)},n.prototype._onRightPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_rightPriceScale,this._lastRightPriceScaleRatio)},n.prototype._setNewBarSpacingByScaleRatio=function(e,t){var i=this.m_timeScale.getValidBarSpacing(d(e,t));this.m_timeScale.isValidBarSpacing(i)&&this.m_timeScale.setBarSpacing(i)},n.prototype._onPriceScaleModeChanged=function(e,t,i){if(t.percentage!==i.percentage||t.indexedTo100!==i.indexedTo100){var n=this.timeScale().visibleBars();null!==n&&(e.recalculatePriceRange(n),e.updatePaneViews())}},t.Pane=n}).call(t,i(8))},function(e,t,i){"use strict";(function(e,n){function o(e,t){return t<0&&(e=-e),e/100*t+t}function r(e,t){var i=100*(e-t)/t;return t<0?-i:i}function s(e,t){var i=r(e.minValue(),t),n=r(e.maxValue(),t);return new S(i,n)}function a(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}function l(e,t){var i=100*(e-t)/t+100;return t<0?-i:i}function c(e,t){var i=l(e.minValue(),t),n=l(e.maxValue(),t);return new S(i,n)}function h(e,t){if(this.m_base=e,this.m_integralDividers=t,this.m_fractionalDividers=[],_.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function u(e,t,i,n){this.m_marks=[],this.m_base=t,this.m_priceScale=e,this._currentFormatBase=0,this._coordinateToLogicalFunc=i,this._logicalToCoordinateFunc=n}function d(t,i){var o;i=Object.assign({},p,i),this._properties=new e(i),this._scalesProperties=t,this.m_height=0,this._internalHeightCache=null,this._internalHeightChanged=new n,this.m_priceRange=null,this._priceRangeChanged=new n,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new n,o=this,this._coordinateToLogicalFunc=function(e,t){return o._coordinateToLogical(e,t)},this._logicalToCoordinateFunc=function(e,t,i){return o._logicalToCoordinate(e,t,i)},this.m_markBuilder=new u(this,100,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this._modeChanged=new n,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,o=this,this._properties.listeners().subscribe(null,function(){o.mainSource()&&o.mainSource().model()&&o.mainSource().model().fullUpdate()}),this._scalesProperties.listeners().subscribe(this,function(){
this._marksCache=null})}var p,_=i(50),f=i(0).LineDataSource,m=i(28).PriceDataSource,y=i(63).Series,g=i(21).PriceFormatter,v=i(70).PercentageFormatter,S=i(48).PriceRange;h.prototype.TICK_SPAN_EPSILON=1e-9,h.prototype.tickSpan=function(e,t,i){var n,o=0===this.m_base?0:1/this.m_base,r=this.TICK_SPAN_EPSILON,s=Math.pow(10,Math.max(0,Math.ceil(_.log10(e-t)))),a=0;for(a=0,n=this.m_integralDividers[0];s>o+r&&_.greaterOrEqual(s,o,r)&&_.greaterOrEqual(s,i*n,r)&&_.greaterOrEqual(s,1,r);++a,n=this.m_integralDividers[a%this.m_integralDividers.length])s/=n;if(s<=o+r&&(s=o),s=Math.max(1,s),this.m_fractionalDividers.length>0&&_.equal(s,1,r))for(a=0,n=this.m_fractionalDividers[0];s>o+r&&_.greaterOrEqual(s,i*n,r);++a,n=this.m_fractionalDividers[a%this.m_fractionalDividers.length])s/=n;return s},u.prototype.TICK_DENSITY=2.5,u.prototype.base=function(){return this.m_base},u.prototype.setBase=function(e){if(e<0)throw new RangeError("base < 0");this.m_base=e},u.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},u.prototype.tickSpan=function(e,t){var i,n,o,r,s,a,l;if(e<t)throw new RangeError("high < low");return i=this.m_priceScale.height(),n=this.tickMarkHeight(),o=(e-t)*n/i,r=new h(this.m_base,[2,2.5,2]),s=new h(this.m_base,[2,2,2.5]),a=new h(this.m_base,[2.5,2,2]),l=[],l.push(r.tickSpan(e,t,o)),l.push(s.tickSpan(e,t,o)),l.push(a.tickSpan(e,t,o)),_.min(l)},u.prototype.tickMarkHeight=function(){return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},u.prototype.rebuildTickMarks=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d=this.m_priceScale;if(null===d)throw new TypeError("scale is null");if(d.isEmpty())return void(this.m_marks=[]);if(null===(e=d.mainSource()))return void(this.m_marks=[]);if(t=e.firstValue(),i=d.height(),n=this._coordinateToLogicalFunc(i-1,t),o=this._coordinateToLogicalFunc(0,t),o=Math.max(o,n),n=Math.min(o,n),o!==n)for(r=this.tickSpan(o,n),s=o%r,s+=s<0?r:0,this.m_marks=[],a=o>=n?1:-1,l=null,c=d.formatter(),h=o-s;h>n;h-=r)u=this._logicalToCoordinateFunc(h,t,!0),null!==l&&Math.abs(u-l)<this.tickMarkHeight()||(this.m_marks.push({coord:Math.round(u),label:c.format(h)}),l=u,d.isLog()&&(r=this.tickSpan(h*a,n)))},u.prototype.marks=function(){return this.m_marks},p={autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0,indexedTo100:!1},d.prototype.initScaleProperties=function(){var e=this.isLockScale();e&&(this.properties().percentage.setValue(!1),this.properties().indexedTo100.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1)),this.properties().percentageDisabled.setValue(e),this.properties().logDisabled.setValue(e),this.properties().autoScaleDisabled.setValue(this.properties().percentage.value()||this.properties().indexedTo100.value()),this.properties().percentage.value()&&(this.properties().log.setValue(!1),this.properties().indexedTo100.setValue(!1)),this.properties().indexedTo100.value()&&(this.properties().log.setValue(!1),this.properties().percentage.setValue(!1))},d.prototype.isAutoScale=function(){
return this._properties.autoScale.value()&&!this.isLockScale()},d.prototype.isLockScale=function(){return this._properties.lockScale.value()},d.prototype.isLog=function(){return this._properties.log.value()},d.prototype.isPercentage=function(){return this._properties.percentage.value()},d.prototype.isIndexedTo100=function(){return this._properties.indexedTo100.value()},d.prototype._convertPriceRangeFromLog=function(e){var t,i;return null===e?null:(t=this._fromLog(e.minValue()),i=this._fromLog(e.maxValue()),new S(t,i))},d.prototype._convertPriceRangeToLog=function(e){var t,i;return null===e?null:(t=this._toLog(e.minValue()),i=this._toLog(e.maxValue()),new S(t,i))},d.prototype._canConvertPriceRangeFromLog=function(e){var t,i;return null!==e&&(t=this._fromLog(e.minValue()),i=this._fromLog(e.maxValue()),isFinite(t)&&isFinite(i))},d.prototype._setAutoScaleValueWithDependentProperties=function(e){!e&&this._properties.autoScale.value()&&this._properties.percentage.value()&&(this._properties.percentage.setValueSilently(e),this._properties.indexedTo100.setValueSilently(e)),this._properties.autoScale.setValueSilently(e),this._properties.lockScale.value()&&e&&(this._properties.lockScale.setValueSilently(!1),this._properties.percentageDisabled.setValueSilently(!1),this._properties.logDisabled.setValueSilently(!1))},d.prototype._setLockScaleValueWithDependentProperties=function(e){this._properties.lockScale.setValueSilently(e),e&&(this._properties.autoScale.setValueSilently(!1),this._properties.percentage.setValueSilently(!1),this._properties.indexedTo100.setValueSilently(!1),this._properties.log.setValueSilently(!1),this._properties.autoScaleDisabled.setValueSilently(!e)),this._properties.percentageDisabled.setValueSilently(e),this._properties.logDisabled.setValueSilently(e)},d.prototype._setPercentageValueWithDependentProperties=function(e){this._properties.percentage.setValueSilently(e),this._properties.autoScaleDisabled.setValueSilently(e),e&&this._properties.autoScale.setValueSilently(!0),this._properties.log.value()&&e&&this._properties.log.setValueSilently(!1),this._properties.lockScale.value()&&e&&this._properties.lockScale.setValueSilently(!1),this._properties.indexedTo100.value()&&e&&this._properties.indexedTo100.setValueSilently(!1)},d.prototype._setIndexedTo100ValueWithDependentProperties=function(e){this._properties.indexedTo100.setValueSilently(e),this._properties.autoScaleDisabled.setValueSilently(e),e&&this._properties.autoScale.setValueSilently(!0),this._properties.log.value()&&e&&this._properties.log.setValueSilently(!1),this._properties.lockScale.value()&&e&&this._properties.lockScale.setValueSilently(!1),this._properties.percentage.value()&&e&&this._properties.percentage.setValueSilently(!1)},d.prototype._setLogValueWithDependentProperties=function(e){this._properties.log.setValueSilently(e),this._properties.percentage.value()&&e&&(this._properties.percentage.setValueSilently(!1),this._properties.autoScaleDisabled.setValueSilently(!1)),
this._properties.lockScale.value()&&e&&this._properties.lockScale.setValueSilently(!1),this._properties.indexedTo100.value()&&e&&this._properties.indexedTo100.setValueSilently(!1)},d.prototype.mode=function(){return{autoScale:this._properties.autoScale.value(),lockScale:this._properties.lockScale.value(),percentage:this._properties.percentage.value(),indexedTo100:this._properties.indexedTo100.value(),log:this._properties.log.value()}},d.prototype.setMode=function(e){var t={},i=this.mode(),n=null;void 0!==e.autoScale&&e.autoScale!==i.autoScale&&(t.autoScale=e.autoScale,this._setAutoScaleValueWithDependentProperties(e.autoScale)),void 0!==e.lockScale&&e.lockScale!==i.lockScale&&(t.lockScale=e.lockScale,this._setLockScaleValueWithDependentProperties(e.lockScale)),void 0!==e.percentage&&e.percentage!==i.percentage&&(t.percentage=e.percentage,this._setPercentageValueWithDependentProperties(e.percentage)),void 0!==e.indexedTo100&&e.indexedTo100!==i.indexedTo100&&(t.indexedTo100=e.indexedTo100,this._setIndexedTo100ValueWithDependentProperties(e.indexedTo100)),void 0!==e.log&&e.log!==i.log&&(t.log=e.log,this._setLogValueWithDependentProperties(e.log)),i.log&&!this._properties.log.value()&&(this._canConvertPriceRangeFromLog(this.m_priceRange)?null!==(n=this._convertPriceRangeFromLog(this.m_priceRange))&&this.setPriceRange(n):this.properties().autoScale.setValue(!0)),!i.log&&this._properties.log.value()&&null!==(n=this._convertPriceRangeToLog(this.m_priceRange))&&this.setPriceRange(n),i.autoScale!==this._properties.autoScale.value()&&this._properties.autoScale.listeners().fire(this._properties.autoScale),i.autoScaleDisabled!==this._properties.autoScaleDisabled.value()&&this._properties.autoScaleDisabled.listeners().fire(this._properties.autoScaleDisabled),i.lockScale!==this._properties.lockScale.value()&&this._properties.lockScale.listeners().fire(this._properties.lockScale),i.percentage!==this._properties.percentage.value()&&(this._properties.percentage.listeners().fire(this._properties.percentage),this.updateFormatter()),i.indexedTo100!==this._properties.indexedTo100.value()&&(this._properties.indexedTo100.listeners().fire(this._properties.indexedTo100),this.updateFormatter()),i.percentageDisabled!==this._properties.percentageDisabled.value()&&this._properties.percentageDisabled.listeners().fire(this._properties.percentageDisabled),i.log!==this._properties.log.value()&&this._properties.log.listeners().fire(this._properties.log),i.logDisabled!==this._properties.logDisabled.value()&&this._properties.logDisabled.listeners().fire(this._properties.logDisabled),void 0===t.log&&void 0===t.percentage&&void 0===t.lockScale&&void 0===t.autoScale&&void 0===t.percentage||this._modeChanged.fire(i,this.mode())},d.prototype.modeChanged=function(){return this._modeChanged},d.prototype.properties=function(){return this._properties},d.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},d.prototype.height=function(){return this.m_height},d.prototype.setHeight=function(e){this.m_height!==e&&(this.m_height=e,
this._invalidateInternalHeightCache(),this._marksCache=null)},d.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)},d.prototype.setTopMargin=function(e){if(!isNumber(e))throw new TypeError("invalid margin");if(e<0||e>30)throw new RangeError("invalid margin");this.m_topMargin!==e&&(this.m_topMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},d.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},d.prototype.setBottomMargin=function(e){if(!isNumber(e))throw new TypeError("invalid margin");if(e<0||e>30)throw new RangeError("invalid margin");this.m_bottomMargin!==e&&(this.m_bottomMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},d.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var e=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=e,e},d.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()},d.prototype.internalHeightChanged=function(){return this._internalHeightChanged},d.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},d.prototype.priceRangeChanged=function(){return this._priceRangeChanged},d.prototype.setPriceRange=function(e,t,i){var n,o,r;if(!(e instanceof S))throw new TypeError("incorrect price range");return n=this.m_priceRange,!!(t||null===n&&null!==e||null!==n&&!n.equals(e))&&(o=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(e),r=null!==this.m_minPriceRange&&e.containsStrictly(this.m_minPriceRange),!(this.isLockScale()&&!t&&(o||r))&&(this._marksCache=null,this.m_priceRange=e,void(i||this._priceRangeChanged.fire(n,e))))},d.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},d.prototype.invertedCoordinate=function(e){return this.height()-1-e},d._logicalOffset=4,d._coordOffset=1e-4,d.prototype._toLog=function(e){var t,i=Math.abs(e);return i<1e-8?0:(t=_.log10(i+d._coordOffset)+d._logicalOffset,e<0?-t:t)},d.prototype.priceToLogical=function(e){return this.isLog()&&e?this._toLog(e):e},d.prototype._fromLog=function(e){var t,i=Math.abs(e);return i<1e-8?0:(t=Math.pow(10,i-d._logicalOffset)-d._coordOffset,e<0?-t:t)},d.prototype.logicalToPrice=function(e){return this.isLog()?this._fromLog(e):e},d.prototype._logicalToCoordinate=function(e,t,i){var n,o;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.priceToLogical(e),n=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(e-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(n),i?o:Math.round(o))},d.prototype.priceToCoordinate=function(e,t,i){return this.isPercentage()?e=r(e,t):this.isIndexedTo100()&&(e=l(e,t)),this._logicalToCoordinate(e,t,i)},d.prototype.pointsArrayToCoordinates=function(e,t){var i,n,o,s,a,c,h,u,d;if(this.makeSureItIsValid(),i=this.bottomMargin()*this.height(),
n=this.priceRange().minValue(),o=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(o-n),this.isPercentage())for(c=0;c<e.length;c++)e[c].y=r(e[c].y,t);if(this.isIndexedTo100())for(c=0;c<e.length;c++)e[c].y=l(e[c].y,t);if(this.isLog())for(c=0;c<e.length;c++)e[c].y=this.priceToLogical(e[c].y);for(c=0;c<e.length;c++)h=e[c].y,TradingView.isNaN(h)||void 0===h||null===h||(u=i+a*(h-n),d=this.m_height-1-u,e[c].y=Math.round(d))},d.prototype.pricesArrayToCoordinates=function(e,t){var i,n,o,s,a,c,h,u,d;if(this.makeSureItIsValid(),i=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),o=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(o-n),this.isPercentage())for(c=0;c<e.length;c++)e[c]=r(e[c],t);if(this.isIndexedTo100())for(c=0;c<e.length;c++)e[c]=l(e[c],t);if(this.isLog())for(c=0;c<e.length;c++)e[c]=this.priceToLogical(e[c]);for(c=0;c<e.length;c++)void 0!==(h=e[c])&&null!==h&&(u=i+a*(h-n),d=this.m_height-1-u,e[c]=Math.round(d))},d.prototype.barPricesToCoordinates=function(e,t){var i,n,o,s,a,c,h,u,d,p,_,f;if(this.makeSureItIsValid(),i=e,n=this.bottomMargin()*this.height(),o=this.priceRange().minValue(),s=this.priceRange().maxValue(),a=this.internalHeight()-1,c=null,this.isPercentage()?c=r:this.isIndexedTo100()?c=l:this.isLog()&&(c=function(e){return e?this._toLog(e):e}.bind(this)),null!==c)for(h=0;h<i.length;h++)i[h]&&(i[h].open=c(i[h].open,t),i[h].high=c(i[h].high,t),i[h].low=c(i[h].low,t),i[h].close=c(i[h].close,t),i[h].additionalPrice&&(i[h].additionalPrice=c(i[h].additionalPrice,t)));for(u=a/(s-o),h=0;h<i.length;h++)(d=i[h])&&(p=d.open,_=n+u*(p-o),f=this.m_height-1-_,d.open=Math.round(f),p=d.high,_=n+u*(p-o),f=this.m_height-1-_,d.high=Math.round(f),p=d.low,_=n+u*(p-o),f=this.m_height-1-_,d.low=Math.round(f),p=d.close,_=n+u*(p-o),f=this.m_height-1-_,d.close=Math.round(f),d.additionalPrice&&(p=d.additionalPrice,_=n+u*(p-o),f=this.m_height-1-_,d.additionalPrice=Math.round(f)))},d.prototype._coordinateToLogical=function(e,t){var i,n;return this.makeSureItIsValid(),this.isEmpty()?0:(i=this.invertedCoordinate(e),n=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((i-this.bottomMargin()*this.height())/(this.internalHeight()-1)),this.logicalToPrice(n))},d.prototype.coordinateToPrice=function(e,t){var i=this._coordinateToLogical(e,t);return this.isPercentage()?i=o(i,t):this.isIndexedTo100()&&(i=a(i,t)),i},d.prototype.dataSources=function(){return this.m_dataSources},d.prototype.orderedSources=function(){var e,t,n,o;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(e=[],t=0;t<this.m_dataSources.length;t++)n=this.m_dataSources[t],null==n.zorder()&&n.setZorder(t+1),e.push(n);return o=i(176).Pane,e=o.sortSources(e),this._cachedOrderedSoruces=e,this._cachedOrderedSoruces},d.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null},d.prototype.hasSeries=function(){return this._hasSeries},d.prototype.addDataSource=function(e,t){var i,n
;(t||-1===this.m_dataSources.indexOf(e))&&(TradingView.isInherited(e.constructor,y)&&(i=e.properties(),!0!==this._hasSeries&&(i.lockScale&&(this.setMode({lockScale:i.lockScale.value()}),i.removeProperty("lockScale")),i.pnfStyle.lockScale&&i.pnfStyle.removeProperty("lockScale")),this._hasSeries=!0),n=this,e.properties().visible.listeners().subscribe(null,function(){n._sourcesForAutoscale=null}),this.m_dataSources.push(e),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.initScaleProperties(),this.invalidateSourcesCache())},d.prototype.removeDataSource=function(e){var t=this.m_dataSources.indexOf(e);if(-1===t)throw Error("source is not attached to scale");this.m_dataSources.splice(t,1),TradingView.isInherited(e.constructor,y)&&(this._hasSeries=!1),this.mainSource()||this.setMode({autoScale:!0}),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache()},d.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint},d.prototype.startScale=function(e){this.isPercentage()||this.isIndexedTo100()||null===this.m_scaleStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=this.m_height-e,this.m_priceRangeSnapshot=this.priceRange().clone()))},d.prototype.marks=function(){return this._marksCache?this._marksCache:(this.m_markBuilder.rebuildTickMarks(),this._marksCache=this.m_markBuilder.marks(),this.onMarksChanged.fire(),this._marksCache)},d.prototype.setMaxPriceRange=function(e){this.m_maxPriceRange=e},d.prototype.setMinPriceRange=function(e){this.m_minPriceRange=e},d.prototype.scaleTo=function(e){var t,i;this.isPercentage()||this.isIndexedTo100()||null!==this.m_scaleStartPoint&&(this.setMode({autoScale:!1}),e=this.m_height-e,e<0&&(e=0),t=(this.m_scaleStartPoint+.2*(this.m_height-1))/(e+.2*(this.m_height-1)),i=this.m_priceRangeSnapshot.clone(),t=Math.max(t,.1),i.scaleAroundCenter(t),this.setPriceRange(i))},d.prototype.endScale=function(){this.isPercentage()||this.isIndexedTo100()||null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null)},d.prototype.startScroll=function(e){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=e,this.m_priceRangeSnapshot=this.priceRange().clone()))},d.prototype.scrollTo=function(e){var t,i,n,o;this.isAutoScale()||null!==this.m_scrollStartPoint&&(t=this.priceRange().length()/(this.height()-1),i=e-this.m_scrollStartPoint,n=i*t,o=this.m_priceRangeSnapshot.clone(),o.shift(n),this.setPriceRange(o,!0),this._marksCache=null)},d.prototype.endScroll=function(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_priceRangeSnapshot=null)},d.prototype.state=function(){var e={};return e.m_priceRange=!this.priceRange()||this.isPercentage()||this.isIndexedTo100()?null:this.priceRange().serialize(),e.m_isAutoScale=this.isAutoScale(),
e.m_isPercentage=this._properties.percentage.value(),e.m_isIndexedTo100=this._properties.indexedTo100.value(),e.m_isLog=this._properties.log.value(),e.m_isLockScale=this.isLockScale(),e.m_height=this.m_height,e.m_topMargin=this.m_topMargin,e.m_bottomMargin=this.m_bottomMargin,e},d.prototype.restoreState=function(e){var t,i=e.m_priceRange;if(void 0===i)throw new TypeError("invalid state");if(void 0===e.m_isAutoScale)throw new TypeError("invalid state");t={autoScale:e.m_isAutoScale},void 0!==e.m_isPercentage&&(t.percentage=e.m_isPercentage),void 0!==e.m_isIndexedTo100&&(t.indexedTo100=e.m_isIndexedTo100),void 0!==e.m_isLog&&(t.log=e.m_isLog),void 0!==e.m_isLockScale&&(t.lockScale=e.m_isLockScale),i?(i instanceof S||(i=new S(i)),this.setPriceRange(i,!0)):this.m_priceRange=null,void 0!==e.m_height&&this.setHeight(Math.max(0,e.m_height)),this.setMode(t),void 0!==e.m_topMargin&&(this.m_topMargin=e.m_topMargin),void 0!==e.m_bottomMargin&&(this.m_bottomMargin=e.m_bottomMargin),this._mainSource=void 0,this._scaleSeriesOnly=!1},d.prototype.mainSource=function(){var e,t;if(void 0!==this._mainSource)return this._mainSource;for(e=void 0,t=0;t<this.m_dataSources.length;t++){if(TradingView.isInherited(this.m_dataSources[t].constructor,y)){e=this.m_dataSources[t];break}!e&&TradingView.isInherited(this.m_dataSources[t].constructor,m)&&(e=this.m_dataSources[t])}return this._mainSource=e,this._mainSource||null},d.prototype.formatter=function(){return this._formatter||this.updateFormatter(),this._formatter},d.prototype.formatPrice=function(e,t){return this.isPercentage()?e=r(e,t):this.isIndexedTo100()&&(e=l(e,t)),this.formatter().format(e)},d.prototype.updateFormatter=function(){var e,t;this._marksCache=null,e=this.mainSource(),t=100,e&&(t=e.base()),this._formatter=null,this.isPercentage()?(this._formatter=new v,t=100):this.isIndexedTo100()?(this._formatter=new g(100,1),t=100):this._formatter=e?e.formatter():new g(100,1),this.m_markBuilder=new u(this,t,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this.m_markBuilder.rebuildTickMarks()},d.prototype._recalculateSourcesForAutoscale=function(){var e,t;this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.scaleSeriesOnly.value()),e=this._scaleSeriesOnly&&this._hasSeries,t=function(t){return!!(t.properties().visible.value()||t instanceof y)&&(e?TradingView.isInherited(t.constructor,y):TradingView.isInherited(t.constructor,m))},this._sourcesForAutoscale=this.m_dataSources.filter(t)},d.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},d.prototype.recalculatePriceRange=function(e){this._invalidatedForRange={visibleBars:e,isValid:!1}},d.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},d.prototype.recalculatePriceRangeImpl=function(){
var e,t,i,n,o,r,a,l,h,u,d,p,_=this._invalidatedForRange.visibleBars;if(null!==_){for(e=null,t=this.sourcesForAutoscale(),i=0,n=0,o=this.isPercentage(),r=this.isIndexedTo100(),a=0;a<t.length;a++)l=t[a],l.properties().visible.value()&&(h=_.firstBar(),u=_.lastBar(),d=l.priceRange(h,u),d&&(o?d=s(d,l.firstValue()):r&&(d=c(d,l.firstValue())),e=null===e?d:e.merge(d)),l.margins&&(p=l.margins(),i=Math.max(p[0],i),n=Math.max(p[1],n)));(Math.abs(n-this._studyBottomMargin)>.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=n,this._studyTopMargin=i,this._marksCache=null,this._invalidateInternalHeightCache()),e?(e.minValue()===e.maxValue()&&(e=new S(e.minValue()-.5,e.maxValue()+.5)),this.setPriceRange(e)):this.m_priceRange||this.setPriceRange(new S(-.5,.5)),this._invalidatedForRange.isValid=!0}},d.prototype.sourcesToUpdateViews=function(){var e,t;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],e=0;e<this.m_dataSources.length;e++)t=this.m_dataSources[e],TradingView.isInherited(t.constructor,f)&&!t.isActualSymbol()||this._sourcesToUpdateViews.push(t);return this._sourcesToUpdateViews},d.prototype.updatePaneViews=function(){var e,t=this.sourcesToUpdateViews();for(e=0;e<t.length;e++)t[e].updateAllViews()},d.prototype.priceRangeInPrice=function(){var e,t,i,n,o;return this.isEmpty()?null:null===(e=this.mainSource())?null:(t=e.firstValue(),i=this.height(),n=this.coordinateToPrice(i-1,t),o=this.coordinateToPrice(0,t),{from:n,to:o})},t.PriceScale=d}).call(t,i(13),i(8))},function(e,t,i){"use strict";var n,o,r,s;i.d(t,"a",function(){return s}),n=i(6),i.n(n),o=i(109),r=i(84),s=function(){function e(e){this._lineRendererData={width:0,height:0,points:[new n.Point(0,0)],color:"rgba(0, 0, 0, 0)",linewidth:1,linestyle:r.LINESTYLE_SOLID,visible:!1},this._lineRenderer=new o.HorizontalLineRenderer,this._invalidated=!0,this._series=e,this._model=e.model(),this._lineRenderer.setData(this._lineRendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._lineRenderer},e}()},function(e,t,i){"use strict";function n(e,t,i){this.source=e,this.pane=t,this._rendererFactory=i}function o(e,t){this._barWidth=e.barWidth,this._plates=e.plates,this._tooltip=e.tooltip,this._model=t}function r(){this._layout=[],this._currentId=void 0,this.tooltipHovered=!1}var s=i(6).Point,a=i(60).pointInCircle,l=i(9).HitTestResult;n.prototype.update=function(){},n.prototype.renderer=function(){return this._rendererFactory(this.source)},o.prototype.draw=function(e){e.save();for(var t=0;t<this._plates.length;t++)if(this._plates[t].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,e)),this._tooltip.draw(this._plates.map(function(e){return this._plateTransform(e)}.bind(this)),e),this._tooltip.endDraw(),e.restore()},o.prototype._drawItem=function(e,t){e.save(),this._highlightByAuthor&&!t.highlightByAuthor&&(e.globalAlpha=.4);var i=this._dotTransform(t)
;i.mine?this._drawTriangle(e,i):this._drawDot(e,i),e.restore()},o.prototype._commonTransform=function(e){var t=Math.max(1.4*e.minSize,this._barWidth+4),i=e.y+{up:-1,down:1}[e.direction]*(t*(e.order+.6)+.25*t),n=TradingView.clone(e.overridedTheme||this.themes[e.theme]);return n.dotBorderWidth=e.hovered||e.highlightByAuthor?4:2,{id:e.id,theme:n,themeName:e.theme,x:Math.round(e.x+1),y:Math.round(i),pinned:e.pinned,hovered:e.hovered}},o.prototype._dotTransform=function(e){var t=this._commonTransform(e);return t.radius=Math.max(e.minSize/2,.4*this._barWidth),t.label=e.label,t.labelFontColor=e.labelFontColor,t.labelFontSize=Math.ceil(Math.max(10,Math.min(t.radius,20))),this._model.updateDotData(e,t)},o.prototype._plateTransform=function(e){var t=this._commonTransform(e);return this._model.updatePlateData(e,t)},o.THEMES=["green","red","neutral","yellow","blue"],o.prototype.themes={green:{border:"#78C143",background:"#8DDD54"},red:{border:"#CC4545",background:"#ED5A5A"},neutral:{border:"#EAC300",background:"#FFD400"},yellow:{border:"#EAC300",background:"#FFD400"},blue:{border:"#047ACE",background:"#0496FF"}},o.prototype._drawTriangle=function(e,t){var i,n,o,r;e.strokeStyle=t.theme.border,e.fillStyle=t.theme.background,e.lineWidth=t.theme.dotBorderWidth,i=t,n=t.radius,o=Math.cos(Math.PI/6)*n,r=Math.sin(Math.PI/6)*n,e.translate(i.x,i.y),"up"===t.direction&&e.rotate(Math.PI),t.public||(e.lineWidth/=2),e.beginPath(),e.moveTo(0,-n),e.lineTo(o,r),e.lineTo(-o,r),e.lineTo(0,-n),e.closePath(),e.stroke(),t.public&&e.fill()},o.prototype._drawDot=function(e,t){e.strokeStyle=t.theme.border,e.fillStyle=t.theme.background,e.lineWidth=t.theme.dotBorderWidth,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!0),e.closePath(),e.stroke(),e.fill(),t.label&&t.radius>6&&(e.textAlign="center",e.textBaseline="middle",e.font="bold "+t.labelFontSize+"px Arial",e.fillStyle=t.labelFontColor,e.fillText(t.label,t.x,t.y))},o.prototype.hitTest=function(e){var t,i;for(i=this._plates.length-1;i>=0;--i)if(t=this._hitTestDot(this._plates[i],e))return t;return null},o.prototype._hitTestDot=function(e,t){var i=this._dotTransform(e),n=new s(i.x,i.y);return a(t,n,Math.max(i.radius,8))?new l(l.REGULAR,e):null},r.prototype._createLayout=function(){throw Error("Child class must override this member")},r.prototype._updatePlate=function(e){throw Error("Child class must override this member")},r.prototype._getContainer=function(e){return this._container&&this._context===e||(this._context=e,this._container=$(e.canvas).parent()),this._container},r.prototype._plateArrowSize=14,r.prototype.showPlate=function(e,t){var i,n,o,r,s,a,l,c;this._currentId===e.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=e.id,this._createLayout(),this._getContainer(t).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),n=Math.round(e.barWidth/2),n>15&&(n=15),n<10&&(n=10),this._updatePlate(e),o=t.canvas.getBoundingClientRect(),
r=e.x-this._layout.outerWidth()<this._plateArrowSize,s=o.width-e.x+Math.round(e.barWidth/2+n),r&&(s-=this._layout.outerWidth()+2*this._plateArrowSize),a=o.height,l=20,c=10,this._layout.toggleClass("right",r),this._layout.css({top:Math.min(Math.max(e.y,l),a-this._layout.outerHeight()-c),right:s,fontSize:n+"px",display:"block"})},r.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())},r.prototype._toggleLayout=function(e){this._layout.toggle(e)},r.prototype.hide=function(e){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove(),e()})},r.prototype.setSource=function(e){this.source=e},t.BarsMarksContainerPaneView=n,t.BarsMarksContainerRenderer=o,t.BarMarkTooltip=r},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"NonSeriesStudy",function(){return l}),n=i(1),o=i(7),i.n(o),r=i(34),i.n(r),s=i(18),a=i.n(s),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype.clearData=function(){this._customData=null,this._indexes=null},t.prototype.restoreData=function(e,t,i){r.Study.prototype.restoreData.call(this,e),this._customData=t,this._indexes=i},t.prototype.state=function(t){var i=e.prototype.state.call(this,t);return t&&(i.nonSeriesData=this._customData,i.indexes=this._indexes),i},t.prototype.customData=function(){return this._customData},t.prototype._setPaneViews=function(e){this._paneViews=e,this.model().invalidate(new a.a(a.a.LIGHT_UPDATE))},t.prototype._onDataUpdated=function(t,i,n){null!==i&&(i.indexes_replace?(Object(o.assert)("nochange"!==n),this._indexes=n):(this._customData=i.data,"nochange"!==n&&(this._indexes=n))),e.prototype._onDataUpdated.call(this,t,i,n)},t}(r.Study),l.prototype.superclass=r.Study},function(e,t,i){function n(e,t,i,s,a){if(!i)return void r.logDebug("Missed undo model");o.call(this,e,t,!0,i,s),a?e.callbacks().subscribe(this,a):e.callbacks().subscribe(this,n.prototype.onActionCallback)}var o=i(317).Binding,r=i(4).getLogger("Chart.PropertyPage.ActionBinder");inherit(n,o),n.prototype.onActionCallback=function(e){this._undoModel.setProperty(this._property,this.value(),this._undoText)},n.prototype.value=function(){return this.control().checked},n.prototype.setValue=function(e){return this.control().checked=!!e},t.ActionBinder=n},function(e,t,i){"use strict";var n=function(){function e(e){switch(e){case"c67":case"m67":case"c45":return"copy";case"c86":case"m86":case"s45":return"paste";case"c88":case"m88":case"s46":return"cut"}}function t(e){var t=[];return e.shiftKey&&t.push("s"),e.ctrlKey&&t.push("c"),e.metaKey&&t.push("m"),e.altKey&&t.push("a"),t.push(e.keyCode),t.join("")}function i(e){var t=$.Event(u+":"+e);return $(window).trigger(t,{AppClipboard:_}),t}function n(n){var o,r,s;if((document.activeElement===document.body||document.activeElement===document.documentElement)&&(o=t(n),r=e(o))){if("keydown"===n.type)d[o]=!0;else if(d[o])return;if(document.getSelection){if(!document.getSelection().isCollapsed)return
}else if(document.selection&&"None"!==document.selection.type)return;n.isDefaultPrevented()||(s=i(r),s.isDefaultPrevented()&&n.preventDefault())}}function o(e){e=e.originalEvent||e,e.key===h&&i("change")}function r(){p||($(document).on("keypress keydown",n),$(window).on("storage",o),p=!0)}function s(){$(document).off("keypress keydown",n),$(window).off("storage",o),$(window).off(u+":copy"),$(window).off(u+":paste"),$(window).off(u+":cut"),$(window).off(u+":change"),p=!1}function a(){try{return JSON.parse(TVLocalStorage.getItem(h))}catch(e){return null}}function l(e){if(null==e)return c();var t=JSON.stringify(e);t!==TVLocalStorage.getItem(h)&&(TVLocalStorage.setItem(h,t),i("change"))}function c(){TVLocalStorage.getItem(h)&&(TVLocalStorage.removeItem(h),i("change"))}var h="application-clipboard",u="appclip",d={},p=!1,_={init:r,set:l,get:a,clear:c,destroy:s};return _}();e.exports=n},function(e,t,i){"use strict";var n=i(25);JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(e,t,i,o){return n.Std.or(n.Std.and(n.Std.eq(e,t),n.Std.eq(e,i)),n.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*o},this.main=function(e,t){var i,o,r;return this._context=e,this._input=t,i=this.f_0(n.Std.close(this._context),n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),o=n.Std.cum(i,this._context),r=o,[r]}}},{name:"Accumulative Swing Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#3C78D8"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index"},constructor:function(){this.f_0=function(e,t){var i=t.new_var(n.Std.open(t)),o=t.new_var(n.Std.high(t)),r=t.new_var(n.Std.low(t)),s=t.new_var(n.Std.close(t)),a=n.Std.abs(o-s.get(1)),l=n.Std.abs(r-s.get(1)),c=n.Std.abs(o-r),h=n.Std.abs(s.get(1)-i.get(1)),u=n.Std.max(a,l),d=n.Std.iff(a>=n.Std.max(l,c),a-.5*l+.25*h,n.Std.iff(l>=n.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return n.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*u/e*50)},this.f_1=function(e,t){var i=this.f_0(e,t);return n.Std.cum(i,t)},this.main=function(e,t){var i,n;return this._context=e,
this._input=t,i=this._input(0),n=this.f_1(i,this._context),[n]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(e,t){return n.Std.gt(e,t)},this.f_1=function(e,t){return n.Std.lt(e,t)},this.f_2=function(e,t){return 0===t?e:e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=this.f_1(n.Std.close(this._context),n.Std.open(this._context)),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_2(s,c),u=h,[u]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=n.Std.alma(a,o,r,s),[l]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(e,t){return 100*(e+t)/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,
i=this._input(0),o=n.Std.high(this._context),r=i+1,s=this._context.new_var(o),a=n.Std.highestbars(s,r,this._context),l=this.f_0(a,i),c=n.Std.low(this._context),h=this._context.new_var(c),u=n.Std.lowestbars(h,r,this._context),d=this.f_0(u,i),p=l,_=d,[p,_]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index"},constructor:function(){this.f_0=function(e){var t=this._context.new_var(n.Std.high(this._context)),i=n.Std.change(t),o=this._context.new_var(n.Std.low(this._context)),r=-n.Std.change(o),s=this._context.new_var(n.Std.tr(void 0,this._context)),a=n.Std.rma(s,e,this._context),l=this._context.new_var(n.Std.and(n.Std.gt(i,r),n.Std.gt(i,0))?i:0),c=n.Std.fixnan(100*n.Std.rma(l,e,this._context)/a,this._context),h=this._context.new_var(n.Std.and(n.Std.gt(r,i),n.Std.gt(r,0))?r:0);return[c,n.Std.fixnan(100*n.Std.rma(h,e,this._context)/a,this._context)]},this.f_1=function(e,t){var i=this.f_0(e),o=i[0],r=i[1],s=o+r,a=this._context.new_var(n.Std.abs(o-r)/(n.Std.eq(s,0)?1:s));return[100*n.Std.rma(a,t,this._context)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(e,t){var i,o,r,s;return this._context=e,this._input=t,i=this._input(0),o=n.Std.tr(this._context),r=this._context.new_var(o),s=n.Std.rma(r,i,this._context),[s]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){return n.Std.le(e,0)?0:1},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=n.Std.hl2(this._context),o=this._context.new_var(i),r=n.Std.sma(o,5,this._context),s=this._context.new_var(i),a=n.Std.sma(s,34,this._context),l=this.f_0(r,a),c=l,h=this._context.new_var(l),u=n.Std.change(h),d=this.f_1(u),[c,d]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(e,t,i,n){return(e-t)/(i-n)},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0(n.Std.close(this._context),n.Std.open(this._context),n.Std.high(this._context),n.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h),
d=this.f_2(a,h),p=a,_=u,f=d,[p,_,f]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/(i-t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(i,d,u),_=p,[_]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(u,d,a),_=p,[_]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,
visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(e,t,i,o){return n.Std.or(n.Std.and(n.Std.eq(e,t),n.Std.eq(e,i)),n.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*o},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=n.Std.volume(this._context),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_1(s,c),u=h,[u]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.accdist(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(e,t,i){return e-t*i},
this.f_1=function(e,t,i){return e+t*i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.high(this._context),a=this._context.new_var(s),l=n.Std.highest(a,i,this._context),c=n.Std.atr(i,this._context),h=this.f_0(l,o,c),u=this._context.new_var(s),d=n.Std.lowest(u,i,this._context),p=this.f_1(d,o,c),_=this._context.new_var(h),f=n.Std.highest(_,r,this._context),m=this._context.new_var(p),y=n.Std.lowest(m,r,this._context),g=y,v=f,[g,v]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},constructor:function(){this.f_0=function(e){return n.Std.ge(e,0)?e:0},this.f_1=function(e){return n.Std.ge(e,0)?0:-e},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return this.f_2(e-t,e+t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),h=n.Std.sum(c,i,this._context),u=this._context.new_var(l),d=n.Std.sum(u,i,this._context),p=this.f_3(h,d),_=p,[_]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#34dddd",width:1,style:0},1:{color:"#006400",width:1,style:0},2:{color:"#98fb98",width:1,style:0},3:{color:"#00FF00",width:1,style:0},4:{color:"#8B0000",width:1,style:0},5:{color:"#FF0000",width:1,style:0},6:{color:"#FF7F00",width:1,style:0},7:{color:"#ffc04c",width:1,style:0},8:{color:"#FFFF00",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone"},constructor:function(){this.f_0=function(){
var e=n.Std.close(this._context),t=n.Std.hlc3(this._context),i=this._context.new_var(n.Std.high(this._context)),o=n.Std.highest(i,30,this._context),r=n.Std.lowest(i,30,this._context),s=25/(o-r)*r,a=this._context.new_var(e),l=this._context.new_var(n.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/t*s,h=n.Std.sqrt(1+c*c),u=n.Std.round(180*n.Std.acos(1/h)/3.141592653589793),d=n.Std.iff(n.Std.gt(c,0),-u,u),p=n.Std.and(n.Std.gt(d,-2.14),n.Std.le(d,-.71))?7:8,_=n.Std.and(n.Std.gt(d,-3.57),n.Std.le(d,-2.14))?6:p,f=n.Std.and(n.Std.gt(d,-5),n.Std.le(d,-3.57))?5:_,m=n.Std.le(d,-5)?4:f,y=n.Std.and(n.Std.lt(d,2.14),n.Std.ge(d,.71))?3:m,g=n.Std.and(n.Std.lt(d,3.57),n.Std.ge(d,2.14))?2:y,v=n.Std.and(n.Std.lt(d,5),n.Std.ge(d,3.57))?1:g;return[1,n.Std.ge(d,5)?0:v]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(e,t,i,o){return 100*n.Std.log10(e/(t-i))/o},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=this._input(0),o=n.Std.atr(1,this._context),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context),h=n.Std.low(this._context),u=this._context.new_var(h),d=n.Std.lowest(u,i,this._context),p=n.Std.log10(i),_=this.f_0(s,c,d,p),f=_,[f]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",
objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},constructor:function(){this.f_0=function(e,t,i){return(e-t)/(.015*i)},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=n.Std.hlc3(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.sma(r,o,this._context),a=this._context.new_var(i),l=n.Std.dev(a,o,this._context),c=this.f_0(i,s,l),h=c,[h]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI"},constructor:function(){this.f_1=function(e,t,i){var o=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_2=function(e,t,i){var o=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_3=function(){var e=0;return function(t){var i=t.get(0),o=t.get(1);return e=i===o?0:i>o?n.Std.nz(e)<=0?1:n.Std.nz(e)+1:n.Std.nz(e)>=0?-1:n.Std.nz(e)-1,this._context.new_var(e)}}(),this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=this._input(0),s=this._input(1),a=this._input(2),l=n.Std.rsi(this.f_1(o,r,this._context),this.f_2(o,r,this._context)),c=this.f_3(o),h=n.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),u=this._context.new_var(n.Std.roc(o,1)),d=n.Std.percentrank(u,a),p=n.Std.avg(l,h,d),[p]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,
type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(e,t){return e+t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.roc(a,o),c=this._context.new_var(s),h=n.Std.roc(c,r),u=this.f_0(l,h),d=this._context.new_var(u),p=n.Std.wma(d,i,this._context),_=p,[_]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff"},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.Std.period(this._context),n.Std.period(this._context))},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._context.new_unlimited_var(this._context.symbol.time),this._input(0),n.Std.period(this._context),o=n.Std.close(this._context),r=this._input(1),this._context.select_sym(1),s=this._context.new_unlimited_var(this._context.symbol.time),a=n.Std.close(this._context),l=this._context.new_unlimited_var(a),this._context.select_sym(0),c=l.adopt(s,i,0),h=this._context.new_var(o),u=this._context.new_var(c),d=n.Std.correlation(h,u,r,this._context),[d]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator"},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1),o=this._context.new_var(n.Std.close(this._context)),r=this._context.new_var(n.Std.sma(o,e,this._context)),s=this._context.new_var(n.Std.close(this._context)),a=s.get(i)-r,l=n.Std.close(this._context)-r.get(i),c=t?a:l,h=-i
;return[c,t?h:0]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index"},constructor:function(){this.f_0=function(e){return-e},this.f_1=function(e,t){return n.Std.and(n.Std.gt(e,t),n.Std.gt(e,0))?e:0},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return e+t},this.f_4=function(e,t,i){return n.Std.abs(e-t)/(n.Std.eq(i,0)?1:i)},this.f_5=function(e){return 100*e},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.high(this._context),s=this._context.new_var(r),a=n.Std.change(s),l=n.Std.low(this._context),c=this._context.new_var(l),h=n.Std.change(c),u=this.f_0(h),d=n.Std.tr(this._context),p=this._context.new_var(d),_=n.Std.rma(p,i,this._context),f=this.f_1(a,u),m=this._context.new_var(f),y=n.Std.rma(m,i,this._context),g=this.f_2(y,_),v=n.Std.fixnan(g,this._context),S=this.f_1(u,a),b=this._context.new_var(S),w=n.Std.rma(b,i,this._context),P=this.f_2(w,_),T=n.Std.fixnan(P,this._context),x=this.f_3(v,T),C=this.f_4(v,T,x),L=this._context.new_var(C),I=n.Std.rma(L,o,this._context),A=this.f_5(I),k=v,E=T,M=A,[k,E,M]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",
shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=n.Std.low(this._context),r=this._context.new_var(o),s=n.Std.lowest(r,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context),h=n.Std.avg(c,s),u=s,d=c,p=h,[u,d,p]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this.f_0(s,l),h=c,[h]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(e,t,i,n,o){return e*t*(i-n)/o},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.hl2(this._context),s=this._context.new_var(r),a=n.Std.change(s),l=this.f_0(i,a,n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),c=this._context.new_var(l),h=n.Std.sma(c,o,this._context),u=h,[u]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(e,t){return e*t},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(s,n.Std.volume(this._context)),l=this._context.new_var(a),c=n.Std.ema(l,i,this._context),h=c,[h]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{
id:"in_1",name:"percent",defval:10,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(e,t,i){return e?t:i},this.f_1=function(e,t){return e*(1+t)},this.f_2=function(e,t){return e*(1-t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=n.Std.ema(a,o,this._context),c=this._context.new_var(i),h=n.Std.sma(c,o,this._context),u=this.f_0(s,l,h),d=r/100,p=this.f_1(u,d),_=this.f_2(u,d),f=u,m=p,y=_,[f,m,y]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,bands:[{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform"},constructor:function(){this.f_0=function(e){var t=n.Std.lt(e,-.99)?-.999:e;return[n.Std.gt(e,.99)?.999:t]},this.f_1=function(){var e,t,i,o=this._input(0),r=this._context.new_var(n.Std.hl2(this._context)),s=n.Std.highest(r,o,this._context),a=this._context.new_var(n.Std.hl2(this._context)),l=n.Std.lowest(a,o,this._context),c=this._context.new_var(),h=this.f_0(.66*((n.Std.hl2(this._context)-l)/n.Std.max(s-l,.001)-.5)+.67*n.Std.nz(c.get(1)));return c.set(h[0]),e=this._context.new_var(),e.set(.5*n.Std.log((1+c.get(0))/n.Std.max(1-c.get(0),.001))+.5*n.Std.nz(e.get(1))),t=e.get(1),i=e.get(0),[i,t]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"Historical Volatility",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},
description:"Historical Volatility",shortDescription:"HV",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1e12}],id:"historical_volatility@tv-basicstudies-1",scriptIdPart:"",name:"Historical Volatility"},constructor:function(){this.f_0=function(){var e=this._input(0),t=n.Std.or(n.Std.isintraday(this._context),n.Std.and(n.Std.isdaily(this._context),n.Std.eq(n.Std.interval(this._context),1)))?1:7,i=this._context.new_var(n.Std.close(this._context)),o=this._context.new_var(n.Std.log(n.Std.close(this._context)/i.get(1)));return[100*n.Std.stdev(o,e,this._context)*n.Std.sqrt(365/t)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Hull MA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull Moving Average",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Hull MA@tv-basicstudies-1",scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=o/2,s=this._context.new_var(i),a=n.Std.wma(s,r,this._context),l=this._context.new_var(i),c=n.Std.wma(l,o,this._context),h=this.f_0(a,c),u=n.Std.sqrt(o),d=n.Std.round(u),p=this._context.new_var(h),_=n.Std.wma(p,d,this._context),f=_,[f]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496ff"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#991515"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:1,style:0},1:{color:"#FF0000",width:1,style:0}}}},filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",palette:"palette_0",target:"fill_0",type:"colorer"}],styles:{plot_0:{title:"Conversion Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Base Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Lagging Span",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Lead 1",histogramBase:0,joinPoints:!1,isHidden:!1},plot_4:{title:"Lead 2",histogramBase:0,joinPoints:!1,
isHidden:!1}},description:"Ichimoku Cloud",shortDescription:"Ichimoku",is_price_study:!0,is_hidden_study:!1,id:"Ichimoku Cloud@tv-basicstudies-1",palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background",isHidden:!1,palette:"palette_0"}],inputs:[{id:"in_0",name:"Conversion Line Periods",defval:9,type:"integer",min:1,max:1e12},{id:"in_1",name:"Base Line Periods",defval:26,type:"integer",min:1,max:1e12},{id:"in_2",name:"Lagging Span 2 Periods",defval:52,type:"integer",min:1,max:1e12},{id:"in_3",name:"Displacement",defval:26,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.donchian=function(e){var t=this._context.new_var(n.Std.low(this._context)),i=this._context.new_var(n.Std.high(this._context));return n.Std.avg(n.Std.lowest(t,e,this._context),n.Std.highest(i,e,this._context))},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),o=this._input(3),r=this.donchian(e),s=this.donchian(t),a=n.Std.avg(r,s),l=this.donchian(i);return[r,s,n.Std.close(this._context),a,l,-o,o,o,n.Std.gt(a,l)?0:1]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_1();return[i[0],i[1],{value:i[2],offset:i[5]},{value:i[3],offset:i[6]},{value:i[4],offset:i[7]},i[8]]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"mult",defval:1,type:"float",min:-1e12,max:1e12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels"},constructor:function(){this.f_0=function(e,t,i,n){return e?t:i-n},this.f_1=function(e,t,i){return e+t*i},this.f_2=function(e,t,i){return e-t*i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=n.Std.ema(a,r,this._context),
c=this.f_0(o,n.Std.tr(this._context),n.Std.high(this._context),n.Std.low(this._context)),h=this._context.new_var(c),u=n.Std.ema(h,r,this._context),d=this.f_1(l,u,s),p=this.f_2(l,u,s),_=d,f=l,m=p,[_,f,m]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator"},constructor:function(){this.f_0=function(e,t){return n.Std.ge(e,0)?t:-t},this.f_1=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=n.Std.hlc3(this._context),o=this._context.new_var(i),r=n.Std.change(o),s=this.f_0(r,n.Std.volume(this._context)),a=this._context.new_var(s),l=n.Std.ema(a,34,this._context),c=this._context.new_var(s),h=n.Std.ema(c,55,this._context),u=this.f_1(l,h),d=this._context.new_var(u),p=n.Std.ema(d,13,this._context),_=u,f=p,[_,f]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:2e3},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:2e3},{id:"in_3",name:"roclen4",defval:30,type:"integer",min:1,max:2e3},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:2e3},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:2e3},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:2e3},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:2e3}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(e,t,i,n){return e+2*t+3*i+4*n},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H
;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=this._input(3),a=this._input(4),l=this._input(5),c=this._input(6),h=this._input(7),u=this._input(8),d=n.Std.close(this._context),p=i,_=this._context.new_var(d),f=n.Std.roc(_,p),m=a,y=this._context.new_var(f),g=n.Std.sma(y,m,this._context),v=o,S=this._context.new_var(d),b=n.Std.roc(S,v),w=l,P=this._context.new_var(b),T=n.Std.sma(P,w,this._context),x=r,C=this._context.new_var(d),L=n.Std.roc(C,x),I=c,A=this._context.new_var(L),k=n.Std.sma(A,I,this._context),E=s,M=this._context.new_var(d),V=n.Std.roc(M,E),D=h,O=this._context.new_var(V),R=n.Std.sma(O,D,this._context),B=this.f_0(g,T,k,R),N=this._context.new_var(B),F=n.Std.sma(N,u,this._context),W=B,H=F,[W,H]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:1,max:1e12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1e12,max:1e12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.linreg(s,i,o),l=a,[l]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.linreg(r,o,0),a=s,[a]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",
histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.sma(s,i,this._context),l=this._context.new_var(r),c=n.Std.sma(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"MA with EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"MA",histogramBase:0,joinPoints:!1},plot_1:{title:"EMA",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA with EMA Cross",shortDescription:"MA/EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Length MA",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Length EMA",defval:10,type:"integer",min:1,max:2e3}],id:"MA with EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA with EMA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.sma(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.high(this._context),n.Std.low(this._context)),
r=this._context.new_var(o),s=n.Std.ema(r,9,this._context),a=this._context.new_var(s),l=n.Std.ema(a,9,this._context),c=this.f_1(s,l),h=this._context.new_var(c),u=n.Std.sum(h,i,this._context),d=u,[d]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic"},constructor:function(){this.f_0=function(){var e,t=this._input(0),i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.ema(o,t,this._context),s=this._context.new_var(),a=s.get(1)+(i-s.get(1))/(t*n.Std.pow(i/s.get(1),4));return s.set(n.Std.na(s.get(1))?r:a),e=s.get(0),[e]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Momentum",metainfo:{_metainfoVersion:30,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=this._input(0),o=n.Std[this._input(1)](this._context),r=this._context.new_var(o),s=r.get(i),a=s?o-s:null,[a]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow"},constructor:function(){this.f_0=function(e,t,i){
return e*(n.Std.le(t,0)?0:i)},this.f_1=function(e,t,i){return e*(n.Std.ge(t,0)?0:i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=n.Std.hlc3(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(n.Std.volume(this._context),s,o),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_1(n.Std.volume(this._context),s,o),u=this._context.new_var(h),d=n.Std.sum(u,i,this._context),p=n.Std.rsi(c,d),_=p,[_]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#CC0000"}},precision:4,filledAreasStyle:{fill_0:{color:"#A2C4C9",transparency:90,visible:!0}},inputs:{in_0:20,in_1:20,in_2:0,in_3:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_1",type:"plot_plot",title:"Plots Background"}],description:"Moving Average Channel",shortDescription:"MAC",is_price_study:!0,inputs:[{id:"in_0",name:"Upper Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"Lower Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_2",name:"Upper Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"in_3",name:"Lower Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Channel@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Channel"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=n.Std.high(this._context),o=n.Std.low(this._context),r=this._input(0),s=this._input(1),a=this._input(2),l=this._input(3),c=this._context.new_var(i),h=this._context.new_var(o),u=n.Std.sma(c,r,this._context),d=n.Std.sma(h,s,this._context),
[{value:u,offset:a},{value:d,offset:l}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y;return this._context=e,this._input=t,i=n.Std[this._input(2)](this._context),o=this._input(0),r=this._input(1),s=this._input(3),a=this._context.new_var(i),l=n.Std.ema(a,o,this._context),c=this._context.new_var(i),h=n.Std.ema(c,r,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=n.Std.ema(d,s,this._context),_=this.f_0(u,p),f=_,m=u,y=p,[f,m,y]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.ema(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},
precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.wma(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.change(o),s=this.f_0(r,n.Std.volume(this._context),r),a=s,[a]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.change(o),s=this.f_0(r,n.Std.volume(this._context),r),a=n.Std.cum(s,this._context),l=a,[l]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum",
defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.sar(i,o,r,this._context),a=s,[a]}}},{name:"Price Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496FF"}},precision:4,inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=n.Std.high(this._context),o=this._context.new_var(i),r=n.Std.low(this._context),s=this._context.new_var(r),a=this._input(0),l=this._input(1),c=n.Std.highest(o,a,this._context),h=n.Std.lowest(s,a,this._context),u=n.Std.avg(c,h),[{value:c,offset:l},{value:h,offset:l},{value:u,offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(e,t){return(e-t)/t*100},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.sma(l,r,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,
joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend"},constructor:function(){this.f_0=function(){var e=this._context.new_var(n.Std.close(this._context));return[n.Std.cum(n.Std.change(e)/e.get(1)*n.Std.volume(this._context),this._context)]},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change"},constructor:function(){this.main=function(e,t){var i,o,r;return this._context=e,this._input=t,i=this._context.new_var(n.Std.close(this._context)),o=this._input(0),r=100*(i.get(0)-i.get(o))/i.get(o),[r]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(e){return n.Std.max(e,0)},this.f_1=function(e){return-n.Std.min(e,0)},this.f_2=function(e,t){return n.Std.eq(e,0)?100:n.Std.eq(t,0)?0:100-100/(1+t/e)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.change(r),a=this.f_0(s),l=this._context.new_var(a),c=n.Std.rma(l,o,this._context),h=this.f_1(s),u=this._context.new_var(h),d=n.Std.rma(u,o,this._context),p=this.f_2(d,c),_=p,[_]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,
linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),r=this._context.new_var(o),s=n.Std.swma(r,this._context),a=this._context.new_var(s),l=n.Std.sum(a,i,this._context),c=this.f_0(n.Std.high(this._context),n.Std.low(this._context)),h=this._context.new_var(c),u=n.Std.swma(h,this._context),d=this._context.new_var(u),p=n.Std.sum(d,i,this._context),_=this.f_1(l,p),f=this._context.new_var(_),m=n.Std.swma(f,this._context),y=_,g=m,[y,g]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(e,t){return n.Std.le(e,0)?0:t},this.f_1=function(e,t){return n.Std.gt(e,0)?0:t},this.f_2=function(e,t){return e/(e+t)*100},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.stdev(r,i,this._context),a=this._context.new_var(o),l=n.Std.change(a),c=this.f_0(l,s),h=this._context.new_var(c),u=n.Std.ema(h,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),_=n.Std.ema(p,14,this._context),f=this.f_2(u,_),m=f,[m]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,
transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,i,o,this._context),c=this._context.new_var(l),h=n.Std.ema(c,r,this._context),u=this.f_0(l,h),d=l,p=h,_=u,[d,p,_]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average"},constructor:function(){this.f_0=function(){var e,t=this._input(0),i=n.Std[this._input(1)](this._context),o=this._context.new_var(i),r=n.Std.sma(o,t,this._context),s=this._context.new_var(),a=(s.get(1)*(t-1)+i)/t;return s.set(n.Std.na(s.get(1))?r:a),e=s.get(0),[e]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{
plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=n.Std.high(this._context),l=n.Std.low(this._context),c=this._context.new_var(s),h=this._context.new_var(a),u=this._context.new_var(l),d=n.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=n.Std.sma(p,o,this._context),f=this._context.new_var(_),m=n.Std.sma(f,r,this._context),y=_,g=m,[y,g]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI"},constructor:function(){this.f_1=function(e,t,i){var o=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_2=function(e,t,i){var o=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=n.Std.rsi(this.f_1(l,o,this._context),this.f_2(l,o,this._context)),h=this._context.new_var(c),u=this._context.new_var(c),
d=this._context.new_var(c),p=n.Std.stoch(h,u,d,r,this._context),_=this._context.new_var(p),f=n.Std.sma(_,s,this._context),m=this._context.new_var(f),y=n.Std.sma(m,a,this._context),g=f,v=y,[g,v]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(e){return n.Std.log(e)},this.f_1=function(e){return 1e4*e},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context)),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),h=n.Std.ema(c,i,this._context),u=this._context.new_var(h),d=n.Std.change(u),p=this.f_1(d),_=p,[_]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA"},constructor:function(){this.f_0=function(e,t,i){return 3*(e-t)+i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),h=n.Std.ema(c,i,this._context),u=this.f_0(s,l,h),d=u,[d]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25,
type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,o,i,this._context),c=l,h=this._context.new_var(c),[c,n.Std.ema(h,r,this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator"},constructor:function(){this.f_0=function(e,t,i){var o=this._context.new_var(e),r=this._context.new_var(t);return[n.Std.sum(o,i,this._context)/n.Std.sum(r,i,this._context)]},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),o=this._context.new_var(n.Std.close(this._context)),r=n.Std.max(n.Std.high(this._context),o.get(1)),s=this._context.new_var(n.Std.close(this._context)),a=n.Std.min(n.Std.low(this._context),s.get(1)),l=n.Std.close(this._context)-a,c=r-a,h=this.f_0(l,c,e),u=this.f_0(l,c,t),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"VWAP",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#3A6CA8"}},precision:4},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP"},constructor:function(){this.f_1=function(e){e.hist=null,e.add_hist()},this.init=function(e,t){this._isNewSession=n.Std.createNewSessionCheck(e)},this.main=function(e,t){var i,o,r,s;return this._context=e,this._input=t,i=e.new_var(),o=e.new_var(),this._context.symbol.time&&(r=this._context.symbol.time,this._isNewSession(r)&&(this.f_1(i),this.f_1(o))),i.set(n.Std.nz(i.get(1))+n.Std.hlc3(this._context)*n.Std.volume(this._context)),o.set(n.Std.nz(o.get(1))+n.Std.volume(this._context)),s=i.get(0)/o.get(0),[s]}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{
linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.vwma(r,o,this._context),a=s,[a]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(e,t){return 100*(e-t)/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.volume(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator"},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(n.Std.low(this._context)),i=this._context.new_var(n.Std.abs(n.Std.high(this._context)-t.get(1))),o=n.Std.sum(i,e,this._context),r=this._context.new_var(n.Std.high(this._context)),s=this._context.new_var(n.Std.abs(n.Std.low(this._context)-r.get(1))),a=n.Std.sum(s,e,this._context),l=this._context.new_var(n.Std.atr(1,this._context)),c=n.Std.sum(l,e,this._context);return[o/c,a/c]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{
name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(e,t,i){return 100*(e-t)/(t-i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=n.Std.high(this._context),r=this._context.new_var(o),s=n.Std.highest(r,i,this._context),a=n.Std.low(this._context),l=this._context.new_var(a),c=n.Std.lowest(l,i,this._context),h=this.f_0(n.Std.close(this._context),s,c),u=h,[u]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.hl2(this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(s),h=n.Std.ema(c,o,this._context),u=this._context.new_var(s),d=n.Std.ema(u,r,this._context),p=l,_=h,f=d,[{value:p,offset:8},{value:_,offset:5},{value:f,offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",
transparency:0,color:"#800000"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#808000"}},precision:4,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(n.Std.high(this._context)),i=n.Std.or(n.Std.and(n.Std.and(n.Std.lt(t.get(e+2),t.get(e)),n.Std.lt(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))),n.Std.or(n.Std.or(n.Std.and(n.Std.lt(t.get(e+3),t.get(e)),n.Std.and(n.Std.and(n.Std.lt(t.get(e+2),t.get(e)),n.Std.eq(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e))))),n.Std.and(n.Std.and(n.Std.lt(t.get(e+4),t.get(e)),n.Std.lt(t.get(e+3),t.get(e))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))))),n.Std.or(n.Std.and(n.Std.and(n.Std.lt(t.get(e+5),t.get(e)),n.Std.and(n.Std.lt(t.get(e+4),t.get(e)),n.Std.eq(t.get(e+3),t.get(e)))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e))))),n.Std.and(n.Std.and(n.Std.and(n.Std.lt(t.get(e+6),t.get(e)),n.Std.lt(t.get(e+5),t.get(e))),n.Std.and(n.Std.eq(t.get(e+4),t.get(e)),n.Std.le(t.get(e+3),t.get(e)))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))))))),o=this._context.new_var(n.Std.low(this._context))
;return[n.Std.or(n.Std.and(n.Std.and(n.Std.gt(o.get(e+2),o.get(e)),n.Std.gt(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))),n.Std.or(n.Std.or(n.Std.and(n.Std.gt(o.get(e+3),o.get(e)),n.Std.and(n.Std.and(n.Std.gt(o.get(e+2),o.get(e)),n.Std.eq(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e))))),n.Std.and(n.Std.and(n.Std.gt(o.get(e+4),o.get(e)),n.Std.gt(o.get(e+3),o.get(e))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))))),n.Std.or(n.Std.and(n.Std.and(n.Std.gt(o.get(e+5),o.get(e)),n.Std.and(n.Std.gt(o.get(e+4),o.get(e)),n.Std.eq(o.get(e+3),o.get(e)))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e))))),n.Std.and(n.Std.and(n.Std.and(n.Std.gt(o.get(e+6),o.get(e)),n.Std.gt(o.get(e+5),o.get(e))),n.Std.and(n.Std.eq(o.get(e+4),o.get(e)),n.Std.ge(o.get(e+3),o.get(e)))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))))))),i]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"dur",function(){return n}),i.d(t,"easingFunc",function(){return o}),i.d(t,"CubicBezier",function(){return r}),i.d(t,"color",function(){return s}),n=350,o={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},r=function(){function e(e,t,i,n){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=n}return e.prototype.easingFunc=function(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))},e.prototype._a=function(e,t){return 1-3*t+3*e},e.prototype._b=function(e,t){return 3*t-6*e},e.prototype._c=function(e){return 3*e},e.prototype._calcBezier=function(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e},e.prototype._getSlope=function(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)},e.prototype._getTForX=function(e){var t,i,n,o=e;for(t=0;t<4;++t){if(0===(i=this._getSlope(o)))return o;n=this._calcBezier(o)-e,o-=n/i}return o},e}(),s={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black27:"#2f3241",
black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30",growing:"#37bc9b",falling:"#ff4a68"}},function(e,t,i){function n(){this._data=null,this._hittest=new o(o.MOVEPOINT)}var o,r,s,a;i(71),o=i(9).HitTestResult,r=i(103).LineEnd,s=i(30).distanceToSegment,a=i(27).extendAndClipLineSegment,n.prototype.setData=function(e){this._data=e},n.prototype.setHitTest=function(e){this._hittest=e},n.prototype.drawArrow=function(e,t,i,n){var o,r,s,a,l,c,h,u,d;t.subtract(e).length()<1||(o=t.subtract(e).normalized(),r=5*n,s=o.scaled(r),a=t.subtract(s),l=o.transposed(),c=3*n,h=l.scaled(c),u=a.add(h),d=a.subtract(h),CanvasEx.drawLine(i,Math.round(u.x),Math.round(u.y),t.x,t.y),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),t.x,t.y))},n.prototype.extendAndClipLineSegment=function(e,t){return a(e,t,this._data.width,this._data.height,this._data.extendleft,this._data.extendright)},n.prototype.drawCircle=function(e,t,i,n){n=$.extend({fillStyle:"#000000"},n),t.save(),t.fillStyle=n.fillStyle,t.beginPath(),t.arc(e.x,e.y,i,0,2*Math.PI,!1),t.fill(),n.strokeWidth&&(t.lineWidth=n.strokeWidth,t.stroke()),t.restore()},n.prototype.draw=function(e){var t,i,n,o,r;null===this._data||this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.lineStyle=this._data.linestyle,t=this._data.floatPoints||this._data.points,i=t[0],n=t[1],this._data.overlayLineEndings?o=[$.extend(!0,{},i),$.extend(!0,{},n)]:this.drawEnds(e,[i,n]),r=this.extendAndClipLineSegment(i,n),null!==r&&this._data.linewidth>0&&CanvasEx.drawLine(e,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(e,o))},n.prototype.drawEnds=function(e,t){var i=t[0],n=t[1];switch(this._data.leftend){case r.Arrow:this.drawArrow(n,i,e,e.lineWidth);break;case r.Circle:this.drawCircle(i,e,e.lineWidth,this._data.endstyle)}switch(this._data.rightend){case r.Arrow:this.drawArrow(i,n,e,e.lineWidth);break;case r.Circle:this.drawCircle(n,e,e.lineWidth,this._data.endstyle)}},n.prototype.hitTest=function(e){var t,i,n,o,r,a
;return null===this._data||this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(t=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,n=i[0],o=i[1],r=this.extendAndClipLineSegment(n,o),null!==r&&(a=s(r[0],r[1],e),a.distance<=t)?this._hittest:null)},t.TrendLineRenderer=n},function(e,t,i){function n(e,t){this._linesMaxWidth=null,this._hittest=t||new o(o.MOVEPOINT),this._data={},this._fontSize=0,this.setData(e)}var o=i(9).HitTestResult,r=i(81).calcTextHorizontalShift,s=i(46).drawRoundRect;n.prototype.setData=function(e){var t,i,n,o=this._data,r=this.fontStyle();this._data=e,this._fontSize=e.fontsize||e.fontSize||30,t=e.text===o.text,i=e.wordWrapWidth===o.wordWrapWidth,n=r===this.fontStyle(),t&&i&&n?(this._data.lines=o.lines,this._lines=o.lines):(this._linesMaxWidth=null,e.lines=this.wordWrap(e.text,e.wordWrapWidth),this._lines=e.lines)},function(){function e(){var e=document.createElement("canvas");e.width=0,e.height=0,t=e.getContext("2d"),e=null}var t;n.prototype.setPoints=function(e,t){this._data.points=e,this._hittest=t||new o(o.MOVEPOINT)},n.prototype._getLinesMaxWidth=function(){var i,n;if(null!==this._linesMaxWidth)return this._linesMaxWidth;if(t||e(),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.wordWrapWidth)return this._data.wordWrapWidth;for(i=0,n=0;n<this._lines.length;n++)i=Math.max(i,t.measureText(this._lines[n]).width);return this._linesMaxWidth=i,i},n.prototype.measure=function(){var e=this._fontSize,t=this._getLinesMaxWidth(),i=e*this._lines.length,n=~~(e/6);return this._data.backgroundHorzInflate&&(t+=2*this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(i+=2*this._data.backgroundVertInflate),t=Math.ceil(t+2*n),i=Math.ceil(i+2*n),t%2!=0&&t++,this._data.padding&&(i+=this._data.padding),{width:t,height:i,textBgPadding:n}},n.prototype.wordWrap=function(i,n,o){var r,s,a,l,c,h,u,d,p;if(t||e(),n=+n,i+="",r=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),r[r.length-1]||r.pop(),!isFinite(n)||n<=0)return r;for(t.font=o||this.fontStyle(),s=[],a=0;a<r.length;a++)if(l=r[a],(c=t.measureText(l).width)<=n)s.push(l);else for(h=l.split(/([-\)\]\},.!?:;])|(\s+)/);h.length;){if((u=~~(n/c*(h.length+2)/3))<=0||t.measureText(h.slice(0,3*u-1).join("")).width<=n)for(;t.measureText(h.slice(0,3*(u+1)-1).join("")).width<=n;)u++;else for(;u>0&&t.measureText(h.slice(0,3*--u-1).join("")).width>n;);if(u>0)s.push(h.slice(0,3*u-1).join("")),h.splice(0,3*u);else{if(d=h[0]+(h[1]||""),p=1===p?1:~~(n/t.measureText(d)*d.length),t.measureText(d.substr(0,p)).width<=n)for(;t.measureText(d.substr(0,p+1)).width<=n;)p++;else for(;p>1&&t.measureText(d.substr(0,--p)).width>n;);p<1&&(p=1),s.push(d.substr(0,p)),h[0]=d.substr(p),h[1]=""}if((c=t.measureText(h.join("")).width)<=n){s.push(h.join(""));break}}return s}}(),n.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},n.prototype._y=function(){var e,t=this._fontSize*this._lines.length;switch(this._data.scaleY&&(t*=this._data.scaleY),
e=this._data.points[0].y+this._data.offsetY+t,this._data.vertAlign){case"top":break;case"bottom":e-=t;break;case"middle":e-=t/2}return e},n.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},n.prototype.draw=function(e){var t,i,n,o,a,l,c,h,u,d,p,_,f,m,y,g;if(0!==this._data.points.length){switch(t=this._x(),i=this._y(),n=this._fontSize,this._data.scaleY&&(n*=this._data.scaleY),i-=n*(this._lines.length-1),e.textBaseline="alphabetic",e.font=this.fontStyle(),this._data.horzAlign){case"left":e.textAlign="start";break;case"right":e.textAlign="end";break;case"center":e.textAlign="center"}if(e.translate(t+.5,i+.5),t=0,i=0,n=this._fontSize,this._data.scaleX&&this._data.scaleY&&(o=Math.min(this._data.scaleX,this._data.scaleY),e.scale(o,o)),a=this._getLinesMaxWidth(),l=r(e,a),c=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(h=t,this._data.horzAlign){case"left":break;case"right":h-=a;break;case"center":h-=a/2}u=n*this._lines.length,d=~~(n/6),this._data.backgroundHorzInflate&&(a+=2*this._data.backgroundHorzInflate,h-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(u+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),p={x:Math.floor(h-d),y:Math.floor(i-n),w:Math.ceil(a+2*d),h:Math.ceil(u+2*d)},p.w%2!=0&&p.w++,this._data.padding&&(p.h+=this._data.padding,c=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(s(e,p.x,p.y,p.w,p.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fill()),this._data.borderColor&&(_=~~Math.max(n/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=_,e.stroke())):(this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fillRect(p.x,p.y,p.w,p.h)),this._data.borderColor?(_=~~Math.max(n/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=_,e.strokeRect(p.x-_/2,p.y-_/2,p.w+_,p.h+_)):this._data.highlightBorder&&(e.strokeStyle=this._data.color,e.lineWidth=1,e.beginPath(),y=[3,1],e.dashedLineTo(p.x-.5,m=p.y-.5,f=p.x+p.w+.5,m,y),e.dashedLineTo(f,m,f,m=p.y+p.h+.5,y),e.dashedLineTo(f=p.x-.5,m,p.x+p.w+.5,m,y),e.dashedLineTo(f,p.y-.5,f,m,y),e.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),e.fillStyle=this._data.color,this._data.forceTextAlign&&(e.textAlign=this._data.horzAlign?this._data.horzAlign:"left"),this._data.forceTextAlign||(t+=l),g=0;g<this._lines.length;g++)e.fillText(this._lines[g],t,i),i+=n+c}},n.prototype.hitTest=function(e){var t,i,n,o,r,s;return 0===this._data.points.length?null:(t=this._fontSize,this._data.scaleY&&(t*=this._data.scaleY),i=this._getLinesMaxWidth(),this._data.scaleX&&(i*=this._data.scaleX),n=this._data.points[0].x+this._data.offsetX,o=this._data.points[0].y+this._data.offsetY,"bottom"===this._data.vertAlign&&(o-=this._lines.length*this._fontSize),
"middle"===this._data.vertAlign&&(o-=this._lines.length*this._fontSize/2),"right"===this._data.horzAlign?n-=i:"center"===this._data.horzAlign&&(n-=i/2),r=this._data.backgroundColor||this._data.borderColor?~~(t/6):0,s=this._data.borderColor?~~Math.max(t/12,1):0,e.x>=n-r-s&&e.x<=n+i+r+s&&e.y>=o-s&&e.y<=o+this._lines.length*this._fontSize+2*r+s?this._hittest:null)},t.TextRenderer=n},,,function(e,t,i){"use strict";function n(e){return"."+e.replace(/\+/g,"")}function o(e,t,i,o){var r,s;void 0===i&&(i="keydown"),r=n(e),s=o?$(o):u,s.unbind(i+r).bind(i+r,e,function(e){$(e.target).is("input[type=password]")||d||t.apply(null,Array.prototype.slice.call(arguments))}),h[e]=t}function r(e,t,i){void 0===t&&(t="keydown"),(i?$(i):u).unbind(t+n(e)),delete h[e]}function s(){return d?null:d=Object(c.randomHashN)(4)}function a(e){if(e!==d)throw Error("Lock id is outdated");d=null}var l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.bind=o,t.unbind=r,t.disable=s,t.enable=a,l=i(14),i.n(l),c=i(33),h={},u=$(document),d=null},function(e,t,i){"use strict";function n(e){this._data=e}function o(e,t){this._data=e,this._model=t,this.radius=this._data.radius||o.OUTER_RADIUS}function r(e){n.call(this,e)}var s=i(9).HitTestResult,a=i(167).PaneRendererArrowsUpDown;i(71),n.RADIUS=3.5,n.prototype.tolerance=2,n.prototype.draw=function(e){function t(e){return void 0===e.x||TradingView.isNaN(e.x)||null===e.x||void 0===e.y||TradingView.isNaN(e.y)||null===e.y}var i,n,o;if(this._data)for(e.strokeStyle="#6B6B6B",e.fillStyle="#D6D6D6",i=this._data.vertOffset||0,n=0;n<this._data.points.length;n++)o=this._data.points[n],t(o)||this._drawMarker(e,o,i)},n.prototype._drawMarker=function(e,t,i){e.beginPath(),e.arc(t.x+.5,t.y+.5+i,n.RADIUS,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()},n.prototype.hitTest=function(e){var t,i;if(!this._data)return null;for(t=0;t<this._data.points.length;t++)if(i=this._data.points[t],i.subtract(e).length()<=n.RADIUS+this.tolerance)return new s(this._data.hittestResult,i.data);return null},o.OUTER_RADIUS=TradingView.isMobile.any()?16:8,o.prototype.tolerance=2,o.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h=this._data.currentPoint,u=this._data.outerStrokeWidth||1;for(t=0;t<this._data.points.length;t++)i=this._data.points[t],n=i.subtract(h).length(),o=TradingView.isInteger(i.data)&&this._data.linePointBeingEdited===i.data,r=this.radius,s=this._data.strokeWidth||2,a=n<=r+this.tolerance,l=a?1:0,r+=l,s+=l,o||(i.square?(e.fillStyle=this._data.backgroundColor,e.fillRect(i.x-r,i.y-r,2*r,2*r),e.fillStyle=this._data.color,c=r-u,e.fillRect(i.x-c,i.y-c,2*c,2*c),c=r-u-s,e.fillStyle=this._data.backgroundColor,e.fillRect(i.x-c,i.y-c,2*c,2*c)):(e.beginPath(),e.arc(i.x,i.y,r,0,2*Math.PI,!0),e.closePath(),e.fillStyle=this._data.backgroundColor,e.fill(),e.beginPath(),e.arc(i.x,i.y,r-u,0,2*Math.PI,!0),e.closePath(),e.fillStyle=this._data.color,e.fill(),e.beginPath(),e.arc(i.x,i.y,r-u-s,0,2*Math.PI,!0),e.closePath(),e.fillStyle=this._data.backgroundColor,e.fill()))},o.prototype.hitTest=function(e){var t,i,n
;for(t=0;t<this._data.points.length;t++)if(i=this._data.points[t],n=i.subtract(e).length(),n<=this.radius+this.tolerance)return new s(this._data.hittestResult,i.data);return null},inherit(r,n),r.prototype._drawMarker=function(e,t,i){var o=t.isUp?1:-1,r=a.prototype._calculateVerticalOffset(this._data.barSpacing),s=a.prototype._calculateMinHeight(this._data.barSpacing),l=i+o*r+o*s;e.beginPath(),e.arc(t.x+.5,t.y+.5+l,n.RADIUS,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()},t.SelectionRenderer=n,t.LineAnchor=o,t.SelectionRendererArrowsUpDown=r},,,function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LimitedPrecisionNumericFormatter",function(){return o}),n=i(12),i.n(n),o=function(){function e(e){void 0===e&&(e=1),this._precision=e}return e.prototype.format=function(e){var t,i;return Object(n.isNumber)(e)||(e=parseFloat(e)),t=e.toFixed(this._precision),i=Math.pow(10,-this._precision),Math.max(parseFloat(t),i)+""},e}()},function(e,t,i){"use strict";function n(e,t,i){return e*(1-i)+t*i}function o(e){return new l(e)}var r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),t.doAnimate=o,r=i(1),s=i(184),a={from:0,duration:250,easing:s.easingFunc.easeOutCubic},l=function(){function e(e){var t,i=this;this._doing=!0,this._options=r.a({},a,e),t=performance.now(),window.requestAnimationFrame(function(e){i._animation(t,i._options.from,e)})}return e.prototype.stop=function(){this._doing=!1},e.prototype._animation=function(e,t,i){var o,r,s,a,l,c=this;return this._doing?(i=!i||i<1e12?performance.now():i,o=i-e,r=o>=this._options.duration||t===this._options.to,s=n(this._options.from,this._options.to,this._options.easing(o/this._options.duration)),a=r?this._options.to:s,l=a-t,this._options.onStep(l,a),r?void this._finishAnimation():void window.requestAnimationFrame(function(t){c._animation(e,a,t)})):void this._finishAnimation()},e.prototype._finishAnimation=function(){this._options.onComplete&&this._options.onComplete()},e}()},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11px" height="9px"><path fill="none" fill-rule="evenodd" stroke-width="2" d="M1 3.22l3.415 3.496L10 1"/></svg>'},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),n=i(488),Object.defineProperty(t,"AutocompleteField",{enumerable:!0,get:function(){return n.AutocompleteField}}),o=i(492),Object.defineProperty(t,"CheckboxField",{enumerable:!0,get:function(){return o.CheckboxField}}),r=i(254),Object.defineProperty(t,"InputField",{enumerable:!0,get:function(){return r.InputField}}),s=i(493),Object.defineProperty(t,"InputFieldRegExp",{enumerable:!0,get:function(){return s.InputFieldRegExp}}),a=i(253),Object.defineProperty(t,"SaveRenameDialog",{enumerable:!0,get:function(){return a.SaveRenameDialog}})},function(e,t,i){"use strict";function n(e,t,n,s){var a=Object(o.loadPropertyPages)(),l=function(o,r){i.e(17).then(function(r){a.then(function(){var r=i(357),a=new r(e,t,s);a.show(n),o(a)})}.bind(null,i)).catch(r)};return Object(r.retries)(function(e){
return new Promise(l)},2)}var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.showEditObjectDialog=n,o=i(2),i.n(o),r=i(134)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HEADER_TOOLBAR_HEIGHT_EXPANDED",function(){return o}),i.d(t,"HEADER_TOOLBAR_HEIGHT_COLLAPSED",function(){return r}),n=i(477),i.n(n),o=parseInt(n["css-value-header-toolbar-height"]),r=3},function(e,t,i){"use strict";var n,o,r,s,a;i.d(t,"a",function(){return s}),i.d(t,"b",function(){return a}),n=i(1),o=i(8),r=i.n(o),s=function(){function e(e,t,i,n,o){var s=this;this._onChange=new r.a,this._handleChange=function(){s._onChange.fire(s.get())},this._crossTabEvents=e,this._jsonKeyValueStore=t,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=n,this.defaultStoreValue=this._serialize(o),this._subscribe()}return e.prototype.get=function(){var e=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(e)},e.prototype.set=function(e,t){var i=this._serialize(e);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,i,t),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(e)},e.prototype.getOnChange=function(){return this._onChange},e.prototype.destroy=function(){this._unsubscribe(),this._onChange.destroy(),delete this._onChange},e.prototype._subscribe=function(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)},e.prototype._unsubscribe=function(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._serialize=function(e){return e},t.prototype._deserialize=function(e){return e},t}(s)},function(e,t,i){"use strict";function n(e){for(var t=0;t<u.length;t++)if(e===u[t].id)return!0;return!1}var o,r,s,a,l,c,h,u;for(Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"availableTimezones",function(){return u}),t.timezoneIsAvailable=n,i(11),o=i(340),r=[{id:"Etc/UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")}],s=[{id:"Africa/Cairo",title:$.t("Cairo"),offset:0},{id:"Africa/Johannesburg",title:$.t("Johannesburg"),offset:0},{id:"Africa/Lagos",title:$.t("Lagos"),offset:0},{id:"America/Argentina/Buenos_Aires",title:$.t("Buenos Aires"),offset:0},{id:"America/Bogota",title:$.t("Bogota"),offset:0},{id:"America/Caracas",title:$.t("Caracas"),offset:0},{id:"America/Chicago",title:$.t("Chicago"),offset:0},{id:"America/El_Salvador",title:$.t("San Salvador"),offset:0},{id:"America/Juneau",title:$.t("Juneau"),offset:0},{id:"America/Lima",title:$.t("Lima"),offset:0},{id:"America/Los_Angeles",title:$.t("Los Angeles"),offset:0},{id:"America/Mexico_City",title:$.t("Mexico City"),offset:0},{id:"America/New_York",title:$.t("New York"),offset:0},{id:"America/Phoenix",title:$.t("Phoenix"),offset:0},{id:"America/Santiago",title:$.t("Santiago"),offset:0},{id:"America/Sao_Paulo",
title:$.t("Sao Paulo"),offset:0},{id:"America/Toronto",title:$.t("Toronto"),offset:0},{id:"America/Vancouver",title:$.t("Vancouver"),offset:0},{id:"Asia/Almaty",title:$.t("Almaty"),offset:0},{id:"Asia/Ashkhabad",title:$.t("Ashkhabad"),offset:0},{id:"Asia/Bahrain",title:$.t("Bahrain"),offset:0},{id:"Asia/Bangkok",title:$.t("Bangkok"),offset:0},{id:"Asia/Chongqing",title:$.t("Chongqing"),offset:0},{id:"Asia/Dubai",title:$.t("Dubai"),offset:0},{id:"Asia/Ho_Chi_Minh",title:$.t("Ho Chi Minh"),offset:0},{id:"Asia/Hong_Kong",title:$.t("Hong Kong"),offset:0},{id:"Asia/Jakarta",title:$.t("Jakarta"),offset:0},{id:"Asia/Jerusalem",title:$.t("Jerusalem"),offset:0},{id:"Asia/Kolkata",title:$.t("Kolkata"),offset:0},{id:"Asia/Kuwait",title:$.t("Kuwait"),offset:0},{id:"Asia/Muscat",title:$.t("Muscat"),offset:0},{id:"Asia/Qatar",title:$.t("Qatar"),offset:0},{id:"Asia/Riyadh",title:$.t("Riyadh"),offset:0},{id:"Asia/Seoul",title:$.t("Seoul"),offset:0},{id:"Asia/Shanghai",title:$.t("Shanghai"),offset:0},{id:"Asia/Singapore",title:$.t("Singapore"),offset:0},{id:"Asia/Taipei",title:$.t("Taipei"),offset:0},{id:"Asia/Tehran",title:$.t("Tehran"),offset:0},{id:"Asia/Tokyo",title:$.t("Tokyo"),offset:0},{id:"Atlantic/Reykjavik",title:$.t("Reykjavik"),offset:0},{id:"Australia/Adelaide",title:$.t("Adelaide"),offset:0},{id:"Australia/Brisbane",title:$.t("Brisbane"),offset:0},{id:"Australia/Perth",title:$.t("Perth"),offset:0},{id:"Australia/Sydney",title:$.t("Sydney"),offset:0},{id:"Europe/Athens",title:$.t("Athens"),offset:0},{id:"Europe/Belgrade",title:$.t("Belgrade"),offset:0},{id:"Europe/Berlin",title:$.t("Berlin"),offset:0},{id:"Europe/Copenhagen",title:$.t("Copenhagen"),offset:0},{id:"Europe/Helsinki",title:$.t("Helsinki"),offset:0},{id:"Europe/Istanbul",title:$.t("Istanbul"),offset:0},{id:"Europe/London",title:$.t("London"),offset:0},{id:"Europe/Luxembourg",title:$.t("Luxembourg"),offset:0},{id:"Europe/Madrid",title:$.t("Madrid"),offset:0},{id:"Europe/Moscow",title:$.t("Moscow"),offset:0},{id:"Europe/Oslo",title:$.t("Oslo"),offset:0},{id:"Europe/Paris",title:$.t("Paris"),offset:0},{id:"Europe/Riga",title:$.t("Riga"),offset:0},{id:"Europe/Rome",title:$.t("Rome"),offset:0},{id:"Europe/Stockholm",title:$.t("Stockholm"),offset:0},{id:"Europe/Tallinn",title:$.t("Tallinn"),offset:0},{id:"Europe/Vilnius",title:$.t("Vilnius"),offset:0},{id:"Europe/Warsaw",title:$.t("Warsaw"),offset:0},{id:"Europe/Zurich",title:$.t("Zurich"),offset:0},{id:"Pacific/Auckland",title:$.t("New Zealand"),offset:0},{id:"Pacific/Chatham",title:$.t("Chatham Islands"),offset:0},{id:"Pacific/Fakaofo",title:$.t("Tokelau"),offset:0},{id:"Pacific/Honolulu",title:$.t("Honolulu"),offset:0},{id:"Pacific/Norfolk",title:$.t("Norfolk Island"),offset:0}],a=0,l=s;a<l.length;a++)c=l[a],h=Object(o.a)(c.id),c.title="("+h.string+") "+c.title,c.offset=h.offset;s.sort(function(e,t){var i=e.offset-t.offset;return 0!==i?i:e.title.localeCompare(t.title)}),u=r.concat(s)},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DateFormatter",function(){return o
}),n=i(21),o=function(){function e(){}return e.prototype.format=function(e){return n.customFormatters&&n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.format(e):Object(n.numberToStringWithLeadingZero)(e.getUTCFullYear(),4)+"-"+Object(n.numberToStringWithLeadingZero)(e.getUTCMonth()+1,2)+"-"+Object(n.numberToStringWithLeadingZero)(e.getUTCDate(),2)},e.prototype.formatLocal=function(e){return n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.formatLocal?n.customFormatters.dateFormatter.formatLocal(e):n.customFormatters.dateFormatter.format(e):Object(n.numberToStringWithLeadingZero)(e.getFullYear(),4)+"-"+Object(n.numberToStringWithLeadingZero)(e.getMonth()+1,2)+"-"+Object(n.numberToStringWithLeadingZero)(e.getDate(),2)},e}()},function(e,t,i){"use strict";function n(e,t){var i,n;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,r&&(n=r.get(i)),n||(n=i.ownerDocument.createRange(),n.selectNodeContents(i),r&&r.set(i,n)),n.createContextualFragment(e)}function o(e,t){var i,o,r,s=n(e,t);if("firstElementChild"in s)i=s.firstElementChild;else for(i=null,o=0;o<s.childNodes.length;o++)if(r=s.childNodes[o],1===r.nodeType){i=r;break}return null!==i&&s.removeChild(i),i}t.a=n,t.b=o;var r;"WeakMap"in window&&(r=new WeakMap)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolBarsPatternMode",function(){return n});var n;!function(e){e[e.Bars=0]="Bars",e[e.Line=1]="Line",e[e.OpenClose=2]="OpenClose",e[e.LineOpen=3]="LineOpen",e[e.LineHigh=4]="LineHigh",e[e.LineLow=5]="LineLow",e[e.LineHL2=6]="LineHL2"}(n||(n={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.reduce(function(e,t,i){return~e.indexOf(t)||e.push(t),e},[])},e.exports=t.default},function(e,t,i){"use strict";function n(e,t,i){var n,o,r,s,a=null,l=0;return i=i||{},s=function(){l=!1===i.leading?0:Date.now(),a=null,r=e.apply(n,o),a||(n=o=null)},function(){var c,h=Date.now();return l||!1!==i.leading||(l=h),c=t-(h-l),n=this,o=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),l=h,r=e.apply(n,o),a||(n=o=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"isDrawingToolbarVisible",function(){return c}),n=i(49),i.n(n),o=i(5),i.n(o),r=i(16),s=i.n(r),a=!o.enabled("hide_left_toolbar_by_default"),l=n.getBool("ChartDrawingToolbarWidget.visible",a),c=new s.a(l)},function(e,t){e.exports={inputWrapper:"inputWrapper-6bNZbTW4-",textInput:"textInput-3WRWEmm7-",error:"error-v0663AtN-",success:"success-7iP8kTY5-",textInputLeftDirection:"textInputLeftDirection-mlAXPh8V-",xsmall:"xsmall-3Ah_Or2--",small:"small-2bmxiJCE-",large:"large-1JDowW2I-",iconed:"iconed-3ZQvxTot-",inputIcon:"inputIcon-W_Bse-a1-",clearable:"clearable-2tabt_rj-",clearIcon:"clearIcon-389FR5J4-",grouped:"grouped-34HX1lDr-"}},function(e,t,i){"use strict";i(496),function(e){function t(e,t,i){
for(var n=0;n<a.length;n++)a[n]||(t=t.toLowerCase()),e.addEventListener(a[n]+t,i,!1)}function i(t){var i=t.data(h).complete;n(t),i&&e.isFunction(i)&&i()}function n(e){e.stop(!0),e.css("background-color",""),e.removeData(c),e.removeData(h)}function o(e){var t=e.data(c);t&&(!0!==t?(t--,t?(r(e),e.data(c,t)):i(e)):r(e))}function r(e){var t=e.css("background-color"),i=e.data(h),n=i.highlightColor||u,r=i.duration||d,s=i.easing||p;e.animate({"background-color":n},r,s).animate({"background-color":t},r,s,o.bind(e,e))}var s,a,l,c,h,u,d,p,_=!1,f=document.body||document.documentElement,m="animation",y="Webkit Moz O ms Khtml".split(" "),g="";if(void 0!==f.style.animationName&&(_=!0),!1===_)for(s=0;s<y.length;s++)if(void 0!==f.style[y[s]+"AnimationName"]){g=y[s],m=g+"Animation","-"+g.toLowerCase()+"-",_=!0;break}a=["webkit","moz","MS","o",""],l="flicker-",c=l+"enable",h=l+"options",u="#fbf8e9",d=400,p="swing",e.fn.highlight=function(i,o){switch(i){default:return i=void 0===i||i,this.each(function(){var n,s;_?(i=!0===i?"infinite":i,t(this,"AnimationEnd",function(){this.style[m]=""}),n=document.getElementsByTagName("html")[0].classList,n.contains("theme-dark")?this.style[m]="highlight-animation-theme-dark 0.4s ease-in-out "+i+" alternate":this.style[m]="highlight-animation 0.4s ease-in-out "+i+" alternate"):(s=e(this),s.data(c,i),s.data(h,e.extend({},o||{})),s.is(":animated")||r(s))});case!1:return this.each(function(){_?this.style[m]="":n(e(this))})}}}(jQuery)},function(e,t,i){"use strict";function n(e){return new Promise(function(t){i.e(2).then(function(n){var o=i(188).createDialog;t(o(r.a({},a,e)))}.bind(null,i)).catch(i.oe)})}function o(e){n(e).then(function(e){return e.open()})}var r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.createNoticeDialog=n,t.showNoticeDialog=o,r=i(1),s=i(14),i.n(s),i(11),a={width:400,destroyOnClose:!0,title:window.t("Notification"),content:window.t("You are notified"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]}},function(e,t,i){"use strict";function n(e){this._data=e,this.bars=e.bars,this._barWidth=o.optimalBarWidth(e.barSpacing),this._barBorderWidth=1}var o=i(27),r=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.bars,m=this._data.barSpacing,y=this._data.drawWick,g=this._data.drawBorder,v=this._data.wickColor,S=this._barBorderWidth,b=this._barWidth;if(e.lineCap="square",e.lineStyle=this._data.lineStyle,m<1){if(y){for(e.strokeStyle=v,e.lineWidth=1,e.beginPath(),h=f.length;h-- >0;)u=f[h],e.moveTo(u.time,u.low),e.lineTo(u.time,u.high);e.stroke()}for(e.lineWidth=1,d="",p=!1,e.beginPath(),h=f.length;h-- >0;)u=f[h],c=u.time,d!==u.color&&(p&&(e.stroke(),e.beginPath(),p=!1),e.strokeStyle=u.color,d=u.color),e.moveTo(u.time,u.open),e.lineTo(u.time,u.close),p=!0;p&&e.stroke()}else{
if(f=f.slice().sort(function(e,t){return e.color>t.color?-1:e.color<t.color?1:0}),e.translate(-.5,-.5),e.lineWidth=S,y)for(_=v,e.fillStyle=v,h=f.length;h--;)u=f[h],c=u.time,t=u.open,i=u.high,n=u.low,o=u.close,u.wickColor&&u.wickColor!==_&&(e.fillStyle=u.wickColor,_=u.wickColor),a=Math.min(t,o),l=Math.max(t,o),u.hollow?(e.fillRect(c,i,1,a-i),e.fillRect(c,l,1,n-l)):e.fillRect(c,i,1,n-i);if(g)for(h=f.length;h--;)u=f[h],f[h+1]&&u.borderColor===f[h+1].borderColor||(e.fillStyle=u.borderColor),u.hollow||(c=u.time,t=u.open,o=u.close,r=Math.round(c-b),s=Math.round(c+b),a=Math.min(t,o),l=Math.max(t,o),e.fillRect(r,a,s-r+1,l-a+1));for(h=f.length;h--;)u=f[h],c=u.time,t=u.open,i=u.high,n=u.low,o=u.close,r=Math.round(c-b),s=Math.round(c+b),a=Math.min(t,o),l=Math.max(t,o),f[h+1]&&u.color===f[h+1].color||(e.strokeStyle=u.color),e.fillStyle=u.color,Math.abs(a-l)<=1&&(e.fillStyle=u.borderColor),u.hollow?(e.translate(-.5,-.5),e.strokeRect(r+1,a+1,s-r,l-a),e.translate(.5,.5)):(g&&(r+=1,a+=1,s-=1,l-=1),e.fillRect(r,a,s-r+1,l-a+1))}},n.prototype.hitTest=function(e){var t,i,n,s,a=this.bars,l=.5*this._data.barSpacing;if(0===a.length)return null;if(e.x<a[0].time-l)return null;if(e.x>a[a.length-1].time+l)return null;for(t=null,i=0;i<a.length;++i)if(n=a[i],e.x<=n.time+l){t=n;break}return s=o.selectionTolerance(this._barBorderWidth),t&&t.high-s<=e.y&&e.y<=t.low+s?this._data.hittest||new r(r.REGULAR):null},t.PaneRendererCandles=TradingView.PaneRendererCandles=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ScaleType",function(){return n}),i.d(t,"plotShapesData",function(){return o}),i(11),function(e){e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None"}(n||(n={})),o={shape_arrow_down:{guiName:$.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown"},shape_arrow_up:{guiName:$.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup"},shape_circle:{guiName:$.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle"},shape_cross:{guiName:$.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross"},shape_diamond:{guiName:$.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond"},shape_flag:{guiName:$.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag"},shape_label_down:{guiName:$.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown"},shape_label_up:{guiName:$.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup"},shape_square:{guiName:$.t("Square"),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square"},shape_triangle_down:{guiName:$.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown"},shape_triangle_up:{guiName:$.t("Triangle Up"),id:"shape_triangle_up",
paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup"},shape_xcross:{guiName:$.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross"}}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MarkLocation",function(){return n}),i.d(t,"HAlign",function(){return o}),i.d(t,"VAlign",function(){return r}),i.d(t,"LineStyle",function(){return s}),function(e){e.AboveBar="AboveBar",e.BelowBar="BelowBar",e.Top="Top",e.Bottom="Bottom",e.Right="Right",e.Left="Left",e.Absolute="Absolute",e.AbsoluteUp="AbsoluteUp",e.AbsoluteDown="AbsoluteDown"}(n||(n={})),function(e){e.Left="left",e.Center="center",e.Right="right"}(o||(o={})),function(e){e.Top="top",e.Middle="middle",e.Bottom="bottom"}(r||(r={})),function(e){e[e.Solid=0]="Solid",e[e.Dotted=1]="Dotted",e[e.Dashed=2]="Dashed"}(s||(s={}))},,function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"BarsRange",function(){return o}),n=i(7),i.n(n),o=function(){function e(e,t){Object(n.assert)(e<=t,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=e,this._lastBar=t}return e.prototype.firstBar=function(){return this._firstBar},e.prototype.lastBar=function(){return this._lastBar},e.prototype.count=function(){return this._lastBar-this._firstBar+1},e.prototype.contains=function(e){return this._firstBar<=e&&e<=this._lastBar},e.prototype.equals=function(e){return this._firstBar===e.firstBar()&&this._lastBar===e.lastBar()},e}()},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";!function(e){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var t=function(t){var i=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/i}(document.createElement("canvas").getContext("2d"));t<=1||(e.hidpiCanvasRatio=t,function(e){var i,n,o=function(e,t){for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},r={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4]};e.drawImagePatchedSource=e.drawImage,i=e.drawImage,e.drawImagePatchedSourceAndDest=function(e){var n,o=Array.prototype.slice.call(arguments);for(n=1;n<o.length;++n)o[n]&&(o[n]*=t);return o.length>5&&("width"in e&&(o[3]=Math.min(e.width,Math.max(1,o[3]))),"height"in e&&(o[4]=Math.min(e.height,Math.max(1,o[4])))),i.apply(this,o)},o(r,function(i,n){var o=e[n];e[n]=function(){var e,n;if("all"===i)for(n=[],e=arguments.length;0<e--;)n[e]=arguments[e]*t;else for(n=Array.prototype.slice.call(arguments),e=i.length;0<e--;)n[i[e]]&&(n[i[e]]=n[i[e]]*t);return o.apply(this,n)}}),e.drawImage=function(e){return function(){
return arguments[0]instanceof HTMLCanvasElement?e.drawImagePatchedSourceAndDest.apply(this,arguments):e.drawImagePatchedSource.apply(this,arguments)}}(e),n=/(\d+(?:\.\d+)?)(px|em|rem|pt)/g,e.fillText=function(e){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=t,i[2]*=t,this.font=this.font.replace(n,function(e,i,n){return i*t+n}),e.apply(this,i),this.font=this.font.replace(n,function(e,i,n){return i/t+n})}}(e.fillText),e.strokeText=function(e){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=t,i[2]*=t,this.font=this.font.replace(n,function(e,i,n){return i*t+n}),e.apply(this,i),this.font=this.font.replace(n,function(e,i,n){return i/t+n})}}(e.strokeText)}(CanvasRenderingContext2D.prototype),function(e){e.getContext=function(e){return function(i){var n=e.call(this,i);return"2d"===i&&this.width!==Math.floor(parseInt(this.style.width)*t)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=t,this.height*=t),n}}(e.getContext)}(HTMLCanvasElement.prototype))}}(window)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolPitchforkStyle",function(){return n});var n;!function(e){e[e.Original=0]="Original",e[e.Schiff=1]="Schiff",e[e.Inside=2]="Inside",e[e.Schiff2=3]="Schiff2"}(n||(n={}))},function(e,t){},function(e,t,i){"use strict";function n(e,t){i.e(21).then(i.bind(null,699)).then(function(i){new i.ChangeIntervalDialog(e).show(t)})}Object.defineProperty(t,"__esModule",{value:!0}),t.showChangeIntervalDialog=n},function(e,t,i){"use strict";function n(e,t){var i,n;return void 0===e&&(e=[]),void 0===t&&(t=[]),i=document.createElement("div"),n=document.createElement("div"),i.appendChild(n),i.classList.add(o.container),n.classList.add(o.inner),e.forEach(function(e){i.classList.add(o[e])}),t.forEach(function(e){i.classList.add(o[e])}),i}var o;t.a=n,o=i(478),i.n(o)},function(e,t,i){"use strict";function n(e){return Object(U.fetch)("/theme/?themeName="+encodeURIComponent(e),{credentials:"include",method:"GET"}).then(function(e){return e.json()}).then(function(e){var t={};return e.content&&(t.content=JSON.parse(e.content)),t})}function o(){return Y||Object(U.fetch)("/themes/",{credentials:"include",method:"GET"}).then(function(e){return Y=e.json()})}function r(e,t){var i=new FormData;return i.append("content",JSON.stringify(t)),i.append("name",e),Y=null,Object(U.fetch)("/save-theme/",{credentials:"include",method:"POST",body:i}).then(function(e){return e.json()},function(e){return $.logError(e)})}function s(e){var t=new FormData;return t.append("name",e),Y=null,Object(U.fetch)("/remove-theme/",{credentials:"include",method:"POST",body:t}).then(function(e){return e.json()},function(e){return $.logError(e)})}function a(e){return n(e).then(function(e){return!!e.content})}function l(){return J||(J=new Promise(function(e){i.e(22).then(function(t){var n,o=i(1245),r=i(1246);e((n={},n[Z.Light]=r,n[Z.Dark]=o,n))}.bind(null,i)).catch(i.oe)})),J}function c(){return[Z.Light,Z.Dark]}function h(){return l().then(function(e){var t;return t={},
t[Z.Light]=JSON.parse(e[Z.Light]),t[Z.Dark]=JSON.parse(e[Z.Dark]),t})}function u(e){return h().then(function(t){return t[e]})}function d(e){return X[e]||e}function p(e){return h().then(function(t){return c().some(function(i){return _(t[i],e)})})}function _(e,t){var i=e.content===t.content;return m(e.content,function(e,n){var o=g(e,t.content);return!(i=f(n,o))}),i}function f(e,t){if("string"==typeof e&&"string"==typeof t)try{return Object(G.areEqualRgb)(Object(G.parseRgb)(e),Object(G.parseRgb)(t))}catch(i){return e===t}return e===t}function m(e,t){void 0===e&&(e={});try{y(e,[],t)}catch(e){return}}function y(e,t,i){var n,o;for(n in e)if(e.hasOwnProperty(n))if(o=t.concat(n),"object"==typeof e[n])y(e[n],o,i);else if(i(o,e[n]))throw Error("exit")}function g(e,t){var i,n;for(void 0===t&&(t={}),i=t,n=0;n<e.length;n++){if(!i||"object"!=typeof i)return;i=i[e[n]]}if("string"==typeof i||"number"==typeof i)return i}function v(e,t){var i,n;return void 0===t&&(t=[]),(i=ee[e])?oe.test(i)?i:(n=i,t.push(e),-1!==t.indexOf(n)?(console.warn("Colors definitions cycled"),i):t.length>ne?(console.warn("Too many variables-link in HEX-color search: "+t[0]),null):v(n,t)):null}function S(e,t){var i=re[e];if(!i)throw Error("No such color "+e);return i}function b(e,t){var i,n;t||(t=window),i=t.document.documentElement;for(n in ae)ae[n].className&&i.classList.toggle(ae[n].className,n===e)}function w(e){return!e.isPrivate}function P(){return ae[ce.value()]||ae[le]}function T(e){return P().getThemedColor(e)}function x(e){ce.setValue(e)}function C(){x(Object(z.getValue)(he)||le)}function L(){return Object(z.getValue)(he)||null}function I(){Object(z.setValue)(he,P().name,{forceFlush:!0})}function A(e){return n(e)}function k(){return o()}function E(){return c()}function M(e){return u(e).then(function(e){return e||{content:void 0}})}function V(){return h()}function D(e,t){return r(e,t)}function O(e){return s(e)}function R(e){return a(e)}function B(e){return d(e)}function N(e){return p(e)}function F(e){return{content:{chartProperties:{paneProperties:e.m_model.properties().paneProperties.state(),scalesProperties:e.m_model.properties().scalesProperties.state()},mainSourceProperties:e.m_model.m_mainSeries.properties().state()}}}var W,H,j,z,U,q,$,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se,ae,le,ce,he;Object.defineProperty(t,"__esModule",{value:!0}),W=i(248),i(11),H=i(16),j=i.n(H),z=i(49),U=i(336),q=i(4),$=Object(q.getLogger)("Themes.Provider"),Y=null,G=i(24),function(e){e.Light="light",e.Dark="dark"}(Z||(Z={})),J=null,K={},K[Z.Light]=window.t("Light",{context:"colorThemeName"}),K[Z.Dark]=window.t("Dark",{context:"colorThemeName"}),K.Black=window.t("Black",{context:"colorThemeName"}),K.Blue=window.t("Blue",{context:"colorThemeName"}),K.Grey=window.t("Grey",{context:"colorThemeName"}),K.White=window.t("White",{context:"colorThemeName"}),X=K,Q=i(480),ee=i(481),te=i(7),ie={},ne=Object.keys(ee).length,oe=/^#[0-9A-F]{6}$/i,Object.keys(ee).forEach(function(e){var t=v(e);ie[e]=Object(te.ensureNotNull)(t)}),re=ie,i.d(t,"themes",function(){return ae}),
i.d(t,"DEFAULT_THEME",function(){return le}),i.d(t,"watchedTheme",function(){return ce}),t.applyTheme=b,t.isPublicTheme=w,t.getCurrentTheme=P,t.setThemedColor=T,t.setTheme=x,t.restoreTheme=C,t.savedThemeName=L,t.syncTheme=I,t.getTheme=A,t.getThemeNames=k,t.getStdThemeNames=E,t.getStdTheme=M,t.getStdThemes=V,t.saveTheme=D,t.removeTheme=O,t.isThemeExist=R,t.translateStdThemeName=B,t.isStdTheme=N,t.extractThemeFromModel=F,se={},se[Z.Light]={name:Z.Light,label:window.t("Light",{context:"colorThemeName"}),className:"theme-light",order:2,getThemedColor:function(e){return S(e)}},se[Z.Dark]={name:Z.Dark,label:window.t("Dark",{context:"colorThemeName"}),className:"theme-dark",order:1,getThemedColor:function(e){return S(Q[e])}},ae=se,le="light",ce=new j.a,ce.subscribe(function(e){b(e,window)}),he="current_theme.name"},function(e,t,i){"use strict";var n=i(31),o=i(12).parseJSONorNot,r=i(4).getLogger("Chart.SaveloadAdapter.Library"),s=function(){var e,t,i,s,a={},l=null;return a.setCustomAdapter=function(e){l=e,r.logNormal("Use custom save-load adapter")},a.initialize=function(n,o,r,a){e=n,t=o,i=r,s=a},a.updateUser=function(e){t=e},a.getCharts=function(n,a){function c(e){e=e.map(function(e){return{id:e.id,name:e.name,image_url:e.id,modified_iso:e.timestamp,short_symbol:e.symbol,interval:e.resolution}}),n(e)}return l?void l.getAllCharts().then(c).catch(a):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t)),type:"GET",crossDomain:!0}).done(function(e){var t=o(e);if("ok"!==t.status)return r.logWarn("Charts list request failed: "+t.message),void a();c(t.data)}).fail(a)},a.removeChart=function(n,a){if(l)return void l.removeChart(n).then(a);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t),encodeURIComponent(n)),type:"DELETE",crossDomain:!0}).done(function(e){var t=o(e);"ok"!==t.status&&r.logWarn("Chart delete request failed: "+t.message),a()})},a.saveChart=function(n,a,c,h,u,d,p){var _,f=u.id.value(),m={name:n,content:JSON.stringify(h),symbol:a,resolution:c};if(l)return m.id=f,void l.saveChart(m).then(d).catch(p);_="{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t)),void 0!==f&&null!==f&&(_+="&chart="+encodeURIComponent(f)),$.ajax({url:_,data:m,type:"POST",crossDomain:!0}).done(function(e){var t=o(e);if("ok"!==t.status)return r.logWarn("Chart save request failed: "+t.message),void p();d(t.id)}).fail(function(){p()})},a.getChartContent=function(n,a,c){function h(e){var t=JSON.parse(e);return t.uid=n.id,t}if(l)return void l.getChartContent(n.id).then(function(e){var t=h(e);a(t)}).catch(c);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t),encodeURIComponent(n.id)),type:"GET",crossDomain:!0}).done(function(e){var t,i=o(e);if("ok"!==i.status)return void r.logWarn("Chart load request failed: "+i.message);t=h(i.data.content),a(t)
}).fail(function(){c&&c()})},a.loadChart=function(e){a.getChartContent(e,function(e){n.emit("chart_load_requested",e)},function(){r.logWarn("Error loading chart")})},a.removeStudyTemplate=function(n,a){if(l)return void l.removeStudyTemplate({name:n}).then(a);$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t),encodeURIComponent(n)),type:"DELETE",crossDomain:!0}).done(function(e){var t=o(e);"ok"!==t.status&&r.logWarn("Chart delete request failed: "+t.message),a()})},a.getStudyTemplateContent=function(n,r){if(l)return void l.getStudyTemplateContent({name:n}).then(function(e){r({content:e})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t),encodeURIComponent(n)),type:"GET",crossDomain:!0}).done(function(e){r(o(e).data)})},a.saveStudyTemplate=function(n,a){var c={name:n.name,content:n.content};if(l)return void l.saveStudyTemplate(c).then(a.bind(null,{error:""})).catch(function(e){a({error:null!=e?""+e:"error"})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t)),type:"POST",crossDomain:!0,data:c}).done(function(e){var t=o(e);"ok"!==t.status&&r.logWarn("Template save request failed: "+t.message),a({error:"ok"===t.status?"":t.status})})},a._templatesCache=null,a.getStudyTemplatesList=function(n){function c(e){e=e.map(function(e){return{is_default:!1,name:e.name}}),a._templatesCache=e,n(e)}return a._templatesCache?void n(a._templatesCache):(a._templatesCache=[],l?void l.getAllStudyTemplates().then(c):void $.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(e),encodeURIComponent(t)),type:"GET",crossDomain:!0}).done(function(e){if(null!==a._templatesCache){var t=o(e);if("ok"!==t.status)return void r.logWarn("Templates list request failed: "+t.message);c(t.data)}}))},a.invalidateStudyTemplatesList=function(){a._templatesCache=null},a}();e.exports=s},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.SaveRenameDialog=void 0,o=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),i(484),r=i(82),s={YES:"yes",CLOSE:"close"},a=0,t.SaveRenameDialog=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.fields,o=t.confirm,r=t.title,s=void 0===r?"":r,a=t.destroyOnClose,l=void 0===a||a,c=t.modal,h=void 0!==c&&c;n(this,e),this._$form=$("<div></div>"),this._fields=i,this._appendFieldsToForm(),this._title=s,this._destroyOnClose=l,this._modal=h,this._isConfirmDialogOpened=!1,o&&(this._needCheckConfirm=!0,this._shouldShowConfirm=o.shouldShowDialog,
this._getConfirmMessage=o.getMessage)}return o(e,[{key:"setField",value:function(e,t){this._fields.find(function(t){return t.name===e}).value=t}},{key:"show",value:function(){var e=this,t=this._createDialog();return new Promise(function(i){t.then(function(t){t.on("action:submit",function(t){return e._onSubmit(t,i)}),t.open(),t.on("beforeClose",e._unmountFields.bind(e)),e._fields[a].select()})})}},{key:"_appendFieldsToForm",value:function(){var e=this;this._fields.forEach(function(t){t.appendTo(e._$form)})}},{key:"_createDialog",value:function(){var e=this;return new Promise(function(t){i.e(2).then(function(n){var o=i(188).createDialog;t(o({type:e._modal?"modal":"popup",title:e._title,content:e._$form,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions i-align_right tv-dialog__section--no-border">',width:470,destroyOnClose:e._destroyOnClose,isClickOutFn:function(){if(e._isConfirmDialogOpened)return!1},actions:[{name:"submit",type:"primary",text:$.t("Save"),key:13,addClass:"js-submit-button"},{name:"cancel",type:"default",text:$.t("Cancel"),method:"close",addClass:"js-cancel-button"}]}))}.bind(null,i)).catch(i.oe)})}},{key:"_onSubmit",value:function(e,t){var i=this,n=this._validate();if(n)e.error(n.error),n.focus();else{if(!this._needCheckConfirm)return t(this._collectValues(),e),void e.close();Promise.resolve(this._shouldShowConfirm(this._collectValues())).then(function(n){if(!n)return t(i._collectValues(),e),void e.close();i._showConfirmDialog().then(function(n){n===s.CLOSE&&(e.focus(),i._fields[a].focus()),n===s.YES&&(t(i._collectValues(),e),e.close())})})}}},{key:"_showConfirmDialog",value:function(){var e=this;return new Promise(function(t){Promise.resolve(e._getConfirmMessage(e._collectValues())).then(function(i){e._isConfirmDialogOpened=!0,(0,r.createConfirmDialog)({type:"modal",content:i}).then(function(i){i.on("action:yes",function(e){t(s.YES),e.close()}),i.on("afterClose",function(){t(s.CLOSE),e._isConfirmDialogOpened=!1}),i.open()})})})}},{key:"_validate",value:function(){return this._fields.find(function(e){return!e.valid})}},{key:"_collectValues",value:function(){return this._fields.reduce(function(e,t){return e[t.name]=t.value,e},{})}},{key:"_unmountFields",value:function(){this._fields.forEach(function(e){e.unmount&&e.unmount()})}}]),e}()},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o;Object.defineProperty(t,"__esModule",{value:!0}),o=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),t.InputField=function(){function e(t){var i=t.label,o=t.name,r=t.maxLength,s=t.error,a=void 0===s?"":s;n(this,e),this._name=o,
this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+i+'</span>\n\t\t\t\t<input class="tv-control-input" type="text" name="'+o+'" maxlength="'+r+'"/>\n\t\t\t</label>'),this._$input=this._$field.find("input"),this._error=a}return o(e,[{key:"appendTo",value:function(e){e.append(this._$field)}},{key:"focus",value:function(){return this._$input.focus()}},{key:"select",value:function(){return this.focus().select()}},{key:"value",set:function(e){this._$input.val(e)},get:function(){return this._$input.val()}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._$input.val().trim()}},{key:"error",set:function(e){this._error=e},get:function(){return this._error}}]),e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ChartChangesWatcher",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e,t,i){this._hasChanges=!1,this._undoHistory=e,this._chartSaver=t,this._globalEvents=i,this._onValueChanged=new o.a,this._subscribe()}return e.prototype.destroy=function(){this._unsubscribe(),this._onValueChanged.destroy()},e.prototype.hasChanges=function(){return this._hasChanges},e.prototype.getOnChange=function(){return this._onValueChanged},e.prototype._subscribe=function(){this._globalEvents.subscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().subscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().subscribe(this,this._handleChartSaved)},e.prototype._unsubscribe=function(){this._globalEvents.unsubscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().unsubscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().unsubscribe(this,this._handleChartSaved)},e.prototype._setChanges=function(e){this._hasChanges=e,this._onValueChanged.fire(e)},e.prototype._handleChartLoaded=function(){this._setChanges(!1)},e.prototype._handleChangeUndoStack=function(){var e=this._undoHistory.undoStack().head();e&&!e.customFlag("doesnt_affect_save")&&this._setChanges(!0)},e.prototype._handleChartSaved=function(e){e&&this._setChanges(!1)},e}()},function(e,t,i){"use strict";function n(e,t){o.enabled("saveload_requires_authentication")?window.runOrSignIn(e,t):e()}var o;t.a=n,o=i(5),i.n(o)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"debounce",function(){return n});var n=function(e,t){function i(){e.apply(o,n)}var n,o,r=0;return function(){o=this,n=arguments,clearTimeout(r),r=setTimeout(i,t)}}},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"UndoMacroCommand",function(){return r}),n=i(1),o=i(43),r=function(e){function t(t){var i=e.call(this,t,!1)||this;return i._subcommands=[],i}return n.c(t,e),t.prototype.addCommand=function(e){this._subcommands.push(e)},t.prototype.isEmpty=function(){return 0===this._subcommands.length},t.prototype.redo=function(){
for(var e=0;e<this._subcommands.length;e++)this._subcommands[e].redo()},t.prototype.undo=function(){for(var e=this._subcommands.length-1;e>=0;e--)this._subcommands[e].undo()},t}(o.UndoCommand)},function(e,t,i){"use strict";function n(e){var t,i;if(""===e)return Promise.resolve(null);if(t=JSON.parse(e),!Object(o.isObject)(t)||"function"==typeof t)return Promise.reject(Error("Non-object content in the non-series envelope"));if(Object(o.hasProperty)(t,"indexes_replace"))return Promise.resolve({indexes_replace:!0});if(i={indexes_replace:!1},Object(o.hasProperty)(t,"offsets")&&(i.offsets=t.offsets),Object(o.hasProperty)(t,"isUpdate")){if("boolean"!=typeof t.isUpdate)return Promise.reject(Error('Invalid type of "isUpdate" field'));i.isUpdate=t.isUpdate}return Object(o.hasProperty)(t,"data")&&(i.data=t.data),Object(o.hasProperty)(t,"graphicsCmds")&&(i.graphicsCmds=Object(r.b)(t.graphicsCmds)),Promise.resolve(i)}var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.unpackNonSeriesData=n,i(1),o=i(260),i.n(o),r=i(261)},function(e,t,i){"use strict";function n(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function o(e,t){return t in e}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=n,t.hasProperty=o},function(e,t,i){"use strict";function n(e){var t,i,n,o;if(Object(a.hasProperty)(e,"create"),Object(a.hasProperty)(e,"erase"))for(t=e.erase,Object(s.assert)(Array.isArray(t),"Collection of erase commands should be array"),i=0,n=t;i<n.length;i++)o=n[i],Object(s.assert)("all"===o.action||"one"===o.action,"Erase command action should be 'all' or 'one'");return e}function o(e,t){e.forEach(function(e){var i,n,o;for(i=0,n=e;i<n.length;i++)o=n[i],o.indexes=t})}function r(e,t){for(var i=0;i<e.length;++i)if(e[i].id===t)return i;return-1}var s,a,l,c,h;t.b=n,i.d(t,"a",function(){return h}),s=i(7),i.n(s),a=i(260),i.n(a),l=i(165),c=i(262),h=function(){function e(){this.indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._hhistsByTimePointIndex=new Map}return e.prototype.horizlines=function(){return this._horizlines},e.prototype.vertlines=function(){return this._vertlines},e.prototype.lines=function(){return this._lines},e.prototype.hlines=function(){return this._hlines},e.prototype.textmarks=function(){return this._textmarks},e.prototype.shapemarks=function(){return this._shapemarks},e.prototype.backgrounds=function(){return this._backgrounds},e.prototype.polygons=function(){return this._polygons},e.prototype.trendchannels=function(){return this._trendchannels},e.prototype.hhists=function(){return this._hhists},e.prototype.hhistsByTimePointIndex=function(){return this._hhistsByTimePointIndex},e.prototype.clear=function(){this.indexes=[],this._clearPrimitives()},e.prototype.extract=function(){var e={indexes:this.indexes,horizlines:this._horizlines,vertlines:this._vertlines,lines:this._lines,hlines:this._hlines,
textmarks:this._textmarks,shapemarks:this._shapemarks,backgrounds:this._backgrounds,polygons:this._polygons,trendchannels:this._trendchannels,hhists:this._hhists};return this.indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._hhistsByTimePointIndex.clear(),new c.a("data",e)},e.prototype.replaceIndexesTo=function(e){this.indexes=e,o(this._horizlines,e),o(this._vertlines,e),o(this._lines,e),o(this._hlines,e),o(this._textmarks,e),o(this._shapemarks,e),o(this._backgrounds,e),o(this._polygons,e),o(this._trendchannels,e),o(this._hhists,e),this._postProcess()},e.prototype.processCommands=function(e,t){void 0!==e.erase&&this._processEraseCommands(e.erase),void 0!==e.create&&this._processCreateCommands(e.create,t)},e.prototype._processCreateCommands=function(e,t){var i,n;for(i in e)if(e.hasOwnProperty(i))switch(n=i,Object(s.assert)(n in t,"There is a '"+n+"' in study response, but it doesn't present in graphics info!"),n){case"horizlines":Object(l.b)(this._horizlines,e[n],t[n],this.indexes);break;case"vertlines":Object(l.b)(this._vertlines,e[n],t[n],this.indexes);break;case"lines":Object(l.b)(this._lines,e[n],t[n],this.indexes);break;case"hlines":Object(l.b)(this._hlines,e[n],t[n],this.indexes);break;case"textmarks":Object(l.b)(this._textmarks,e[n],t[n],this.indexes);break;case"shapemarks":Object(l.b)(this._shapemarks,e[n],t[n],this.indexes);break;case"backgrounds":Object(l.b)(this._backgrounds,e[n],t[n],this.indexes);break;case"polygons":Object(l.b)(this._polygons,e[n],t[n],this.indexes);break;case"trendchannels":Object(l.b)(this._trendchannels,e[n],t[n],this.indexes);break;case"hhists":Object(l.b)(this._hhists,e[n],t[n],this.indexes)}this._postProcess()},e.prototype._processEraseCommands=function(e){var t,i,n,o=function(e){if("all"===e.action)s._clearPrimitives();else{({horizlines:s._horizlines,vertlines:s._vertlines,lines:s._lines,hlines:s._hlines,textmarks:s._textmarks,shapemarks:s._shapemarks,backgrounds:s._backgrounds,polygons:s._polygons,trendchannels:s._trendchannels,hhists:s._hhists})[e.type].forEach(function(t){var i=r(t[0].items,e.id);i>=0&&t[0].items.splice(i,1)})}},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],o(n)},e.prototype._postProcess=function(){this._hhists.size>0&&Object(l.e)(this)},e.prototype._clearPrimitives=function(){this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._hhistsByTimePointIndex.clear()},e}()},function(e,t,i){"use strict";function n(){return new c}function o(e){return new c("state",e)}function r(e){var t,i,n,o,r,c=new Set;for(t=0,i=l.d;t<i.length;t++)n=i[t],s(c,e[n]());return o=[],c.forEach(function(e){return o.push(e)}),o.sort(function(e,t){return e-t}),r={indexes:o},e.horizlines().forEach(function(e,t){
var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.horizlines=r.horizlines||[],Object(l.a)(r.horizlines,a.a({},d,{startIndex:o.indexOf(c[d.startIndex]),endIndex:o.indexOf(c[d.endIndex])}),t)}),e.vertlines().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.vertlines=r.vertlines||[],Object(l.a)(r.vertlines,a.a({},d,{index:o.indexOf(c[d.index])}),t)}),e.lines().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.lines=r.lines||[],Object(l.a)(r.lines,a.a({},d,{startIndex:o.indexOf(c[d.startIndex]),endIndex:o.indexOf(c[d.endIndex])}),t)}),e.hlines().forEach(function(e,t){var i,n,o,s,a,c;for(i=0,n=e;i<n.length;i++)for(o=n[i],s=0,a=o.items;s<a.length;s++)c=a[s],r.hlines=r.hlines||[],Object(l.a)(r.hlines,c,t)}),e.textmarks().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.textmarks=r.textmarks||[],Object(l.a)(r.textmarks,a.a({},d,{time:o.indexOf(c[d.time])}),t)}),e.shapemarks().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.shapemarks=r.shapemarks||[],Object(l.a)(r.shapemarks,a.a({},d,{time:o.indexOf(c[d.time])}),t)}),e.backgrounds().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.backgrounds=r.backgrounds||[],Object(l.a)(r.backgrounds,a.a({},d,{start:o.indexOf(c[d.start]),stop:o.indexOf(c[d.stop])}),t)}),e.polygons().forEach(function(e,t){var i,n,s,c=function(e){var i,n,s,c,h=e.indexes;for(i=0,n=e.items;i<n.length;i++)s=n[i],c=s.points.map(function(e){return a.a({},e,{index:o.indexOf(h[e.index])})}),r.polygons=r.polygons||[],Object(l.a)(r.polygons,a.a({},s,{points:c}),t)};for(i=0,n=e;i<n.length;i++)s=n[i],c(s)}),e.trendchannels().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.trendchannels=r.trendchannels||[],Object(l.a)(r.trendchannels,a.a({},d,{startIndex:o.indexOf(c[d.startIndex]),endIndex:o.indexOf(c[d.endIndex])}),t)}),e.hhists().forEach(function(e,t){var i,n,s,c,h,u,d;for(i=0,n=e;i<n.length;i++)for(s=n[i],c=s.indexes,h=0,u=s.items;h<u.length;h++)d=u[h],r.hhists=r.hhists||[],Object(l.a)(r.hhists,a.a({},d,{firstBarTime:o.indexOf(c[d.firstBarTime]),lastBarTime:o.indexOf(c[d.lastBarTime])}),t)}),r}function s(e,t){t.forEach(function(t,i){var n,o,r,s,a,l;for(n=0,o=t;n<o.length;n++)for(r=o[n],s=0,a=r.indexes;s<a.length;s++)l=a[s],e.add(l)})}var a,l,c;i.d(t,"a",function(){return c}),t.b=n,t.c=o,t.d=r,a=i(1),l=i(165),c=function(){function e(e,t){var i,n;this.indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,
this._hhistsByTimePointIndex=new Map,"data"===e?(i=t,this.indexes=i.indexes,this._horizlines=i.horizlines,this._vertlines=i.vertlines,this._lines=i.lines,this._hlines=i.hlines,this._textmarks=i.textmarks,this._shapemarks=i.shapemarks,this._backgrounds=i.backgrounds,this._polygons=i.polygons,this._trendchannels=i.trendchannels,this._hhists=i.hhists,this._postProcess()):"state"===e&&(n=t,this.indexes=n.indexes||[],Object(l.b)(this._horizlines,n.horizlines,void 0,this.indexes),Object(l.b)(this._vertlines,n.vertlines,void 0,this.indexes),Object(l.b)(this._lines,n.lines,void 0,this.indexes),Object(l.b)(this._hlines,n.hlines,void 0,this.indexes),Object(l.b)(this._textmarks,n.textmarks,void 0,this.indexes),Object(l.b)(this._shapemarks,n.shapemarks,void 0,this.indexes),Object(l.b)(this._backgrounds,n.backgrounds,void 0,this.indexes),Object(l.b)(this._polygons,n.polygons,void 0,this.indexes),Object(l.b)(this._trendchannels,n.trendchannels,void 0,this.indexes),Object(l.b)(this._hhists,n.hhists,void 0,this.indexes),this._postProcess())}return e.prototype.horizlines=function(){return this._horizlines},e.prototype.vertlines=function(){return this._vertlines},e.prototype.lines=function(){return this._lines},e.prototype.hlines=function(){return this._hlines},e.prototype.textmarks=function(){return this._textmarks},e.prototype.shapemarks=function(){return this._shapemarks},e.prototype.backgrounds=function(){return this._backgrounds},e.prototype.polygons=function(){return this._polygons},e.prototype.trendchannels=function(){return this._trendchannels},e.prototype.hhists=function(){return this._hhists},e.prototype.hhistsByTimePointIndex=function(){return this._hhistsByTimePointIndex},e.prototype._postProcess=function(){this._hhists.size>0&&Object(l.e)(this)},e}()},function(e,t,i){"use strict";function n(e){this.bars=e.bars,this.barSpacing=e.barSpacing,this.barWidth=o.optimalBarWidth(e.barSpacing),this.barLineWidth=Math.max(1,Math.round(this.barWidth)),this.dontDrawOpen=e.dontDrawOpen}var o=i(27),r=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n;for(e.save(),e.translate(.5,.5),i=0;i<this.bars.length;++i)n=this.bars[i],t!==n.color&&(e.fillStyle=n.color,t=n.color),e.fillRect(Math.round(n.time-this.barLineWidth/2),Math.round(n.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(n.low-n.high+this.barWidth)),this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||e.fillRect(Math.round(n.time-1.5*this.barWidth),Math.round(n.open-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)),e.fillRect(Math.round(n.time),Math.round(n.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)));e.restore()},n.prototype.hitTest=function(e){var t,i,n,s,a=this.bars,l=.5*this.barSpacing;if(0===a.length)return null;if(e.x<a[0].time-l)return null;if(e.x>a[a.length-1].time+l)return null;for(t=null,i=0;i<a.length;++i)if(n=a[i],e.x<=n.time+l){t=n;break}return s=o.selectionTolerance(this.barLineWidth),t&&t.high-s<=e.y&&e.y<=t.low+s?new r(r.REGULAR):null},
t.PaneRendererBars=TradingView.PaneRendererBars=n},function(e,t,i){"use strict";function n(e){e.forceLineColor=!1,r.call(this,e),this.color1=e.color1,this.color2=e.color2,this.bottom=e.bottom,this.isSeries=!!e.isSeries,this._simpleMode=e.simpleMode}var o=i(27).coordinateIsValid,r=i(136).PaneRendererLine;inherit(n,r),n.prototype.draw=function(e){var t,i,n,s,a,l,c,h,u,d,p,_;if(0!==this.items.length){for(e.lineCap="square",e.strokeStyle=this.lineColor,e.lineWidth=this.lineWidth,e.lineStyle=this.lineStyle,e.lineWidth=1,t=0;t<this.items.length&&!o(this.items[t].y);)t++;for(i=this.items.length-1;i>=0&&!o(this.items[i].y);)i--;if(!(t>=i)){for(e.translate(.5,.5),n={},s=this.items,a=t;a<=i;a++)l=s[a],c=l.style?l.style.color:this.lineColor,a<i&&s[a+1].style&&(h=s[a+1].style.color,c!==h&&(u=n[h]||[],u.push(l),n[h]=u)),d=n[c]||[],d.push(l),n[c]=d;for(c in n){for(d=n[c],e.beginPath(),p=0,a=0;a<d.length;a++)d[a].style&&d[a].style.color!==c&&(e.moveTo(d[p].x,this.bottom),this.walkLine(e,d.slice(p,a),!0,this.bottom),p=a);e.moveTo(d[p].x,this.bottom),this.walkLine(e,d.slice(p,d.length),!0,this.bottom),e.closePath(),this.isSeries?(_=e.createLinearGradient(0,0,0,this.bottom),_.addColorStop(0,this.color1),_.addColorStop(1,this.color2),e.fillStyle=_,this._simpleMode=!0):e.fillStyle=c,e.fill()}e.lineWidth=this.lineWidth,r.prototype.draw.call(this,e)}}},t.PaneRendererArea=TradingView.PaneRendererArea=n},function(e,t,i){"use strict";function n(e,t,i,n,o){var r,s,a,l,c;for(this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=this._fontStyle(t,i,n,o),this._fontSize=o,r=$("<canvas>"),s=r.get(0).getContext("2d"),s.font=this._font,a=0,l=0;l<this._lines.length;l++)c=s.measureText(this._lines[l]).width,a=Math.max(a,c);this.textImageWidth=a+1,this.textImageHeight=this._lines.length*o}n.prototype.paintTo=function(e,t,i,n,o,r){var s=this._getTextImage(t),a=this._x(i,o,this.textImageWidth),l=this._y(n,r,this.textImageHeight);e.drawImage(s,a-.5,l-.5)},n.prototype._getTextImage=function(e){var t,i,n,o,r;if(this._canvasesMap[e])return this._canvasesMap[e].get(0);for(t=$("<canvas>").attr("width",this.textImageWidth).attr("height",this.textImageHeight),i=t.get(0).getContext("2d"),i.textBaseline="top",i.font=this._font,i.textAlign="center",i.fillStyle=e,n=Math.round(this.textImageWidth/2),o=0,r=0;r<this._lines.length;r++)i.fillText(this._lines[r],n,o),o+=this._fontSize;return this._canvasesMap[e]=t,t.get(0)},n.prototype._x=function(e,t,i){var n=e;switch(t){case"left":break;case"right":n-=i;break;case"center":n-=i/2}return Math.round(n)},n.prototype._y=function(e,t,i){var n=e;switch(t){case"top":break;case"bottom":n-=i;break;case"middle":n-=i/2}return Math.round(n)},n.prototype._fontStyle=function(e,t,i,n){return(e?"bold ":"")+(t?"italic ":"")+n+"px "+i},e.exports=n},function(e,t,i){"use strict";e.exports=function(e,t){var i,n=10,o=e%n;for(o&&(e=e-o+n),i=[];e<=t;e+=n)i.push(e);return i}},function(e,t,i){"use strict";function n(e){this._props=e,this._text="",this._size="12px",this._bold=!1}n.prototype.text=function(){
return this._text},n.prototype.setText=function(e){this._text=e},n.prototype.color=function(){return this._props.scalesProperties.textColor.value()},n.prototype.bold=function(){return this._bold},n.prototype.size=function(){return this._size},e.exports=n},function(e,t,i){"use strict";function n(e,t){this.handler=e,this.customId=t}function o(){}var r=i(12).declareClassAsPureInterface;TradingView.WEB_SOCKET_WAS_CONNECTED=!1,o.REBIND_STUDY_STANDALONE_TO_CHILD=1,o.REBIND_STUDY_CHILD_TO_STANDALONE=2,o.prototype.defaultWatchlistSymbols=function(){},o.prototype.defaultResolutions=function(){},o.prototype.supportedSymbolsTypes=function(){},o.prototype.supportedExchangesList=function(){},o.prototype.futuresRegex=function(){},o.prototype.quoteCreateSession=function(e){},o.prototype.quoteDeleteSession=function(e){},o.prototype.quoteSetFields=function(e,t){},o.prototype.quoteAddSymbols=function(e,t){},o.prototype.quoteRemoveSymbols=function(e,t){},o.prototype.quoteFastSymbols=function(e,t){},o.prototype.depthCreateSession=function(e,t,i){},o.prototype.depthDeleteSession=function(e){},o.prototype.depthSetSymbol=function(e,t){},o.prototype.depthClearSymbol=function(e){},o.prototype.depthSetScale=function(e,t){},o.prototype.chartCreateSession=function(e,t){},o.prototype.chartDeleteSession=function(e){},o.prototype.createSession=function(e,t){},o.prototype.removeSession=function(e){},o.prototype.connected=function(){},o.prototype.connect=function(){},o.prototype.disconnect=function(){},o.prototype.switchTimezone=function(e,t){},o.prototype.resolveSymbol=function(e,t,i,n,o){},o.prototype.createSeries=function(e,t,i,n,o,r,s){},o.prototype.removeSeries=function(e,t,i){},o.prototype.modifySeries=function(e,t,i,n,o,r){},o.prototype.requestMoreData=function(e,t,i,n){},o.prototype.requestMetadata=function(e,t,i){},o.prototype.isCanCreateStudy=function(e,t){},o.prototype.createStudy=function(e,t,i,n,o,r,s){},o.prototype.rebindStudy=function(e,t,i,n,o,r,s,a){},o.prototype.removeStudy=function(e,t,i){},o.prototype.modifyStudy=function(e,t,i,n,o){},o.prototype.createPointset=function(e,t,i,n,o,r,s){},o.prototype.modifyPointset=function(e,t,i,n,o){},o.prototype.removePointset=function(e,t,i){},o.prototype.requestMoreTickmarks=function(e,t,i,n){},o.prototype.requestFirstBarTime=function(e,t,i,n){},o.prototype._invokeHandler=function(e,t){},o.prototype._sendRequest=function(e,t){},o.prototype._onMessage=function(e){},o.prototype._convertTimescaleResponse=function(e){},o.prototype._dispathNotification=function(e){},o.prototype._invokeNotificationHandler=function(e,t,i){},o.prototype._notifySessions=function(e){},o.prototype.unpack=function(e){},o.prototype.searchSymbols=function(e,t,i,n,o,r,s,a,l){},o.prototype.serverTimeOffset=function(){},o.prototype.getMarks=function(e,t,i,n,o){},o.prototype.getTimescaleMarks=function(e,t,i,n,o){},r(o,"ChartApiInterface"),e.exports.HandlerInfo=n,e.exports.ChartApiInterface=o},function(e,t,i){"use strict";function n(e){var t=new Map;return e.plots.forEach(function(e,i){t.set(e.id,function(e){return e[i+1]})}),t}
Object.defineProperty(t,"__esModule",{value:!0}),t.studyPlotFunctionMap=n},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var o=t||this.createPropertiesObject("linetoolfibwedge");r.call(this,e,o),e._fibWedgeLabelsCache||(e._fibWedgeLabelsCache=new n),i.e(0).then(function(e){var t=i(696).FibWedgePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.getCache=function(){return this._model._fibWedgeLabelsCache||(this._model._fibWedgeLabelsCache=new n),this._model._fibWedgeLabelsCache},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Fib Wedge"},o.prototype.name=function(){return"Fib Wedge"},o.prototype.setPoint=function(e,t){var i,n,o,s,a,l,c;r.prototype.setPoint.call(this,e,t),this._recursiveGuard||(this._recursiveGuard=!0,2===e?(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0],s=o.subtract(i).length(),a=n.subtract(i).normalized(),n=i.add(a.scaled(s)),l=this.screenPointToPoint(n),this._properties.points[1].price.setValue(l.price),this._properties.points[1].bar.setValue(l.index)):(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0],c=n.subtract(i).length(),a=o.subtract(i).normalized(),o=i.add(a.scaled(c)),l=this.screenPointToPoint(o),this._properties.points[2].price.setValue(l.price),this._properties.points[2].bar.setValue(l.index)),this._recursiveGuard=!1)},o.prototype.addPoint=function(e){var t,i,n,o,s,a,l,c;return 2===this._points.length&&(t=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(e)[0],o=i.subtract(t).length(),s=n.subtract(t).normalized(),n=t.add(s.scaled(o)),a=this.ownerSource().firstValue(),l=this.priceScale().coordinateToPrice(n.y,a),c=Math.round(this._model.timeScale().coordinateToIndex(n.x)),e={index:c,price:l}),r.prototype.addPoint.call(this,e)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibWedgeStylesPropertyPage},t.LineToolFibWedge=o},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolVertLineTimeAxisView",function(){return a}),n=i(1),o=i(170),r=i(171),s=i(172),a=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._model=i,n._invalidated=!0,n._renderer=new r.TimeAxisViewRenderer,n}return n.c(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.updateImpl=function(){
var e,t;this._model.timeScale().isEmpty()||0!==this._source.points().length&&(this._text="",this._background=this._source.properties().linecolor.value(),e=this._source.points()[0].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),t=this._model.timeScale().indexToUserTime(e),t&&(this._text=new s.AbbreviatedDateTimeFormatter(this._model.mainSeries().isDWM()).format(t)),this._invalidated=!1)},t.prototype.renderer=function(){return this._invalidated&&this.updateImpl(),this._renderer.setData({width:this._model.timeScale().width(),text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,visible:!0}),this._renderer},t}(o.TimeAxisView)},function(e,t,i){"use strict";(function(e){function n(e,t){this._pane=e,this._timeScale=t}function o(e){this._line=e}function r(e,t){this._adapter=new o(this),this._constructor="LineToolExecution";var n=t||new l("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},s.call(this,e,n),i.e(0).then(function(e){var t=i(771).ExecutionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(0).LineDataSource,a=i(131),l=i(3).DefaultProperty,c=i(17).PlotRowSearchMode;n.prototype._cachedByBarIndexOrderedExecutions={},n.recreateOrderedByBarsSourcesCache=function(e){var t,i,o,r,s;for(n.clearOrderedByBarsSourcesCache(),t=n.prototype,i=e.orderedSources(),o=0;o<i.length;++o)r=i[o],r._adapter&&void 0!==r._adapter._index&&(s=t._cachedByBarIndexOrderedExecutions[r._adapter._index],t._cachedByBarIndexOrderedExecutions[r._adapter._index]=s||[],t._cachedByBarIndexOrderedExecutions[r._adapter._index].push(r))},n.clearOrderedByBarsSourcesCache=function(){n.prototype._cachedByBarIndexOrderedExecutions={}},n.prototype.getXYCoordinate=function(e,t,i){var n,o,s,a,l,h,u,d,p,_,f=0,m=e.getDirection(),y="buy"===m,g=this._pane.model().mainSeries();if(g.bars&&(n=y?10:-10,null!==(o=g.bars().search(i,c.NearestLeft))&&(i=o.index,s=y?o.value[TradingView.LOW_PLOT]:o.value[TradingView.HIGH_PLOT],a=g.priceScale(),l=g.firstValue(),f=a.priceToCoordinate(s,l)+n)),e._index=i,h=t.visibleBars(),!isFinite(i)||null===h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(u=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=u.length-1;d>=0;--d)if((p=u[d])instanceof r&&p._adapter._index===i&&p._adapter.getDirection()===m){if(p===e._line)break;_=p._adapter._height(),f=y?f+_:f-_}return{x:t.indexToCoordinate(i),y:f}},o.prototype._height=function(){var e,t=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&a.fontHeight(this.getFont()),e=10,t+i+0+e},o.prototype.getIndex=function(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index},o.prototype.setIndex=function(e){var t,i=this._line._model.timeScale(),n=i.baseIndex(),o=n-Math.abs(e);return this._line.startMoving(this._line.points()[0]),t=TradingView.merge({},this._line.points()[0]),t.index=o,this._line.move(t),this._line.endMoving(),this},o.prototype.getTime=function(){
return this._unixtime},o.prototype.setTime=function(e){var t=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(e,t.interval(),t.symbolInfo()):e,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(e){return this._line.points().length>0&&(this._line.points()[0].price=e),this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},o.prototype.getText=function(){return this._line.properties().text.value()},o.prototype.setText=function(e){return this._line.properties().text.setValue(e||""),this._line.updateAllViewsAndRedraw(),this},o.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},o.prototype.setArrowHeight=function(e){return this._line.properties().arrowHeight.setValue(e||5),this},o.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},o.prototype.setArrowSpacing=function(e){return this._line.properties().arrowSpacing.setValue(e||1),this},o.prototype.getDirection=function(){return this._line.properties().direction.value()},o.prototype.setDirection=function(e){return this._line.properties().direction.setValue(e||"buy"),this},o.prototype.getArrowColor=function(){return a.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},o.prototype.setArrowColor=function(e){return a.setColorToProperties(e,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},o.prototype.getTextColor=function(){return a.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},o.prototype.setTextColor=function(e){return a.setColorToProperties(e,this._line.properties().textColor,this._line.properties().textTransparency),this},o.prototype.getFont=function(){return a.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},o.prototype.setFont=function(e){return a.setFontToProperties(e,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},o.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(r,s),r.POINTS_COUNT=1,r.skipMagnetting=!0,r.prototype.pointsCount=function(){return r.POINTS_COUNT},r.prototype.title=function(){return"Execution"},r.prototype.name=function(){return"Execution"},r.prototype.hasContextMenu=function(){return!1},r.prototype.state=function(){return null},
r.prototype.updateAllViews=function(){return this._isVisible()?s.prototype.updateAllViews.call(this):null},r.prototype.priceAxisViews=function(e,t){return this._isVisible()?s.prototype.priceAxisViews.call(this,e,t):null},r.prototype._isVisible=function(){return this._model.properties().tradingProperties.showExecutions.value()},r.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?s.prototype.paneViews.call(this,t):null},r.prototype.userEditEnabled=function(){return!1},r.prototype.showInObjectTree=function(){return!1},r.prototype.getInputsPropertyPage=function(){return null},t.ExecutionsPositionController=n,t.LineToolExecution=r}).call(t,i(5))},function(e,t,i){"use strict";function n(e,t,i){return new l(e,t,i)}var o,r,s,a,l;t.a=n,o=i(1),r=i(12),i.n(r),s=i(19),a=i.n(s),l=function(e){function t(t,i,n){return e.call(this,t,i,n,{names:["width","color","visible"]})||this}return o.c(t,e),t.prototype._iterateLevels=function(e,t){var i,n,o;for(i in e.levels)if(e.levels[i]&&Object(r.isSameType)(e.levels[i],t.typecheck())){n=t.tpl();for(o in this._map.names)this._map.names.hasOwnProperty(o)&&(n=t.fill(o,this._map.names[o],e.levels[i],n));e.levels[i]=n}return e},t}(a.a)},function(e,t,i){"use strict";function n(e,t){this._constructor="LineTool5PointsPattern";var n=t||new r("linetool5pointspattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(697).Pattern5PaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(275).DateTimeFormatter,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 5},n.prototype.title=function(){return"XABCD Pattern"},n.prototype.name=function(){return"XABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}},n.prototype._updateTooltip=function(){var e,t,i,n,o,r=this._tooltipFieldsHash,a=this.points().m_values;a[0]&&(t=this._model.timeScale().indexToUserTime(a[0].index),r.time0.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,r.price0.value=this._model.mainSeries()._formatter.format(a[0].price)),a[1]&&(e=this._model.timeScale().indexToUserTime(a[1].index),r.time1.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,r.price1.value=this._model.mainSeries()._formatter.format(a[1].price)),a[2]&&(i=this._model.timeScale().indexToUserTime(a[2].index),r.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,r.price2.value=this._model.mainSeries()._formatter.format(a[2].price)),a[3]&&(n=this._model.timeScale().indexToUserTime(a[3].index),r.time3.value=n?new s(this._model.mainSeries().isDWM()).format(n):0,
r.price3.value=this._model.mainSeries()._formatter.format(a[3].price)),a[4]&&(o=this._model.timeScale().indexToUserTime(a[4].index),r.time4.value=e?new s(this._model.mainSeries().isDWM()).format(o):0,r.price4.value=this._model.mainSeries()._formatter.format(a[4].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},n.prototype.getStylesPropertyPage=function(){return a.LineToolLineTool5PointsPatternStylesPropertyPage},t.LineTool5PointsPattern=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DateTimeFormatter",function(){return r}),n=i(130),o=i(201),r=function(){function e(e){void 0===e&&(e=!1),this._dwm=e}return e.prototype.format=function(e){var t=(new o.DateFormatter).format(e);return this._dwm||(t+=" "+(new n.TimeFormatter).format(e)),t},e.prototype.formatLocal=function(e){var t=(new o.DateFormatter).formatLocal(e);return this._dwm||(t+=" "+(new n.TimeFormatter).formatLocal(e)),t},e}()},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolNote";var o=t||new a("linetoolnote");o.hasChild("text")||o.addChild("text",new s($.t("Text"))),o.addExclusion("text"),r.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(793).NotePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i=t||new a("linetoolnoteabsolute");i.locked.value()||i.locked.setValue(!0),n.call(this,e,i)}var r=i(0).LineDataSource,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,r),n.TOOLTIP_WIDTH=300,n.TOOLTIP_PADDING=10,n.TOOLTIP_LINESPACING=5,n.version=1,n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return $.t("Note")},n.prototype.name=function(){return"Note"},n.prototype.applyTemplate=function(e){delete e.locked,delete e.text,r.prototype.applyTemplate.call(this,e)},n.prototype.getTooltipWidth=function(){return n.TOOLTIP_WIDTH},n.prototype.getTooltipPadding=function(){return n.TOOLTIP_PADDING},n.prototype.getTooltipLineSpacing=function(){return n.TOOLTIP_LINESPACING},inherit(o,n),o.prototype.title=function(){return $.t("Anchored Note")},o.prototype.name=function(){return"Anchored Note"},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t},n.prototype.getStylesPropertyPage=function(){return l.LineToolNotePropertyPage},t.LineToolNote=n,t.LineToolNoteAbsolute=o},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolText";var n=t||new l("linetooltext");n.hasChild("text")||n.addChild("text",new a($.t("Text"))),n.addExclusion("text"),r.call(this,e,n),this._timeScale=e.timeScale(),this._barSpacing=e.timeScale().barSpacing(),i.e(0).then(function(e){var t=i(350).TextPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i=t||new l("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),n.call(this,e,i)}var r=i(0).LineDataSource,s=i(28).DataSource,a=i(13),l=i(3).DefaultProperty,c=i(2).propertyPages;inherit(n,r),
n.MIN_WIDTH=100,n.prototype.setPoint=function(e,t){var i,o,r=this.properties();if(0===e&&r.wordWrapWidth&&r.wordWrapWidth.value()){if(i=r.locked&&r.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),o=this._timeScale.indexToCoordinate(t.index)-i-~~(r.fontsize.value()/6),!isFinite(o))return;r.wordWrapWidth.setValue(Math.max(n.MIN_WIDTH,o))}},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return $.t("Text",{context:"tool"})},n.prototype.name=function(){return"Text"},n.prototype.setPriceScale=function(e){s.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&(this._priceDencity=e.height()/e.priceRange().length(),this._isPriceDencityLog=e.isLog())},n.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},n.prototype.applyTemplate=function(e){delete e.locked,delete e.text,r.prototype.applyTemplate.call(this,e)},inherit(o,n),o.prototype.title=function(){return $.t("Anchored Text")},o.prototype.name=function(){return"Anchored Text"},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return c.LineToolTextStylesPropertyPage},t.LineToolText=n,t.LineToolTextAbsolute=o},function(e,t,i){"use strict";function n(e){return e.description||""}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslatedSymbolDescription=n;i(11)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesPriceAxisView",function(){return d}),n=i(1),o=i(7),i.n(o),r=i(15),s=i(58),a=i(5),i.n(a),l=i(40),c=a.enabled("countdown"),h=a.enabled("price_scale_always_last_bar_value"),u=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_LINE,l.STYLE_AREA,l.STYLE_HOLLOW_CANDLES,l.STYLE_HEIKEN_ASHI],d=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._getSource=function(){return this._source},t.prototype._getData=function(){return this._data},t.prototype._isCountdownEnabled=function(){return c},t.prototype._countdownText=function(){var e,t,i,n,s,a,l,c,h,u,d;return this._source.isDWM()?"":(e=1e3*Object(o.ensure)(Object(o.ensureNotNull)(this._source.data().bars().last()).value[0]),t=1e3*this._source.serverTimeOffset(),i=r.Interval.parse(this._source.interval()),n=i.multiplier()||0,s=i.isSeconds()?n:60*n,a=e.valueOf()+1e3*s,l=(new Date).valueOf()+t,(c=Math.round((a-l)/1e3))<=0?"":(c=Math.min(c,s),h=null,c>=3600&&(h=this._addLeadingZero(Math.floor(c/3600))),c%=3600,u=this._addLeadingZero(Math.floor(c/60)),c%=60,d=this._addLeadingZero(Math.floor(c)),null!==h?h+":"+u+":"+d:u+":"+d))},t.prototype._updateRendererData=function(e){var t,i,n,o,r,s,a,d;e.visible=!1,t=this._source.properties(),i=this._data.model.properties().scalesProperties.showSeriesLastValue.value(),
n=c&&-1!==u.indexOf(t.style.value())&&t.showCountdown.value(),(i||n)&&(o=this._source.lastValueData(void 0,h),o.noData||t.style.value()===l.STYLE_HEIKEN_ASHI&&t.haStyle.showRealLastPrice.value()&&(r=this._source.lastValueData(void 0,!1),s=this._source.lastValueData(void 0,!0),!r.noData&&!s.noData&&r.index===s.index)||(a=i?o.text:"",d=n?this._countdownText():"",0===a.length?(e.text=d,e.secondLine=""):(e.text=a,e.secondLine=d),0===a.length&&0===d.length||(e.visible=!0,e.background=this._source.priceLineColor(o.color),e.color=this.generateTextColor(e.background),e.coordinate=o.coordinate,e.floatCoordinate=o.floatCoordinate)))},t.prototype._addLeadingZero=function(e){return("0"+e).slice(-2)},t}(s.a)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_,f;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesDataWindowView",function(){return f}),n=i(1),o=i(24),i.n(o),r=i(83),i.n(r),s=i(118),a=i(123),l=i(17),c=i(70),h=i(281),u=i(38),d=new c.PercentageFormatter,p=window.t("n/a"),_=p+" ("+p+"%)",f=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._series=t,n._model=i,n._items.push(new s.DataWindowItem(window.t("Open"),"")),n._items.push(new s.DataWindowItem(window.t("High"),"")),n._items.push(new s.DataWindowItem(window.t("Low"),"")),n._items.push(new s.DataWindowItem(window.t("Close"),"")),n._items.push(new s.DataWindowItem("","")),n._items.push(new s.DataWindowItem(window.t("Change"),"")),n.update(),n}return n.c(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.dump=function(){return{header:this._header,items:this._items}},t.prototype._updateImpl=function(){var e,t,i,n,s,c,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D=this._series.symbolInfo();if(D?(this._header=[D.name,Object(a.translatedIntervalString)(this._series.interval()),D.exchange].join(", "),this._title=D.description):this._header=this._series.symbol(),this._items[0].setValue(p),this._items[1].setValue(p),this._items[2].setValue(p),this._items[3].setValue(p),this._items[5].setValue(_),e=this._items[4],e.setValue(p),e.setVisible(!1),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()){if(t=this._model.crossHairSource().appliedIndex(),!Object(r.isNumber)(t)){if(null===(i=this._series.data().last()))return;t=i.index}if(void 0!==(n=this._series.nearestIndex(t,l.PlotRowSearchMode.NearestLeft))&&(s=this._series.data().valueAt(n),c=this._series.data().valueAt(n-1),f=this._series.model().paneForSource(this._series),null!==s&&null!==f&&(m=s[1],y=s[2],g=s[3],v=s[4],S=c&&c[4],null!=m&&null!=y&&null!=g&&null!=v&&(b=this._series.formatter(),this._items[0].setValue(b.format(m)),this._items[1].setValue(b.format(y)),this._items[2].setValue(b.format(g)),this._items[3].setValue(b.format(v)),this._items[4].setValue(b.format(this._series.barFunction()(s))),w=_,null!=S&&(P=Object(h.a)(S,v),w=Object(u.forceLTRStr)(b.format(v-S,!0)+" ("+d.format(P,!0)+")")),this._items[5].setValue(w),
T=this._series.barColorer(),x=T.barStyle(n,!1),C=null!=x.barBorderColor?x.barBorderColor:x.barColor,void 0!==(L=f.properties().child("background"))))))for(I=L.value(),A=Object(o.parseRgb)(C),k=Object(o.parseRgb)(I),Object(o.distanceRgb)(A,k)<70&&(C=Object(o.rgbToHexString)(Object(o.invertRgb)(A))),E=0,M=this._items;E<M.length;E++)V=M[E],V.setColor(C)}},t}(s.DataWindowView)},function(e,t,i){"use strict";function n(e,t){return 100*(t-e)/e}t.a=n},function(e,t,i){"use strict";function n(e,t){this.m_series=e,this.m_model=t,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=T.enabled("source_selection_markers")}function o(e,t){n.call(this,e,t)}function r(e,t){n.call(this,e,t)}function s(e,t){n.call(this,e,t)}function a(e,t){n.call(this,e,t)}function l(e,t){this.m_series=e,this.m_model=t,this.m_items=[]}function c(e,t){l.call(this,e,t),this._invaidated=!0}function h(e,t){l.call(this,e,t),this._invaidated=!0}function u(e,t){l.call(this,e,t),this._invaidated=!0,this._renderer=new v}var d=i(6).Point,p=i(190).SelectionRenderer,_=i(9).HitTestResult,f=i(263).PaneRendererBars,m=i(136).PaneRendererLine,y=i(264).PaneRendererArea,g=i(210).PaneRendererCandles,v=i(608).PaneRendererBaseline,S=i(69).CompositeRenderer,b=i(266),w=i(29),P=i(17).PlotRowSearchMode,T=i(5);n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,p,f,m=this;if(this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()&&null!==(e=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()){for(t=this.m_series.nearestIndex(e.firstBar(),P.NearestRight),i=this.m_series.nearestIndex(e.lastBar(),P.NearestLeft);t<=i&&null===this.m_series.bars().valueAt(t);t++);if(!(t>i)&&(e=this.m_series.bars().range(t,i),n=this.m_series.priceScale(),o=this.m_series.barColorer(),r={},e.each(function(e,t){var i,n;void 0!==t[TradingView.OPEN_PLOT]&&void 0!==t[TradingView.HIGH_PLOT]&&void 0!==t[TradingView.LOW_PLOT]&&void 0!==t[TradingView.CLOSE_PLOT]&&(i={},i.time=Math.round(e),i.open=t[TradingView.OPEN_PLOT],i.high=t[TradingView.HIGH_PLOT],i.low=t[TradingView.LOW_PLOT],i.close=t[TradingView.CLOSE_PLOT],r.value=t,n=t[TradingView.STYLE_PLOT]?t[TradingView.STYLE_PLOT]:o.barStyle(e,!1,r),t[TradingView.STYLE_PLOT]=n,r.previousValue=t,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,m.m_bars.push(i))},this),0!==this.m_bars.length&&(s=this.m_bars[0].close,n.barPricesToCoordinates(this.m_bars,s)),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_series===this.m_model.selectedSource()))for(a=b(t,i),this._selectionData={points:[]},this._selectionData.hittestResult=_.REGULAR,l=0;l<a.length;l++)c=a[l],null!==(h=this.m_series.bars().valueAt(c))&&(u=.5*(h[TradingView.OPEN_PLOT]+h[TradingView.CLOSE_PLOT]),p=this.m_model.timeScale().indexToCoordinate(c),f=this.m_series.priceScale().priceToCoordinate(u,s),this._selectionData.points.push(new d(p,f)))}},n.prototype.items=function(){return this.m_bars},
n.prototype.dump=function(){var e={};return e.bars=this.m_bars,e},inherit(o,n),o.prototype.renderer=function(){var e,t;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),t=new S,t.append(new f(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new p(this._selectionData)),t},inherit(r,n),r.prototype.renderer=function(){var e,t;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.drawWick=this.m_series.properties().candleStyle.drawWick.value(),e.drawBorder=this.m_series.properties().candleStyle.drawBorder.value(),e.borderColor=this.m_series.properties().candleStyle.borderColor.value(),e.wickColor=this.m_series.properties().candleStyle.wickColor.value(),t=new S,t.append(new g(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new p(this._selectionData)),t},inherit(s,n),s.prototype.renderer=function(){var e,t;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.drawWick=this.m_series.properties().haStyle.drawWick.value(),e.drawBorder=this.m_series.properties().haStyle.drawBorder.value(),e.borderColor=this.m_series.properties().haStyle.borderColor.value(),e.wickColor=this.m_series.properties().haStyle.wickColor.value(),t=new S,t.append(new g(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new p(this._selectionData)),t},inherit(a,n),a.prototype.renderer=function(){var e,t;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value(),e.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value(),e.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),e.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),t=new S,t.append(new g(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new p(this._selectionData)),t},l.prototype.update=function(){var e,t,i,n,o,r,s,a,l,c,h,u,p,f;if(this.m_items=[],!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()&&null!==(e=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()&&(t=this.m_series.nearestIndex(e.firstBar(),P.NearestRight),i=this.m_series.nearestIndex(e.lastBar(),P.NearestLeft),e=this.m_series.bars().range(t,i),o=this.m_series.priceScale(),r={color:this.m_series.properties().lineStyle.color.value()},s=this.m_series.barFunction(),e.each(function(e,t){var i,o=s(t);return void 0!==o&&null!==o&&(void 0===n&&(n=o),i=new d(e,o),i.style=r,this.m_items.push(i),!1)}.bind(this)),o.pointsArrayToCoordinates(this.m_items,n),
this.m_model.timeScale().indexesToCoordinates(this.m_items),this.m_series===this.m_model.selectedSource()))for(a=b(t,i),this._selectionData={points:[]},this._selectionData.hittestResult=_.REGULAR,l=0;l<a.length;l++)c=a[l],h=this.m_series.data().valueAt(c),u=s(h),p=this.m_model.timeScale().indexToCoordinate(c),f=this.m_series.priceScale().priceToCoordinate(u,n),this._selectionData.points.push(new d(p,f))},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var e,t,i,n;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),e=this.m_series.properties().lineStyle,t={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:e.color.value(),lineStyle:e.linestyle.value(),withMarkers:e.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:e.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:e.linewidth.value(),simpleMode:!0},i=new m(t),this.m_series===this.m_model.selectedSource()?(n=new S,n.append(i),this._isMarkersEnabled&&n.append(new p(this._selectionData))):n=i,n},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var e,t,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),e={},e.simpleMode=!1,e.barSpacing=this.m_model.timeScale().barSpacing(),e.items=this.m_items,e.lineColor=this.m_series.properties().areaStyle.linecolor.value(),e.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),e.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),t=this.m_series.properties().areaStyle.transparency.value(),e.isSeries=!0,e.color1=w.generateColor(this.m_series.properties().areaStyle.color1.value(),t),e.color2=w.generateColor(this.m_series.properties().areaStyle.color2.value(),t),e.bottom=this.m_series.priceScale().height(),i=new S,i.append(new y(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new p(this._selectionData)),i},inherit(u,l),u.prototype.update=function(){this._invalidated=!0},u.prototype._updateImpl=function(){var e,t;l.prototype.update.call(this),e=this.m_series.properties().baselineStyle,t=e.transparency.value(),this._topFillColor1=w.generateColor(e.topFillColor1.value(),t),this._topFillColor2=w.generateColor(e.topFillColor2.value(),t),this._bottomFillColor1=w.generateColor(e.bottomFillColor1.value(),t),this._bottomFillColor2=w.generateColor(e.bottomFillColor2.value(),t),this._topLineColor=e.topLineColor.value(),this._bottomLineColor=e.bottomLineColor.value(),this._topLineWidth=e.topLineWidth.value(),this._bottomLineWidth=e.bottomLineWidth.value(),this._barSpacing=this.m_model.timeScale().barSpacing(),this._bottom=this.m_series.priceScale().height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-e.baseLevelPercentage.value())/100))},u.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this.m_items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,
bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,lineStyle:CanvasEx.LINESTYLE_SOLID,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});var e=new S;return e.append(this._renderer),this.m_series===this.m_model.selectedSource()&&e.append(new p(this._selectionData)),e},t.SeriesBarsPaneView=o,t.SeriesCandlesPaneView=r,t.SeriesHollowCandlesPaneView=a,t.SeriesLinePaneView=c,t.SeriesAreaPaneView=h,t.SeriesHeikenAshiPaneView=s,t.SeriesBaselinePaneView=u},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesWaterlinePaneView",function(){return c}),n=i(1),o=i(6),i.n(o),r=i(178),s=i(284),a=i(9),l=i(84),c=function(e){function t(t){var i=e.call(this,t)||this,n={cursorType:s.PaneCursorType.VerticalResize,pressedMouseMoveHandler:function(e){var i=t.priceScale(),n=t.properties().baselineStyle,o=i.height(),r=100-e.y/o*100,s=r<0?0:Math.round(10*r)/10;n.baseLevelPercentage.setValue(Math.max(Math.min(s,100),0))}};return i._lineRenderer.setHitTest(new a.HitTestResult(a.HitTestResult.CUSTOM_MOVE,n)),i._lineRendererData.visible=!0,i._lineRendererData.linestyle=l.LINESTYLE_SPARSE_DOTTED,i}return n.c(t,e),t.prototype._updateImpl=function(){var e=this._series.properties().baselineStyle,t=Math.abs(100-e.baseLevelPercentage.value());this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.points=[new o.Point(0,Math.round(this._lineRendererData.height*(t/100)))],this._lineRendererData.color=e.baselineColor.value()},t}(r.a)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PaneCursorType",function(){return n});var n;!function(e){e[e.Default=0]="Default",e[e.Pointer=1]="Pointer",e[e.Eraser=2]="Eraser",e[e.Dot=3]="Dot",e[e.Grabbing=4]="Grabbing",e[e.ZoomIn=5]="ZoomIn",e[e.VerticalResize=6]="VerticalResize"}(n||(n={}))},function(e,t,i){"use strict";function n(e,t,i,n){var o;return o="study_"+(n.classId||n.shortId),new(o in d?d[o]:r.Study)(e,t,i,n)}var o,r,s,a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),o=i(26),r=i(34),s=i(624),a=i(626),l=i(629),c=i(1),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c.c(t,e),t.prototype.hasContextMenu=function(){return!1},t.prototype.showInObjectTree=function(){return!1},t.prototype.isSavedInStudyTemplates=function(){return!1},t.prototype.isRemovedByStudyTemplates=function(){return!1},t.prototype.removeByRemoveAllStudies=function(){return!1},t.prototype.isUserDeletable=function(){return!1},t.prototype.statusView=function(){return null},t.prototype.isDraggable=function(){return!1},t.prototype.applyPreferences=function(e){this._properties.merge(e),
void 0!==this._properties.graphics.vertlines&&this._properties.graphics.vertlines.sessBreaks.visible.listeners().fire(this._properties.graphics.vertlines.sessBreaks.visible),void 0!==this._properties.graphics.backgrounds&&(this._properties.graphics.backgrounds.inSession.visible.listeners().fire(this._properties.graphics.backgrounds.inSession.visible),this._properties.graphics.backgrounds.outOfSession.visible.listeners().fire(this._properties.graphics.backgrounds.outOfSession.visible))},t}(r.Study),h.prototype.superclass=r.Study,u=i(631),t.createStudy=n,d={study_PivotPointsStandard:s.study_PivotPointsStandard,study_Overlay:a.study_Overlay,study_Compare:l.study_Compare,study_Sessions:h,study_ScriptWithDataOffset:u.study_ScriptWithDataOffset};for(p in d)d.hasOwnProperty(p)&&(TradingView[p]=d[p])},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayDataWindowView",function(){return p}),n=i(1),o=i(118),r=i(40),s=i(70),a=i(17),l=i(281),c=i(38),h=new s.PercentageFormatter,u=window.t("n/a"),d=u+" ("+u+"%)",p=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._study=t,n._model=i,n._items.push(new o.DataWindowItem(window.t("Open"),"")),n._items.push(new o.DataWindowItem(window.t("High"),"")),n._items.push(new o.DataWindowItem(window.t("Low"),"")),n._items.push(new o.DataWindowItem(window.t("Close"),"")),n._items.push(new o.DataWindowItem("","")),n._items.push(new o.DataWindowItem(window.t("Change"),"")),n.update(),n}return n.c(t,e),t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.update=function(){this._invalidated=!0},t.prototype._updateImpl=function(){var e,t,i,n,o,s,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k;if(this._header=this._study.title(),this._items[0].setValue(u),this._items[1].setValue(u),this._items[2].setValue(u),this._items[3].setValue(u),this._items[5].setValue(d),!this._model.timeScale().isEmpty()&&0!==this._study.data().size()&&(e=this._items[4],e.setVisible(!1),n=!1,o=this._study.properties().style.value(),o===r.STYLE_BARS?(t=this._study.properties().barStyle.upColor.value(),i=this._study.properties().barStyle.downColor.value(),n=this._study.properties().barStyle.barColorsOnPrevClose.value()):o===r.STYLE_CANDLES?(t=this._study.properties().candleStyle.upColor.value(),i=this._study.properties().candleStyle.downColor.value(),n=this._study.properties().candleStyle.barColorsOnPrevClose.value()):o===r.STYLE_HOLLOW_CANDLES?(t=this._study.properties().hollowCandleStyle.upColor.value(),i=this._study.properties().hollowCandleStyle.downColor.value(),n=!0):o===r.STYLE_LINE?(t=this._study.properties().lineStyle.color.value(),i=t):o===r.STYLE_AREA&&(t=this._study.properties().areaStyle.linecolor.value(),i=t),s=this._model.crossHairSource().appliedIndex(),null!==(p=this._study.data().search(s,a.PlotRowSearchMode.NearestLeft,!0))&&(_=p.index,f=p.value,m=this._study.data().search(_-1,a.PlotRowSearchMode.NearestLeft,!0),y=f[1],g=f[2],v=f[3],S=f[4],b=m&&m.value[4],
null!=y&&null!=g&&null!=v&&null!=S&&(w=this._study.formatter(),this._items[0].setValue(w.format(y)),this._items[1].setValue(w.format(g)),this._items[2].setValue(w.format(v)),this._items[3].setValue(w.format(S)),e.setValue(w.format(this._study.barFunction()(f))),null!=b&&(P=Object(l.a)(b,S),T=w.format(S-b,!0)+" ("+h.format(P,!0)+")",this._items[5].setValue(Object(c.forceLTRStr)(T))),o===r.STYLE_BASELINE?(C=this._study.barColorer(),L=C.barStyle(_,!1),x=null!=L.barBorderColor?L.barBorderColor:L.barColor):n&&_>=1?null!=b&&(x=b<=S?t:i):x=y<=S?t:i,void 0!==x))))for(I=0,A=this._items;I<A.length;I++)k=A[I],k.setColor(x)},t}(o.DataWindowView)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompareDataWindowView",function(){return r}),n=i(1),o=i(117),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._studyCompare=t,n}return n.c(t,e),t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this),this._items[0].setTitle(this._studyCompare.guiPlotName(""))},t}(o.StudyDataWindowView)},function(e,t,i){"use strict";function n(e){var t,i=[],o=e.m_items;for(t=0;t<o.length;t++)o[t]._menu&&(i.push(o[t]._menu),i=i.concat(n(o[t]._menu)));return i}function o(e,t,i){var n,o;this.options={},this._parentMenuItem=i,$.extend(this.options,t),this.options.class&&(this.options.attributes.class=this.options.class),this.jqMenu=null,this.m_wrapper=null,this.m_items=[];for(n in e)o=e[n],this.addItem(o)}var r,s,a,l,c,h,u,d;i(208),r=i(289),s=i(41).ActionPlaceholder,a=i(637),l=a.Item,c=a.ItemPlaceholder,h=i(290),u=i(38).IS_RTL,d=i(638).setOffset,o.prototype.addItem=function(e){var t;return t=e instanceof s?new c(e,this):new l(e,this),this.m_items.push(t),t},o.renderItem=function(e,t){e.append(t.render(e))},o.prototype.closeOtherSubmenus=function(e){for(var t=0;t<this.m_items.length;++t)this.m_items[t].highlight(!1),this.m_items[t]._menu&&(this.m_items[t]._menu.destroy(),this.m_items[t]._menu=null)},o.prototype.isShown=function(){return null!==this.jqMenu},o.prototype.render=function(){var e,t,i,n=this.getAttributes();if(this._parentMenuItem){e=$("<table>"),this.jqMenu=e,e.attr("cellspacing","0"),e.attr("cellpadding","0"),e.addClass("context-menu"),e.addClass("submenu");for(t in this.m_items)i=this.m_items[t],o.renderItem(e,i)}else{e=h.create(r.MENU_TAG,n),this.jqMenu=e;for(t in this.m_items)i=this.m_items[t],o.renderItem(e,i)}return this.jqMenu},o.prototype.getAttributes=function(){var e={},t=["context-menu"];return this.options.attributes&&this.options.attributes.class&&t.push(this.options.attributes.class),e.cellspacing=0,e.cellpadding=0,e.class=t.join(),e},o.prototype.deploy=function(e,t){var i,o=this,r=e.target&&e.target.ownerDocument||document,s=this.wrapper();return this.jqMenu=s.append(this.render()),t?($(t).data("submenu",this.jqMenu),$(r.body).append(this.jqMenu),this.jqMenu.data("parent-menu",t),this.jqMenu.data("parent-item",e.currentTarget)):($(r.body).append(this.jqMenu),i=function(e){var t,s;if(!o.m_wrapper[0].contains(e.target)){for(t=n(o),
s=0;s<t.length;s++)if(t[s].m_wrapper[0].contains(e.target))return;o.hide(),r.removeEventListener("mousedown",i,!1),r.removeEventListener("touchstart",i,!1)}},r.addEventListener("mousedown",i,!1),r.addEventListener("touchstart",i,!1)),this.jqMenu.contextMenu(function(e){return!1}),this._setCoords(e),this.jqMenu},o.prototype.show=function(e,t){this.deploy(e,t).show()},o.prototype.hide=function(){this.isShown()&&this.destroy()},o.prototype.destroy=function(){this.m_items.forEach(function(e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},o.prototype._setCoords=function(e){var t,i,n,o,r,s,a,l,c,h=e.target.ownerDocument,p=h.defaultView,_=5,f=this.jqMenu,m=$(this.jqMenu.data("parent-item")),y={width:$(p).width(),height:Math.min($(p).height(),$(h.body).height())},g={top:$(h).scrollTop(),left:$(h).scrollLeft()};for(this.jqMenu.css({maxWidth:y.width-2*_,maxHeight:y.height-2*_}),t={width:f.outerWidth(),height:f.outerHeight()},n=u?t.width:0,m.size()?(o=m.offset(),i={top:o.top-1,left:o.left+m.outerWidth()}):i={top:e.pageY,left:e.pageX-n},d(this.jqMenu[0],i),r=!1,s={},s.top=Math.min(i.top,y.height+g.top-t.height-_),a=u?i.left+_<g.left:i.left+t.width+_>y.width+g.left,a||this.options.reverse?u?s.left=i.left+t.width:(r=!0,s.left=i.left-t.width):s.left=i.left,l=e.target;l&&1===l.nodeType;l=l.parentNode)if("fixed"===$(l).css("position")){this.jqMenu.css("position","fixed");break}d(this.jqMenu[0],s),r&&(c=t.width-this.jqMenu.outerWidth())&&(s.left+=c,d(this.jqMenu[0],s))},o.prototype._wrapper=function(){var e=r.WRAPPER_ATTRIBUTES;return this.m_wrapper=h.create(r.WRAPPER_TAG,e),this._parentMenuItem||this.m_wrapper.addClass("topmenu"),this.m_wrapper},o.prototype.wrapper=function(e){return this.m_wrapper||this._wrapper()},e.exports=o},function(e,t,i){"use strict";e.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(e,t,i){"use strict";var n={};n.renderAttributes=function(e){var t,i="";for(t in e)e[t]&&(i+=" "+t+'="'+e[t]+'"');return i},n.create=function(e,t){var i=$(document.createElement(e));return t&&(t.html&&(i.html(t.html),delete t.html),i.attr(t)),i},
n.validAttributes=["abbr","accept-charset","accept","accesskey","action","align","alink","alt","archive","axis","background","bgcolor","border","cellpadding","cellspacing","char","charoff","charset","checked","cite","class","classid","clear","code","codebase","codetype","color","cols","colspan","compact","content","coords","data","datetime","declare","defer","dir","disabled","enctype","face","for","frame","frameborder","headers","height","href","hreflang","hspace","http-equiv","id","ismap","label","lang","language","link","longdesc","marginheight","marginwidth","maxlength","media","method","multiple","name","nohref","noresize","noshade","nowrap","object","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","profile","prompt","readonly","rel","rev","rows","rowspan","rules","scheme","scope","scrolling","selected","shape","size","span","src","standby","start","style","summary","tabindex","target","text","title","type","usemap","valign","value","valuetype","version","vlink","vspace","width"],n.validAttribute=function(e){return-1!==jQuery.inArray(e,n.validAttributes)},n.cleanAttributes=function(e){return jQuery.each(e,function(t,i){n.validAttribute(t)||delete e[t]}),e},e.exports=n},function(e,t,i){"use strict";function n(){null===a&&i.e(3).then(function(e){if(null===a){var t=i(813).FavoriteDrawingToolbar;a=new t({left:window.innerWidth/2,top:r.HEADER_TOOLBAR_HEIGHT_EXPANDED+61})}}.bind(null,i)).catch(i.oe)}function o(){var e,t;return null===l&&null!==a&&(e=new s.Action({text:window.t("Favorite Drawings Toolbar"),checkable:!0,statName:"ToggleFavoriteDrawingsToolbar"}),t=a,t.canBeShown().subscribe(function(t){e.setEnabled(t)},{callWithLast:!0}),t.visibility().subscribe(function(t){e.setChecked(t)},{callWithLast:!0}),e.callbacks().subscribe(null,function(){t.isVisible()?t.hide():t.show()}),l=e),l}var r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),t.createFavoriteDrawingToolbar=n,t.createToolbarAction=o,i(11),r=i(198),s=i(41),i.n(s),a=null,l=null},function(e,t,i){"use strict";function n(e){"number"!=typeof e&&(e=TradingView.STUDY_COUNT_LIMIT),(0,o.showNoticeDialog)({title:$.t("Warning"),content:$.t("Studies limit exceeded: {0} studies per layout.<br>\nPlease, remove some studies.").format(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.showTooManyStudiesNotice=n;var o=i(209)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"UndoStack",function(){return l}),n=i(43),o=i(8),r=i.n(o),s=i(4),a=Object(s.getLogger)("Common.UndoStack"),l=function(){function e(){this._commands=[],this._onChange=new r.a}return e.prototype.onChange=function(){return this._onChange},e.prototype.isEmpty=function(){return 0===this._commands.length},e.prototype.clear=function(){this._commands.length=0,this._onChange.fire()},e.prototype.push=function(e){
if(!(e instanceof n.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(e),this._onChange.fire()},e.prototype.pop=function(){if(this.isEmpty())return void a.logDebug("pop: undo stack is empty");var e=this._commands.pop();return this._onChange.fire(),e},e.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},e}()},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"RestoreDefaultsUndoCommand",function(){return r}),i.d(t,"RestoreUserDefaultsUndoCommand",function(){return s}),i.d(t,"RestoreFactoryDefaultsUndoCommand",function(){return a}),n=i(1),o=i(43),r=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._chartModel=t,o._defaultProperty=i,o._state=i.state(),o}return n.c(t,e),t.prototype.undo=function(){this._defaultProperty.mergeAndFire(this._state),this._chartModel.mainSeries().onChartStyleChanged()},t}(o.UndoCommand),s=function(e){function t(t,i,n){return void 0===n&&(n="Restore User Defaults"),e.call(this,t,i,n)||this}return n.c(t,e),t.prototype.redo=function(){this._chartModel.restoreDefaults(this._defaultProperty)},t}(r),a=function(e){function t(t,i,n){return void 0===n&&(n="Restore Defaults"),e.call(this,t,i,n)||this}return n.c(t,e),t.prototype.redo=function(){this._chartModel.restoreFactoryDefaults(this._defaultProperty)},t}(r)},function(e,t,i){"use strict";var n,o,r,s,a;i.d(t,"a",function(){return a}),n=i(4),o=i(33),r=i(135),i(132),s=Object(n.getLogger)("GUI.Blocks.AbstractIndicator"),a=function(){function e(e){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1,this._tooltipType="custom",this._quoteSession=e.quoteSession}return e.prototype.getValue=function(){return this._value},e.prototype.getTooltipText=function(){return this.getLabel()},e.prototype.getLabel=function(){return this._labelMap[this._value]||""},e.prototype.getElement=function(){return this._el},e.prototype.update=function(e,t){this._updateValue(e,t),this._render()},e.prototype.setTooltipEnabled=function(e){void 0===e&&(e=!1),this._showTooltip!==e&&(this._showTooltip=e,this._renderTooltip())},e.prototype.enableShortMode=function(){!0!==this._shortMode&&(this._shortMode=!0,this._render())},e.prototype.disableShortMode=function(){!1!==this._shortMode&&(this._shortMode=!1,this._render())},e.prototype.isShortModeEnabled=function(){return this._shortMode},e.prototype.start=function(){!this._subscribed&&this._symbolName&&(this._quoteSession||(this._quoteSession=Object(r.getQuoteSessionInstance)("simple")),this._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)},e.prototype.stop=function(){this._subscribed&&this._quoteSession&&this._symbolName&&(this._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)},e.prototype._init=function(e){this._el=e.el?e.el:document.createElement("span"),this._el.innerHTML="",this._classMap=e.classMap,
this._labelMap=e.labelMap,this._showTooltip=e.showTooltip,this._classSuffix=e.classSuffix,this._symbolName=e.symbol,e.tooltipType&&(this._tooltipType=e.tooltipType),this._quoteSessionGUID=Object(o.guid)(),!0===e.short&&this.enableShortMode(),e.data&&this._updateValue(e.data)},e.prototype._clearClasses=function(){var e=this;Object.values(this._classMap).map(function(t){e._el.classList.remove(""+t),e._el.classList.remove(""+t+e._classSuffix)})},e.prototype._render=function(){this._renderClasses(),this._renderTooltip(),this._renderLabel()},e.prototype._renderLabel=function(){this._el.textContent=this.getLabel()},e.prototype._updateValue=function(e,t){var i=this._getValueFromData(e);(t||i!==this._value)&&(this._value=i)},e.prototype._renderClasses=function(){var e,t,i,n=this._el.classList;n.add(this._componentClass,this._componentClass+this._classSuffix),e=this._classMap[this._value];for(t in this._classMap)(i=this._classMap[t])&&(i===e?n.add(i,i+this._classSuffix):n.remove(i,i+this._classSuffix));!e&&this._value&&s.logWarn("no className for status "+this._value)},e.prototype._renderTooltip=function(){this._el.setAttribute("title",this._showTooltip?this.getTooltipText():""),"custom"===this._tooltipType&&this._el.classList.toggle("apply-common-tooltip",this._showTooltip)},e.prototype._getQuoteSessionId=function(){return this._quoteSessionPrefix+"."+this._quoteSessionGUID},e}(),window.AbstractIndicator=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var i=new Date(e+t),n=Math.round(Math.abs(t)/6e4),o="UTC";return 0!==n&&(o+=t>0?"+":"-",o+=Math.floor(n/60),n%60&&(o+=":"+n%60)),i.getUTCFullYear()+"-"+("0"+(i.getUTCMonth()+1)).slice(-2)+"-"+("0"+i.getUTCDate()).slice(-2)+" "+("0"+i.getUTCHours()).slice(-2)+":"+("0"+i.getUTCMinutes()).slice(-2)+" ("+o+")"}function r(e){return"string"==typeof e&&0!==e.trim().length}function s(e){var t,i,n,o,s;if(!e||0===e.length)return!0;for(t=0;t<e.length;t++){if(r(e[t])||e[t].id||r(e[t].title))return!1;if(e[t].lines)for(i=e[t].lines,n=i.length,o=0;o<n;o++)if(s=i[o],r(s)||r(s.line))return!1}return!0}function a(e,t){var i,n,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.hasOwnProperty("text")?(i=r&&(0,d.forceLTRStr)(e.text)||e.text,e.hasOwnProperty("color")&&o?t.append($("<span>",{style:"color: "+e.color}).text(i)):t.text(i)):(n=r&&(0,d.forceLTRStr)(e)||e,t.text(n))}function l(e,t){if(Array.isArray(e)&&2===e.length)$("<dl>").append(a(e[0],$("<dt>")),a(e[1],$("<dd>"),!0,!0)).appendTo(t);else if(e.hasOwnProperty("br")&&e.br)$("<br>").appendTo(t);else{var i=$("<dl>").append(a(e,$("<dt>"))).appendTo(t);e.hasOwnProperty("listItem")&&i.addClass("list-item")}}function c(e,t){var i=(0,d.forceLTRStr)(e.text);$("<a>").attr("href",e.href).text(i).addClass(e.class).appendTo(t)}function h(e,t){var i,n,r,s,a,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof e)i=(0,d.forceLTRStr)(e),
$("<h2>").text(i).appendTo(t);else if(e.hasOwnProperty("lines"))for(n=0;n<e.lines.length;n++)e.lines[n].hasOwnProperty("line")?0===n?e.lines[n].line.isEmpty||$("<h2>").text(e.lines[n].line).appendTo(t):l(e.lines[n].line,t):e.lines[n].hasOwnProperty("link")&&c(e.lines[n].link,t);else e.hasOwnProperty("title")&&$("<h2>").text(e.title).appendTo(t),e.hasOwnProperty("actual")&&(r=e.actual&&(0,d.forceLTRStr)(e.actual),$("<dl>").append($("<dt>").text($.t("Actual")+": "),$("<dd>").text(r||"—")).appendTo(t)),e.hasOwnProperty("forecast")&&(s=e.forecast&&(0,d.forceLTRStr)(e.forecast),$("<dl>").append($("<dt>").text($.t("Forecast")+": "),$("<dd>").text(s||"—")).appendTo(t)),e.hasOwnProperty("previous")&&(a=e.previous&&(0,d.forceLTRStr)(e.previous),$("<dl>").append($("<dt>").text($.t("Previous")+": "),$("<dd>").text(a||"—")).appendTo(t)),e.hasOwnProperty("timestamp")&&$("<dl>").append($("<dt>").text($.t("Date")+": "),$("<dd>").text(o(e.timestamp,h)||"—")).appendTo(t)}var u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.Tooltip=void 0,u=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),i(666),d=i(38),t.Tooltip=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.direction,o=void 0===i?"top":i,r=t.clickable,s=void 0!==r&&r,a=t.wide,l=void 0!==a&&a;n(this,e),this._direction=o,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=l?250:200,this._$tooltip=$("<div>").addClass("tv-chart-events-source__tooltip").css({position:"absolute",width:this._width+"px"}),this._$tooltipContent=$("<div>").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip),s&&this._$tooltip.addClass("tv-chart-events-source__tooltip--clickable")}return u(e,[{key:"show",value:function(){var e,t,i,n,o,r,a,l,c,u,d,p,_,f,m,y,g,v,S,b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},w=b.items,P=void 0===w?[]:w,T=b.x,x=void 0===T?0:T,C=b.y,L=void 0===C?0:C,I=b.wrapElement,A=void 0===I?null:I,k=b.timeOffset,E=void 0===k?"":k,M=b.leftBorderColor,V=void 0===M?null:M;if(A&&!s(P)){if(e=$(A).width(),t=$(A).height(),i=!1,n=!1,this._tooltipShown||(this._$tooltip.appendTo(A),this._tooltipShown=!0,i=!0,n=!0),x===this._tooltipX&&L===this._tooltipY||(i=!0),i&&(o=Math.max(Math.min(x-this._width/2,e-this._width-10),0),this._$tooltip.css({left:Math.round(o),bottom:Math.round(t-L+10)})),this._tooltipItems||(n=!0),!n)for(r=P.length;r--;)if(this._tooltipItems[r]!==P[r]){n=!0;break}if(n){if(a=void 0,P.length<=1)a=P;else{for(l={},c=P.length;c--;)u=P[c].importance,null==u&&(u=-1),l[u]||(l[u]=[]),l[u].push(P[c]);if(d=Object.keys(l).sort(function(e,t){return e-t}),d.length<=1)a=l[d[0]];else for(a=[],p=d.length;p--;)for(_=l[d[p]],f=_.length;f--;)a.push(_[f])}for(this._$tooltipContent.empty(),m=a.length;m--;)y=a[m],g="",
y.hasOwnProperty("importance")?("string"==typeof y.importance&&("earnings"===y.importance?g="--importance-earnings":"splits"===y.importance?g="--importance-splits":"dividends"===y.importance?g="--importance-dividends":"list"===y.importance&&(g="--importance-list")),0===y.importance?g="--importance-normal":y.importance>0&&(g="--importance-high")):V||(g="--importance-none"),v="tv-chart-events-source__tooltip__item",g&&(v+=" "+v+g),S=$("<div>").attr("class",v),V&&S.css("border-left-color",V),h(y,S,E),S.appendTo(this._$tooltipContent);this._tooltipItems=P}"bottom"===this._direction&&this._$tooltip.css({bottom:Math.round(t-L-this._$tooltipContent.height()+10)})}}},{key:"hide",value:function(){this._tooltipShown&&(this._$tooltip.detach(),this._tooltipShown=!1)}},{key:"isOpened",value:function(){return this._tooltipShown}}]),e}()},function(e,t,i){"use strict";(function(t){var n=i(37),o=i(15).Interval,r=i(8),s=i(5),a=function(e,t){this._server=e,this._session=t,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new r,this.seriesError=new r,this._lastBarTimes={}};a.prototype.lastBarTime=function(e){return this._lastBarTimes[e]},a.prototype._userTimezone=function(){return this._timezone},a.prototype.setTimezone=function(e){this._timezone="exchange"===e?"exchange":t.get_timezone(e),this._timezoneId=e},a.prototype.timezone=function(){return this._timezoneId},a.prototype.setResolution=function(e){this._isDWM=o.isDWM(e),this._resolution=e},a.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},a.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},a.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},a.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},a.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},a.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},a.prototype.onSeriesError=function(e,t){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t]}),this.seriesError.fire(e,t)},a.prototype.onSeriesClearData=function(e,t){var i={};i[e]={series:[],turnaround:t},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[],index_diff:[]}]})},a.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},a.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},a.prototype._calcMarksTime=function(e,i,o,r,a){
var l,c,h,u,d,p=t.get_timezone(i),_=this;if(this._isDWM&&!s.enabled("disable_resolution_rebuild"))for(d=new n.Session,d.init(p,o),u=0;u<e.length;u++)h=e[u],l=r(h),c=t.utc_to_cal(p,1e3*l),c=d.spec.correctTradingDay(c,p),t.set_hms(c,0,0,0,0,p),e[u]=a(h,parseInt(c.valueOf()/1e3));else for(u=0;u<e.length;u++)e[u]=a(e[u],_.timeInTimezone(r(e[u]),p))},a.prototype.onTickmarksUpdated=function(e,t,i,n){var r,s,a,l,c,h,u;if(o.isEqual(n,this._resolution)){for(r=t.slice(0),this._calcMarksTime(r,i.timezone,i.session,function(e){return e},function(e,t){return t}),s=[],a=[],c=0;c<r.length;++c)h=r[c],s.push([this._spanByTime(h,l),h,e+c]),a.push(h),l=h;u={method:"tickmark_update",params:[this._session,{index:e,zoffset:0,changes:a,marks:s,index_diff:[]}]},this._server.receiveLocalResponse(u)}},a.prototype.onTimescaleUpdate=function(e,t,i,n,o,r){var s,a,l,c,h,u,d,p,_=r&&r.slice(0);for(this._lastBarTimes[e]=_?_&&_[_.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,n.timezone,n.session,function(e){return e.value[0]},function(e,t){return e.exTime=t,e}),_&&this._calcMarksTime(_,n.timezone,n.session,function(e){return e},function(e,t){return{markTime:t,time:e}}),s={},s[e]={series:i,turnaround:t},a=[],l=[],h=i.map(function(e){return{markTime:e.exTime,time:e.value[0]}}),_&&(h=h.concat(_)),u=0;u<h.length;++u)d=h[u].markTime,a.push([this._spanByTime(d,c),d,o+u]),l.push(h[u].time),c=d;p={method:"timescale_update",params:[this._session,s,{index:o,zoffset:0,changes:l,marks:a,index_diff:[]}]},this._server.receiveLocalResponse(p)},a.prototype.onSeriesTimeframeUpdate=function(e,t,i,n,o){var r={method:"series_timeframe",params:[this._session,e,t,i,n,o]};this._server.receiveLocalResponse(r)},a.prototype.onPointsetDataUpdate=function(e,t,i,n){this._onDataUpdate(e,t,i,null,n,1)},a.prototype.onDataUpdate=function(e,t,i,n,o){this._onDataUpdate(e,t,i,n,o,0)},a.prototype._onDataUpdate=function(e,t,i,n,o,r){var s,a={},l="",c=[];null!==n&&(l=JSON.stringify(n.data),c=n.indexes||[]),a[e]={s:i,ns:{d:l,indexes:c},turnaround:t},s={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(s)},a.prototype.onQuotesData=function(e){this._server.receiveLocalResponse({method:"quote_symbol_data",params:e})},a.prototype.onDepthData=function(e){this._server.receiveLocalResponse({method:"dd",params:e})},a.prototype.onDepthUpdate=function(e){this._server.receiveLocalResponse({method:"dpu",params:e})},a.prototype.onProjectionUpdate=function(e,t,i,n){var o,r=i.data,s=r[r.length-1],a={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:s?s[4]:i.price,bars:r.map(function(e,t){return{time:t,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],factor:e[6],additionalPrice:e[6]}})}},l={};l[e]={s:n||[],ns:{d:JSON.stringify(a),indexes:r.map(function(e,t){return i.barsetSize+(e[0]||0)})},turnaround:t},o={method:"data_update",params:[this._session,l]},this._server.receiveLocalResponse(o)},a.prototype.timeInTimezone=function(e,i){
return"exchange"===this._userTimezone()?parseInt(t.utc_to_cal(i,1e3*e).valueOf()/1e3):parseInt(t.utc_to_cal(this._userTimezone(),1e3*e).valueOf()/1e3)},a.prototype._spanByTime=function(e,t){function i(e){return 60*e*60*1e3}function n(e){return 60*e*1e3}function o(e){return 1e3*e}var r,s,a,l=[{divisor:1,span:20},{divisor:o(1),span:19},{divisor:n(5),span:21},{divisor:n(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!t)return 20;if(r=new Date(1e3*t),s=new Date(1e3*e),s.getYear()!==r.getYear())return 70;if(s.getUTCMonth()!==r.getUTCMonth())return 60;if(s.getUTCDate()!==r.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(r/l[a].divisor)!==Math.floor(s/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],e.exports=a}).call(t,i(35))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"supportedLineTools",function(){return n});var n={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush",onlySelectable:!0},text:{name:"LineToolText",supportsText:!0},anchored_text:{name:"LineToolTextAbsolute",supportsText:!0},note:{name:"LineToolNote",supportsText:!0},anchored_note:{name:"LineToolNoteAbsolute",supportsText:!0},callout:{name:"LineToolCallout",supportsText:!0},balloon:{name:"LineToolBalloon",supportsText:!0},arrow_up:{name:"LineToolArrowMarkUp",supportsText:!0},arrow_down:{name:"LineToolArrowMarkDown",supportsText:!0},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:!0},arrow_right:{name:"LineToolArrowMarkRight",supportsText:!0},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},cross_line:{name:"LineToolCrossLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},info_line:{name:"LineToolInfoLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fixed:{name:"LineToolGannFixed"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{
name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},function(e,t,i){"use strict";var n,o,r,s,a,l;i.d(t,"a",function(){return o}),i.d(t,"b",function(){return r}),i.d(t,"c",function(){return s}),i.d(t,"d",function(){return a}),i.d(t,"e",function(){return l}),n=i(25),i.n(n),o=function(){function e(){}return e.prototype.init=function(e,t){e.new_sym(t(1),n.Std.period(e),n.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1},e.prototype.main=function(e,t){var i,o,r,s,a,l,c=e.symbol.time,h=n.Std[this._source](e);return e.select_sym(1),i=n.Std[this._source](e),o=e.new_unlimited_var(i),r=e.new_unlimited_var(e.symbol.time),e.select_sym(0),isNaN(c)?null:(s=r.indexOf(c),-1!==s&&r.get(s)!==c&&(s=-1),a=s<0?NaN:o.get(s),l=this._doCalculation(this._scaleFactor1,h,this._scaleFactor2,a),[l])},e}(),r={styles:{plot1:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:2,inputs:{source:"close",symbol2:""}},s=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],a=[{id:"plot1",type:"line"}],l={plot1:{title:"Plot",histogramBase:0}}},function(e,t,i){"use strict";function n(e){var t=e.className,i=e.icon,n=void 0===i?"":i,r=e.onClick,s=e.title;return o.createElement("span",{title:s,className:t,dangerouslySetInnerHTML:{__html:n},onClick:r})}var o;t.a=n,o=i(20),i.n(o)},function(e,t,i){var n;!function(t){"use strict";function o(){}function r(e,t){
for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function s(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var l=o.prototype,c=t.EventEmitter;l.getListeners=function(e){var t,i,n=this._getEvents();if(e instanceof RegExp){t={};for(i in n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i])}else t=n[e]||(n[e]=[]);return t},l.flattenListeners=function(e){var t,i=[];for(t=0;t<e.length;t+=1)i.push(e[t].listener);return i},l.getListenersAsObject=function(e){var t,i=this.getListeners(e);return i instanceof Array&&(t={},t[e]=i),t||i},l.addListener=function(e,t){var i,n,o;if(!a(t))throw new TypeError("listener must be a function");i=this.getListenersAsObject(e),n="object"==typeof t;for(o in i)i.hasOwnProperty(o)&&-1===r(i[o],t)&&i[o].push(n?t:{listener:t,once:!1});return this},l.on=s("addListener"),l.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},l.once=s("addOnceListener"),l.defineEvent=function(e){return this.getListeners(e),this},l.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},l.removeListener=function(e,t){var i,n,o=this.getListenersAsObject(e);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],t))&&o[n].splice(i,1);return this},l.off=s("removeListener"),l.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},l.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},l.manipulateListeners=function(e,t,i){var n,o,r=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(n=i.length;n--;)r.call(this,t,i[n]);else for(n in t)t.hasOwnProperty(n)&&(o=t[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},l.removeEvent=function(e){var t,i=typeof e,n=this._getEvents();if("string"===i)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},l.removeAllListeners=s("removeEvent"),l.emitEvent=function(e,t){var i,n,o,r,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)n=i[o],!0===n.once&&this.removeListener(e,n.listener),n.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},l.trigger=s("emitEvent"),l.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},l.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},l._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},l._getEvents=function(){return this._events||(this._events={})},o.noConflict=function(){return t.EventEmitter=c,o},void 0!==(n=function(){return o}.call(t,i,t,e))&&(e.exports=n)}(this||{})},,function(e,t,i){"use strict";var n,o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"RectangleRenderer",function(){return h}),n=i(9),o=i(30),i.n(o),r=i(60),i.n(r),s=i(6),i.n(s),
a=i(29),l=i(7),i.n(l),c=i(46),i.n(c),h=function(){function e(e,t,i){this._data=null,this._hitTestResult=e||new n.HitTestResult(n.HitTestResult.MOVEPOINT),this._backHitTestResult=t||new n.HitTestResult(n.HitTestResult.MOVEPOINT_BACKGROUND),this._forceOverrideTransparency=!!i}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,n,o;null===this._data||this._data.points.length<2||(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&Object(c.setLineStyle)(e,this._data.linestyle),t=this._data.points,i=t[0],n=t[1],o=n.subtract(i),e.beginPath(),e.rect(i.x,i.y,o.x,o.y),this._data.linewidth>0&&e.stroke(),this._data.fillBackground&&(e.fillStyle=this.getColor(),e.fill()))},e.prototype.hitTest=function(e){var t,i,n,a,l,c,h,u,d,p;return null===this._data||this._data.points.length<2||this._data.nohittest?null:(t=this._data.points,i=t[0],n=t[1],a=new s.Point(n.x,i.y),l=new s.Point(i.x,n.y),c=Object(o.distanceToSegment)(i,a,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(a,n,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(n,l,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(l,i,e),c.distance<=3?this._hitTestResult:this._data.fillBackground&&(h=Math.min(i.x,n.x),u=Math.max(i.x,n.x),d=Math.min(i.y,n.y),p=Math.max(i.y,n.y),i=new s.Point(h,d),n=new s.Point(u,p),Object(r.pointInRectangle)(e,i,n))?this._backHitTestResult:null))))},e.prototype.getColor=function(){var e=Object(l.ensure)(this._data);return Object(a.generateColor)(e.backcolor,e.transparency,this._forceOverrideTransparency)},e}()},function(e,t,i){"use strict";var n,o,r,s;i.d(t,"a",function(){return s}),n=i(1),o=i(20),i.n(o),r=i(59),i.n(r),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleOutsideEvent=function(e){t.props.handler&&!r.findDOMNode(t).contains(e.target)&&t.props.handler(e)},t}return n.c(t,e),t.prototype.componentDidMount=function(){this.props.click&&document.addEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.addEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.addEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.addEventListener("touchstart",this._handleOutsideEvent,!1)},t.prototype.componentWillUnmount=function(){this.props.click&&document.removeEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.removeEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.removeEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.removeEventListener("touchstart",this._handleOutsideEvent,!1)},t.prototype.render=function(){var e=this.props,t=(e.click,e.handler,e.mouseDown,e.touchEnd,e.touchStart,e.ctor),i=void 0===t?"span":t,r=n.e(e,["click","handler","mouseDown","touchEnd","touchStart","ctor"]);return o.createElement(i,n.a({},r))},t}(o.Component)},function(e,t,i){"use strict";function n(e){
return void 0===e&&(e=""),'\n\t\t<div class="tv-spinner" role="progressbar">\n\t\t\t<div class="tv-spinner__spinner-layer">\n\t\t\t\t<div class="tv-spinner__background tv-spinner__width_element"></div>\n\t\t\t\t<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--left"></div>\x3c!--\n\t\t\t\t--\x3e<div class="tv-spinner__circle-clipper tv-spinner__width_element tv-spinner__circle-clipper--right"></div>\n\t\t\t</div>\n\t\t</div>\n\t'}var o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DEFAULT_SIZE",function(){return s}),t.renderSpinnerTemplate=n,i.d(t,"Spinner",function(){return l}),o=i(333),i.n(o),r=i(202),s="large",a=Object(r.b)(n()),l=function(){function e(e){this._shown=!1,this._el=a.cloneNode(!0),this.setSize(e||s)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,e.appendChild(this._el)),this._shown=!0,this},e.prototype.stop=function(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},e.prototype.setStyle=function(e){var t=this;return Object.keys(e).forEach(function(i){var n=e[i];void 0!==n&&t._el.style.setProperty(i,n)}),this},e.prototype.setSize=function(e){var t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className="tv-spinner "+t+" "+(this._shown?"tv-spinner--shown":""),this},e.prototype.getEl=function(){return this._el},e.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},e}()},function(e,t,i){"use strict";function n(e){return Object(r.clean)(JSON.stringify(e))}function o(e){return JSON.parse(Object(r.clean)(e,!0))}var r;t.b=n,t.a=o,r=i(160),i.n(r)},function(e,t,i){"use strict";function n(e){for(var t=0;t<p.length;t++)if(p[t].name===e)return t;return-1}function o(e){if(!_)for(var t=p.length-1;t>=0&&!0!==p[t].func(e);t--);}function r(e){e.addEventListener("keypress",o,!1)}function s(e,t){var i={name:e,func:t},o=n(i.name);o>-1?p[o]=i:p.push(i)}function a(e){p.forEach(function(t,i){t.name===e&&p.splice(i,1)})}function l(e,t){var i={name:e,func:t},o=n(i.name);o>-1&&p.splice(o,1),p.unshift(i)}function c(){return _?null:_=Object(d.randomHashN)(4)}function h(e){if(e!==_)throw Error("Lock id is outdated");_=null}var u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.registerListener=s,t.removeListener=a,t.pushBackListener=l,t.disable=c,t.enable=h,u=i(14),i.n(u),d=i(33),p=[],_=null,r(window)},function(e,t,i){"use strict";(function(n){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),s=i(309),i(337),a=i(4).getLogger("Ui.TvControlCheckbox"),l={
labelWrapper:'{{#hasLabel}}<label>{{#labelLeft}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelLeft}}</span>{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelRight}}</span>{{/labelRight}}</label>{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}',inputWrapper:'<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}</{{ tag }}>',checkbox:'<input{{#id}} id="{{ id }}"{{/id}} class="{{> checkboxClass }}" type="checkbox"{{#name}} name="{{ name }}"{{/name}}{{#checked}} checked{{/checked}}{{#disabled}} disabled{{/disabled}}>',checkboxClass:"{{ customClass }}__input",box:'<span class="{{ customClass }}__box {{#boxAddClass}}{{boxAddClass}}{{/boxAddClass}}">'+i(195)+"</span>",ripple:'<span class="{{ customClass }}__ripple js-ripple"></span>'},c="i-inited",h=function(){function e(t){var i,n=t.customClass,r=void 0===n?"tv-control-checkbox":n,s=t.$checkbox,l=t.tag,h=t.id,u=t.name,d=t.checked,p=t.disabled,_=t.labelLeft,f=t.labelRight,m=t.labelAddClass,y=t.boxAddClass;if(o(this,e),this.$el=null,void 0===l&&(l=_||f?"span":"label"),i=s instanceof $&&!!s.length){if(!s.is("input[type=checkbox]"))return void a.logError("`$checkbox` need to be input[type=checkbox]");if(s.hasClass(c))return;this._setInputId(s,h),this._setInputClass(s,r),this._setInputName(s,u),this._setInputChecked(s,d),this._setInputDisabled(s,p),d=!!s.prop("checked"),p=!!s.attr("disabled")}this.$el=this.render({$checkbox:s,hasCheckbox:i,customClass:r,tag:l,id:h,name:u,checked:d,disabled:p,labelLeft:_,labelRight:f,hasLabel:_||f,labelAddClass:m,boxAddClass:y}),this.$checkbox=i?s:this.$el.find("input[type=checkbox]")}return r(e,[{key:"_setInputId",value:function(e,t){void 0!==t&&e.attr("id",t)}},{key:"_setInputClass",value:function(e,t){var i=n.render(l.checkboxClass,{customClass:t});e.addClass(i)}},{key:"_setInputName",value:function(e,t){void 0!==t&&e.attr("name",t)}},{key:"_setInputChecked",value:function(e,t){void 0!==t&&e.prop("checked",!!t)}},{key:"_setInputDisabled",value:function(e,t){void 0!==t&&(t?e.setAttribute("disabled","disabled"):e.removeAttr("disabled"))}},{key:"render",value:function(e){var t,i=e.$checkbox,o=$(n.render(l.labelWrapper,e,l));return e.hasCheckbox&&(o.insertBefore(i),t=o.find("."+e.customClass).andSelf().filter("."+e.customClass).eq(0),t.prepend(i.detach()),i.addClass(c)),o}},{key:"checked",set:function(e){this._setInputChecked(this.$checkbox,!!e)},get:function(){return!!this.$checkbox.prop("checked")}}]),e}(),$.fn.tvControlCheckbox=(0,s.createTvBlockWithInstance)("tv-control-checkbox",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new h(TradingView.mergeObj(t,{$checkbox:e}))}),t.default=h,e.exports=t.default}).call(t,i(126))},function(e,t,i){"use strict";function n(e){if(e)return function(t,i,n){function o(t,i){return i?e[t](a,i):e[t](a)}var r,s,a=$(this)
;return"get"===t?(r=i,"function"==typeof e[r]?o(r,n):e[r]):e[t]?a.each(function(){return o(t,s)}):a}}function o(e,t){function i(e,t,i){return void 0===i?e[t]():e[t](i)}if(e&&t)return e=""+e,function(n,o,a){var l,c,h;return"get"===n?l=o:(c=o,"object"===(void 0===n?"undefined":r(n))&&void 0===o?(c=n,n="init"):"string"!=typeof n&&(n="init")),"getInstance"===n?$(this).eq(0).data(e):"destroy"===n?(h=$(this).eq(0).data(e))?void("function"==typeof h.destroy?(i(h,"destroy",c),$(this).eq(0).removeData(e)):s.logError("[Block Plugin] "+e+" does not support destroy command")):void console.warn("[Block Plugin] Trying to execute destroy method of "+e+" but it has not been inited"):"get"===n?(h=$(this).eq(0).data(e),h?"function"==typeof h[l]?i(h,l,a):h[l]:void console.warn("[Block Plugin] Trying to get prop or execute method of "+e+" but it has not been inited")):$(this).each(function(){var o=$(this),r=o.data(e);void 0===r&&(r=void 0===c?t(o):t(o,c),o.data(e,r)),"init"!==n&&("function"==typeof r[n]?i(r,n,c):s.logError("[Block Plugin] "+e+" does not support command "+n))})}}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=i(4).getLogger("CommonUI.CreateTVBlockPlugin");e.exports.createTvBlockPlugin=n,e.exports.createTvBlockWithInstance=o},,function(e,t,i){"use strict";function n(e){var t,i,n,o,r;return t=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i,i=t.exec(e)||[],n=~~i[1],o=i[2]&&i[2].toUpperCase()||null,r={qty:!n&&o?1:n,unit:o},r.error=!n&&!o,r.intraday=!(r.error||r.unit&&"H"!==r.unit),r}function o(e){var t,i,o;return l.enabled("allow_supported_resolutions_set_only")?null!==(t=r(e))&&Object(c.isAvailable)(""+t):(i=n(e),!i.error&&(i.intraday?h.linking.intraday.value():!(o=h.linking.supportedResolutions.value())||null!==i.unit&&!!~o.indexOf(i.unit)))}function r(e){var t=n(e),i=t.qty,o=t.unit;return t.error?null:("H"===o&&(i*=60,o=null),i&&!o?i+"":o&&(!i||1===i&&"S"!==o)?o:i+o)}function s(){var e=!1;return e}function a(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntervalValue=n,t.intervalIsSupported=o,t.sanitizeIntervalValue=r,t.canShowSpreadActions=s,t.globalKeypressMatches=a,l=i(5),i.n(l),c=i(61),h=i(62)},function(e,t,i){"use strict";function n(e,t,i){this._cache=e,this._cacheRect=t,this._targetRect=i}var o=i(6).Point,r=i(60).pointInRectangle,s=i(9).HitTestResult;n.prototype.draw=function(e){e.translate(.5,.5),e.drawImage(this._cache,this._cacheRect.left,this._cacheRect.top,this._cacheRect.width,this._cacheRect.height,this._targetRect.left,this._targetRect.top,this._targetRect.width,this._targetRect.height),e.translate(-.5,-.5)},n.prototype.hitTest=function(e){var t=new o(this._targetRect.left,this._targetRect.top),i=t.add(new o(this._targetRect.width,this._targetRect.height));return r(e,t,i)?new s(s.REGULAR):null},
e.exports=n},,,function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PipFormatter",function(){return r}),n=i(1),o=i(21),r=function(e){function t(t,i,n,o){var r=this;return i||(i=1),"forex"!==n&&"cfd"!==n||!o?(r=e.call(this,1)||this,r._isForex=!1):(r=e.call(this,o)||this,r._isForex=!0),r._pipPriceScale=t,r._pipMinMove=i,r._pipMinMove2=o,r}return n.c(t,e),t.prototype.format=function(t,i,n){var o=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===o&&(o=NaN),e.prototype.format.call(this,t*this._pipPriceScale/o,i,n)},t}(o.PriceFormatter)},,function(e,t,i){function n(e,t,i,n,r,s){if(!e)return void o.logDebug("Missing control");this._control=e,this._property=t,this._applyOnFly=i,this._undoModel=n,this._undoText=r,t&&(this._formatters=[],this._changed=!1,this.setValue(t.value()),t.listeners().subscribe(this,this.propertyChanged))}var o=i(4).getLogger("Chart.PropertyPage.Binding");n.prototype.addFormatter=function(e){this._formatters.push(e),this.setValue(this._property.value())},n.prototype._formatValue=function(e){return this._formatters.reduce(function(e,t){return t(e)},e)},n.prototype._setValueToProperty=function(e){this._setter?this._setter.call(this,e):this.setValueToProperty(e)},n.prototype._attachToControl=function(e,t){var i=this;t?e.on("keyup change input",function(e){var t=i.value();i._setValueToProperty(t),i.setValue(t)}):(e.keypress(function(e){if(i._changed=!0,13===e.which){var t=i.value();i._setValueToProperty(t),i.setValue(t)}}),e.focusout(function(e){var t=i.value();i.changed()&&(i._setValueToProperty(t),i.setValue(t))}),e.change(function(e){var t=i.value();$(e.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i._setValueToProperty(t)},250)):i._setValueToProperty(t),i.setValue(t)}))},n.prototype.control=function(){return this._control},n.prototype.changed=function(){return this._changed},n.prototype.setValueToProperty=function(e){this._undoModel.setProperty(this._property,e,this._undoText),this._changed=!1},n.prototype.property=function(){return this._property},n.prototype.propertyChanged=function(e){this.setValue(e.value())},n.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},t.Binding=n},function(e,t,i){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeSpanFormatter",function(){return n}),i(11),n=function(){function e(){}return e.prototype.format=function(e){var t,i,n,o,r=e<0;return e=Math.abs(e),t=Math.floor(e/86400),e-=86400*t,i=Math.floor(e/3600),e-=3600*i,n=Math.floor(e/60),e-=60*n,o="",t&&(o+=t+$.t("d",{context:"dates"})+" "),i&&(o+=i+$.t("h",{context:"dates"})+" "),n&&(o+=n+$.t("m",{context:"dates"})+" "),e&&(o+=e+$.t("s",{context:"dates"})+" "),r&&(o="-"+o),o.trim()},e}()},,,function(e,t,i){"use strict";function n(){return[[1,0,0],[0,1,0],[0,0,1]]}function o(e,t){var i,n,o,r=[[0,0,0],[0,0,0],[0,0,0]];for(i=0;i<3;i++)for(n=0;n<3;n++)for(o=0;o<3;o++)r[i][n]+=e[i][o]*t[o][n];return r}
function r(e){var t=Math.cos(e),i=Math.sin(e);return[[t,-i,0],[i,t,0],[0,0,1]]}function s(e,t){return[[e,0,0],[0,t,0],[0,0,1]]}function a(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function l(e,t){var i,n,o=[t.x,t.y,1],r=[0,0,0];for(i=0;i<3;i++)for(n=0;n<3;n++)r[i]+=o[n]*e[i][n];return new c.Point(r[0],r[1])}Object.defineProperty(t,"__esModule",{value:!0});var c=i(6);t.identityMatrix=n,t.multiplyMatrices=o,t.rotationMatrix=r,t.scalingMatrix=s,t.translationMatrix=a,t.transformPoint=l},function(e,t,i){"use strict";function n(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Object.defineProperty(t,"__esModule",{value:!0}),t.regExpEscape=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StatsPosition",function(){return n});var n;!function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(n||(n={}))},function(e,t,i){"use strict";var n,o;i.d(t,"a",function(){return o}),i(1),n=i(20),i.n(n),function(e){e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace",e[e.DownArrow=40]="DownArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.LeftArrow=37]="LeftArrow",e[e.Escape=27]="Escape",e[e.Tab=9]="Tab"}(o||(o={}))},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>'},function(e,t,i){"use strict";function n(e){var t,i=e.className,n=e.icon,u=e.clearable,d=e.onClear,p=e.size,_=e.strictLeftDirectionInput,f=o.e(e,["className","icon","clearable","onClear","size","strictLeftDirectionInput"]),m=s(c.inputWrapper,(t={},t[i]=!!i,t[c.iconed]=!!n,t[c.clearable]=u,t));return r.createElement(h,o.a({theme:c,className:m,leftComponent:n?r.createElement(a.a,{key:"inputIcon",icon:n,className:c.inputIcon}):void 0,rightComponent:u?r.createElement(a.a,{className:c.clearIcon,icon:l,key:"clearIcon",onClick:d}):void 0,sizeMode:p,strictLeftDirectionInput:_},f))}var o,r,s,a,l,c,h;i.d(t,"a",function(){return h}),t.b=n,o=i(1),r=i(20),i.n(r),s=i(102),i.n(s),a=i(300),l=i(325),i.n(l),c=i(207),i.n(c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.c(t,e),t.prototype.render=function(){var e,t,i,n,a=this.props,l=a.theme,h=a.error,u=a.success,d=a.sizeMode,p=a.leftComponent,_=a.rightComponent,f=a.grouped,m=a.fontSize,y=a.reference,g=a.className,v=(a.strictLeftDirectionInput,o.e(a,["theme","error","success","sizeMode","leftComponent","rightComponent","grouped","fontSize","reference","className","strictLeftDirectionInput"])),S={fontSize:m},b=s(l.textInput,this.props.strictLeftDirectionInput&&c.textInputLeftDirection,(e={},e[l.error]=h,e[l.success]=u,e[l[d]]=!!d,e)),w=s(l.inputWrapper,(t={},t[g]=!!g,t[l.grouped]=f,
t)),P=[],T=r.createElement("input",o.a({ref:y,className:b,key:"textInput",style:S},v));return p&&(i={className:s(l.leftComponent,p.props.className),key:"leftComponent"},P.push(r.cloneElement(p,i))),P.push(T),_&&(n={className:s(l.rightComponent,_.props.className),key:"rightComponent"},P.push(r.cloneElement(_,n))),r.createElement("div",{className:w},P)},t}(r.PureComponent)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LabelSettings",function(){return n});var n;!function(e){e.offset=8,e.font="Arial",e.fontSize=12,e.lineSpacing=10,e.bgColor="rgba(255,255,255,.8)",e.borderColor="#e3e3e3",e.padding=8}(n||(n={}))},function(e,t,i){"use strict";function n(e){i.e(9).then(function(t){i(358).showGoToDateDialog(e)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.showGoToDateDialog=n},,,function(e,t,i){"use strict";!function(e){e.fn.selectable=function(t){return this.each(function(){var i=e(this);i.css("user-select",t?"text":"none"),i.css("-moz-user-select",t?"text":"-moz-none"),i.css("-webkit-user-select",t?"auto":"none"),(e.browser.msie||e.browser.opera)&&i.attr("unselectable",t?"off":"on")})}}(jQuery)},,function(e,t){},function(e,t,i){"use strict";var n,o;i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o}),n=52,o=5},function(e,t,i){"use strict";function n(){var e,t,i=[];for(i=i.concat([61536,61537,61538,61539]),i=i.concat([61725,61726]),i=i.concat([61575,61576,61796,61797]),i=i.concat([61779,61780,61781,61782,61783,61784,61785,61786]),e=i.slice(0),t=61440;t<=61846;t++)-1===i.indexOf(t)&&(t%16==15&&61487!==t||t>=61620&&t<=61630||61718!==t&&61719!==t&&61472!==t&&61619!==t&&e.push(t));return e}Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"availableIcons",function(){return o});var o=n()},function(e,t,i){"use strict";function n(e,t){return window.fetch(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fetch=n},function(e,t){},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o;Object.defineProperty(t,"__esModule",{value:!0}),o=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),t.KeyboardListener=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keydown",i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n(this,e),this._event=t,this._preventDefault=i}return o(e,[{key:"regHandlers",value:function(e){this._handlers=e}},{key:"watchOn",value:function(e){this._listener=this._regListener(),this._watchingEl=e,e.addEventListener(this._event,this._listener)}},{key:"stopWatching",value:function(){this._watchingEl.removeEventListener(this._event,this._listener)}},{key:"_regListener",value:function(){var e=this;return function(t){var i=t.which,n=e._getHandler(i);t.stopPropagation(),n(t)}}},{key:"_getHandler",value:function(e){
var t=this,i=t._handlers[e],n=function(){},o=function(e){t._preventDefault&&e.preventDefault(),i(e)};return i?o:n}}]),e}()},function(e,t,i){"use strict";function n(e){l.call(this,e),this.ch=e.char[0]||" ",this.fontFamily=e.fontFamily||"Arial",this._charCache=new a(this.ch,!1,!1,this.fontFamily,this.height)}var o=i(6).Point,r=i(27).selectionTolerance,s=i(9).HitTestResult,a=i(265),l=i(44).PaneRendererAbstractShape;inherit(n,l),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a=this._vertOffset>0?1:-1;for(t=0,i=this.items.length;t<i;t++)n=this.items[t],o=n.x,r=n.y+this._vertOffset-a*Math.round(this.height/2),s=n.style&&null!=n.style.color?n.style.color:this._color,this._charCache.paintTo(e,s,o,r,"center",this._vertOffset>0?"middle":"bottom")},n.prototype.hitTest=function(e){var t,i,n,a=this._vertOffset,l=r(this.height);for(t=0;t<this.items.length;++t)if((i=this.items[t])&&(n=new o(i.x,i.y+a),n.subtract(e).length()<=l))return new s(s.REGULAR);return null},t.PaneRendererUnicodeChar=TradingView.PaneRendererUnicodeChar=n},function(e,t,i){"use strict";function n(e){var t,i=Object(o.get_timezone)(e).offset_utc(Date.now()),n="",r=i/1e3/60/60;return r%1&&(n=":"+r%1*60),t="",t=r>0?"+"+(r-r%1)+n:0===r?"":r-r%1+n+"",{offset:i,string:"UTC"+t}}var o;t.a=n,o=i(35),i.n(o)},,,,,,,,function(e,t,i){"use strict";function n(e){var t,i;return void 0===e&&(e=location.host),t=["i18n.tradingview.com","partial.tradingview.com","www.tradingview.com","wwwcn.tradingview.com"],i=["d33t3vvu2t2yu5.cloudfront.net","dwq4do82y8xi7.cloudfront.net","s.tradingview.com","s3.tradingview.com"],-1!==t.indexOf(e)||-1!==i.indexOf(e)||e.match(/^[a-z]{2}\.tradingview\.com/)||e.match(/prod-[^.]+.tradingview.com/)?"battle":-1!==e.indexOf("tradingview.com")?"staging":e.match(/webcharts/)?"staging_local":(e.match(/^localhost(:\d+)?$/),"local")}function o(){return"local"===n()}function r(){return"battle"===n()}function s(){return!r()}Object.defineProperty(t,"__esModule",{value:!0}),t.environment=n,t.isLocal=o,t.isProd=r,t.isDebug=s},function(e,t,i){"use strict";function n(e,t,i){this._textSizeCache=t,this._data=e,this._fontSize=e.fontsize?e.fontsize:e.fontSize?e.fontSize:12,this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0,e.lines=this._lines=l.prototype.wordWrap.call(this,e.text,e.wordWrapWidth),this._hittest=i||new c(c.MOVEPOINT)}function o(){var e=document.createElement("canvas");e.width=0,e.height=0,r=e.getContext("2d"),e=null}var r,s=i(6).Point,a=i(60).pointInRectangle,l=i(186).TextRenderer,c=i(9).HitTestResult,h=i(46).drawRoundRect,u={priceRange:{width:15,height:14,
data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};n.prototype._preRender=function(){var e,t,i,n,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x;if(!this._preRendered){if(r||o(),e=this._data.points[0].x+(this._data.offsetX||0),t=e,i=this._data.points[0].y+(this._data.offsetY||0),n=i,a=this._fontSize,l=this._lineSpacing,c=a+l,h=c*this._lines.length-l,r.textBaseline="top",r.font=this.fontStyle(),u=[],this._data.wordWrapWidth)for(d=this._data.wordWrapWidth,p=0;p<this._lines.length;p++)u.push(this._data.wordWrapWidth);else for(d=0,p=0;p<this._lines.length;p++)_=r.measureText(this._lines[p]).width,u.push(_),d=Math.max(d,_);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){f={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},m={x:0,y:0},this._data.backgroundHorzInflate&&(y=this._data.backgroundHorzInflate/2,f.left+=y,f.right+=y,m.x=-y),this._data.backgroundVertInflate&&(g=this._data.backgroundVertInflate/2,f.top+=g,f.bottom+=g,m.y=-g),v="number"==typeof this._data.padding?this._data.padding:~~(a/6);for(p in f)f[p]||(f[p]=v);S={x:Math.floor(e+m.x),y:Math.floor(i+m.y),w:Math.ceil(d+f.left+f.right),h:Math.ceil(h+f.top+f.bottom)},t+=f.left+m.x,n+=f.top+m.y,"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(b="middle"===this._data.vertAlign?i-S.h/2:i-S.h-(S.y-i),w=b-S.y,n+=w,S.y=b),
"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(P="center"===this._data.horzAlign?e-S.w/2:e-S.w-(S.x-e),T=P-S.x,t+=T,S.x=P,!0!==this._data.doNotAlignText&&("right"===this._data.horzAlign?(r.textAlign="end",t+=d):(r.textAlign="center",t+=d/2))),S.w%2!=0&&S.w++,S.x+=.5,S.y+=.5,this._boundingRect=[new s(S.x,S.y),new s(S.x+S.w,S.y+S.h)],this._rect=S,this._padding=f,this._defaultPadding=v}else"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(n-=Math.round(h*("middle"===this._data.vertAlign?.5:1))),x=t,"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(x-=Math.round(d*("center"===this._data.horzAlign?.5:1))),this._boundingRect=[new s(x,n),new s(x+d,n+h)];this._textPoint={x:t,y:n},this._textSizeCache&&(this._textSizeCache.widths=u),this._preRendered=!0,this._maxWidth=d}},n.prototype._drawIcon=function(e,t,i,n){var o,r,s,a;if(u.hasOwnProperty(n)){if(o=u[n],!o.src){for(o.src=document.createElement("canvas"),o.src.width=o.width,o.src.height=o.height,r=o.src.getContext("2d"),s=r.createImageData(o.width,o.height),a=0;a<o.data.length;a++)s.data[a]=o.data[a];r.putImageData(s,0,0)}e.drawImage(o.src,t,i)}},n.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,u,d;if(0!==this._data.points.length){for(this._preRender(),t=this._fontSize,i=this._lineSpacing,n=t+i,e.textBaseline="top",e.font=this.fontStyle(),o=this._rect,(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect?("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||!0!==this._data.doNotAlignText&&(e.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?(h(e,o.x,o.y,o.w,o.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.globalAlpha=this._data.backgroundTransparency,e.fill(),e.globalAlpha=1),this._data.borderColor&&(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(t/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=r,e.stroke())):(this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.globalAlpha=this._data.backgroundTransparency,e.fillRect(o.x,o.y,o.w,o.h),e.globalAlpha=1),this._data.borderColor?(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(t/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=r,e.strokeRect(o.x-r/2,o.y-r/2,o.w+r,o.h+r)):this._data.highlightBorder&&(e.strokeStyle=this._data.color,e.lineWidth=1,e.beginPath(),l=[3,1],e.dashedLineTo(o.x-.5,a=o.y-.5,s=o.x+o.w+.5,a,l),e.dashedLineTo(s,a,s,a=o.y+o.h+.5,l),e.dashedLineTo(s=o.x-.5,a,o.x+o.w+.5,a,l),e.dashedLineTo(s,o.y-.5,s,a,l),e.globalAlpha=.5,e.stroke(),e.globalAlpha=1)),this._data.icons&&this._data.icons.forEach(function(t,i){var r=o.x+this._defaultPadding,s=o.y+this._padding.top+n*i;this._drawIcon(e,r,s,t)
},this)):"right"===this._data.horzAlign?e.textAlign="end":"center"===this._data.horzAlign&&(e.textAlign="center"),c=this._textPoint.x,u=this._textPoint.y,e.fillStyle=this._data.color,this._data.forceTextAlign&&(e.textAlign=this._data.horzAlign?this._data.horzAlign:"left"),d=0;d<this._lines.length;d++)e.fillText(this._lines[d],c,u),u+=n;return{width:o.w+2}}},n.prototype.hitTest=function(e){return 0===this._data.points.length?null:(this._preRender(),this._boundingRect&&a(e,this._boundingRect[0],this._boundingRect[1])?this._hittest:null)},t.TrendLineStatsRenderer=n},,,function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"RiskRewardPointIndex",function(){return n});var n;!function(e){e[e.Entry=0]="Entry",e[e.Close=1]="Close",e[e.ActualEntry=2]="ActualEntry",e[e.ActualClose=3]="ActualClose"}(n||(n={}))},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"AlertStatus",function(){return n}),i.d(t,"Direction",function(){return o}),function(e){e[e.Waiting=0]="Waiting",e[e.Success=1]="Success",e[e.Failure=2]="Failure"}(n||(n={})),function(e){e[e.Up=1]="Up",e[e.Down=2]="Down"}(o||(o={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CalloutConsts",function(){return n});var n;!function(e){e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",e[e.MinWidth=100]="MinWidth"}(n||(n={}))},function(e,t,i){"use strict";function n(e,t){return e.compareTo(t)}function o(e){return Array.from(e).reduce(function(e,t){var i=+t;return-1===e.indexOf(i)&&e.push(i),e},[])}function r(e,t,i){var n=6e4,o=new Date(t.valueOf()+e*n);return e+(i.offset_loc(t)/n-i.offset_loc(o)/n)}var s,a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SessionEntry",function(){return d}),i.d(t,"ExchangeSession",function(){return p}),s=i(35),i.n(s),a=i(78),l=i(4),c=Object(l.getLogger)("Chart.Model.ExchangeSession"),h=[s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY],u=[s.SUNDAY,s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY,s.SATURDAY],d=function(){function e(e,t,i){this._dayOfWeek=e,this._start=t,this._length=i}return e.prototype.start=function(){return this._start},e.prototype.alignedStart=function(){return this._start<0?this._start+s.minutesPerDay:this._start},e.prototype.isOvernight=function(){return this._start<0},e.prototype.dayOfWeek=function(){return this._dayOfWeek},e.prototype.length=function(){return this._length},e.prototype.weight=function(){return this._dayOfWeek*s.minutesPerDay+this._start},e.prototype.compareTo=function(e){var t=this.weight(),i=t+this._length,n=e.weight();return t<=n&&n<i?0:t>n?1:-1},e}(),p=function(){function e(e){void 0===e&&(e="0000-0000");var t=this;this._entries=[],this._firstDayOfWeek=s.MONDAY,this._weekEndsCount=null,"24x7"===e.toLowerCase()?u.forEach(function(e){t.addSessionEntry(e,0,0)}):this._parseSpec(e),this._entries.sort(n)}return e.prototype.entries=function(){return this._entries},e.prototype.firstDayOfWeek=function(){return this._firstDayOfWeek},
e.prototype.addSessionEntry=function(e,t,i){i<=t&&0!==t&&(t-=s.minutesPerDay);var n=i===t?s.minutesPerDay:i-t;this._entries.push(new d(e,t,n))},e.prototype.isWeekEnd=function(e){var t=Object(a.lowerbound)(this._entries,new d(e,0,0),function(e,t){return e.dayOfWeek()<t.dayOfWeek()});return t>this._entries.length-1||this._entries[t].dayOfWeek()!==e},e.prototype.weekEndsCount=function(){if(null===this._weekEndsCount){var e={};this._entries.forEach(function(t){e[t.dayOfWeek()]=1}),this._weekEndsCount=7-Object.keys(e).reduce(function(t,i){return t+(e[+i]||0)},0)}return this._weekEndsCount},e.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},e.prototype.indexOfSessionEntry=function(e,t){var i=Object(a.lowerbound)(this._entries,new d(e,t,0),function(e,t){return e.compareTo(t)<0});return i>this._entries.length-1?0:i},e.prototype.findSessionEntry=function(e,t){return this._entries[this.indexOfSessionEntry(e,t)]},e.prototype.correctTradingDay=function(e,t){var i=s.get_day_of_week(e),n=60*s.get_hours(e)+s.get_minutes(e),o=this.findSessionEntry(i,n),r=o.dayOfWeek(),a=(r-i+7)%7;return 0!==a&&s.add_date(e,a),e},e.prototype.alignToSessionStart=function(e,t){var i=s.get_day_of_week(e),n=s.get_minutes_from_midnight(e),o=this.findSessionEntry(i,n),a=o.alignedStart(),l=o.dayOfWeek(),c=o.isOvernight(),h=(l-i+7)%7-(c?1:0);return 0!==h&&s.add_date(e,h),s.set_hms(e,a/60|0,a%60,0,0,t),r(o.length(),e,t)},e.prototype._parseSpec=function(e){var t=this,i={},n=!1;e=this._parseFirstDayOfWeek(e),e.split("|").forEach(function(e){var t,r,s=e.split(":");if(1!==s.length&&2!==s.length)return void c.logError("Bad session section: "+e);if(t=1===s.length){if(n)return void c.logError("Duplicated default section: "+e);n=!0}r=t?h:o(s[1]),r.forEach(function(e){t&&i[e]||(i[e]=s[0])})}),u.forEach(function(n){var o=i[n];void 0!==o&&o.split(",").forEach(function(i){var o,r,a=i.split("-");2!==a.length&&(c.logError("Bad sessions spec: "+e),a=["0000","0000"]),o=a[0],r=a[1],t.addSessionEntry(n,s.get_minutes_from_hhmm(o),s.get_minutes_from_hhmm(r))})})},e.prototype._parseFirstDayOfWeek=function(e){var t,i,n,o=e.split(";");return o.length>2?(c.logError("Only one `first day` specification expected @ session "+e),e):1===o.length?e:(t=o[0].indexOf("-")>=0,i=t?NaN:parseInt(o[0]),n=1,isNaN(i)&&(n=0,i=parseInt(o[1])),i<s.SUNDAY||i>s.SATURDAY?(c.logError("Unexpected day index @ session: "+e+"; day index "+i),e):(this._firstDayOfWeek=i,o[n]))},e}()},function(e,t,i){"use strict";var n,o,r;i.d(t,"a",function(){return r}),n=i(1),o=i(114),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._startLoading=function(){return i.e(28).then(i.bind(null,812))},t}(o.a)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){function t(){var t=window.parent[window.urlParams.uid].settingsAdapter;null!=t?(TVSettings.setSettingsAdapter(t),TVSettings.sync()):e.enabled("use_localstorage_for_settings")&&TVSettings.sync()}function n(){
var e,t,i,n,o=urlParams.theme;return o?(e=f.savedThemeName(),t=o.toLowerCase(),(i=f.themes[t])?(f.setTheme(i.name),f.syncTheme(),o===e?$.Deferred().resolve():(n=$.Deferred(),f.getStdTheme(i.name).then(function(e){n.resolve(e.content)}).catch(function(e){console.warn("Cannot load theme {0}, reason: {1}".format(i.name,e)),n.resolve()}),n.promise())):$.Deferred().resolve()):$.Deferred().resolve()}function o(e){var t=/(\d+)(\w+)/;return e.map(function(e){var i=t.exec(e.text),n=i[2].toLowerCase(),o=parseInt(i[1]),r="y"===n?12*o+"m":o+n,s=q.Symbol.parsePeriod(e.resolution);return{text:window.t(e.title)||o+window.t(n,{context:"dates",count:o}),description:e.description||"",value:r,targetResolution:e.resolution,requiresIntraday:s.isIntraday}})}function r(){JSON.parse(urlParams.disabledFeatures).forEach(function(t){e.setEnabled(t,!1)}),JSON.parse(urlParams.enabledFeatures).forEach(function(t){e.setEnabled(t,!0)})}function s(){e.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?m.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?m.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(e.setEnabled("saveload_storage_customization",!1),e.setEnabled("header_saveload",!1)))}function a(){ee.resolve()}function l(t){var n,o,r,s,a,l;return e.enabled("header_widget")?(n=B.allocate({areaName:"top"}),o=i(255).ChartChangesWatcher,r=new o(t.chartWidgetCollection.undoHistory,window.saver,T),s=JSON.parse(urlParams.favorites),s.intervals=s.intervals.map(function(e){var t=""+e;return t.match(/1[DWMYdwmy]/)&&(t=t.slice(1)),t}),a=null,e.enabled("study_templates")&&(a=new w(A,TVSettings),window.studyTemplates=new b({chartWidgetCollection:t.chartWidgetCollection,favoriteStudyTemplatesService:a})),l=Modernizr.touch?["full"]:e.enabled("caption_buttons_text_if_possible")?void 0:["medium"],new d(new u,{chartSaver:window.saver,chartApiInstance:ChartApiInstance,chartWidgetCollection:t.chartWidgetCollection,defaultIntervals:Object.keys(ChartApiInstance.defaultResolutions()),defaultFavoriteStyles:s.chartTypes,defaultFavoriteIntervals:s.intervals,hideStudyTemplates:!0,resizerBridge:n,studyMarket:window.studyMarket,studyTemplates:window.studyTemplates,favoriteStudyTemplatesService:a,allowedModes:l,saveChartService:t.saveChartService,loadChartService:t.loadChartService,chartChangesWatcher:r})):null}function c(e){if(Z){var t=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?urlParams.toolbarbg+"":void 0;return t&&$("<style>").text("body,.chart-controls-bar,#footer-chart-panel{background-color:#"+t+" !important}").appendTo($("head")),new p({bgColor:t,chartWidgetCollection:e,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,resizerBridge:B.allocate({areaName:"left"})})}return null}var h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee,te;i(464),i(11),
h=i(465).i18nReady,i(466),i(133),i(474),r(),u=i(475).RestrictedToolsetBootloader,d=i(476).HeaderToolbarBootloader,p=i(479).DrawingToolbarBootloader,_=i(206).isDrawingToolbarVisible,f=i(251),m=i(252),y=i(41).Action,g=i(482).ChartSaver,v=i(483).SaveChartService,S=i(485).LoadChartService,b=i(487).StudyTemplates,w=i(494).FavoriteStudyTemplateService,P=i(62).linking,T=i(31),x=i(21),C=x.formatterOptions,L=x.customFormatters,I=i(495).StudyMarket,A=i(107).TVXWindowEvents,k=i(497).createDeferredPromise,E=i(205),M=i(15).Interval,V=i(498).Root,D=i(500).ChartPage,O=i(135).destroyQuoteSessions,R=new V(window),B=new D(R.allocate()),i(503),N=i(504),F=i(291).createFavoriteDrawingToolbar,W=i(668),H=i(26),j=i(678),i(183),i(686),z=i(128).setSearchRequestDelay,U=i(40),q=i(25),Y=window.parent[urlParams.uid].customIndicatorsUrl,G=$.Deferred(),K=$.Deferred(),Z=e.enabled("left_toolbar"),$.when(G,K).done(function(){window.ChartApiInstance.start()}),Y?$.getScript(Y).done(function(){void 0!==window.__customIndicators&&window.isArray(window.__customIndicators)&&(window.PineJS=i(25),JSServer.studyLibrary=JSServer.studyLibrary.concat(window.__customIndicators),console.log("{0} custom indicators loaded.".format(window.__customIndicators.length)),G.resolve())}).fail(function(e){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(Y,e.statusText,e.status)),G.resolve()}):G.resolve(),window.widgetReady=function(e){T.subscribe("onChartReady",e)},window.customizeUI=function(e){null!=e.studiesOverrides&&H.setDefaultsOverrides(e.studiesOverrides),window.__defaultsOverrides=e.defaultsOverrides},window.applyStudiesOverrides=function(e){e&&window.chartWidgetCollection.applyStudiesOverrides(e)},window.applyOverrides=function(e){$.extend(!0,window.__defaultsOverrides,e),window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools(),window.chartWidgetCollection.applyOverrides(e)},window.changeTheme=function(e){var t=f.themes[e.toLowerCase()];t&&window.tradingViewApi.themes().setStdTheme(t.name).then(function(){window.applyOverrides(window.__defaultsOverrides)})},window.is_authenticated=!1,window.parent[urlParams.uid].brokerFactory,JSON.parse(window.urlParams.brokerConfig),window.t("charts by TradingView"),window.t("powered by TradingView"),window.t("by TradingView"),J=null,X=k(),Q=function(t){function n(){w&&w.load(),x&&x.load().then(function(e){TradingView.bottomWidgetBar=e}),A&&A.load().then(function(e){window.footerWidget=e}),k&&k.load().then(function(e){window.widgetbar=e,null==window.tradingViewApi.watchlist()&&window.tradingViewApi.setWatchlistManager(null)})}var r,s,a,h,u,d,p,f,m,y,b,w,x,A,k;if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");e.setEnabled("charting_library_debug_mode","true"===urlParams.debug),e.setEnabled("chart_property_page_trading",!1),e.setEnabled("chart_property_page_template_button",!1),r=$("#library-container"),e.enabled("remove_library_container_border")&&(r.css("border","0px"),
r.css("padding","1px")),e.enabled("no_min_chart_width")&&(window.document.body.style.minWidth="0px"),window.customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):void 0,defaultsOverrides:JSON.parse(urlParams.overrides)}),urlParams.numeric_formatting=urlParams.numeric_formatting&&JSON.parse(urlParams.numeric_formatting),urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(C.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new W(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(L.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(L.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),window.ChartApiInstance.setStudiesAccessController(window.ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)),s=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,a=urlParams.interval||"D",h=o(JSON.parse(urlParams.timeFrames)),u=function(e,t){return e?t!==U.STATUS_DELAYED&&t!==U.STATUS_DELAYED_STREAMING&&t!==U.STATUS_READY?[]:h.filter(function(t){return!(t.requiresIntraday&&!e.has_intraday)&&!(e.supported_resolutions&&e.supported_resolutions.indexOf(M.normalize(t.targetResolution))<0)}):[]},d={resizerBridge:B.allocate({areaName:"center"}),padding:e.enabled("border_around_the_chart")?5:0,edge:e.enabled("border_around_the_chart")?4:0,content:s,widgetOptions:{hideIdeas:!0,addVolume:!0,handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:a,defTimeframe:urlParams.timeframe&&urlParams.timeframe.toLowerCase(),crossHairMenuEnabled:e.enabled("chart_crosshair_menu"),paneContextMenuEnabled:e.enabled("pane_context_menu"),priceScaleContextMenuEnabled:e.enabled("scales_context_menu"),marketStatusWidgetEnabled:e.enabled("display_market_status"),timeScaleWidget:{contextMenuEnabled:e.enabled("scales_context_menu"),timezoneMenuEnabled:e.enabled("timezone_menu")},timeScale:{preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:e.enabled("lock_visible_time_range_on_resize")},goToDateEnabled:e.enabled("go_to_date"),seriesControlBarEnabled:e.enabled("timeframes_toolbar"),seriesControlBar:{timeFramesWidgetEnabled:!0,timeFramesWidget:{goToDateEnabled:e.enabled("go_to_date"),availableTimeFrames:u},timeWidgetEnabled:!0,timeWidget:{timezoneMenuEnabled:e.enabled("timezone_menu")},adjustForDividendsButtonEnabled:!1,extendedHoursButtonEnabled:!1,percentageScaleButtonEnabled:!0,logScaleButtonEnabled:!0,autoScaleButtonEnabled:!0,scalePropertiesButtonEnabled:e.enabled("main_series_scale_menu"),fullscreenButtonEnabled:!0}},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl},Z&&(F(),d.widgetOptions.isDrawingToolbarVisible=_),s&&void 0!==s.extendedData&&(p=s.extendedData,d.metaInfo={id:p.uid,name:p.name,description:p.description,uid:p.uid,username:"",tags:""}),
f=window.chartWidgetCollection=new N(d),window.studyMarket=new I(f),"undefined"!=typeof serviceLocator&&serviceLocator.registerService(CHART_WIDGET_COLLECTION_SERVICE,f),f.activeChartWidget.subscribe(function(e){T.emit("activeChartChanged",f.getAll().indexOf(e))}),window.saver=new g(f),m=new v(f,window.saver),y=new S(f),window.chartWidget=f.activeChartWidget.value(),window.pro=new TradingView.Pro,b=l({chartWidgetCollection:f,saveChartService:m,loadChartService:y}),null!==b?b.load().then(function(e){J=e,X.resolve()}):(X.promise.catch(function(){}),X.reject("header widget is not loaded")),w=c(f),x=null,A=null,k=null,window.tradingViewApi=new j(f,window.ChartApiInstance,m,y),P.bindToChartWidgetCollection(f),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),TradingView.isNaN(urlParams.ssreqdelay)||z(Math.max(0,+urlParams.ssreqdelay)),window.ChartApiInstance.connect(),i.e(3).then(function(e){var t=i(822);window.lineToolPropertiesToolbar=new t(f)}.bind(null,i)).catch(i.oe),$(".tv-content").bind("contextmenu",function(e){var t=$(e.originalEvent.target);if(!t.is("input")&&!t.is("textarea"))return!1}),K.resolve(),f.undoHistory.undoStack().onChange().subscribe(null,E(function(){T.emit("onAutoSaveNeeded")},1e3*(urlParams.autoSaveDelay||5),{leading:!1,trailing:!0})),chartWidget.withModel(null,function(){ChartApiInstance.on("realtime_tick",function(e){T.emit("onTick",e)}),t&&void 0===s&&(f.applyTheme(t),window.applyOverrides(window.__defaultsOverrides)),e.enabled("charting_library_debug_mode")&&T.subscribeToAll(function(){var e=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(e[0],JSON.stringify(e.slice(1))))})}),f.firstWidgetInitialized?n():chartWidget.chartWidgetInitialized.subscribe(null,n,!0),T.subscribe("chart_load_requested",function(e){window.tradingViewApi.loadChart({json:JSON.parse(e.content),extendedData:e})})},window.addEventListener("unload",function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),O(),window.ChartApiInstance&&(window.ChartApiInstance.destroy(),window.ChartApiInstance=null)}),s(),ee=$.Deferred(),window.parent[urlParams.uid].loadLastChart&&e.enabled("saveload_storage_customization")?m.getCharts(function(e){if(0===e.length)return void a();var t=e.sort(function(e,t){return t.modified_iso-e.modified_iso})[0];m.getChartContent(t,function(e){var t=JSON.parse(e.content);t.extendedData=e,urlParams.chartContent=JSON.stringify({json:t}),a()},a)},a):a(),t(),te=$.Deferred(),$.when(n(),h,te,ee).done(function(t){if($(window).resize(),$(".loading-indicator").hide(),setTimeout(Q.bind(null,t),0),e.enabled("14851")&&(Math.random()<=.02||e.enabled("cqg_terminal")||e.enabled("amp_terminal"))){!function(e,t,i,n,o,r,s){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,r=t.createElement(i),s=t.getElementsByTagName(i)[0],r.async=1,r.src=n,s.parentNode.insertBefore(r,s)
}(window,document,"script","//www.google-analytics.com/analytics.js","ga");var i=document.URL.match(RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-126447705-1","auto"),ga("set","anonymizeIp",!0),ga("set",{hostname:i,page:i,referrer:i}),ga("send","pageview")}}),function(){var e=!0;window.parent[urlParams.uid].datafeed.onReady(function(t){e&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=t,te.resolve()}),e=!1}(),window.getFunctionFromArguments=function(e){return window.parent[urlParams.uid][e]},window.createShortcutAction=function(){var e={};return function(t,i){void 0===e[t]&&(e[t]=new y({shortcut:t})),e[t].callbacks().subscribe(null,i)}}(),window.initializationFinished=function(){window.chartWidgetCollection.undoHistory.clearStack()},window.resizeWindow=function(){$(window).resize()},window.headerReady=function(){return X.promise},window.createButton=function(e){if(null===J)throw Error("Cannot create button: header widget is not ready or is not loaded - use `headerReady` to wait until header is ready");e=e||{};var t=e.align||"left";return J.addButton(t)}}).call(t,i(5))},function(e,t){e.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_trading_notifications_history:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol","header_screenshot"]},compare_symbol:{subsets:["header_compare"]},property_pages:{subsets:["show_chart_property_page","chart_property_page"]},show_chart_property_page:{},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_events_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},hide_left_toolbar_by_default:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},hide_legend_by_default:{},show_hide_button_in_legend:{},format_button_in_legend:{},
study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},charting_library_debug_mode:{},cl_feed_return_all_data:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},create_volume_indicator_by_default_once:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},show_animated_logo:{},link_to_tradingview:{},logo_without_link:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_defaults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},display_data_mode:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},footer_bugreport_button:{},footer_publish_idea_button:{},footer_showdom_button:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},study_dialog_fundamentals_economy_addons:{},uppercase_instrument_names:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},japanese_chart_styles:{},hide_series_legend_item:{},hide_study_overlay_legend_item:{},hide_study_compare_legend_item:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},bars_marks:{},chart_scroll:{},chart_zoom:{},source_selection_markers:{},high_density_bars:{},open_account_manager:{},multiple_watchlists:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},no_min_chart_width:{},lock_visible_time_range_on_resize:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","dont_show_boolean_study_arguments","left_toolbar","control_bar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","uppercase_instrument_names","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","create_volume_indicator_by_default_once","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_content_overrides_by_defaults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_layouttoggle","datasource_copypaste","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","property_pages","support_multicharts","display_market_status","display_data_mode","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","study_on_study","japanese_chart_styles","show_login_dialog","dome_widget","bars_marks","chart_scroll","chart_zoom","show_trading_notifications_history","source_selection_markers","study_dialog_fundamentals_economy_addons","multiple_watchlists","marked_symbols"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","display_data_mode","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","uppercase_instrument_names","left_toolbar","control_bar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","create_volume_indicator_by_default_once","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","dont_show_boolean_study_arguments","header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_compare","header_indicators","star_some_intervals_by_default","display_market_status","display_data_mode","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","compare_symbol","show_login_dialog","plain_studymarket","japanese_chart_styles","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages","show_animated_logo"]},
bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","uppercase_instrument_names","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","header_widget","header_saveload","dont_show_boolean_study_arguments","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","create_volume_indicator_by_default_once","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages","go_to_date","adaptive_logo","caption_buttons_text_if_possible"]},charting_library:{subsets:["charting_library_base"]},static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library_base","footer_showdom_button","support_multicharts","header_layouttoggle","japanese_chart_styles","chart_property_page_trading","add_to_watchlist","open_account_manager","show_dom_first_time","multiple_watchlists","show_trading_notifications_history"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","footer_showdom_button","dome_widget","show_dom_first_time","japanese_chart_styles","remove_img_from_rss","add_to_watchlist","show_trading_notifications_history"]},amp_terminal:{subsets:["cqg_terminal"]}}},function(e,t){},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"i18nReady",function(){return o}),n=i(14),i.n(n),o=$.Deferred(),r=function(){o.resolve(),document.body.removeEventListener("tradingview-i18next-initialized",r)},window.__tradingviewI18nextInited?r():document.body.addEventListener("tradingview-i18next-initialized",r)},function(e,t,i){"use strict";function n(e){return e.keys().map(e)}window.TradingView=window.TradingView||{},window.requireAll=n,i(467),i(331),i(71),i(468),i(12),i(46),
i(85),i(469),i(159),i(160),i(470),i(49),i(106),i(246)},function(e,t,i){"use strict";!function(e){e.fn.contextMenu=function(t){e(this).bind("contextmenu",function(e){return t(e),!1})}}(jQuery)},function(e,t,i){"use strict";!function(e,t,i){"$:nomunge";function n(n,o){function r(t){e(s).each(function(){var i=e(this);this===t.target||i.has(t.target).length||i.triggerHandler(o,[t.target])})}o=o||n+i;var s=e(),a=n+"."+o+"-special-event";e.event.special[o]={setup:function(){s=s.add(this),delete s.prevObject,1===s.length&&e(t).bind(a,r)},teardown:function(){s=s.not(this),delete s.prevObject,0===s.length&&e(t).unbind(a)},add:function(e){var t=e.handler;e.handler=function(e,i){e.target=i,t.apply(this,arguments)}}}}e.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(e){n(e)}),n("focusin","focus"+i),n("focusout","blur"+i),Modernizr.touch&&(n("touchstart","mousedown"+i),n("touchmove","mousemove"+i),n("touchend","mouseup"+i)),e.addOutsideEvent=n}(jQuery,document,"outside")},function(e,t,i){"use strict";function n(e){var t,i;if(3===e.nodeType&&e.data.trim())return e;if(e.childNodes)for(t=e.childNodes.length;t--;)if(i=n(e.childNodes[t]))return i;return null}function o(e,t){var i,n=t.parentNode;n&&(i=t.nextSibling,i?n.insertBefore(e,i):n.appendChild(e))}function r(e){var t,i,r,s=n(e);if(s){if(t=s.data,s.parentNode&&s.parentNode.tagName&&"sup"===s.parentNode.tagName.toLowerCase())return;i=/^([^]*)(\S)(\s*)$/.exec(t),i&&(s.data=i[1],r=document.createElement("sup"),r.textContent=i[2],o(r,s),i[3]&&o(document.createTextNode(i[3]),r))}}Object.defineProperty(t,"__esModule",{value:!0}),$.fn.lastCharSup=function(){for(var e=0;e<this.size();e++)r(this.get(e));return this}},function(module,exports,__webpack_require__){"use strict";(function(Delegate,_,Featuresets){function reloadPageOnSingOut(){var e=[/^\/chart\//],t=!0;e.forEach(function(e){e.test(window.location.pathname)&&(t=!1)}),t&&window.location.reload(!0)}function loginUser(e,t){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),user=$.extend(!0,{},e),TradingView.changeLoginState(!0),"function"==typeof t&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",function(){t()}):"function"==typeof t&&t()}function onLoginStateChange(is_initial){window.iframeAuthWidget&&user.is_first_login&&(window.iframeAuthWidget.preventClose=!0);var available_offers=user.available_offers
;$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&!!user.is_trial).toggleClass("is-not-trial",!(is_authenticated&&user&&user.is_trial)).toggleClass("is-not-trial-available",void 0===available_offers[OFFERS.trial]).toggleClass("is-trial-available",void 0!==available_offers[OFFERS.trial]).toggleClass("is-upsale-available",is_authenticated&&void 0!==available_offers[OFFERS.upsale]),window.TVSettings&&window.TVSettings.sync(user.settings),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?($(".saved_charts_count").html(user.saved_charts),$(".treated_charts_count").html(user.treated_charts_count),$(".js-trial-days-left").html(user.trial_days_left_text||""),$(".js-header-gopro-button").attr("href","/gopro/"),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&($(function(){}),trackEvent("Conversion","First login"),user.prort_trial_started&&delete user.prort_trial_started,delete user.is_first_login),TradingView.setTrialAvailiable(void 0!==user.available_offers[OFFERS.trial])):(Object.keys(available_offers).forEach(function(e){available_offers[e].available_for_anons||delete available_offers[e]}),user={username:"Guest",following:"0",followers:"0",ignore_list:{},available_offers:available_offers},$(".user-info-username").html(user.username),TVLocalStorage.removeItem("trial_availiable"))}var loginStateChange,djangoLogoutFinished,TVXWindowEvents=__webpack_require__(107).TVXWindowEvents,trackEvent=__webpack_require__(39).trackEvent,OFFERS={};__webpack_require__(471),$(document).ajaxSend(function(e,t,i){"POST"!==i.type||i.crossDomain||t.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.locale?t.setRequestHeader("X-Language",window.locale):console.warn("window.locale is not defined"))}),loginStateChange=window.loginStateChange?window.loginStateChange:window.loginStateChange=new Delegate,djangoLogoutFinished=window.djangoLogoutFinished?window.djangoLogoutFinished:window.djangoLogoutFinished=new Delegate,loginStateChange.subscribe(null,onLoginStateChange),TVXWindowEvents.on("loginStateChange",function(){var e=JSON.parse(this);window.user=e.user,window.is_authenticated=!!e.is_authenticated,loginStateChange.fire()}),TVXWindowEvents.on("signOut",function(){reloadPageOnSingOut()}),function(){var e="user-obj-changed",t={};window.crossTabSyncUserAttr=function(t){var i={};t instanceof Array?t.forEach(function(e){i[e]=window.user[e]}):i[t]=window.user[t],TVXWindowEvents.emit(e,JSON.stringify(i))},window.onChangeUserAttrInAnotherTab=function(e){var i=new Delegate;return t[e]||(t[e]=[]),t[e].push(i),i},TVXWindowEvents.on(e,function(e){var i,n;e=JSON.parse(e);for(i in e)if(window.user[i]=e[i],t[i])for(n=0;n<t[i].length;n++)t[i][n].fire(e[i])})}(),TradingView.changeLoginState=function(e){
window.is_authenticated=!!e,TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),loginStateChange.fire()},window.loginUser=loginUser,TradingView.signOut=function(){var e=_.clone(window.user);TradingView.changeLoginState(!1),$.ajax({type:"POST",url:"/accounts/logout/",dataType:"html"}).done(function(){TVXWindowEvents.emit("djangoLogoutFinished"),djangoLogoutFinished.fire(),TVXWindowEvents.emit("signOut"),reloadPageOnSingOut()}).fail(function(){window.user=e,TradingView.changeLoginState(!0)})},window.loginRequiredDelegate=new Delegate,window.runOrSignIn=function(e,t){t||(t={}),t.verifiedPhoneRequired,(is_authenticated||Featuresets.enabled("charting_library_base"))&&e()},TradingView.runOrGoPro=function(e,t,i){isProductFeatureEnabled(t)&&e()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.setTrialAvailiable=function(e){TVLocalStorage.setItem("trial_availiable",e?1:0)},$.fn.reverse=[].reverse,$(window).load(function(){window.loaded=!0}),TradingView.notificationsChanged=new Delegate}).call(exports,__webpack_require__(8),__webpack_require__(187),__webpack_require__(5))},function(e,t,i){"use strict";function n(e){$(e).attr("title")||e.offsetWidth+a>=e.scrollWidth||$(e).attr("title",$(e).text())}function o(e){return e.offsetWidth+a<e.scrollWidth}var r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),r=i(14),i.n(r),s=i(132),a=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){n(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function e(){Object(s.hide)(),a.off("mouseleave mousedown",e)}var t,i,n,r,a=$(this);if(a.is(".apply-overflow-tooltip--check-children")){for(t=!1,i=a.children(),n=0;n<i.length;n++)if(o(i[n])){t=!0;break}if(!t)return}else if(!o(a[0]))return;r="",r=a.is(".apply-overflow-tooltip--allow-text")?a.text():a.clone().children().remove().end().text().trim(),Object(s.showOnElement)(a[0],{text:r}),a.on("mouseleave mousedown",e)})})},function(e,t,i){"use strict";function n(e){l=e}function o(){if(l)return l;if(!a||!window.document.body)return"indeterminate";var e=window.document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),l="reverse",e.scrollLeft>0?l="default":(e.scrollLeft=1,0===e.scrollLeft&&(l="negative")),document.body.removeChild(e),l}function r(e,t){var i,n=e.scrollLeft;if("rtl"!==t)return n;if("indeterminate"===(i=o()))return Number.NaN;switch(i){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n}return n}function s(e,t,i){if("rtl"!==i)return void(e.scrollLeft=t);var n=o();if("indeterminate"!==n)switch(n){case"negative":e.scrollLeft=e.clientWidth-e.scrollWidth+t;break;case"reverse":
e.scrollLeft=e.scrollWidth-e.clientWidth-t;break;default:e.scrollLeft=t}}var a,l;Object.defineProperty(t,"__esModule",{value:!0}),a=!("undefined"==typeof window||!window.document||!window.document.createElement),t._setScrollType=n,t.detectScrollType=o,t.getNormalizedScrollLeft=r,t.setNormalizedScrollLeft=s},function(e,t){e.exports={"common-tooltip":"common-tooltip-s2GEoMlT-","common-tooltip--hidden":"common-tooltip--hidden-Z0EAvXgv-","common-tooltip--horizontal":"common-tooltip--horizontal-13imOC5w-","common-tooltip--farther":"common-tooltip--farther-2yXMAkHF-","common-tooltip--vertical":"common-tooltip--vertical-mcRoucek-","common-tooltip-farther":"common-tooltip-farther-XoKytD99-","common-tooltip--no-pointer-events":"common-tooltip--no-pointer-events-3nL0Vygu-","common-tooltip--direction_normal":"common-tooltip--direction_normal-3u9ejKM2-","common-tooltip__body":"common-tooltip__body-356XFpBj-","common-tooltip__button-container":"common-tooltip__button-container-3EjyKV3s-","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-3quqi1Sv-","common-tooltip__button":"common-tooltip__button-1rnQgujz-","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-XN-JUTdr-","common-tooltip__ear-holder":"common-tooltip__ear-holder-yIJjpvgu-","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-1rmzWejA-","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-1D8FkNkw-","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-oXq5sFXr-","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-BnAcuW1N-","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-2wXRtgYZ-","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-3oG604Li-","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-34hrFTFo-","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-2gS_uAOl-","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-rQ38KmpQ-","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-1eb7dyCg-","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-1XJ40e4D-","common-tooltip__plus-sign":"common-tooltip__plus-sign-3CKSupKp-"}},function(e,t,i){"use strict";TradingView.PublishedChartsTimeline=function(){},TradingView.LinearRegressionPaneView=function(){},TradingView.study_PivotPointsStandard=function(){},TradingView.study_PivotPointsHighLow=function(){},TradingView.study_ZigZag=function(){},TradingView.study_LinearRegression=function(){},TradingView.study_ElliottWave=function(){},TradingView.ESDStudyBase=function(){},TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},TradingView.study_VbPVisible=function(){},
TradingView.study_VbPSessions=function(){},TradingView.study_ESD$TV_DIVIDENDS=function(){},TradingView.study_ESD$TV_SPLITS=function(){},TradingView.study_ESD$TV_EARNINGS=function(){},TradingView.MockupRequestedCache=function(e){e&&e([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.LinetoolTemplatesList=function(){},window.PublishedScript={suggest:function(){var e=$.Deferred();return e.resolve(null),e}}},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"RestrictedToolsetBootloader",function(){return r}),n=i(1),o=i(114),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._startLoading=function(){return i.e(7).then(i.bind(null,698)).then(function(e){return e.getRestrictedToolSet()})},t}(o.a)},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HeaderToolbarBootloader",function(){return c}),n=i(1),o=i(20),i.n(o),r=i(59),i.n(r),s=i(198),a=i(250),l=i(114),c=function(e){function t(t,i){var n=e.call(this)||this;return n._toolsBootloader=t,n._headerProps=i,n._headerProps.resizerBridge.negotiateHeight(s.HEADER_TOOLBAR_HEIGHT_EXPANDED),n._headerProps.resizerBridge.body.value()[0].appendChild(Object(a.a)(["border-right","border-left"],["bottom-left-radius","bottom-right-radius"])),n}return n.c(t,e),t.prototype._startLoading=function(){var e=this;return Promise.all([this._toolsBootloader.load(),this._loadHeaderToolbar()]).then(function(t){var i=t[0],s=t[1];return r.render(o.createElement(s,n.a({},e._headerProps,{tools:i})),e._headerProps.resizerBridge.body.value()[0])})},t.prototype._loadHeaderToolbar=function(){return i.e(18).then(i.bind(null,700)).then(function(e){return e.HeaderToolbar})},t}(l.a)},function(e,t){e.exports={"css-value-header-toolbar-height":"38px"}},function(e,t){e.exports={container:"container-2BvS3Fpg-",inner:"inner-3YzQuyJx-","border-left":"border-left-LYAXTdyL-","border-right":"border-right-OzIcepiV-","border-top":"border-top-193CSDqN-","border-bottom":"border-bottom-2lZASSTD-","top-right-radius":"top-right-radius-FE25nrPp-","top-left-radius":"top-left-radius-1ELOZlIb-","bottom-right-radius":"bottom-right-radius-7zqIiaLN-","bottom-left-radius":"bottom-left-radius-xCxQ998i-"}},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DrawingToolbarBootloader",function(){return h}),n=i(1),o=i(20),i.n(o),r=i(59),i.n(r),s=i(206),a=i(334),l=i(114),c=i(250),h=function(e){function t(t){var i=e.call(this)||this;return i._opts=t,s.isDrawingToolbarVisible.value()&&(i._opts.resizerBridge.negotiateWidth(a.b),i._opts.resizerBridge.body.value()[0].appendChild(Object(c.a)())),i}return n.c(t,e),t.prototype._startLoading=function(){var e=this;return i.e(5).then(i.bind(null,701)).then(function(t){return r.render(o.createElement(t.DrawingToolbar,n.a({},e._opts)),e._opts.resizerBridge.body.value()[0])})},t}(l.a)},function(e,t){e.exports={"color-active-hover-text":"color-gull-gray",
"color-alert-bg":"color-mirage-1","color-alert-text":"color-loblolly","color-border":"color-bright-gray","color-border-chat-fields":"color-bright-gray","color-border-hover":"color-trout-1","color-border-table":"color-bright-gray","color-brand":"color-picton-blue-1","color-brand-active":"color-curious-blue","color-brand-hover":"color-scooter","color-button-hover-bg":"color-mirage-3","color-chart-page-bg":"color-charade","color-common-tooltip-text":"color-loblolly","color-common-tooltip-bg":"color-trout-2","color-depthrenderer-fill-style":"color-catskill-white","color-depthrenderer-stroke-style":"color-trout-1","color-disabled-border-and-color":"color-ebony-clay","color-disabled-input":"color-bright-gray","color-empty-container-message":"color-slate-gray","color-footer-chart-panel-bg":"color-mirage-3","color-highlight-new":"color-dark-slate-blue","color-icons":"color-slate-gray","color-input-bg":"color-charade","color-input-textarea-readonly":"color-trout-1","color-input-publish-bg":"color-mirage-1","color-item-active-blue":"color-blue-dianne","color-item-hover-active-bg":"color-charade","color-item-hover-bg":"color-ebony-clay","color-item-hover-blue":"color-blue-dianne","color-item-selected-blue":"color-blue-dianne","color-link":"color-curious-blue","color-list-item":"color-slate-gray","color-list-nth-child-bg":"color-mirage-3","color-news-highlight":"color-charade","color-pane-bg":"color-mirage-1","color-placeholder":"color-trout-2","color-popup-bg":"color-mirage-3","color-popup-menu-item-hover-bg":"color-ebony-clay","color-popup-menu-separator":"color-bright-gray","color-row-hover-active-bg":"color-ebony-clay","color-sb-scrollbar-body-bg":"color-trout-2","color-screener-header-bg":"color-mirage-3","color-screener-header-bg-hover":"color-ebony-clay","color-screener-description":"color-loblolly","color-section-separator-border":"color-bright-gray","color-separator-table-chat":"color-bright-gray","color-tag-active-bg":"color-bright-gray","color-tag-hover-bg":"color-charade","color-text-regular":"color-loblolly","color-text-secondary":"color-trout-1","color-toolbar-button-text-active":"color-picton-blue-1","color-toolbar-interactive-element-text-normal":"color-slate-gray","color-toolbar-interactive-element-text-hover":"color-gull-gray","color-toolbar-opened-element-bg":"color-mirage-3","color-tooltip-bg":"color-bright-gray","color-tv-button-checked":"color-slate-gray","color-tv-dialog-caption":"color-athens-gray-2","color-tv-dropdown-item-hover-bg":"color-charade","color-underlined-text":"color-gull-gray","color-widget-pages-bg":"color-mirage-2","color-forex-icon":"color-white","color-list-item-active-bg":"color-medium-blue","color-list-item-hover-bg":"color-ebony-clay","color-list-item-text":"color-loblolly"}},function(e,t){e.exports={"color-aqua-spring":"#ebf9f5","color-army-green":"#3d2c12","color-army-green-2":"#31230d","color-athens-gray-1":"#f2f3f5","color-athens-gray-2":"#f7f8fa","color-athens-gray-3":"#eceff2","color-black":"#000000","color-blue-dianne":"#21384d","color-bright-gray":"#363c4e",
"color-carnation":"#f04561","color-catskill-white":"#e1ecf2","color-charade":"#2f3241","color-charcoal-grey":"#323337","color-curious-blue":"#299dcd","color-dark-blue-grey":"#123440","color-dark-grey":"#292a2d","color-dark-grey-blue":"#28415a","color-dark-sky-blue":"#37a6ef","color-dark-slate-blue":"#194453","color-deep-sea-blue":"#016087","color-medium-blue":"#2e7bb2","color-ebony-clay":"#262b3e","color-foam":"#d7f0fb","color-gull-gray":"#9db2bd","color-humming-bird":"#d3eef9","color-keppel-1":"#37bc9b","color-keppel-2":"#34b293","color-lavender-blush":"#ffedf0","color-loblolly":"#c5cbce","color-manatee":"#878ca8","color-mandy":"#eb4d5c","color-milk-chocolate":"#6f2626","color-mirage-1":"#131722","color-mirage-2":"#171b29","color-mirage-3":"#1c2030","color-mischka":"#d6d8e0","color-morning-glory":"#9addcc","color-oslo-gray":"#8b8e95","color-pale":"#fff2cf","color-pale-grey-2":"#e7ebee","color-pale-sky":"#6b7988","color-picton-blue-1":"#3bb3e4","color-picton-blue-2":"#41bef1","color-puerto-rico":"#3bc2a1","color-purple-brown":"#4e2934","color-purple-brown-2":"#3d2028","color-radical-red":"#ff4a68","color-regent-gray":"#8797a5","color-scooter":"#38acdb","color-silver-tree":"#53b987","color-slate-gray":"#758696","color-sundown":"#ffa4b3","color-sunglow":"#ffca3b","color-tan-hide":"#ff9850","color-trout-1":"#4c525e","color-trout-2":"#4f5966","color-violet-1":"#332738","color-violet-2":"#271d2b","color-water-blue":"#1592e6","color-white":"#ffffff","color-white-ice":"#ebf7fc","color-wild-watermelon":"#ff5773","color-brownish-grey":"#8d6e63","color-lightish-purple":"#a75ee8","color-active-hover-text":"color-black","color-alert-bg":"color-white","color-alert-text":"color-black","color-border-table":"color-athens-gray-3","color-brand":"color-picton-blue-1","color-brand-active":"color-curious-blue","color-brand-hover":"color-scooter","color-brand-light":"color-picton-blue-2","color-chart-page-bg":"color-pale-grey-2","color-common-tooltip-bg":"color-ebony-clay","color-common-tooltip-text":"color-athens-gray-1","color-danger":"color-radical-red","color-depthrenderer-stroke-style":"color-athens-gray-1","color-highlight-new":"color-pale","color-input-bg":"color-white","color-input-publish-bg":"color-white","color-link":"color-brand","color-list-nth-child-bg":"color-athens-gray-2","color-pane-bg":"color-white","color-popup-bg":"color-white","color-popup-menu-item-hover-bg":"color-white-ice","color-popup-menu-separator":"color-catskill-white","color-replay-data-mode":"color-radical-red","color-screener-header-bg":"color-athens-gray-2","color-screener-description":"color-trout-2","color-success":"color-keppel-1","color-toolbar-button-text-active":"color-water-blue","color-toolbar-interactive-element-text-normal":"color-trout-1","color-toolbar-interactive-element-text-hover":"color-mirage-1","color-toolbar-opened-element-bg":"color-athens-gray-2","color-tooltip-bg":"color-ebony-clay","color-tv-dialog-caption":"color-trout-2","color-tv-dropdown-item-hover-bg":"color-athens-gray-1","color-underlined-text":"color-slate-gray",
"color-widget-pages-bg":"color-white","color-growing":"color-keppel-1","color-falling":"color-radical-red","color-label-long":"color-success","color-label-short":"color-danger","color-label-education":"color-sunglow","color-label-neutral":"color-gull-gray","color-collapse-tabs-border":"color-athens-gray-3","color-forex-icon":"color-bright-gray","color-list-item-active-bg":"color-dark-sky-blue","color-list-item-hover-bg":"color-white-ice","color-list-item-text":"color-ebony-clay","color-border":"#dadde0","color-border-chat-fields":"#c9cbcd","color-border-hover":"#c8c8c8","color-button-hover-bg":"#f2f2f2","color-depthrenderer-fill-style":"#555555","color-disabled-border-and-color":"#ececec","color-disabled-input":"#ececec","color-readonly-input":"#b4b4b4","color-empty-container-message":"#8a8a8a","color-footer-chart-panel-bg":"#f1f3f6","color-icons":"#7d7d7d","color-input-textarea-readonly":"#555555","color-item-active-blue":"#eff9ff","color-item-hover-active-bg":"#f1f3f6","color-item-hover-bg":"#edf1f2","color-item-hover-blue":"#c6e9f8","color-item-selected-blue":"#eafafe","color-list-item":"#888989","color-news-highlight":"#f2f5f8","color-placeholder":"#adaeb0","color-row-hover-active-bg":"#f1f3f6","color-sb-scrollbar-body-bg":"#d8d8d8","color-screener-header-bg-hover":"#f1f3f6","color-section-separator-border":"#b5b7b9","color-separator-table-chat":"#eaecef","color-tag-active-bg":"#cfdce3","color-tag-hover-bg":"#dce6ea","color-text-regular":"#4a4a4a","color-text-secondary":"#b4b4b4","color-tv-button-checked":"#757575","color-white-theme-tooltip-text":"#333333","color-white-theme-tooltip-border":"#d6d6d6","color-seeking-alpha-brand":"#ff7200"}},function(e,t,i){"use strict";(function(e,n){function o(t){this._chartWidgetCollection=t,this._chartAboutToBeSavedDelegate=new e,this._chartSavedDelegate=new e,this._prevChartState=null,this._chartHasBeenModified=new e,this._chartSizeLimitExceededDelegate=new e}var r=i(12).deepEquals,s=i(67),a=window.t("The publication preview could not be loaded. Please disable your browser extensions and try again.");o.prototype.chartHasBeenModified=function(){return this._chartHasBeenModified},o.prototype.chartSizeLimitExceeded=function(){return this._chartSizeLimitExceededDelegate},o.prototype.chartAboutToBeSaved=function(){return this._chartAboutToBeSavedDelegate},o.prototype.chartSaved=function(){return this._chartSavedDelegate},o.prototype.whenReadyToSave=function(e){var t,i,n=this._chartWidgetCollection,o=n.activeChartWidget.value(),r=o.model().mainSeries();r.symbolInfo()&&!r.hasDelayedSymbolIntervalChange()?e():(t=null,i=null,t=function(){r.dataEvents().symbolError().unsubscribe(null,i,!0),e()},i=function(){r.dataEvents().symbolResolved().unsubscribe(null,t,!0)},r.dataEvents().symbolResolved().subscribe(null,t,!0),r.dataEvents().symbolError().subscribe(null,i,!0))},o.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)},o.prototype._fillAsyncInfo=function(e,t,i){function n(t){e.content=JSON.stringify($.extend(!0,r,t)),o.resolve(e)}
var o,r=JSON.parse(e.content),s=this._chartWidgetCollection;return t||(i=!0),o=$.Deferred(),i?s.asyncState(!!t).then(n):s.activeChartWidget.value().asyncState(!!t).then(n),o.promise()},o.prototype._fillSavingInfo=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_;if(e||(t=!0),n={publish_request_id:Math.random().toString(36).substring(2)},o=this._chartWidgetCollection,r=o.activeChartWidget.value(),s=o.metaInfo,a=r.model().mainSeries(),l=a.properties(),c=a.symbolInfo(),s.id.value()&&(n.id=s.id.value()),n.name=s.name.value()||"",n.description=s.description.value()||"",n.resolution=a.properties().interval.value(),n.symbol_type=null!==c&&c.type||"",n.exchange=null!==c&&c.exchange||"",n.listed_exchange=null!==c&&c.listed_exchange||"",null!==c&&a.isSpread()?(h=c.legs[0],u=c.base_name[0],u=u.split(":")[1],n.symbol=h,n.short_name=u,n.expression=c.full_name):(n.symbol=null!==c&&c.ticker||l.symbol.value(),n.short_name=l.shortName.value()),null!==c){for(d=[],p=0,_=c.legs.length;p<_;p++)d.push({symbol:c.legs[p],pro_symbol:c.base_name[p]});n.legs=JSON.stringify(d)}else n.legs=JSON.stringify([]);return n.content=t?JSON.stringify(o.state(!!e,i)):JSON.stringify(r.state(!!e,i)),e&&(n.image=JSON.stringify(o.images({onlyActiveChart:!t}))),n.is_realtime=e?"0":"1",n},o.prototype.publishChart=function(e){},o.prototype.publishScript=function(e,t,i){var n,o,r,s,l=this;l._scriptPublisher?l._scriptPublisher.openPublication(e,t):(n=i.ScriptPublisher,o=i.ScriptsProvider,r=i.CategoriesProvider,s=new o({publish:function(e){return new Promise(function(t,i){var n={closeForm:function(){if(e&&e.scriptPublication&&e.scriptPublication.updateScriptIdPart){var i=e.scriptPublication.updateScriptIdPart;publishedScripts.invalidateCache([i]),window.studyMarket&&(window.studyMarket.resetAllPages(),window.studyMarket.updateFavorites())}t()},showError:function(e){i(e)}};try{l.onPublish(e,n)}catch(e){i(a)}})}}),l._scriptPublisher=new n({scriptsProvider:s,categoriesProvider:new r}),l._scriptPublisher.openPublication(e,t))},o.prototype.onPublish=function(e,t){function i(e){return e.returnValue=$.t("Script may be not updated if you leave the page."),e.returnValue}function o(o){var r,s,a,c,h,u;window.removeEventListener("beforeunload",i),l.publishInProgress=!1,r=o.responseText||o,"ok:"===r.substr(0,3)?(s=!1,t.savePrivacySetting&&(s=!e.is_public,TVSettings.setValue("publishchart.private",s)),kmRecord("Chart","{0} Published".format(void 0===e.script_type?"Chart":"Script"),{is_private:s}),a=r.substr(3),c=JSON.parse(a),l._chartWidgetCollection.metaInfo.id.value()||l._chartWidgetCollection.metaInfo.id.setValue(c.id),t.closeForm&&t.closeForm(),l._lastPublishUrl=c.publishUrl,l.hWnd&&(h=c.publishUrl,t.ideaUrl&&(h=n.render(t.ideaUrl,{idea:c.idea})),l.hWnd.location=h)):(t.showError&&((413===o.status||/^[\d\s]*request.+large/i.test(r.trim()))&&(r=window.t("This Chart Layout has a lot of objects and can't be published. Please remove the unused objects (drawings/indicators) through the Object Tree to continue publishing.")),u={html:!0},
t.showError(r||$.t("Error occurred while publishing"),u)),l.hWnd&&(l.hWnd.close(),l.hWnd=null))}var r,s,a,l=this;l.publishInProgress||(r=l._fillSavingInfo(!0,t&&t.publishAllLayout,!0),l._fillAsyncInfo(r,!0,t&&t.publishAllLayout).then(function(t){var n=e.scriptPublication,r=!(!n||!n.updateScriptIdPart),s=new Promise(function(e,t){if(n){var o;r?(window.addEventListener("beforeunload",i),o=ScriptLib.publishNext(n.scriptSource,n.updateScriptIdPart)):o=ScriptLib.publishNew(n.scriptSource,n.scriptProtection),o.done(function(t){r||n.scriptProtection!==TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH||PinePerm.add(window.user.username,t.pineId),e(t.publishedstudyscript_id)}).fail(t)}else e()});r?s.then(function(i){var n={publishedstudyscript_id:i,description:e.description,tags:e.tags};$.ajax({url:"/script-update/",type:"post",dataType:"text",data:$.extend({},t,n),complete:o})},o):s.then(function(i){i&&(e.publishedstudyscript_id=i),$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},t,e),complete:o})},o)}),l.publishInProgress=!0,t.onWidget&&!t.ideaUrl||""!==e.name&&""!==e.description&&e.description.length<=7e4&&e.name.length<=64&&($.cookie("publish_request_id",r.publish_request_id,{path:"/"}),s="/loading/",t.ideaUrl&&(a=urlParams.createUrlParams({ideaUrl:t.ideaUrl}),s="/loading?"+a),l.hWnd=window.open(s,"_blank")))},o.prototype._saveChart=function(e,t,i,n,o){var r=i,a=n;return r=function(e){t.id.value()||(t.id.setValue(e),t.uid.setValue(e)),"function"==typeof i&&i()},s.saveChart(e.name,e.short_name,e.resolution,e,t,r.bind(this),a.bind(this))},o.prototype.saveChartSilently=function(e,t,i,n){var o,s;return r(this._prevChartState,this._chartWidgetCollection.state())[0]?void this._chartSavedDelegate.fire(!0):(o=this._chartWidgetCollection.metaInfo,s=this._fillSavingInfo(t),n=n||{},n.chartName&&(s.name=n.chartName),s.name&&0!==s.name.length||!n.defaultChartName||(s.name=n.defaultChartName),s.name?($(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")}),this._isSaveInProcess=!0,this._chartAboutToBeSavedDelegate.fire(),this._saveChart(s,o,function(){this._chartWidgetCollection.metaInfo.name.setValue(s.name),this._prevChartState=this._chartWidgetCollection.state(),this._chartSavedDelegate.fire(!0),this._isSaveInProcess=!1,e&&e(o)}.bind(this),function(){this._chartSavedDelegate.fire(!1),this._isSaveInProcess=!1,i&&i.apply(null,arguments)}.bind(this),n),void $(window).off("beforeunload.savechart")):void console.warn("Saving chart with empty name is not allowed"))},o.prototype.isSaveInProcess=function(){return this._isSaveInProcess},t.ChartSaver=o}).call(t,i(8),i(126))},function(e,t,i){"use strict";function n(e,t,i,n){return c.b(this,void 0,void 0,function(){var o;return c.d(this,function(r){return o=new h.SaveRenameDialog({fields:[new u.InputField({name:w,label:e+":",error:t,maxLength:64})],title:i}),void 0!==n&&o.setField(w,n),[2,o.show().then(function(e){return e[w]})]})})}function o(e){return c.b(this,void 0,void 0,function(){
return c.d(this,function(t){return[2,n(b.labelRename,b.error,b.titleRename,e)]})})}function r(e){return c.b(this,void 0,void 0,function(){return c.d(this,function(t){return[2,n(b.labelRename,b.error,b.titleCopy,b.valueCopy.format(e))]})})}function s(e){return c.b(this,void 0,void 0,function(){return c.d(this,function(t){return[2,n(b.labelRename,b.error,b.titleNew,e)]})})}function a(e){"/chart/"===location.pathname&&(location.href="/chart/"+e)}function l(){return c.b(this,void 0,void 0,function(){return c.d(this,function(e){return[2,new Promise(function(e){p.enabled("saved_charts_count_restriction")&&!window.user.is_pro?Object(d.getCharts)(function(t){e(t.length<5)}):e(!0)})]})})}var c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SaveChartService",function(){return T}),c=i(1),h=i(253),i.n(h),u=i(254),i.n(u),d=i(67),i.n(d),p=i(5),i.n(p),_=i(39),f=i(16),m=i.n(f),y=i(31),g=i(255),v=i(106),i.n(v),S=i(256),b={labelName:window.t("Chart layout name"),labelRename:window.t("Enter a new chart layout name"),error:window.t("Please enter chart layout name"),titleNew:window.t("Save New Chart Layout"),titleRename:window.t("Rename Chart Layout"),titleCopy:window.t("Copy Chart Layout"),valueCopy:window.t("{0} copy",{context:"ex: AAPL chart copy"})},w="chart-title",P=6e4,T=function(){function e(e,t){this._autosaveTimer=null,this._watchedAutoSaveEnabled=new m.a,this._toggleAutoSaveEnabledHandler=this._toggleAutoSaveEnabled.bind(this),this._chartWidgetCollection=e,this._chartSaver=t,this._chartChangesWatcher=new g.ChartChangesWatcher(e.undoHistory,t,y),e.saveKeysPressed().subscribe(this,this.saveChartOrShowTitleDialog),this._chartChangesWatcher.getOnChange().subscribe(this,this._onStateChanged)}return e.prototype.autoSaveEnabled=function(){return this._watchedAutoSaveEnabled},e.prototype.destroy=function(){},e.prototype.cloneChart=function(){return c.b(this,void 0,void 0,function(){var e,t,i;return c.d(this,function(n){switch(n.label){case 0:return e=this._chartWidgetCollection,[4,l()];case 1:return t=n.sent(),t?[4,r(e.metaInfo.name.value())]:[3,3];case 2:return i=n.sent(),this._saveCurrentChartAsNewWithTitle(i),[3,5];case 3:return[3,5];case 4:n.sent().open(),n.label=5;case 5:return[2]}})})},e.prototype.saveChartAs=function(){Object(S.a)(this.cloneChart.bind(this),{source:"Clone chart"})},e.prototype.renameChart=function(){var e=this;Object(S.a)(function(){return c.b(e,void 0,void 0,function(){var e,t,i;return c.d(this,function(n){switch(n.label){case 0:return e=this._chartWidgetCollection,t=e.metaInfo.name.value(),[4,o(t)];case 1:return i=n.sent(),e.metaInfo.name.setValue(i),this._doSave(),[2]}})})},{source:"Rename chart"})},e.prototype.saveNewChart=function(e,t,i){return c.b(this,void 0,void 0,function(){var n,o,r,a;return c.d(this,function(c){switch(c.label){case 0:return n=this._chartWidgetCollection,o=n.metaInfo.name.value(),[4,l()];case 1:return r=c.sent(),r?[4,s(o)]:[3,3];case 2:return a=c.sent(),n.metaInfo.name.setValue(a),this._doSave(e,t,i),[3,5];case 3:return[3,5];case 4:
c.sent().open(),c.label=5;case 5:return[2]}})})},e.prototype.saveExistentChart=function(e,t,i){this._doSave(e,t,i)},e.prototype.saveChartOrShowTitleDialog=function(e,t,i){var n=this,o=window.saver.isSaveInProcess(),r=this._chartChangesWatcher.hasChanges(),s=!!this._chartWidgetCollection.metaInfo.id.value();window.is_authenticated&&(o||!r&&s)||Object(S.a)(function(){null!==n._chartWidgetCollection.metaInfo.id.value()?n.saveExistentChart(e,t,i):n.saveNewChart(e,t,i)},{source:"Save chart",sourceMeta:"Chart"})},e.prototype.whenReadyToSave=function(e){this._chartSaver.whenReadyToSave(e)},e.prototype.saveToJSON=function(){return this._chartSaver.saveToJSON()},e.prototype.saveChartSilently=function(e,t,i,n){this._chartSaver.saveChartSilently(e,t,i,n)},e.prototype.setAutoSaveEnabled=function(e){var t=this;window.is_authenticated&&window.saver.isSaveInProcess()||Object(S.a)(function(){e?Object(_.trackEvent)("Autosave","On"):Object(_.trackEvent)("Autosave","Off"),t._watchedAutoSaveEnabled.setValue(e)},{source:"AutoSave chart"})},e.prototype._autoSaveEnabledSettingHandler=function(e){},e.prototype._toggleAutoSaveEnabled=function(e){},e.prototype._enableAutoSave=function(){},e.prototype._disableAutoSave=function(){},e.prototype._onStateChanged=function(e){e?Object(v.isFeatureEnabled)("save_every_minute")?this._startAutosave():this._restartAutosave():this._stopAutosave()},e.prototype._saveCurrentChartAsNewWithTitle=function(e){var t=this._chartWidgetCollection;p.enabled("saveload_storage_customization")?(t.metaInfo.uid.deleteValue(),t.metaInfo.id.deleteValue(),t.metaInfo.name.setValue(e),this._doSave()):window.open("/chart/?clone="+t.metaInfo.uid.value()+"&name="+encodeURIComponent(e),"_blank")},e.prototype._doSave=function(e,t,i){var n=this._chartWidgetCollection;void 0!==e&&e(),this._chartSaver.saveChartSilently(function(e){Object(_.trackEvent)("GUI","Save Chart Layout"),a(n.metaInfo.uid.value()),void 0!==t&&t(e)},!1,function(){void 0!==i&&i()})},e.prototype._restartAutosave=function(){this._stopAutosave(),this._startAutosave()},e.prototype._startAutosave=function(){var e=this;p.enabled("charts_auto_save")&&null===this._autosaveTimer&&(this._autosaveTimer=setTimeout(function(){e._autosaveTimer=null,e._chartWidgetCollection.metaInfo.id.value()&&e._doSave()},P))},e.prototype._stopAutosave=function(){null!==this._autosaveTimer&&(clearInterval(this._autosaveTimer),this._autosaveTimer=null)},e}()},function(e,t){},function(e,t,i){"use strict";function n(){return new Promise(function(e){i.e(10).then(function(t){var n=i(1247).LoadChartDialog;e(new n)}.bind(null,i)).catch(i.oe)})}function o(){return r.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise(function(e){Object(c.getCharts)(function(t){e(t)})})}var r,s,a,l,c,h,u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0}),r=i(5),s=i(1),a=i(199),l=function(e){function t(t,i){return e.call(this,t,i,"FAVORITE_CHARTS_CHANGED","loadChartDialog.favorites",{})||this}return s.c(t,e),t}(a.b),c=i(67),h=i(486),u=i(107),d=i(49),p=i(256),
i.d(t,"LoadChartService",function(){return _}),_=function(){function e(e){void 0===e&&(e=null);var t=this;this._favoriteChartsService=new l(u.TVXWindowEvents,d),this._chartWidgetCollection=null,this._dialogPromise=null,this._getChartEntry=function(e){return{id:e.id,url:e.url,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:function(){return t._isActiveChart(e.id)},openAction:function(){return Object(c.loadChart)(e)},deleteAction:function(i,n){Object(h.deleteChart)(n,e.image_url,function(){t._deleteChart(e.id),i.resolve()},i.reject.bind(i))},favoriteAction:t._updateFavorites}},this._updateFavorites=function(e){return t._favoriteChartsService.set(e)},this._isActiveChart=function(e){return null!==t._chartWidgetCollection&&e===t._chartWidgetCollection.metaInfo.id.value()},this._deleteChart=function(e){t._isActiveChart(e)&&(r.enabled("saveload_storage_customization")?null!==t._chartWidgetCollection&&t._chartWidgetCollection.clearChartMetaInfo():location.href="/chart/"+location.search)},this._chartWidgetCollection=e}return e.prototype.showLoadDialog=function(){Object(p.a)(this._showLoadDialog.bind(this),{source:"Load chart",sourceMeta:"Chart"})},e.prototype._showLoadDialog=function(){var e=this;o().then(function(t){return t.map(e._getChartEntry)}).then(function(t){null===e._dialogPromise&&(e._dialogPromise=n()),e._dialogPromise.then(function(i){return i.show(t,e._favoriteChartsService.get())})})},e}()},function(e,t,i){"use strict";function n(e,t,i,n){(0,o.createConfirmDialog)({type:"modal",content:document.createTextNode($.t("Do you really want to delete Chart Layout '{0}' ?").format(e)),addClass:"delete-chart-dialog"}).then(function(e){var o=function(){var e=n;n=null,e&&e()};e.on("action:yes",function(){n=null,r.removeChart(t,i),e.close()}),e.on("action:no",o),e.on("afterClose",o),e.open()})}var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.deleteChart=n,o=i(82),r=i(67)},function(e,t,i){"use strict";function n(e,t){Object(l.saveStudyTemplate)(e,function(i){i.error||(r.setValue("defaultStudyTemplate",e.name),Object(l.invalidateStudyTemplatesList)(),Object(l.getStudyTemplatesList)(t))})}var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S;Object.defineProperty(t,"__esModule",{value:!0}),o=i(1),r=i(49),s=i(160),a=i(196),l=i(67),c="text",h="bool",u={saveRenameDialog:{dialogTitle:window.t("Save Indicator Template As"),titleFieldLabel:window.t("Template name"),titleFieldError:window.t("Please enter template name"),intervalFieldLabel:window.t("Save Interval"),intervalFieldHint:window.t("When selecting this checkbox the study template will set {0} interval on a chart")},confirmDialog:{message:window.t("Study Template '{0}' already exists. Do you really want to replace it?")}},d=function(){function e(e){var t=this;this._showSaveDialog=function(){return o.b(t,void 0,void 0,function(){var e,t;return o.d(this,function(i){switch(i.label){case 0:return e=this._chartWidget.model().model().mainSeries().interval(),[4,this._getActualTemplateList()];case 1:return t=i.sent(),
[4,this._showTemplateSaveRenameDialog(t,e)];case 2:return i.sent(),[2]}})})},this._chartWidget=e.chartWidget,e.onSave&&(this._onSave=e.onSave)}return e.prototype.show=function(){window.runOrSignIn(this._showSaveDialog,{source:"Study templates save as",sourceMeta:"Chart"})},e.prototype._doSave=function(e,t){var i,o,r;e=Object(s.clean)(e),i=this._chartWidget.model().model().studyTemplate(t),o=JSON.stringify(i),r={name:e,content:o},n(r,this._onSave)},e.prototype._getActualTemplateList=function(){return Object(l.invalidateStudyTemplatesList)(),new Promise(function(e){Object(l.getStudyTemplatesList)(e)})},e.prototype._showTemplateSaveRenameDialog=function(e,t){var i=this;new a.SaveRenameDialog({fields:[new a.AutocompleteField({name:c,label:u.saveRenameDialog.titleFieldLabel+":",error:u.saveRenameDialog.titleFieldError,source:e,valueField:"name",textField:"name",maxLength:64}),new a.CheckboxField({name:h,label:u.saveRenameDialog.intervalFieldLabel,hint:u.saveRenameDialog.intervalFieldHint.format(t)})],title:u.saveRenameDialog.dialogTitle,confirm:{shouldShowDialog:function(t){var i=Object(s.clean)(t[c]);return e.map(function(e){return e.name}).includes(i)},getMessage:function(e){return u.confirmDialog.message.format(Object(s.clean)(e[c]))}}}).show().then(function(e){var t=e[c],n=!!e[h];i._doSave(t,n)})},e}(),p=i(39),_=i(8),f=i.n(_),m=i(16),y=i.n(m),g=i(82),i.d(t,"StudyTemplates",function(){return S}),v={confirmDelete:window.t("Do you really want to delete Study Template '{0}' ?")},S=function(){function e(e){var t=this;this._chartWidgetCollection=e.chartWidgetCollection,this._favoriteStudyTemplatesService=e.favoriteStudyTemplatesService,window.loginStateChange.subscribe(null,l.invalidateStudyTemplatesList),this._list=new y.a([]),this._onChange=new f.a,this._list.subscribe(function(){return t._onChange.fire()})}return e.prototype.showSaveAsDialog=function(){var e=this,t=this._chartWidgetCollection.activeChartWidget.value();new d({chartWidget:t,onSave:function(t){e._list.setValue(t)}}).show()},e.prototype.applyTemplate=function(e){var t=this._chartWidgetCollection.activeChartWidget.value();r.setValue("defaultStudyTemplate",e),Object(l.getStudyTemplateContent)(e,function(i){Object(p.trackEvent)("GUI","Load Study Template"),t.model().model().restoreStudyTemplate(JSON.parse(i.content),e),t.updateSeriesControlUI()})},e.prototype.deleteStudyTemplate=function(e){var t=this;window.runOrSignIn(function(){Object(g.createConfirmDialog)({type:"modal",content:v.confirmDelete.format(e)}).then(function(i){i.on("action:yes",function(i){i.actionLoader("yes","start"),Object(l.invalidateStudyTemplatesList)(),Object(l.removeStudyTemplate)(e,function(){var n,o=t.list();t._list.setValue(o.filter(function(t){return t.name!==e})),t._favoriteStudyTemplatesService&&(n=t._favoriteStudyTemplatesService.get(),t._favoriteStudyTemplatesService.set(n.filter(function(t){return t!==e}))),setTimeout(function(){i.actionLoader("yes","stop"),i.close()},0)})}),i.open()})},{source:"Study templates delete"})},e.prototype.list=function(){return this._list.value()},
e.prototype.plainList=function(e){var t,i=this.list();return t="default"===e?i.filter(function(e){return!!e.is_default}):i.filter(function(e){return!e.is_default}),t.map(function(e){return e.name})},e.prototype.getOnChange=function(){return this._onChange},e.prototype.refreshStudyTemplateList=function(e){var t=this;Object(l.getStudyTemplatesList)(function(i){t._list.setValue(i),void 0!==e&&e()})},e}()},function(e,t,i){"use strict";function n(e){var t,i;if(e&&e.__esModule)return e;if(t={},null!=e)for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.AutocompleteField=void 0,r=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),s=i(20),a=n(s),l=i(59),c=n(l),h=i(489),t.AutocompleteField=function(){function e(t){var i,n=this,r=t.label,s=t.name,l=(t.maxLength,t.error),u=void 0===l?"":l,d=t.source;o(this,e),this._name=s,this._error=u,this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+r+"</span>\n\t\t\t</label>"),this._autocompleteContainer=document.createElement("div"),this._$field[0].appendChild(this._autocompleteContainer),i=a.createElement(h.Autocomplete,{source:d.map(function(e){return e.name}),allowUserDefinedValues:!0,preventOnFocusOpen:!0,noEmptyText:!0,preventSearchOnEmptyQuery:!0,setupHTMLInput:function(e){n._autocompleteInput=e},filter:function(e,t){return""===e||e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())}}),c.render(i,this._autocompleteContainer)}return r(e,[{key:"appendTo",value:function(e){e.append(this._$field)}},{key:"focus",value:function(){this._autocompleteInput.focus()}},{key:"select",value:function(){this._autocompleteInput.focus(),this._autocompleteInput.select()}},{key:"unmount",value:function(){c.unmountComponentAtNode(this._autocompleteContainer)}},{key:"value",get:function(){return this._autocompleteInput.value}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._autocompleteInput.value}},{key:"error",get:function(){return this._error}}]),e}()},function(e,t,i){"use strict";function n(e){var t,i=e.dropped,n=void 0!==i&&i,o=e.small,r=void 0!==o&&o,c=e.colorTransition,h=void 0!==c&&c,u=e.style,d=void 0===u?{}:u,p=e.className,_=void 0===p?"":p,f=l(_,a.caret,(t={},t[a.caretRotate]=n,t[a.caretSmall]=r,t[a.caretColorTransition]=h,t));return s.createElement("i",{className:f,style:d})}function o(e,t){return""===e||-1!==t.toLowerCase().indexOf(e.toLowerCase())}var r,s,a,l,c,h,u,d,p,_,f;Object.defineProperty(t,"__esModule",{value:!0}),r=i(1),i(11),s=i(20),a=i(490),l=i(102),c=i(326),h=i(304),u=i(324),d=i(491),p=i(207),i.d(t,"Autocomplete",function(){return f}),_=function(e){
return Array.isArray(e.source)||!e.allowUserDefinedValues},f=function(e){function t(t){var i=e.call(this,t)||this;if(i._setInputRef=function(e){e&&(i._inputElement=e,i.props.setupHTMLInput&&i.props.setupHTMLInput(e),i._inputElement.addEventListener("keyup",i._handleKeyUpEnter))},i._handleCaretClick=function(){i.state.isOpened?i._close():i.props.preventOnFocusOpen?i._open():i._focus()},i._handleOutsideClick=function(){var e=i.props,t=e.allowUserDefinedValues,n=e.value,o=e.onChange,r=i.state.queryValue;t&&r!==n?o&&o(r):i.setState(i._valueToQuery(n)),i._close()},i._handleFocus=function(e){i.props.preventOnFocusOpen||i._open(),i.props.onFocus&&i.props.onFocus(e)},i._handleChange=function(e){var t,n=e.currentTarget.value;i.props.preventSearchOnEmptyQuery&&""===n?i.setState({queryValue:n,isOpened:!1,active:void 0}):(t=i._suggestions(n),i.setState({queryValue:n,isOpened:Object.keys(t).length>0,active:i.props.allowUserDefinedValues?void 0:i._getActiveKeyByValue(n)}))},i._handleItemClick=function(e){var t=e.currentTarget.id;i.setState({queryValue:i._source()[t]}),i._close(),i.props.onChange&&i.props.onChange(t)},i._handleKeyDown=function(e){var t,n,o,r,s,a,l,c,h,d,p,_,f,m;if(-1!==[u.a.DownArrow,u.a.UpArrow,u.a.Enter,u.a.Escape].indexOf(e.which))switch(e.preventDefault(),e.stopPropagation(),t=i.props,n=t.allowUserDefinedValues,o=t.value,r=t.onChange,s=i.state,a=s.active,l=s.isOpened,c=s.queryValue,h=i._suggestions(c),e.which){case u.a.DownArrow:case u.a.UpArrow:if(d=Object.keys(h),!l&&d.length&&e.which===u.a.DownArrow){i.setState({isOpened:!0,active:d[0]});break}if(p=void 0,void 0===a){if(e.which===u.a.UpArrow){i._close();break}p=0}else p=d.indexOf(a)+(e.which===u.a.UpArrow?-1:1);p<0&&(p=0),p>d.length-1&&(p=d.length-1),_=d[p],i.setState({active:_}),(f=document.getElementById(_))&&i._scrollIfNotVisible(f,i._suggestionsElement);break;case u.a.Escape:i._close(),l||i._blur();break;case u.a.Enter:m=a,n&&(l&&m?i.setState(i._valueToQuery(m)):m=c),void 0!==m&&(i._close(),l||i._blur(),m!==o?r&&r(m):i.setState(i._valueToQuery(m)))}},i._setSuggestionsRef=function(e){e&&(i._suggestionsElement=e)},i._scrollIfNotVisible=function(e,t){var i=t.scrollTop,n=t.scrollTop+t.clientHeight,o=e.offsetTop,r=e.clientHeight,s=o+r;return o<=i?void e.scrollIntoView(!0):s>=n?void e.scrollIntoView(!1):void 0},!_(t))throw Error("allowUserDefinedProps === true cay only be used if source is array");return i.state=r.a({isOpened:!1,active:t.value},i._valueToQuery(t.value)),i}return r.c(t,e),t.prototype.componentWillReceiveProps=function(e){this.setState({queryValue:""===e.value?"":this._source()[e.value]||this.state.queryValue,active:e.value})},t.prototype.componentWillUnmount=function(){this._inputElement&&this._inputElement.removeEventListener("keyup",this._handleKeyUpEnter)},t.prototype.render=function(){var e;return s.createElement(h.a,{ctor:"div",className:l(d.autocomplete,(e={},e[d.opened]=this.state.isOpened,e),"js-dialog-skip-escape"),handler:this._handleOutsideClick,click:!0},s.createElement(c.a,{
rightComponent:Object.keys(this._suggestions(this.state.queryValue)).length?s.createElement("div",{className:d.caret,onClick:this._handleCaretClick},s.createElement(n,{className:d.icon,dropped:this.state.isOpened})):void 0,theme:p,reference:this._setInputRef,className:d.textInput,placeholder:this.props.placeholder,value:this.state.queryValue,error:this.props.error,onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this.props.onBlur,onMouseOver:this.props.onMouseOver,onMouseOut:this.props.onMouseOut,onKeyDown:this._handleKeyDown}),this._renderSuggestions())},t.prototype._focus=function(){this._inputElement.focus()},t.prototype._blur=function(){this._inputElement.blur()},t.prototype._open=function(){this.setState({isOpened:!0})},t.prototype._close=function(){this.setState({isOpened:!1,active:void 0})},t.prototype._source=function(){var e={};return Array.isArray(this.props.source)?this.props.source.forEach(function(t){e[t]=t}):e=this.props.source,e},t.prototype._suggestions=function(e){var t=this.props,i=t.value,n=t.filter,r=void 0===n?o:n,s=this._source(),a={},l=Object.keys(s);return e!==s[i]&&(l=l.filter(function(t){return r(e,s[t])})),l.forEach(function(e){return a[e]=s[e]}),a},t.prototype._renderSuggestions=function(){var e=this,t=this._suggestions(this.state.queryValue),i=Object.keys(t).map(function(i){var n,o=l(d.suggestion,(n={},n[d.selected]=e.state.active===i,n));return s.createElement("li",{id:i,key:i,className:o,onClick:e._handleItemClick},t[i])}),n=s.createElement("li",{className:d.noResults},window.t("No results found"));return!i.length&&this.props.noEmptyText?null:s.createElement("ul",{className:d.suggestions,ref:this._setSuggestionsRef},i.length?i:n)},t.prototype._handleKeyUpEnter=function(e){e.which===u.a.Enter&&e.stopImmediatePropagation()},t.prototype._getActiveKeyByValue=function(e){var t,i,n,r=this.props.filter,s=void 0===r?o:r,a=this._suggestions(e),l=Object.keys(a);for(t=0,i=l;t<i.length;t++)if(n=i[t],s(e,a[n]))return n;return l[0]},t.prototype._valueToQuery=function(e){return{queryValue:this._source()[e]||""}},t}(s.PureComponent)},function(e,t){e.exports={caret:"caret-3_GTxtct-",caretRotate:"caretRotate-98O6Gi4f-",caretSmall:"caretSmall-1vg6w8eZ-",caretColorTransition:"caretColorTransition-1y-c2tgp-"}},function(e,t){e.exports={autocomplete:"autocomplete-S6SpJGmW-",caret:"caret-3fqF_ykE-",icon:"icon-1POgzoN_-",textInput:"textInput-1mZnCCcA-",suggestions:"suggestions-NOVMFmSY-",suggestion:"suggestion-3xakscNf-",noResults:"noResults-1pgHgvGL-",selected:"selected-3wOAQHl8-",opened:"opened-2C-bn3cP-"}},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxField=void 0,r=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),
s=i(308),a=n(s),t.CheckboxField=function(){function e(t){var i=t.label,n=t.name,r=t.error,s=void 0===r?"":r,l=t.hint;o(this,e),this._name=n,this._error=s,this._checkboxView=new a.default({labelRight:i,name:n}),this._checkboxView.$el.addClass("tv-rename-chart-dialog__field"),l&&this._checkboxView.$el.append('<span class="tv-rename-chart-dialog__hint apply-common-tooltip" title=\''+l+"'></span>")}return r(e,[{key:"appendTo",value:function(e){e.append(this._checkboxView.$el)}},{key:"focus",value:function(){}},{key:"select",value:function(){}},{key:"value",set:function(e){this._checkboxView.checked=e},get:function(){return this._checkboxView.checked}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!0}},{key:"error",get:function(){return this._error}}]),e}()},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.InputFieldRegExp=void 0,s=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i(196),t.InputFieldRegExp=function(e){function t(e){var i,r;return n(this,t),i=e.regExp,delete e.regExp,r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r._regExp=i,r}return r(t,e),s(t,[{key:"valid",get:function(){return this._regExp.test(this._$input.val())}}]),t}(a.InputField)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"FavoriteStudyTemplateService",function(){return r}),n=i(1),o=i(199),r=function(e){function t(t,i){return e.call(this,t,i,"FAVORITE_STUDY_TEMPLATES_CHANGED","StudyTemplates.quicks",[])||this}return n.c(t,e),t}(o.b)},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyMarket",function(){return s}),n=i(8),o=i.n(n),r=i(134),s=function(){function e(e,t){this.visibilityChanged=new o.a,this._dialogPromise=null,this._dialog=null,this._chartWidgetCollection=e,this._options=t}return e.prototype.isVisible=function(){return null!==this._dialog&&this._dialog.isVisible()},e.prototype.show=function(e){var t=this;if(null===this._dialog)return void this._requestDialog().then(function(){return t.show(e)});this._dialog.show(e)},e.prototype.hide=function(){null!==this._dialog&&this._dialog.hide()},e.prototype.onCustomScriptModified=function(){null!==this._dialog&&this._dialog.onCustomScriptModified()},
e.prototype.resetAllPages=function(){null!==this._dialog&&this._dialog.resetAllPages()},e.prototype.updateFavorites=function(){null!==this._dialog&&this._dialog.updateFavorites()},e.prototype._requestDialog=function(){var e=this,t=function(t,n){i.e(15).then(function(n){var o=i(702).StudyMarketDialog;t(new o(e._chartWidgetCollection,e._options))}.bind(null,i)).catch(n)};return null===this._dialogPromise&&(this._dialogPromise=Object(r.retries)(function(){return new Promise(t)},2).then(function(t){e._dialogPromise=null,e._dialog=t,e._dialog.visibilityChanged.subscribe(null,function(t){e.visibilityChanged.fire(t)})})),this._dialogPromise},e}()},function(e,t){},function(e,t,i){"use strict";function n(){var e,t;return{promise:new Promise(function(i,n){e=i,t=n}),reject:t,resolve:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredPromise=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),n=i(14),i(11),o=i(16),r=i.n(o),s=i(164),a=function(){function e(e){var t,i,n,o,s=this;this._document=e,this.isFullscreen=new r.a,(t=function(){var e,t,i=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(e=0;e<i.length;e++)if((t=i[e])in s._document){s.isFullscreen.setValue(!!s._document[t]);break}})();for(i=0,n=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];i<n.length;i++)o=n[i],e.addEventListener(o,t,!1)}return e.prototype.enter=function(){var e,t,i,n=this._document.documentElement;for(e=0,t=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];e<t.length;e++)if(i=t[e],"function"==typeof n[i]){n[i]();break}this.isFullscreen.setValue(!0)},e.prototype.exit=function(){var e,t,i,n=this._document;for(e=0,t=["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"];e<t.length;e++)if(i=t[e],"function"==typeof n[i]){n[i]();break}this.isFullscreen.setValue(!1)},e}(),l=function(){function e(e){var t,i,n,o,s,a,l=this;this.isVisible=new r.a(!0),i=null,n=function(n){var o=n?n+"Hidden":"hidden";if(o in e)return t=n+"visibilitychange",i=function(){l.isVisible.setValue(!e[o])},i(),e.addEventListener(t,i,!1),"break"};for(o=0,s=["","moz","ms","webkit"];o<s.length&&(a=s[o],"break"!==n(a));o++);this.destroy=function(){i&&(e.removeEventListener(t,i,!1),i=null)}}return e}(),i.d(t,"Root",function(){return c}),c=function(){function e(e){this._window=e,this._fullscreenApi=new a(e.document),this._initFullscreen()}return e.prototype.allocate=function(){var e,t,i,n=this;return this.free(),e=this._window.document,t=$("<div>",e).addClass("js-rootresizer__contents").css({position:"relative",width:"100%",height:"100%"}).prependTo(e.body),this._visibilityApi=new l(this._window.document),i={alive:new r.a(!0),fullscreenable:new r.a(!0),body:new r.a(t),width:new r.a,height:new r.a,availWidth:new r.a,availHeight:new r.a,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:function(){
i.alive.setValue(!1)},attach:function(){i.alive.setValue(!1),n._window.close()},requestFullscreen:function(){n._requestFullscreen()},exitFullscreen:function(){n._exitFullscreen()}},i.alive.subscribe(function(e){e||i!==n._area||n.free()}),this._area=i,this._resizeHandler=function(){var e=i.body.value()[0],t=e.clientWidth,n=e.clientHeight;i.availHeight.setValue(n),i.availWidth.setValue(t),i.height.setValue(n),i.width.setValue(t)},this._resizeHandler(),$(this._window).on("resize",this._resizeHandler),new s.ResizerDetacherState(i).bridge()},e.prototype.free=function(){if(this._resizeHandler&&($(this._window).off("resize",this._resizeHandler),this._resizeHandler=void 0),this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=void 0),this._area){var e=this._area;this._area=void 0,e.alive.setValue(!1),e.body.value().remove()}},e.prototype._requestFullscreen=function(){this._fullscreenApi.enter()},e.prototype._exitFullscreen=function(){this._fullscreenApi.exit()},e.prototype._initFullscreen=function(){var e=this,t=this._window.document;this._fullscreenApi.isFullscreen.subscribe(function(i){i?(e._$exitFullscreenButton=$("<div>",t).addClass("tv-exit-fullscreen-button").text($.t("Exit Full Screen (ESC)")).on("click",function(t){t.preventDefault(),e._exitFullscreen()}).appendTo(t.body),e._onExitFullscreenEsc=function(t){27===t.keyCode&&(t.preventDefault(),e._exitFullscreen())},$(t).on("keyup",e._onExitFullscreenEsc)):(e._$exitFullscreenButton&&(e._$exitFullscreenButton.remove(),e._$exitFullscreenButton=void 0),e._onExitFullscreenEsc&&($(t).off("keyup",e._onExitFullscreenEsc),e._onExitFullscreenEsc=void 0)),e._resizeHandler&&e._resizeHandler()})},e}()},function(e,t){},function(e,t,i){"use strict";function n(e,t){var i,n,o,r,s,a,l=0;for(i=0,n=t;i<n.length&&(o=n[i],r=o.min,s=o.max,e<r||s<r||(a=Math.min(e,s),l=Math.max(l,a),e!==l));i++);return l}function o(e){var t,i,n,o,r,s=[];if(void 0===e)return[];for(Array.isArray(e)||(e=[e]),t=0,i=e;t<i.length;t++)n=i[t],o=void 0,r=void 0,isFinite(n)?o=r=+n:(o=+n.min,r=+n.max),(o<0||isNaN(o))&&(o=0),isNaN(r)&&(r=1/0),o<=r&&r>0&&s.push({min:o,max:r});return s.sort(function(e,t){return e.min-t.min||e.max-t.max}),s}function r(e,t){if(e.length!==t.length)return!1;for(var i=e.length;i--;){if(e[i].min!==t[i].min)return!1;if(e[i].max!==t[i].max)return!1}return!0}function s(e){var t=u.enabled("side_toolbar_in_fullscreen_mode");return"center"===e||"left"===e&&t}var a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),a=i(14),l=i(16),c=i.n(l),h=i(164),u=i(5),i.d(t,"ChartPage",function(){return p}),d=u.enabled("no_min_chart_width"),p=function(){function e(e){var t=this;if(this._$body=$(e.body.value()),0===this._$body.size())throw Error("bridge.body.value() must be an element or not empty jQuery object");this._availableAreas=["left","dompanel","right","top","footer","bottom","center"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._width.subscribe(function(){return t.recalculate()}),this._height.subscribe(function(){return t.recalculate()}),
this._bridge.visible.subscribe(function(){return t._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return t._onParentFullscreenChange()}),this.recalculate()}return e.prototype.allocate=function(e){var t,i,n=this,s=e&&e.areaName;if(-1===this._availableAreas.indexOf(s))throw Error("unknown options.areaName");return this.free(s),t=this._createDOM(s),i={canNegotiate:{width:"left"===s||"right"===s||"dompanel"===s,height:"top"===s||"bottom"===s||"footer"===s},negotiations:{width:[],height:[]},remove:function(){for(var e in n._areas)n._areas[e]===i&&n.free(e)},negotiateWidth:function(e){if(i.canNegotiate.width){var t=o(e);r(i.negotiations.width,t)||(i.negotiations.width=t,n.recalculate())}},negotiateHeight:function(e){if(i.canNegotiate.height){var t=o(e);r(i.negotiations.height,t)||(i.negotiations.height=t,n.recalculate())}},requestFullscreen:function(){n._fullscreenArea||("right"!==s&&"center"!==s||(n._fullscreenArea=s),"center"===s&&n._bridge.requestFullscreen(),n._updateFullscreen())},exitFullscreen:function(){s===n._fullscreenArea&&(n._fullscreenArea=void 0,"center"===s&&n._bridge.exitFullscreen(),n._updateFullscreen())},width:new c.a,height:new c.a,availWidth:new c.a,availHeight:new c.a,alive:new c.a(!0),body:new c.a(t),visible:new c.a(!0),fullscreen:new c.a(!0),rdState:new h.ResizerDetacherState},i.rdState.pushOwner(i),this._areas[s]=i,i.rdState.owner.subscribe(function(e){var t,o,r,a=i.body.value();if(e!==i)a.empty().detach();else{for(t=null,o=n._availableAreas.indexOf(s);o--;)if(r=n._availableAreas[o],n._affectsLayout(r)){t=n._areas[r].body.value();break}t?a.insertAfter(t):a.appendTo(n._$body)}n.recalculate()},{callWithLast:!0}),i.rdState.bridge()},e.prototype.free=function(e){var t=this._areas[e];t&&(this._areas[e]=void 0,$(t.body.value()).remove(),t.alive.setValue(!1))},e.prototype.recalculate=function(){var e,t,i,o,r,s,a,l,c,h,u,p,_,f={};for(this._recalcSingleRunToken=f,e={width:this._width.value(),height:this._height.value()},t=0;t<this._availableAreas.length;t++)if(i=this._availableAreas[t],(o=this._areas[i])&&this._affectsLayout(i)){for("center"===i?(r=0,this._affectsLayout("left")&&(r+=this._areas.left.width.value()),s=0,this._affectsLayout("top")&&(s+=this._areas.top.height.value()),o.body.value().css({left:r,top:s})):"top"!==i&&"bottom"!==i&&"footer"!==i||(r=0,this._affectsLayout("left")&&(r+=this._areas.left.width.value()),o.body.value().css({left:r})),a=void 0,a=o.canNegotiate.width&&!o.canNegotiate.height?["height","width"]:["width","height"],l=0;l<2;l++){if(c=a[l],h=void 0,u=e[c],this._fullscreenArea===i)h=u;else{if("bottom"===i&&"height"===c&&(u-=5),d||"right"!==i&&"dompanel"!==i||"width"!==c||(u-=300),"width"===c?o.availWidth.setValue(u):"height"===c&&o.availHeight.setValue(u),f!==this._recalcSingleRunToken)return;o.canNegotiate[c]?(h=n(u,o.negotiations[c]),e[c]-=h):h=u}if(o.body.value().css(c,h),o[c].setValue(h),f!==this._recalcSingleRunToken)return}o.body.value().toggleClass("js-hidden",!1)}else o&&o.body.value().toggleClass("js-hidden",!0)
;this._affectsLayout("footer")&&(o=this._areas.footer,p=this._height.value()-o.height.value(),this._affectsLayout("bottom")&&(p-=this._areas.bottom.height.value()),o.body.value().css({top:p})),this._affectsLayout("dompanel")&&(o=this._areas.dompanel,_=0,this._affectsLayout("right")&&(_+=this._areas.right.width.value()),o.body.value().css({right:_}))},e.prototype._affectsLayout=function(e){var t,i=this._areas[e];return!!i&&(i.rdState.owner.value()===i&&(this._fullscreenArea&&this._fullscreenArea!==e?s(e):!((this._width.value()<=567||this._height.value()<=450)&&(t=["center","top","left"],!t.includes(e)))))},e.prototype._updateVisibility=function(){var e,t,i,n=this._bridge.visible.value();for(e=0;e<this._availableAreas.length;e++)t=this._availableAreas[e],(i=this._areas[t])&&(n&&this._affectsLayout(t)?i.visible.setValue(!0):i.visible.setValue(!1))},e.prototype._onParentFullscreenChange=function(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,this._updateFullscreen())},e.prototype._updateFullscreen=function(){var e,t,i,n=void 0!==this._fullscreenArea;for(e=0;e<this._availableAreas.length;e++)t=this._availableAreas[e],(i=this._areas[t])&&(t!==this._fullscreenArea?i.body.value().toggleClass("js-hidden",n&&!s(t)):i.fullscreen.setValue(!0));this._updateVisibility(),this.recalculate()},e.prototype._createDOM=function(e){var t=$("<div>").addClass("layout__area--"+e).css("position","absolute");return"bottom"===e?t.css("bottom",0):t.css("top",0),"right"===e||"dompanel"===e?t.css("right",0):t.css("left",0),t},e}()},function(e,t,i){"use strict";(function(e,t){function n(t,i){this.options=$.extend({throttleTimeout:125},i),this._connected=!1,this._symbol_data={},this._subscriptions={},this._delayed_subscriptions=[],this.fieldsSent=new $.Deferred,this.onConnect=new e,this.onDisconnect=new e,this._quoteApi=new o(window.ChartApiInstance),this._type=t||"full",this.fieldsSent=new $.Deferred,this._delayUpdateFastSymbols=s(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}var o,r=i(21).PriceFormatter,s=i(257).debounce,a=i(205),l=i(204),c=i(33);o=i(502),n.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},n.prototype.typeFields={},n.prototype.typeFields.simple=["ch","chp","current_session","description","local_description","language","exchange","fractional","is_tradable","lp","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"],n.prototype.typeFields.simpleDetailed=[].concat(n.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume","dividends_yield"]),n.prototype.typeFields.full=[],n.prototype.connect=function(e){
this._quoteApi.connect(this.quoteHandler.bind(this))},n.prototype.quoteHandler=function(e){var t=e.method,i=e.params;switch(t){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},n.prototype.onConnected=function(){this.setFields();var e=Object.keys(this._symbol_data);e.length&&this._quoteApi.quoteAddSymbols(e,{forcePermission:!0}),this._delayed_subscriptions.forEach(function(e){this.subscribe.apply(this,e)},this),this._delayed_subscriptions=[],this.onConnect.fire()},n.prototype.setFields=function(){var e=n.prototype.typeFields[this._type];e&&e.length&&this._quoteApi.quoteSetFields(e),this.fieldsSent.resolve()},n.prototype.onSymbolData=function(e){var t=e.symbolname,i=this._throttledSymbolData[t];i||(i=this._throttledSymbolData[t]={fnDispatch:a(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?$.extend(!0,i.cache,e):i.cache=e,i.fnDispatch(t)},n.prototype._parseUpdateMode=function(e){var t=e.update_mode;t&&(t=t.match(/(delayed_streaming){1}(?:_([\d]+))?/))&&t[1]&&(t[2]&&(e.update_mode_seconds=+t[2]),e.update_mode=t[1])},n.prototype.dipatchSymbolData=function(e){var t,i,n=this._symbol_data[e],o=this._throttledSymbolData[e].cache;if(delete this._throttledSymbolData[e].cache,this._symbol_data[e]){$.extend(!0,n,o),n.values&&this._parseUpdateMode(n.values);for(t in this._subscriptions)i=this._subscriptions[t],i[e]&&i[e].forEach(function(e){e(n,o)})}},n.prototype.subscribe=function(e,t,i){var n,o;if(!this._connected)return void this._delayed_subscriptions.push(arguments);this._subscriptions[e]=this._subscriptions[e]||{},n=this._subscriptions[e],t=[].concat(t),o=[],t.forEach(function(e){this._symbol_data[e]?n&&n[e]||this._symbol_data[e].subscribers_count++:(this._symbol_data[e]={subscribers_count:1},o.push(e)),n[e]=n[e]||[],n[e].push(i),n[e].fast=!0,this._symbol_data[e]&&this._symbol_data[e].values&&i(this._symbol_data[e],this._symbol_data[e])},this),o.length&&(this._quoteApi.quoteAddSymbols(o,{forcePermission:!0}),this._delayUpdateFastSymbols())},n.prototype.unsubscribe=function(e,t,i){var n,o=this._subscriptions[e];o&&(o[t]&&i?(n=o[t].indexOf(i),~n&&o[t].splice(n,1),o[t].length||delete o[t]):delete o[t]),o&&0===Object.keys(o).length&&delete this._subscriptions[e],this._symbol_data.hasOwnProperty(t)&&(o&&!o[t]&&this._symbol_data[t].subscribers_count--,this._symbol_data[t].subscribers_count||(delete this._symbol_data[t],this._quoteApi.quoteRemoveSymbols([t]),this._delayUpdateFastSymbols()))},n.prototype.setFastSymbols=function(e,t){var i,n;if(this._subscriptions[e]){i=this._subscriptions[e];for(n in i)i[n].fast=-1!==t.indexOf(n)}this._delayUpdateFastSymbols()},n.prototype._updateFastSymbols=function(){if(this._connected){var e=this._fastSymbols();0===e.length?this._quoteApi.quoteHibernateAll():this._quoteApi.quoteFastSymbols(e)}},
n.prototype._delayUpdateFastSymbols=n.prototype._updateFastSymbols,n.prototype._fastSymbols=function(){var e,t,i,n=[];for(e in this._subscriptions){t=this._subscriptions[e];for(i in t)t[i].fast&&n.push(i)}return n=l(n)},n.prototype.formatter=function(e,t){function i(e){var i=t&&!e.fractional?1:e.minmov;return new r(e.pricescale,i,e.fractional,e.minmove2)}function n(e){return e&&null!=e.pricescale&&null!=e.minmov}var o,s=this;return this._waitingForFormatters[e]?this._waitingForFormatters[e]:(o=new Promise(function(t,o){if(s._formatterValuesCache[e])t(i(s._formatterValuesCache[e]));else{var r=c.guid();s.subscribe(r,[e],function(a){a.error&&(s._waitingForFormatters[e]=null,o(a.error)),n(a.values)&&(s._waitingForFormatters[e]=null,s._formatterValuesCache[e]=a.values,t(i(a.values)),s.unsubscribe(r,e))})}}),this._waitingForFormatters[e]=o,o)},n.prototype.snapshot=function(e){var t,i=this;return this._waitingForSnapshot[e]?this._waitingForSnapshot[e]:(t=new Promise(function(t,n){if(i._snapshotValuesCache[e])t(i._snapshotValuesCache[e]);else{var o=c.guid();i.subscribe(o,[e],function(r){r.error&&(i._waitingForSnapshot[e]=null,n(r.error));var s=r.values;s&&s.minmov&&s.pricescale&&s.description&&(i._waitingForSnapshot[e]=null,i._snapshotValuesCache[e]=s,t(s),i.unsubscribe(o,e))})}}),this._waitingForSnapshot[e]=t,t)},TradingView.QuoteSessionMultiplexer=n,void 0!==t&&t&&t.exports&&(t.exports=n)}).call(t,i(8),i(51)(e))},function(e,t,i){"use strict";(function(e){function t(e){this._chartApi=e,this._sessionid="qs_"+n(),this._sessionstarted=!1}var n=i(33).randomHash;t.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},t.prototype.connected=function(){return this._chartApi.connected()},t.prototype.connect=function(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},t.prototype.disconnect=function(){this._chartApi.disconnect()},t.prototype.quoteAddSymbols=function(e,t){e=[].concat(e),t&&t.forcePermission&&(e=e.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,e)},t.prototype.quoteRemoveSymbols=function(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)},t.prototype.quoteFastSymbols=function(e){this._chartApi.quoteFastSymbols(this._sessionid,e)},t.prototype.quoteSetFields=function(e){this._chartApi.quoteSetFields(this._sessionid,e)},t.prototype.onMessage=function(e){switch(e.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler(e)},t.prototype.quoteHibernateAll=function(e){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=t,void 0!==e&&e&&e.exports&&(e.exports=t)}).call(t,i(51)(e))},function(e,t,i){"use strict";var n=i(5);window.onload=function(){function e(){var e=0;return JSON.parse(urlParams.logo).image&&(e="C",n.enabled("link_to_tradingview")||(e="D")),e}function t(){try{
return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(e){return!1}}location.hostname.indexOf(".")>=0&&!t()&&setTimeout(function(){try{var t=e();window.ga&&0!==t&&window.ga("send","event","s",t)}catch(e){}},3e4)}},function(e,t,i){"use strict";(function(t){function n(e){function n(e,t){var i,n,r=[],s=o[mt].count;for(i=0;i<s;i++)r.push(ct[i].chartWidget.state(e,t));return n={layout:mt,charts:r},vt.value()&&(n.symbolLock=1),St.value()&&(n.intervalLock=1),bt.value()&&(n.trackTimeLock=1),n}function x(e){var t,i=$.Deferred(),n=[],r=o[mt].count;for(t=0;t<r;t++)n.push(ct[t].chartWidget.asyncState(e));return $.when.apply($,n).then(function(){var e,t={charts:[]};for(e=0;e<arguments.length;e++)t.charts.push(arguments[e]);i.resolve(t)}),i}function C(){var e,t;for(e=Re?[Re]:ct.slice(0,ft.count).filter(function(e){return!e.hiddenInLayout.value()}),t=0;t<e.length;t++)L(e[t],t,e.length);je.trigger("chart-rect-update",je[0].getBoundingClientRect())}function L(e,t,i){var n=ft.sizer(t,{width:De.value(),height:Oe.value()},ot,rt,i),o={width:Math.max(Math.round(n.width||0)-2*st,0),height:Math.max(Math.round(n.height||0)-2*st,0),top:Math.max(Math.round(n.top||0),0),left:Math.max(Math.round(n.left||0),0)};e.metrics=o,e.body.value().css(o),e.width.setValue(o.width),e.height.setValue(o.height)}function I(){for(var e=0;e<ct.length;e++)ct[e].chartWidget.resizeSeriesControlUI()}function A(){for(var e=0;e<ct.length;e++)ct[e].chartWidget.tickSeriesControlClock()}function k(e){return e.rdState.owner.value()!==e}function E(e){var t,i=0,n=0;for(t=0;t<ft.count;t++)ct[t]&&k(ct[t])||(ct[t]===e&&(n=i),i++);L(e,n,i)}function M(e){function t(){o.visible.setValue(!o.hiddenInLayout.value()&&nt.resizerBridge.visible.value())}var i,n,o;return e=Object.assign({chartWidgetCollection:it,isActive:0===ct.length,barsMarksContainersFactory:V,undoHistory:We,readOnly:lt},e||{}),n=$(document.createElement("div")).addClass("chart-container").appendTo(je).css({position:"absolute",overflow:"hidden"}),o={alive:new _(!0),body:new _(n),width:new _,height:new _,hiddenInLayout:new _(!1),visible:new _,rdState:new f,requestFullscreen:function(){pt.value()&&(at.setValue(o.chartWidget),D(o))},exitFullscreen:function(){at.value()===o.chartWidget&&D(null)},detachable:pt,fullscreenable:pt,fullscreen:new _},o.rdState.pushOwner(o),ct.push(o),o.hiddenInLayout.subscribe(t),nt.resizerBridge.visible.subscribe(t),t(),E(o),Object.assign(e,o.rdState.bridge()),o.chartWidget=i=new r.ChartWidget(e),it.firstWidgetInitialized||i.chartWidgetInitialized.subscribe(null,function(){it.firstWidgetInitialized=!0,I()},!0),(1===ct.length||d.enabled("show_logo_on_all_charts"))&&i.createBranding(),e.containsData?i.finishInitWithoutConnect():i.connect(),B(),F(),Ue.fire(i),i}function V(e){var t,i,n=[];return d.enabled("charting_library_base")&&(t=new S(e),n.push(t),i=new b(e),n.push(i)),n}function D(e){Re!==e&&(Re=e,ht=W(),R(mt))}function O(){D(null);for(var e=0;e<ct.length;e++)ct[e].rdState.bridge().attach()}
function R(e){function t(){ct.every(function(e){return null!==e.chartWidget.model()})&&(B(),h.emit("layout_changed"))}function i(){t()}var n,r,s,a,l,c;e in o||(e="s"),n=o[e].count,h.emit("layout_about_to_be_changed",e),mt=e,ft=o[e];for(r=n;r<ct.length;r++)s=ct[r],k(s)&&s.rdState.bridge().attach();for(r=0;r<n||r<ct.length;r++)s=ct[r],a=Re?Re===s:r<n&&(!s||!k(s)),a?(s?(je.append(s.body.value()),s.hiddenInLayout.setValue(!1),(l=yt.shift())&&(gt=!0,s.chartWidget.loadContent(l.content),gt=!1)):(c=M(Object.assign({},Be,yt.shift()||(at.value()?{content:at.value().state()}:null)||{},0===r||vt.value()?{}:{defSymbol:null})),s=ct[r],c.modelCreated().subscribe(null,i,!0)),s.body.value().toggleClass("multiple",n>1),s.fullscreen.setValue(Re===s)):s&&(s.hiddenInLayout.setValue(!0),s.body.value().detach(),s.fullscreen.setValue(!1));return C(),B(),N(),t(),_t.value()<1&&n>0&&ct[n-1].rdState.bridge().attach(),!0}function B(){var e,t=Math.min(ft.count,ct.length)-1;if(t<0)return void at.deleteValue();e=dt,e<0&&(e=0),e>t&&(e=t),at.setValue(ct[e].chartWidget)}function N(){var e,t=ft.count,i=t;for(e=0;e<t;e++)ct[e]&&k(ct[e])&&i--;_t.setValue(i),pt.setValue(i>1)}function F(){var e,t;for(e=ct.length;e--;)t=e===dt,ct[e].body.value().toggleClass("active",t).toggleClass("inactive",!t)}function W(){return ct.filter(function(e){return!e.hiddenInLayout.value()}).sort(function(e,t){return e.metrics.top-t.metrics.top||e.metrics.left-t.metrics.left})}function H(){var e,t,i,n=Ve.value();"s"!==n&&(e=o[n].count,Re||(ht=W()),t=ut+1,i=ht[t],!i||t>e?(i=ht[0],ut=0):ut=t,at.setValue(i.chartWidget),Re&&R(n))}function j(){return qe}function z(){P("GUI","Save"),qe.fire()}function U(){var e,t=at.value();t&&(e=t.model())&&e.model().setSelectedSource(null)}function q(e){var t=at.value();return!!t&&t.trySetChartStyle(e)}function Y(e){var t,i,n,o;Ge!==e&&(Ge&&(Ge.modelCreated().unsubscribe(null,G),(t=Ge.model())&&(i=t.mainSeries().properties(),i.style.unsubscribe(null,K),n=t.model(),n.onSelectedSourceChanged().unsubscribe(null,Z),Ge=null)),e&&(o=e.model(),o?G(o):e.modelCreated().subscribe(null,G),Ge=e))}function G(e){var t,i=e.mainSeries().properties();i.style.subscribe(null,K),K(i.style),t=e.model(),t.onSelectedSourceChanged().subscribe(null,Z),Z(e.selectedSource())}function K(e){$e.setValue(e.value())}function Z(e){Ye.setValue(e)}function J(e){var t,i,n,o;if(e!==vt.value()){if(We.beginUndoMacro("Symbol Lock"),e)for(t=at.value(),i=t.getSymbol(),n=0;n<ct.length;n++)(o=ct[n].chartWidget)!==t&&o.getSymbol()!==i&&o.setSymbol(i);We.setWatchedValue(vt,e,"Symbol Lock"),We.endUndoMacro()}}function X(e){var t,i,n,o;if(e!==St.value()){if(We.beginUndoMacro("Interval Lock"),e)for(t=at.value(),i=t.getResolution(),n=0;n<ct.length;n++)(o=ct[n].chartWidget)!==t&&o.getResolution()!==i&&o.setResolution(i);We.setWatchedValue(St,e,"Resolution Lock"),We.endUndoMacro()}}function Q(e){bt.value()!==e&&We.setWatchedValue(bt,e,"Track Time")}function ee(e){return e=Ie(e),Ve.value()!==e&&(We.pushUndoCommand(new p(it,e)),!0)}function te(e){vt.value()?ie(e):at.value().setSymbol(e)}
function ie(e){var t,i,n=!1;for(t=0;t<ct.length;t++)i=ct[t].chartWidget,(i.model().mainSeries().properties().symbol.value()!==e||d.enabled("same_data_requery"))&&(n||(We.beginUndoMacro("Change Symbol"),n=!0),i.setSymbol(e));n&&We.endUndoMacro()}function ne(e){var t,i,n;if(!gt)if(St.value()){for(t=!1,i=0;i<ct.length;i++)n=ct[i].chartWidget,n.model().mainSeries().properties().interval.value()!==e&&(t||(We.beginUndoMacro("Change Resolution"),t=!0),n.setResolution(e));t&&We.endUndoMacro()}else at.value().setResolution(e)}function oe(e){var t,i,n;if(e&&e.onlyActiveChart||Re)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[at.value().images()]};for(t=[],i=ft.count,n=0;n<ct.length&&n<i;n++)t.push(ct[n].chartWidget.images());return{layout:mt,hidpiRatio:window.hidpiCanvasRatio||1,charts:t}}function re(){var e,t=[];for(e=0;e<ct.length&&e<ft.count;e++)t=t.concat(ct[e].chartWidget.tags());return t=$.unique(t),t=$.map(t,function(e){return e.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")})}function se(e,t,i,n){var o,r,s,a;if(i||Pt)for(o=ft.count,r=0;r<ct.length&&r<o;r++)(s=ct[r].chartWidget)!==t&&ct[r].rdState.bridge().visible.value()&&(a=s.model())&&a.model().setExternalPosition(e,n)}function ae(e,t){var i,n,o,r;if(bt.value()){for(i=ft.count,We.beginUndoMacro("Sync Time"),n=0;n<ct.length&&n<i;n++)if(o=ct[n].chartWidget,r=o.model()){if(r.model()===t)continue;r.gotoTime(e,{centerIfVisible:!1,model:t})}We.endUndoMacro()}}function le(){Te(!1),ct.forEach(function(e){void 0!==e.timingsMeter&&e.timingsMeter.destroy(),e.chartWidget.destroy()}),nt.resizerBridge.remove(),Qe&&clearInterval(Qe),$(window).off("resize",C),$(document).off("onUpdate",C),ze.resolve(),je.remove(),Xe=null}function ce(){return ze.promise()}function he(){return Ue}function ue(){Fe.id.setValue(void 0),Fe.uid.setValue(void 0),Fe.name.setValue(void 0)}function de(){var e={snapshotUrl:nt.snapshotUrl};(d.enabled("show_dialog_on_snapshot_ready")?u.getImageOfChart:u.getImageOfChartSilently)(it,e,function(e){h.emit("onScreenshotReady",e)})}function pe(){for(var e=o[mt].count;e<ct.length;e++)ct[e].chartWidget.destroy();ct.splice(o[mt].count)}function _e(e){for(var t=0;t<ct.length;t++)ct[t].chartWidget.applyOverrides(e)}function fe(e){for(var t=0;t<ct.length;t++)ct[t].chartWidget.applyStudiesOverrides(e)}function me(){nt.resizerBridge.requestFullscreen()}function ye(){nt.resizerBridge.exitFullscreen()}function ge(){return je}function ve(e,t){(t?[{chartWidget:at.value()}]:ct).forEach(function(t){t.chartWidget._model.model().restoreTheme(e)})}function Se(e,t){y.bind(e,function(e){e.preventDefault(),t()})}function be(){for(var e in Ze)Se(e,Ze[e]);Xe.watchOn(window)}function we(){for(var e in Ze)y.unbind(e);Xe.stopWatching(window)}function Pe(e){Be.onWidget||Ke===e||(Ke=e,e?be():we())}function Te(e){if(Pe(e),0!==ct.length){for(var t=ct.length;t--;)ct[t].chartWidget.setActive(!1);ct[dt].chartWidget.setActive(e)}}function xe(){return ct.map(function(e){return e.chartWidget.getMarketStatusTooltip()})}function Ce(){return ct.map(function(e){
var t=e.chartWidget.model(),i=t?t.mainSeries().status():null;return(null===i?"":e.chartWidget.getDataTextStatus(i))+" ("+i+")"})}function Le(){var e=this;return new Promise(function(t){i.e(14).then(function(){var n=i(820).AddCompareDialog,o=new n(e);t(o.show())}.bind(null,i)).catch(i.oe)})}function Ie(e){return d.enabled("charting_library_base")?e:"s"===e||isProductFeatureEnabled(ProductFeatures.MULTIPLE_CHARTS)&&getProductFeatureConfig(ProductFeatures.MULTIPLE_CHARTS).layout.indexOf(e)>=0||Be.containsData||lt?e:"s"}function Ae(e){if(yt=[],e){e.charts||(e={layout:"s",charts:[e]}),mt=Ie(e.layout||"s");for(var t=0;t<e.charts.length;t++)yt.push({content:e.charts[t]});e.symbolLock&&vt.setValue(!0),e.intervalLock&&St.setValue(!0),e.trackTimeLock&&bt.setValue(!0)}Ve.setValue(mt),R(mt)&&(l.init(),yt.splice(0,yt.length))}function ke(){0===--et&&h.emitOnce("onChartReady")}function Ee(){return Promise.all(ct.map(function(e){return m(e.chartWidget.modelCreated())}))}function Me(){return Promise.all(ct.map(function(e){return m(e.chartWidget.model().mainSeries().dataEvents().symbolResolved())}))}var Ve,De,Oe,Re,Be,Ne,Fe,We,He,je,ze,Ue,qe,$e,Ye,Ge,Ke,Ze,Je,Xe,Qe,et,tt,it=this,nt=Object.assign({},T,e),ot=2,rt=0,st=0,at=new _,lt=nt.readOnly||!1,ct=[],ht=[],ut=0,dt=0,pt=new _,_t=new _,ft=null,mt="s",yt=[],gt=!1,vt=new _(!1),St=new _(!1),bt=new _(!1),wt=new _(TVSettings.getBool("chart.syncCrosshair",!0)),Pt=wt.value();wt.subscribe(function(e){e=!!e,Pt=e,TVSettings.setValue("chart.syncCrosshair",e)}),Ve=new _(mt),De=nt.resizerBridge.width,Oe=nt.resizerBridge.height,Re=null,"padding"in nt&&(ot=nt.padding),"edge"in nt&&(rt=nt.edge),"border"in nt&&(st=nt.border),Be=nt.widgetOptions||{},Ne=nt.metaInfo||{},Fe={id:new _(Ne.id||null),name:new _(Ne.name),description:new _(Ne.description),username:new _(Ne.username),uid:new _(Ne.uid),lastModified:new _(Ne.lastModified)},We=a(),He=function(e){h.emit("undo_redo_state_changed",e)},We.onChange().subscribe(null,He),je=$(nt.resizerBridge.body.value()).eq(0),ze=$.Deferred(),Ue=new t,De.subscribe(C),Oe.subscribe(C),this.updateLayout=C,qe=new t,$e=new _,Ye=new _,Ge=null,at.subscribe(function(e){var t,i;if(e){for(i=ct.length;i--;)if(ct[i].chartWidget===e){t=i;break}if(!isFinite(t))throw Error("Cannot make detached ChartWidget active");if(dt!==t){for(Re&&(k(ct[t])||(Re=ct[t])),dt=t,F(),ht.length&&(ut=ht.indexOf(ct[dt])),i=ct.length;i--;)ct[i].chartWidget.setActive(!1);e.setActive(!0)}Y(e)}},{callWithLast:!0}),Ke=!1,Ze={Tab:H},nt.takeScreenshotEnabled&&(Ze["Alt+s"]=de),nt.saveChartEnabled&&(Ze["Ctrl+s"]=z),Je={},Je[v]=U,Xe=new g("keydown",!1),Xe.regHandlers(Je),Pe(!0),Object.assign(this,{createChartWidget:M,getAll:function(){return ct.map(function(e){return e.chartWidget})},destroy:le,layout:Ve,activeChartWidget:at,activeChartStyle:$e.readonly(),trySetChartStyleToActiveWidget:q,selectedSource:Ye.readonly(),metaInfo:Fe,state:n,asyncState:x,readOnly:function(){return lt},lock:{symbol:vt,setSymbolLockWithUndo:J,interval:St,setIntervalLockWithUndo:X,crosshair:wt,trackTime:bt,setTrackTimeWithUndo:Q},
setSymbol:te,setResolution:ne,updateLayout:C,setChartLayoutWithUndo:ee,resizeWidgetsUI:I,images:oe,tags:re,syncCrosshair:se,syncScroll:ae,setSymbolAll:ie,clearChartMetaInfo:ue,onfeatures:nt.onfeatures,takeScreenshot:de,loadContent:Ae,purgeUnusedWidgets:pe,applyOverrides:_e,applyStudiesOverrides:fe,switchChart:H,startFullscreen:me,exitFullscreen:ye,destroyPromise:ce,chartWidgetCreated:he,saveKeysPressed:j,getContainer:ge,onWidget:Be.onWidget,applyTheme:ve,setActive:Te,inlineChartsCount:_t.readonly(),revertToInline:O,chartMarketStatuses:xe,chartSeriesStatuses:Ce,undoHistory:We,showAddCompareDialog:Le}),Ae(nt.onfeatures?void 0:nt.content),Ve.subscribe(function(e){F(),R(e,!1)&&(ht=W(),ut=ht.indexOf(ct[dt]))}),Ve.hook=function(e){return e===this.value()?e:Ie(e)},lt&&(Ve.writeLock=!0),Qe=setInterval(A,1e3),$(window).on("resize",C),$(document).on("onUpdate",C),d.enabled("datasource_copypaste")&&(c.init(),nt.globalEvents&&($(window).on("appclip:paste",function(e){at.value().onAppClipboardPaste(),e.preventDefault()}),$(window).on("appclip:copy",function(e){at.value().onAppClipboardCopy(),e.preventDefault()}),$(window).on("appclip:cut",function(e){at.value().onAppClipboardCut(),e.preventDefault()}))),et=0,ct.forEach(function(e){if(e){et++;var t=e.chartWidget;t.withModel(null,function(){if(t.model().mainSeries().bars().size()>0)ke();else{var e=function(){ke(),t.model().mainSeries().dataEvents().barReceived().unsubscribe(null,e),t.model().mainSeries().dataEvents().completed().unsubscribe(null,e)};t.model().mainSeries().dataEvents().barReceived().subscribe(null,e),t.model().mainSeries().dataEvents().completed().subscribe(null,e)}})}}),s()&&(tt=l.tool.setValue,l.tool.setValue=function(){it.selectedSource.value()&&it.activeChartWidget.value().model().lineBeingCreated()&&it.activeChartWidget.value().model().cancelCreatingLine(),tt.apply(l.tool,arguments)}),Ee().then(Me).then(function(){window.saver&&window.is_authenticated&&nt.widgetOptions.justCloned&&window.saver.saveChartSilently()}).catch(w.logError.bind(w))}var o=i(108).layouts,r=i(505),s=i(71).supportTouch,a=i(659).createUndoHistory,l=i(32),c=i(182),h=i(31),u=i(660),d=i(5),p=i(661).SetChartLayoutCommand,_=i(16),f=i(164).ResizerDetacherState,m=i(662).delegateToPromise,y=i(189),g=i(338).KeyboardListener,v=i(192).ESC,S=i(663),b=i(664),w=i(4).getLogger("Chart.ChartWidgetCollection"),P=i(39).trackEvent,T={publishChartEnabled:!0,saveChartEnabled:!0,takeScreenshotEnabled:!0};e.exports=n}).call(t,i(8))},function(e,t,i){"use strict";(function(t){function n(e){var i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b;this._options=Object.assign({},se,e),i=this,this._guid=K(),this._startSpinner(this._options.body.value()),n=this._options.content,o=this._options.readOnly,o||(C.init(),C.tool.subscribe(function(){i._updateCrossHairPositionIfNeeded()}),r=function(e,t,i){var n,o=t.mainSeries().syncModel(),r=e.mainSeries().syncModel(),s=i;return o&&r&&(n=e._createSyncPoint(o,r),s=n.sourceTimeToTargetTime(i)),e.timeScale().points().roughIndex(s,r&&r.distance.bind(r))},
C.createdLineTool.subscribe(null,function(e){var t,n,o;i._model&&(t=i._model.model(),e.model!==t&&(n=t.paneForSource(i._model.model().mainSeries()),o={index:r(t,e.model,e.point.timeStamp),price:e.point.price},i._model.createLineTool(n,o,e.linetool,e.properties,e.linkKey)))}),C.continuedLineTool.subscribe(null,function(e){var t,n,o;i._model&&(t=i._model.model(),e.model!==t&&(n={index:r(t,e.model,e.point.timeStamp),price:e.point.price},(o=i._model.lineBeingCreated())&&i._model.model().coninueCreatingLine(n,e.envState,!!e.finalState)&&e.finalState&&o.restoreExternalPoints(e.finalState)))}),C.cancelledLineTool.subscribe(null,function(e){if(i._model){var t=i._model.model();e.model!==t&&i._model.model().cancelCreatingLine()}}),C.startedMovingLineTool.subscribe(null,function(e){var t,n,o;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0])&&(o={index:r(t,e.model,e.point.timeStamp),price:e.point.price},i._model.model().startMovingSource(n,o)))}),C.movedLineTool.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&t.sourceBeingMoved()&&t.sourceBeingMoved().linkKey===e.linkKey&&(n={index:r(t,e.model,e.point.timeStamp),price:e.point.price},i._model.model().moveSource(n)))}),C.finishedMovingLineTool.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&(n=t.sourceBeingMoved())&&(i._model.model().endMovingSource(!!e.finalState),e.finalState&&n.restoreExternalPoints(e.finalState)))}),C.startedChangingLineTool.subscribe(null,function(e){var t,n,o;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0])&&(o={index:r(t,e.model,e.point.timeStamp),price:e.point.price},i._model.model().startChangingLinetool(n,o,e.pointIndex,e.envState)))}),C.changedLineTool.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&t.lineBeingEdited()&&t.lineBeingEdited().linkKey===e.linkKey&&(n={index:r(t,e.model,e.point.timeStamp),price:e.point.price},i._model.model().changeLinePoint(n,e.envState)))}),C.finishedChangingLineTool.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0],t.lineBeingEdited()&&i._model.model().endChangingLinetool(!!e.finalState),n&&e.finalState&&n.restoreExternalPoints(e.finalState)))}),C.removedLineTool.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0])&&i._model.model().removeSource(n))}),C.finishedLineTool.subscribe(null,function(e){var t;i._model&&(t=i._model.model(),e.model!==t&&t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0]&&i._model.model().finishLineTool())}),C.changedLineStyle.subscribe(null,function(e){var t,n;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0])&&(n.properties().merge(e.state),n.propertiesChanged()))}),
C.restoredLineToolState.subscribe(null,function(e){var t,n,o;i._model&&(t=i._model.model(),e.model!==t&&(n=t.dataSources().filter(function(t){return t.linkKey===e.linkKey})[0])&&(o=$.extend({},e.state),o.indexes=o.points.map(function(i){return{index:r(t,e.model,i.time_t),price:i.price}}),t.restoreLineToolState(n,o)))}),C.restoredLineTool.subscribe(null,function(e){if(i._model){var t=i._model.model();e.model!==t&&t.restoreSource(e.state.restorePane,e.state.paneIndex,e.state.paneState,e.state.sourceState,e.state.priceScaleName)}}),C.copiedLineTool.subscribe(null,function(e){var t,n,o,s,a,l;if(i._model&&(t=i._model.model(),e.model!==t)){if(n=t.paneForSource(t.mainSeries()),o=e.points.map(function(i){return{index:r(t,e.model,i.timeStamp),price:i.price}}),s=o[0],a=t.createLineTool(n,s,e.linetool,null,e.linkKey),t.lineBeingCreated())for(l=1;l<o.length;l++)l!==o.length-1||"LineToolBrush"!==e.linetool&&"LineToolGhostFeed"!==e.linetool||t.finishLineTool(!0),t.coninueCreatingLine(o[l],{},l<o.length-1,!0);a.properties().interval.setValue(e.state.interval),a.properties().merge(e.state),a.restoreData&&a.restoreData(e),a.propertiesChanged(),a&&e.finalState&&(a.calcIsActualSymbol(),a.restoreExternalPoints(e.finalState))}})),s=this._options.containsData,a=this._options.onWidget,l=this._options.onCmeWidget,l&&te.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),c=this._options.widgetCustomer,h=this._options.timezone,u=this._options.hideSymbolSearch,d=this._options.defSymbol,p=L.isValid(this._options.defInterval)?this._options.defInterval:void 0,_=parseInt(this._options.defStyle),f=E.isValidStyle(_)?_:void 0,m=this._options.defExtendedHours,y=this._options.defTimeframe,this._chartWidgetCollection=this._options.chartWidgetCollection||null,this._setContent(n),this._readOnly=o,this._containsData=s,this._showChartEvents=!s&&this._options.chartEventsEnabled,this._defSymbol=d,this._defInterval=p,this._defTimeframe=y,this._defStyle=f,this._onWidget=!!a,this._onWidget&&(l?this._widgetCustomer="cme":c&&(this._widgetCustomer=c)),this.controlBarHeight=33,this._hideSymbolSearch=u,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},this._drawRafId=0,g=this._contentSeriesProperties(),g&&(d=g.symbol,p=g.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new W("chartproperties",void 0,void 0,this._options.useUserChartPreferences),v="chartproperties.mainSeriesProperties",S=this._options.useUserChartPreferences?ee.defaults(v):ee.factoryDefaults(v),this._properties.mainSeriesProperties.merge(S),p=p||S.interval||"D",f=f||S.style||V(L.isRange(p)),this._properties.mainSeriesProperties.merge({visible:!0,symbol:d||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:p,style:f,extendedHours:m,lineStyle:{styleType:ee.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),
h&&z(h)&&this._properties.timezone.setValue(h),this._tagsChanged=new t,this._modelCreated=new t,this._disconnected=new t,this._reconnectBailout=new t,this._connected=new t,this._redrawPanes=new t,this._onScroll=new t,this.chartWidgetInitialized=new t,this._chartSession=new U(ChartApiInstance),this._metaInfoRepository=new ne(this._chartSession),this.lhsPriceAxisWidthChanged=new t,this.rhsPriceAxisWidthChanged=new t,this._timingsMeter=null,this._isActive=this._options.isActive,this._options.body.subscribe(function(e){i._setElement(e)},{callWithLast:!0}),b=function(){i.resize()},this._options.width.subscribe(b),this._options.height.subscribe(b),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this))}function o(e){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[e]||"exchange"}var r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se;i(11),r=i(7).assert,s=i(506),a=i(641),l=i(643),c=i(125).PriceAxisWidget,h=i(649).TimeAxisWidget,u=i(87).BarsMarksContainer,d=i(63).Series,p=i(5),_=i(106).isFeatureEnabled,f=i(181).ActionBinder,m=i(197).showEditObjectDialog,y=i(328).showGoToDateDialog,g=i(240).CustomEvent,v=i(34).Study,S=i(124),b=i(0).LineDataSource,w=i(73).isLineToolName,P=i(41),T=P.Action,x=P.ActionSeparator,C=i(32),L=i(15).Interval,I=i(61),A=I.setLastUsedResolution,k=I.getDefaultResolution,E=i(42),M=E.isRangeStyle,V=E.getDefaultStyle,D=i(651).showSymbolInfoDialog,O=i(18),R=i(62).linking,B=i(249).showChangeIntervalDialog,N=i(128).showDialog,F=i(128).activateKeyPressHandler,W=i(3).DefaultProperty,H=i(200),j=H.availableTimezones,z=H.timezoneIsAvailable,U=i(652).ChartSession,q=i(26),Y=i(305).Spinner,G=i(39).trackEvent,K=i(33).guid,Z=i(81).Size,J=i(82).createConfirmDialog,X=i(653).MarketStatusIndicator,Q=i(655).DataModeIndicator,ee=i(133),te=i(4).getLogger("ChartWidget",{color:"#606"}),ie=i(38).IS_RTL,ne=i(657).StudyMetaInfoRepository,oe=i(108).isMultipleLayout,re=i(658).addPerfMark,se={addToWatchlistEnabled:!0,sourceSelectionEnabled:!0,propertyPagesEnabled:!0,paneContextMenuEnabled:!0,priceScaleContextMenuEnabled:!0,verticalTouchScroll:!1,seriesControlBarEnabled:!0,goToDateEnabled:!1,marketStatusWidgetEnabled:!0,chartWarningWidgetEnabled:!0,isSymbolAvailable:function(e){return Promise.resolve(!0)},legendWidgetEnabled:!0,chartEventsEnabled:!0,esdEnabled:!1,noMouseWheelScroll:!1},n.prototype._updateCrossHairPositionIfNeeded=function(){var e,t,i,n;this._model&&(e=C.tool.value(),this._model.model().setCurrentTool(e),TradingView.isMobile.any()&&(t=this._maximizedPaneWidget||this._paneWidgets[0],w(e)&&"LineToolBrush"!==e&&!this.selectBarMode().value()?(i=.5*this._model.model().timeScale().width(),n=.5*t._state.defaultPriceScale().height(),this._model.model().setAndSaveCurrentPosition(i,n,t._state),t._updateTooltip(i,n)):t._hideTooltip()),this._model&&TradingView.isMobile.any()&&this._model.model().crossHairSource().updateAllViews())},n.prototype._setElement=function(e){var t,n
;this._jqMainDiv&&(this._jqMainDiv.remove(),this._jqParent.empty()),this._controlBarNavigation&&this._controlBarNavigation.destroy(),this._seriesControlWidget&&this._seriesControlWidget.destroy(),t=e.prop("ownerDocument"),this._jqParent=$(t.createElement("div")).addClass("chart-container-border").prependTo(e),this._jqMainDiv=$('<div class="chart-widget"/>',t),this._elTooltipDiv=t.createElement("div"),this._elTooltipDiv.className="tooltip-wrapper",this._jqMainDiv.append(this._elTooltipDiv),this._elMainTable=t.createElement("table"),this._elMainTable.className="chart-markup-table",this._elMainTable.setAttribute("cellpading","0"),this._elMainTable.setAttribute("cellspacing","0"),this._jqMainDiv.append(this._elMainTable),n=this._options.seriesControlBarEnabled&&(!p.enabled("lean_chart_load")||!this._chartControlsBar),n&&(this._chartControlsBar=t.createElement("div"),this._chartControlsBar.className="chart-controls-bar",this._chartControlsBar.classList.toggle("chart-controls-bar--inactive",!this._isActive),this._jqParent.append(this._chartControlsBar),i.e(12).then(function(e){var t=i(816).BottomToolbarRenderer;this._isDestroyed||(this._seriesControlWidget=new t(this._chartControlsBar,this,this._chartWidgetCollection,ChartApiInstance,this._options,this._options.seriesControlBar))}.bind(this).bind(null,i)).catch(i.oe)),(this._options.controlBar||p.enabled("control_bar"))&&i.e(1).then(function(e){if(!this._isDestroyed){this._controlBarNavigation&&this._controlBarNavigation.destroy();var t=i(817).ControlBarNavigation;this._controlBarNavigation=new t(this,this._jqMainDiv[0]),this._model&&this._adjustSize()}}.bind(this).bind(null,i)).catch(i.oe),this._containsData||this.createIndicatorImage(),this._options.noMouseWheelScroll||this._jqMainDiv.mousewheel(this._onMousewheel.bind(this)),this.resize(),this.withModel(this,function(){this._jqParent.append(this._jqMainDiv),this._jqMainDiv.on("mousedown",this._requestActive.bind(this)),this._jqMainDiv.on("touchstart",this._requestActive.bind(this))}),this._inited&&(null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),this._paneWidgets.length=0,this._update(new O(O.FULL_UPDATE)))},n.prototype._requestActive=function(){this._chartWidgetCollection&&this._chartWidgetCollection.activeChartWidget.setValue(this)},n.prototype._onMousewheel=function(e,t,i,n){var o,r,s,a,l;if((TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty())return o=e.pageX-5,r=this._paneWidgets[0].lhsPriceAxisWidget.size.w,s=this._timeAxisWidget.size.w,r&&(o=Math.max(0,o-r)),o=Math.min(o,s),a=p.enabled("right_bar_stays_on_scroll")?1:2*(o/s-.5),l=Math.min(1,Math.abs(n)),n>0?this.model().zoomIn(a,l):n<0&&this.model().zoomOut(a,l),i&&this.model().scrollChart(-80*i),!1},n.prototype.getStudyScriptingPkgVers=function(e){return this._metaInfoRepository.getStudyScriptingPkgVers()},n.prototype.setTimezone=function(e){
e&&z(e)?this._properties.timezone.setValue(e):console.warn("Incorrect timezone: "+JSON.stringify(e))},n.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(e){e.refreshData()})},n.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(e){e.clearMarks()})},n.prototype._init=function(){var e,t,i=this;this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),e=function(){i._checkObsoleteTimezone(),i._chartSession&&i._chartSession.connected()&&this._model.restart(),this._content&&(this.initColors(),this._updateGui(),this.update());var e=i._model.mainSeries();e.marketStatus.subscribe(function(t){i.indicatorImage&&i._updateDataAndMarketStatus(t,e.status(),e.quoteData.update_mode_seconds)},{callWithLast:!0}),this._resizeHandler=function(){this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),this.paint(),this.resizeSeriesControlUI(),this.checkCompactMode(),this.resizeIndicator()}.bind(this),this._resizeHandler(),this._jqParent.append(this._jqMainDiv),this._spinner&&(this._spinner.stop(),delete this._spinner),_("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange:chart_"+this._guid,function(e,t){if(t){for(var n=0;n<i._paneWidgets.length;n++)i._paneWidgets[n].hardResetCanvas();i._timeaxiswidget&&i._timeaxiswidget.hardResetCanvas(),i.paint(new O(O.LIGHT_UPDATE))}}),$(window).on("keydown:chart_"+this._guid,function(e){27===e.which&&e.preventDefault()}),this._initBarsMarksSources(),this._activateSymbolSearchHotkeys(),this.model().timeScale().onScroll().subscribe(this,function(){this._onScroll.fire()}),this._inited=!0}.bind(this),t=this._makeDefaultModel(),void 0===t?e():t.then(e)},n.prototype._activateSymbolSearchHotkeys=function(){this.readOnly()||this._hideSymbolSearch||F()},n.prototype._checkObsoleteTimezone=function(){var e=this._properties.timezone.value();z(e)||this._properties.timezone.setValue(o(e))},n.prototype._initBarsMarksSources=function(){var e=this;this.withModel(this,function(){this.model().barsMarksSources().forEach(function(t){t.onNeedRepaint.subscribe(e,e.paint)})})},n.prototype.initESDTimelineWidget=function(){new ESDTimelineWidget(this)},n.prototype.initColors=function(){this._properties.paneProperties.background.listeners().subscribe(this,n.prototype.setBackgroundColor),this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,n.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,n.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,n.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,n.prototype.setScaleTextColor)},n.prototype.paneWidgets=function(){return this._paneWidgets},n.prototype.paneByCanvas=function(e){for(var t=0;t<this._paneWidgets.length;t++)if(this._paneWidgets[t].canvas===e||this._paneWidgets[t].top_canvas===e)return this._paneWidgets[t];return null},
n.prototype.paneByState=function(e){for(var t=0;t<this._paneWidgets.length;t++)if(this._paneWidgets[t]._state===e)return this._paneWidgets[t];return null},n.prototype.priceAxisByCanvas=function(e){var t,i,n;for(t=0;t<this._paneWidgets.length;t++)if(i=this._paneWidgets[t],n=i.priceAxisByCanvas(e))return n;return null},n.prototype.timeAxisByCanvas=function(e){return e===this._timeAxisWidget.canvas||e===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null},n.prototype.properties=function(){return this._properties},n.prototype.emulateCriticalError=function(){this._chartSession.removeSeries("-1",null)},n.prototype.readOnly=function(){return this._readOnly},n.prototype.onDisconnected=function(){return this._disconnected},n.prototype.onReconnectBailout=function(){return this._reconnectBailout},n.prototype.onConnected=function(){return this._connected},n.prototype.onRedrawPanes=function(){return this._redrawPanes},n.prototype.onScroll=function(){return this._onScroll},n.prototype.modelCreated=function(){return this._modelCreated},n.prototype.setResolution=function(e){var t,i;if(!this._model)return void this._properties.mainSeriesProperties.merge({interval:e});t=this._model.mainSeries().properties(),i=window.t("Change Resolution"),this._model.setResolutionProperty(t.interval,e,this,i)},n.prototype.getResolution=function(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()},n.prototype._addSymbol=function(e,t){var i=this.model(),n=i.studiesMetaData(),o="study_Overlay@tv-basicstudies",r=p.enabled("use_overrides_for_overlay")&&TradingView.defaultProperties[o]&&TradingView.defaultProperties[o].style,s=r||(i.mainSeries().properties().style.value()===d.STYLE_CANDLES?d.STYLE_BARS:d.STYLE_CANDLES),a={inputs:{symbol:e},style:s},l=n.filter(function(e){return"Overlay@tv-basicstudies"===e.id})[0];i.insertStudy(l,a,t)},n.prototype.addSymbol=function(e,t){var i=Array.prototype.slice.call(arguments),n=function(){this._addSymbol.apply(this,i)}.bind(this);this._options.isSymbolAvailable(e).then(function(e){e&&n()})},n.prototype.updateActions=function(){function e(){var e,t,i=studyTemplates.plainList("custom"),n=studyTemplates.plainList("default");l.applyStudyTemplate.subActions||(l.applyStudyTemplate.subActions=[]),e=l.applyStudyTemplate.subActions,e.splice(0,e.length),t=new T({text:$.t("Save Indicator Template As..."),statName:"Save"}),t.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDialog),e.push(t,new x),i.length||n.length?(i.length&&($.each(i,function(t,i){function n(e){return function(){return studyTemplates.deleteStudyTemplate(e),this._parentMenu._parentMenuItem._parentMenu.destroy(),!1}}var o=new T({text:i,statName:"SetStudyTemplate"});o.callbacks().subscribe(studyTemplates,function(){this.applyTemplate(i)}),o.deleteButton={action:n(o.text)},e.push(o)}),n.length&&e.push(new x)),$.each(n,function(t,i){var n=new T({text:i,statName:"SetStudyTemplateFromDefaults"});n.callbacks().subscribe(studyTemplates,function(){this.applyTemplate(i)}),
e.push(n)})):e.push(new T({text:window.t("No study templates saved"),enabled:!1}))}var t,i,n,o,r,s,a,l=this.actions(),c=this._model.dataSources(),h=!1,u=!1;for(t=0,i=c.length;t<i;t++)n=c[t],TradingView.isInherited(n.constructor,b)&&n.isUserDeletable()&&(h=!0),TradingView.isInherited(n.constructor,v)&&n.removeByRemoveAllStudies()&&(u=!0),TradingView.isInherited(n.constructor,S)&&(u=!0);this._readOnly||(l.paneRemoveAllStudies&&l.paneRemoveAllStudies.setEnabled(u),l.paneRemoveAllDrawingTools&&l.paneRemoveAllDrawingTools.setEnabled(h),l.paneRemoveAllStudiesDrawingTools&&l.paneRemoveAllStudiesDrawingTools.setEnabled(u||h)),window.studyTemplates&&(e(),studyTemplates.refreshStudyTemplateList(e)),o=this,r=[],s=j,a=function(e){return e.id===o.model().model().properties().timezone.value()},s.forEach(function(e){if(!e.separator){var t=new T({text:e.title,checkable:!0,checked:a(e),statName:"SetTimeZone"});t.callbacks().subscribe(this,function(){o.model().setProperty(o.model().model().properties().timezone,e.id,"Changed Time Zone")}),r.push(t)}},this),l.applyTimeZone.subActions=r,l.addToWatchlist&&(l.addToWatchlist.text=window.t("Add {0} to Watchlist").format(this.getSymbol(!0))),l.addToTextNotes&&(l.addToTextNotes.text=window.t("Add Text Note for {0}").format(this.getSymbol(!0))),this.updateActionForIntradayOnly(l.sessionBreaks)},n.prototype.actions=function(){return this._actions||this._setActions(),this._actions},n.prototype._setActions=function(){var e,t,i,o,r,s,a,l,c,h,u,d,m,g,v,S,b,w,P,L,I,k,E,M,V,F,W,H,j,z,U,q,$,Y,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se,ae,le,ce,he,ue,de,pe,_e,fe=this,me=[];if(!this._readOnly){for(me=[new T({text:window.t("Eraser"),callbackContext:"eraser",statName:"Eraser"}),new x,new T({text:window.t("Trend Line"),callbackContext:"LineToolTrendLine",statName:"LineToolTrendLine"}),new T({text:window.t("Horizontal Line"),callbackContext:"LineToolHorzLine",statName:"LineToolHorzLine"}),new T({text:window.t("Vertical Line"),callbackContext:"LineToolVertLine",statName:"LineToolVertLine"}),new T({text:window.t("Arrow"),callbackContext:"LineToolArrow",statName:"LineToolArrow"}),new T({text:window.t("Ray"),callbackContext:"LineToolRay",statName:"LineToolRay"}),new T({text:window.t("Extended"),callbackContext:"LineToolExtended",statName:"LineToolExtended"}),new T({text:window.t("Parallel Channel"),callbackContext:"LineToolParallelChannel",statName:"LineToolParallelChannel"}),new x,new T({text:window.t("Pitchfork"),callbackContext:"LineToolPitchfork",statName:"LineToolPitchfork"}),new T({text:window.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork",statName:"LineToolSchiffPitchfork"}),new T({text:window.t("Pitchfan"),callbackContext:"LineToolPitchfan",statName:"LineToolPitchfan"}),new T({text:window.t("Gann Square"),callbackContext:"LineToolGannSquare",statName:"LineToolGannSquare"}),new T({text:window.t("Gann Fan"),callbackContext:"LineToolGannFan",statName:"LineToolGannFan"}),new T({text:window.t("Fib Retracement"),callbackContext:"LineToolFibRetracement",statName:"LineToolFibRetracement"}),new T({
text:window.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension",statName:"LineToolTrendBasedFibExtension"}),new T({text:window.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan",statName:"LineToolFibSpeedResistanceFan"}),new T({text:window.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone",statName:"LineToolFibTimeZone"}),new T({text:window.t("Circle Lines"),callbackContext:"LineToolCircleLines",statName:"LineToolCircleLines"}),new T({text:window.t("Fib Circles"),callbackContext:"LineToolFibCircles",statName:"LineToolFibCircles"}),new T({text:window.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs",statName:"LineToolFibSpeedResistanceArcs"}),new x,new T({text:window.t("Rectangle"),callbackContext:"LineToolRectangle",statName:"LineToolRectangle"}),new T({text:window.t("Ellipse"),callbackContext:"LineToolEllipse",statName:"LineToolEllipse"}),new T({text:window.t("Triangle"),callbackContext:"LineToolTriangle",statName:"LineToolTriangle"}),new T({text:window.t("Polyline"),callbackContext:"LineToolPolyline",statName:"LineToolPolyline"}),new T({text:window.t("Arc"),callbackContext:"LineToolArc",statName:"LineToolArc"}),new x,new T({text:window.t("Text",{context:"tool"}),callbackContext:"LineToolText",statName:"LineToolText"}),new T({text:window.t("Anchored Text"),callbackContext:"LineToolTextAbsolute",statName:"LineToolTextAbsolute"}),new T({text:window.t("Balloon"),callbackContext:"LineToolBalloon",statName:"LineToolBalloon"}),new T({text:window.t("Price Label"),callbackContext:"LineToolPriceLabel",statName:"LineToolPriceLabel"}),new x,new T({text:window.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette",statName:"LineToolElliottSubminuette"}),new T({text:window.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor",statName:"LineToolElliottMinor"}),new T({text:window.t("Elliott Wave Circle"),callbackContext:"LineToolElliottCircle",statName:"LineToolElliottCircle"}),new T({text:window.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr",statName:"LineToolElliottMinorRetr"}),new T({text:window.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr",statName:"LineToolElliottMajorRetr"}),new x,new T({text:window.t("Brush"),callbackContext:"LineToolBrush",statName:"LineToolBrush"}),new x,new T({text:window.t("Forecast"),callbackContext:"LineToolPrediction",statName:"LineToolPrediction"})],fe=this,i=function(e){C.tool.setValue(e.callbackContext())},o=0;o<me.length;o++)me[o].callbacks().subscribe(null,i);e=new T({text:window.t("Scales Properties..."),statName:"ScalesProperties"}),t=new T({text:window.t("Timezone/Sessions Properties..."),statName:"TimezoneSessionsProperties"})}r=new T({text:window.t("Reset Chart"),shortcut:"Alt+R",statName:"ResetChart"}),r.callbacks().subscribe(this,this.GUIResetScales),s=new T({text:window.t("Undo"),shortcut:"ctrl+z"}),s.callbacks().subscribe(null,function(){G("GUI","Undo"),fe._model.undoHistory.undo()}),s.disable(),a=new T({
text:window.t("Redo"),shortcut:"ctrl+y"}),a.callbacks().subscribe(null,function(){G("GUI","Redo"),fe._model.undoHistory.redo()}),a.disable(),fe.withModel(null,function(){fe._model.undoHistory.undoStack().onChange().subscribe(fe,fe.updateUndoRedo),fe._model.undoHistory.redoStack().onChange().subscribe(fe,fe.updateUndoRedo)}),l=new T({text:window.t("Loading")}),c=[l],h=new T({text:window.t("Color Theme"),subActions:c,statName:"ColorTheme"}),u=new T({text:window.t("TimeZone"),statName:"TimeZone"}),d=new T({text:window.t("Change Symbol..."),shortcut:window.t("Any Symbol"),doNotBindShortcut:!0,statName:"ChangeSymbol"}),TVSettings.setValue("symboledit.dialog_last_entry",""),d.callbacks().subscribe(this,function(){N({callback:this.setSymbol.bind(this),ownerDocument:this._jqParent.prop("ownerDocument")})}),m=new T({text:window.t("Change Interval..."),shortcut:window.t("Any Number"),doNotBindShortcut:!0,statName:"ChangeInterval"}),m.callbacks().subscribe(this,function(){B({callback:function(e){A(e),R.interval.setValue(e)},ownerDocument:this._jqParent.prop("ownerDocument")})}),TradingView.onWidget()||(this._options.addToWatchlistEnabled&&(g=new T({text:window.t("Add To Watchlist"),shortcut:"Alt+W",statName:"AddToWatchlist"}),g.callbacks().subscribe(this,function(){var e,t,i;if(window.widgetbar){for(e=window.widgetbar.setPage("base"),i=0;i<e.widgets.length;i++)if("watchlist"===e.widgets[i].type){t=e.widgets[i].widgetObject;break}if(!t)return;t.addHighlight(this.getSymbol())}})),_("text_notes")&&(v=new T({text:window.t("Add To Text Notes"),shortcut:"Alt+N",statName:"AddToTextNotes"}),v.callbacks().subscribe(this,function(){var e=this;runOrSignIn(function(){TradingView.bottomWidgetBar&&(TradingView.bottomWidgetBar.toggleWidget("text_notes",!0),TradingView.bottomWidgetBar._widgets.text_notes.addNote(null,e.getSymbol(!0),e.getSymbol()))},{source:"Add text note in chart context menu"})}))),S=new T({text:window.t("Insert Study Template"),statName:"InserStudyTemplate"}),b=new T({shortcut:"Ctrl+Alt+Q",text:window.t("Reset Scale"),statName:"ResetScale"}),b.callbacks().subscribe(null,function(e){fe.model().resetTimeScale()}),w=new T({text:window.t("Insert Drawing Tool"),subActions:me,statName:"InsertDravingTool"}),P=new T({text:window.t("Remove All Indicators"),statName:"RemoveAllIndicators"}),L=new T({text:window.t("Remove All Drawing Tools"),statName:"RemoveAllDrawingTools"}),I=new T({text:window.t("All Indicators And Drawing Tools"),statName:"RemoveAllIndicatorsAndDrawingTools"}),k=new T({text:window.t("Insert Indicator..."),shortcut:"/",statName:"InsertIndicator"}),E=new T({text:window.t("Script Editor..."),statName:"ScriptEditor"}),M=new T({text:window.t("Compare or Add Symbol..."),statName:"CompareOrAddSymbol"}),V=new T({text:window.t("Compare..."),statName:"Compare"}),F=new T({text:window.t("Objects Tree..."),statName:"ObjectsTree"}),W=new T({text:window.t("Properties..."),statName:"ChartProperties",callback:function(e,t){fe.showChartProperties()}}),H=new T({text:window.t("Lock/Unlock"),statName:"ToggleLockSelectedObject"}),
H.callbacks().subscribe(this,n.prototype.toggleLockSelectedObject),j=new T({text:window.t("Hide"),statName:"HideSelectedObject"}),j.callbacks().subscribe(this,n.prototype.hideSelectedObject),p.enabled("property_pages")&&(z=new T({text:window.t("Format..."),statName:"EditSelectedObject"}),z.callbacks().subscribe(this,n.prototype.editSelectedObject)),U=new T({text:window.t("Source Code..."),statName:"OpenSelectedObjectSource"}),U.callbacks().subscribe(this,this.openSelectedObjectSource),q=new T({text:window.t("Left Axis"),checkable:!0,statName:"ToggleLeftAxis"}),q.binder=new f(q,this._properties.scalesProperties.showLeftScale,this.model(),window.t("Show Left Scale")),$=new T({text:window.t("Right Axis"),checkable:!0,statName:"ToggleRightAxis"}),$.binder=new f($,this._properties.scalesProperties.showRightScale,this.model(),window.t("Show Right Scale")),this._properties.scalesProperties.showLeftScale.listeners().subscribe(this,n.prototype._updateScalesActions),this._properties.scalesProperties.showRightScale.listeners().subscribe(this,n.prototype._updateScalesActions),Y=new T({text:window.t("Scale Price Chart Only"),checkable:!0,statName:"ScalePriceChartOnly"}),Y.binder=new f(Y,this._properties.scalesProperties.scaleSeriesOnly,this.model(),window.t("Scale Price Chart Only")),K=this.model().model(),this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){K.recalculateAllPanes(),K.invalidate(new O(O.FULL_UPDATE))}),Z=new T({text:window.t("Drawings Toolbar"),checkable:!0,statName:"ToggleDrawingToolbar"}),J=this._options.isDrawingToolbarVisible,J&&(J.subscribe(function(e){Z.setChecked(e)},{callWithLast:!0}),Z.callbacks().subscribe(null,function(){J.setValue(!J.value())})),X=new T({text:window.t("Magnet Mode"),checkable:!0,statName:"ToggleMagnetMode"}),X.binder=new f(X,C.properties().magnet,this.model(),"Magnet"),Q=new T({text:window.t("Stay in Drawing Mode"),checkable:!0,statName:"ToggleStayInDrawingMode"}),Q.binder=new f(Q,C.properties().stayInDrawingMode,this.model(),window.t("Stay In Drawing Mode")),ee=new T({text:window.t("Sync drawings to all charts"),checkable:!0,statName:"ToggleSyncDrawings"}),ee.binder=new f(ee,C.properties().drawOnAllCharts,this.model(),"SyncDrawings"),te=new T({text:window.t("Lock All Drawing Tools"),checkable:!0,statName:"ToggleLockDrawings"}),te.binder=new f(te,C.lockDrawings(),this.model(),window.t("Lock drawings"),function(e){e||this.binder.setValue(!this.binder.value()),C.lockDrawings().setValue(this.binder.value())}.bind(te)),ie=new T({text:window.t("Hide All Drawing Tools"),checkable:!0,statName:"ToggleHideAllDrawingTools"}),ie.binder=new f(ie,C.hideAllDrawings(),this.model(),window.t("Hide All Drawing Tools"),function(e){e||this.binder.setValue(!this.binder.value()),C.hideAllDrawings().setValue(this.binder.value())}.bind(ie)),ne=new T({text:window.t("Hide Marks On Bars"),checkable:!0,statName:"ToggleHideMarksOnBars"}),ne.binder=new f(ne,C.hideMarksOnBars(),this.model(),window.t("Hide Marks On Bars"),function(e){e||this.binder.setValue(!this.binder.value()),
C.hideMarksOnBars().setValue(this.binder.value())}.bind(ne)),oe=new T({text:window.t("Extended Hours"),checkable:!0,statName:"ToggleExtendedHours"}),oe.binder=new f(oe,this.model().mainSeries().properties().extendedHours,this.model(),window.t("Change Extended Hours")),re=new T({text:window.t("Symbol Last Value"),checkable:!0,checked:!1,statName:"ToggleSymbolLastValue"}),re.binder=new f(re,this.properties().scalesProperties.showSeriesLastValue,this.model(),window.t("Show Symbol Last Value")),se=new T({text:window.t("Symbol Labels"),checkable:!0,checked:!1,statName:"ToggleSymbolLabels"}),se.binding=new f(se,this.properties().scalesProperties.showSymbolLabels,this.model(),"Undo Show Symbol Labels"),ae=new T({text:window.t("Indicator Last Value"),checkable:!0,checked:!1,statName:"ToggleStudyLastValue"}),ae.binder=new f(ae,this.properties().scalesProperties.showStudyLastValue,this.model(),window.t("Show Indicator Last Value")),le=new T({text:window.t("Indicator Labels"),checkable:!0,checked:!1,statName:"ToggleIndicatorsLabels"}),le.binding=new f(le,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels"),ce=new T({text:window.t("Countdown"),checkable:!0,checked:!1,statName:"ToggleCountdown"}),ce.binder=new f(ce,this.model().mainSeries().properties().showCountdown,this.model(),window.t("Show Countdown")),he=null,this._options.goToDateEnabled&&(he=new T({text:window.t("Go to Date..."),shortcut:"Alt+G",statName:"GoToDate"}),he.callbacks().subscribe(null,function(){var e=fe._chartWidgetCollection.activeChartWidget.value();y(e.model())})),ue=new T({text:window.t("Symbol Info..."),checkable:!1,statName:"SymbolInfo"}),ue.callbacks().subscribe(null,function(){var e=fe.model().mainSeries().symbol(),t=fe.model().mainSeries().symbolInfo();D(e,{symbolInfo:t})}),this._actions={chartProperties:W,timeScaleReset:b,chartReset:r,compareOrAdd:M,compare:V,paneObjectTree:F,insertIndicator:k,insertDrawingTool:w,applyColorTheme:h,applyStudyTemplate:S,symbolSearch:d,showSymbolInfoDialog:ue,changeInterval:m,seriesHide:j,studyHide:j,lineToggleLock:H,lineHide:j,showLeftAxis:q,showRightAxis:$,scaleSeriesOnly:Y,drawingToolbarAction:Z,magnetAction:X,stayInDrawingModeAction:Q,syncModeAction:ee,lockDrawingsAction:te,hideAllDrawingsAction:ie,hideAllMarks:ne,applyTimeZone:u,extendedHours:oe,showCountdown:ce,showSeriesLastValue:re,showSymbolLabelsAction:se,showStudyLastValue:ae,showStudyPlotNamesAction:le,undo:s,redo:a,viewSourceCode:U},e&&(this._actions.scalesProperties=e),t&&(this._actions.tmzProperties=t),g&&(this._actions.addToWatchlist=g),!TradingView.onWidget()&&p.enabled("text_notes")&&_("text_notes")&&(this._actions.addToTextNotes=v),null!==he&&(this._actions.gotoDate=he),p.enabled("charting_library_base")||(this._actions.scriptEditor=E),this.createSessionBreaksActions(),this.readOnly()||(de=new T({text:window.t("Remove"),shortcut:"Del",statName:"RemoveSelectedObject"}),de.callbacks().subscribe(this,function(){var e;this._chartWidgetCollection&&(e=this._chartWidgetCollection.activeChartWidget.value()),
e||(e=this),e.removeSelectedSource()}),pe=new T({text:window.t("Stop syncing drawing"),statName:"StopSyncingDrawing"}),pe.callbacks().subscribe(this,function(){var e;this._chartWidgetCollection&&(e=this._chartWidgetCollection.activeChartWidget.value()),e||(e=this),e.unlinkSelectedLine()}),_e=new T({text:window.t("Sync drawing to all charts"),statName:"SyncDrawingToAllCharts"}),_e.callbacks().subscribe(this,function(){var e;this._chartWidgetCollection&&(e=this._chartWidgetCollection.activeChartWidget.value()),e||(e=this),e.copyLineToOtherCharts()}),this._actions.insertDrawingTool=w,this._actions.paneRemoveAllStudies=P,this._actions.paneRemoveAllDrawingTools=L,this._actions.paneRemoveAllStudiesDrawingTools=I,this._actions.seriesRemove=de,this._actions.studyRemove=de,this._actions.lineRemove=de,this._actions.lineUnlink=pe,this._actions.lineCopyToCharts=_e,p.enabled("property_pages")&&(this._actions.format=z),this._actions.lockDrawingsAction=te,this._actions.hideAllDrawingsAction=ie,this._actions.hideAllMarks=ne,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,n.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,n.prototype.removeAllDrawingTools),this._actions.paneRemoveAllStudiesDrawingTools.callbacks().subscribe(this,n.prototype.removeAllStudiesDrawingTools)),this._actions.paneObjectTree.callbacks().subscribe(this,n.prototype.showObjectsTreeDialog),this._actions.chartProperties.callbacks().subscribe(this,n.prototype.showChartProperties),this._actions.insertIndicator.callbacks().subscribe(this,n.prototype.showIndicators),this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,n.prototype.showScriptEditor),this._actions.compareOrAdd.callbacks().subscribe(this,n.prototype.showCompareOrAdd),this._actions.compare.callbacks().subscribe(this,n.prototype.showCompareOrAdd),this._actions.scalesProperties&&this._actions.scalesProperties.callbacks().subscribe(this,n.prototype.showScalesProperties),this._actions.tmzProperties&&this._actions.tmzProperties.callbacks().subscribe(this,n.prototype.showTimezoneProperties),this._updateScalesActions()},n.prototype.executeActionById=function(e){if("takeScreenshot"===e)return console.warn('Action "takeScreenshot" is deprecated. Use method "takeScreenshot" instead'),void this._chartWidgetCollection.takeScreenshot();if("lockDrawingsAction"===e&&console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),"hideAllDrawingsAction"===e&&console.warn('Action "hideAllDrawingsAction" is deprecated. Use method "hideAllDrawingTools" instead'),e in this._actions){var t=this._actions[e];t.checkable&&t.setChecked(!t.checked),this._actions[e].callbacks().fire(t)}else console.warn("Unknown action id: "+e)},n.prototype.getCheckableActionState=function(e){if("lockDrawingsAction"===e)return console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),null
;if("hideAllDrawingsAction"===e)return console.warn('Action "hideAllDrawingsAction" is deprecated. Use method "hideAllDrawingTools" instead'),null;if(e in this._actions){var t=this._actions[e];if(t.checkable)return t.checked;console.warn("Action "+e+" has no state")}else console.warn("Unknown action id: "+e);return null},n.prototype._updateScalesActions=function(){if(this._actions){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility()}},n.prototype.removeAllStudies=function(){this._model.removeAllStudies()},n.prototype.removeAllDrawingTools=function(){this._model.removeAllDrawingTools()},n.prototype.removeAllStudiesDrawingTools=function(){this._model.removeAllStudies(),this._model.removeAllDrawingTools()},n.prototype.model=function(){return this._model},n.prototype.defaultSymbol=function(){return this._defSymbol},n.prototype.connect=function(){this._handler=function(e){this._onData(e)}.bind(this),this._boundOnChartSessionIsConnectedChanged=this._onChartSessionIsConnectedChanged.bind(this),this._chartSession.isConnected().subscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.criticalError().subscribe(this,this._onChartSessionCriticalError),this._chartSession.connect(this._handler)},n.prototype.finishInitWithoutConnect=function(){this._chartSession.disable(),this._init(),this.chartWidgetInitialized.fire()},n.prototype.reconnect=function(){this._chartSession.disconnect(),this._chartSession.connect()},n.prototype.update=function(){if(this._model){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].update();this._timeAxisWidget.update()}},n.prototype.paint=function(e){e||(e=new O(O.FULL_UPDATE));for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].paint(e.invalidateForPane(t),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(e.fullInvalidation()),this._redrawPanes.fire()},n.prototype._makeDefaultGui=function(){this._makeChartWidget(),this._makeLoadingScreen(),this._model&&this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),this._adjustSize(),this._updateScalesActions(),$(this._elMainTable).selectable(!1),this.update(),this.paint()},n.prototype.widget=function(){return this._jqMainDiv},n.prototype.restoreState=function(e,t){this._adjustSize();this._model.restoreState(this._content,t);this._setActions()},n.prototype.redrawPanes=function(e){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].paint();this._redrawPanes.fire()},n.prototype.setBackgroundColor=function(e){this.scaleBackgroundColor=e.value();for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].paint(),this._paneWidgets[t].setCursorForTool();this.update(),this.paint()},n.prototype.setScaleLineColor=function(e){this.scaleLineColor=e.value(),$.each(this._paneSeparators,function(){this.update()}),this.update(),this.paint()},n.prototype.setScaleTextColor=function(e){this.scaleTextColor=e.value(),this.update(),this.paint()},n.prototype.setTimingsMeter=function(e){this._timingsMeter=e,
this._updateTimingsMeterState()},n.prototype._updateTimingsMeterState=function(){var e=this._options.visible.value();null!==this._timingsMeter&&(e?this._timingsMeter.startCollect():this._timingsMeter.stopCollect())},n.prototype._update=function(e){var t,i=e?e.fullInvalidation():O.FULL_UPDATE;if(null!==this._timingsMeter&&this._timingsMeter.startDraw(i),i===O.FULL_UPDATE){for(this._model?this._updateGui():this._adjustSize(),this._timeAxisWidget.update(),t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t]._state=this._model.panes()[t],null!==this._paneWidgets[t].statusWidget()&&this._paneWidgets[t].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.fullUpdate()}else if(i===O.LIGHT_UPDATE){for(this._timeAxisWidget.update(),t=0;t<this._paneWidgets.length;t++)null!==this._paneWidgets[t].statusWidget()&&this._paneWidgets[t].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(i===O.UPDATE_CURSOR_ONLY){for(t=0;t<this._paneWidgets.length;t++)null!==this._paneWidgets[t].statusWidget()&&this._paneWidgets[t].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}this.paint(e),null!==this._timingsMeter&&this._timingsMeter.stopDraw()},n.prototype._createVolumeIfNeeded=function(){var e=p.enabled("create_volume_indicator_by_default")&&this._options.addVolume,t=!this._content,i=p.enabled("charting_library_base"),n=p.enabled("create_volume_indicator_by_default_once"),o=this._content&&!this._content.loading;e&&(t||i&&o&&!n)&&this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,function(){var e=this;setTimeout(function(){var t,i,n,o,r=e._model.model().mainSeries().symbolInfo();r&&(t=!r.has_no_volume,!e.containsVolume()&&t?(i=ee.factoryDefaults("chartproperties.volumePaneSize"),n={paneSize:i},p.enabled("hide_volume_ma")&&(n.styles={vol_ma:{visible:!1}}),e.insertStudy("Volume@tv-basicstudies",!1,p.enabled("volume_force_overlay"),void 0,n)):!t&&e.containsVolume()&&(o=e.model().dataSources().filter(function(e){return e instanceof v&&"Volume"===e.metaInfo().shortId})[0],e._model.model().removeSource(o)))},0)},n)},n.prototype._makeDefaultModel=function(){function e(){var e={readOnly:c.readOnly(),isSnapshot:!!c._containsData,timeScale:c._options.timeScale};return void 0!==c._options.watermarkEnabled&&(e.watermarkEnabled=c._options.watermarkEnabled),void 0!==c._options.crossHairMenuEnabled&&(e.crossHairMenuEnabled=c._options.crossHairMenuEnabled),l(c._chartSession,function(e){if(!(e instanceof O))throw Error("Invalid mask");c._invalidateMask?c._invalidateMask.merge(e):c._invalidateMask=e,c._draw_planned||(c._draw_planned=!0,c._options.visible.when(function(){var e=!document.hidden,i=c.screen&&c.screen.isShown();null!==c._timingsMeter&&e&&!i&&c._timingsMeter.startWaitingDraw(),c._drawRafId=c._jqParent.prop("ownerDocument").defaultView.requestAnimationFrame(t)}))},c._properties,o,c._metaInfoRepository,c,c._options.undoHistory,c._options.barsMarksContainersFactory,e)}function t(){c._draw_planned=!1,c._drawRafId=0,
c._inLoadingState||c._invalidateMask&&(c._invalidateMask=c._update(c._invalidateMask))}var i,o,r,s,a,c=this;if(this._content&&this._content.timeScale.points&&(i=this._content.timeScale.points.items[0],o={startDate:i}),!this._metaInfoRepository.getInternalMetaInfoArray())throw Error("Cannot create chart model: studies metainfo is absent");if(p.enabled("lean_chart_load")?this._model=this._model||e():this._model=e(),this._createVolumeIfNeeded(),r=function(){var e,t;this._model.onTagsChanged().subscribe(this,n.prototype.onModelTagsChanged),this._updateGui(),this._modelCreated.fire(this._model),this._tagsChanged.fire(),e=this._model.mainSeries(),this._defTimeframe&&e.setDefaultTimeframe(this._defTimeframe),this._model.lineCancelled().subscribe(this,this.onLineCancelled),e.dataEvents().symbolNotPermitted().subscribe(null,function(t){e.properties().symbol.setValue(t)}),e.properties().style.unsubscribe(this,this._onChartStyleChanged),e.properties().style.subscribe(this,this._onChartStyleChanged),e.dataEvents().completed().subscribe(this,function(){this._addPerfMark("SeriesCompleted")},!0),e.dataEvents().barReceived().subscribe(this,function(){this._addPerfMark("SeriesFirstDataReceived")},!0),t=this._options,t.handleSessionErrors&&(e.dataEvents().chartTypeNotPermitted().subscribe(null,function(){e.properties().interval.setValue("D")}),e.dataEvents().intradaySpreadNotPermitted().subscribe(null,function(){e.properties().interval.setValue("D")}),e.dataEvents().customIntervalNotPermitted().subscribe(null,function(){e.properties().interval.setValue(k(M(e.properties().style.value())))}),e.dataEvents().intradayExchangeNotPermitted().subscribe(null,function(){e.properties().interval.setValue("D")}),c._options.muteSessionErrors||e.dataEvents().extendedHoursNotPermitted().subscribe(null,function(){})),this._options.handleSessionErrors&&(e.requestingIntradayWhenNotSupported.subscribe(null,function(){e.properties().interval.setValue("D"),c._options.muteSessionErrors}),e.requestingResolutionWhenNotSupported.subscribe(null,function(t){e.properties().interval.setValue(t)}))}.bind(this),this._content){if(this.restoreState(this._content,this._containsData),p.enabled("chart_content_overrides_by_defaults"))return this._defSymbol&&(s=this.setSymbol(this._defSymbol),this.model().model().setPriceAutoScaleForAllMainSources()),a=function(){return this._defInterval&&this.setResolution(this._defInterval),void 0!==this._defStyle&&this.setSeriesStyle(this._model.mainSeries(),this._defStyle),r()}.bind(this),void 0===s?a():s.then(a)}else this._setActions();return r()},n.prototype._onChartStyleChanged=function(){G("Chart","Chart Style "+this._model.mainSeries().getStyleShortName().toUpperCase())},n.prototype._updateGui=function(){this._model&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$(this._elMainTable).selectable(!1),this._adjustSize())},n.prototype.setVisibleTimeRange=function(e,t,i){this._chartSession.setVisibleTimeRange(this._model.mainSeries(),e,t,i)},n.prototype._makeChartWidget=function(){},
n.prototype._makeLoadingScreen=function(){if(p.enabled("lean_chart_load")){if(this.screen)return;this.screen=new n.LoadingScreen(this,this._jqParent)}else this.screen=new n.LoadingScreen(this,this._jqMainDiv)},n.prototype._setSymbol=function(e,t){if(this._model){var i=this._model.mainSeries();if(!t&&i.symbolSameAsCurrent(e)&&!p.enabled("same_data_requery"))return;this._model.setSelectedSource(null),this._model.setScreenChartProperty(i.properties().symbol,e,this,"Change Symbol",p.enabled("same_data_requery"))}else this._properties.mainSeriesProperties.merge({symbol:e})},n.prototype.setSymbol=function(e,t){return this._setSymbol.apply(this,arguments)},n.prototype.getSymbol=function(e){var t;return t=this._model?this._model.mainSeries().properties():this._properties.mainSeriesProperties,t?e&&t.shortName&&t.shortName.value()?t.shortName.value():t.symbol.value():""},n.LoadingScreen=function(e,t){this._cw=e,this.$element=$('<div class="chart-loading-screen">'),this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element),this.$element.appendTo(t),this._showed=!1,this._cw.withModel(this,this._connectToModel)},n.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().dataEvents().messageReceived().subscribe(this,function(e){switch(e.method){case"symbol_error":e.params[1]!==d.PERMISSION_DENIED&&this.hide();break;case"series_error":p.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}})},n.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0,this._showed||(this._showed=!0,this._show())},n.LoadingScreen.prototype._show=function(){var e=this._cw.properties().paneProperties.background.value();this.$shield.css("background",e),this.$element.addClass("fade")},n.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState,this._showed&&this._hide()},n.LoadingScreen.prototype._hide=function(){this._showed=!1,this.$element.removeClass("fade")},n.LoadingScreen.prototype.$canvas=null,n.LoadingScreen.prototype.context=null,n.LoadingScreen.prototype.isShown=function(){return this._showed},n.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},n.prototype.setActivePaneWidget=function(e){this.activePaneWidget=e},n.prototype.isMaximizedPane=function(){return!!this._maximizedPaneWidget},n.prototype.toggleMaximizePane=function(e){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,this._paneSeparators.forEach(function(e){e.show()})):(this._maximizedPaneWidget=e,this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach(function(e){e.hide()}));for(var t=this._paneWidgets.length;t--;)this._paneWidgets[t].updateControls();this._adjustSize(),this.updateIndicatorImagePosition(),this._updateCrossHairPositionIfNeeded()}},n.prototype._makePaneWidgetsAndSeparators=function(){var e,t,i,n,o=this._model.panes(),r=o.length,l=this._paneWidgets.length;for(e=r;e<l;e++)t=this._paneWidgets.pop(),t.destroy(),
(i=this._paneSeparators.pop())&&i.destroy();for(e=l;e<r;e++)t=new s(this,o[e],{contextMenuEnabled:this._options.paneContextMenuEnabled,verticalTouchScroll:this._options.verticalTouchScroll,priceScaleContextMenuEnabled:this._options.priceScaleContextMenuEnabled,symbolMarkerEnabled:this._options.symbolMarkerEnabled,legendWidgetEnabled:this._options.legendWidgetEnabled,legendWidget:this._options.legendWidget,propertyPagesEnabled:this._options.propertyPagesEnabled,sourceSelectionEnabled:this._options.sourceSelectionEnabled}),t.onMouseLeave=this.unsetActivePaneWidget.bind(this),t.onMouseEnter=this.setActivePaneWidget.bind(this),this._paneWidgets.push(t),e>0&&(i=new a(this,e-1,e),this._paneSeparators.push(i),this._timeAxisWidget?i.jqRow.insertBefore(this._timeAxisWidget.jqRow):i.jqRow.appendTo(this._elMainTable)),this._timeAxisWidget?t.jqRow.insertBefore(this._timeAxisWidget.jqRow):t.jqRow.appendTo(this._elMainTable);for(e=0;e<r;e++)n=o[e],t=this._paneWidgets[e],t.state()!==n&&t.setState(n);for(e=r;e--;)this._paneWidgets[e].updateControls()},n.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new h(this,this._options.timeScaleWidget),this._timeAxisWidget.jqRow.appendTo(this._elMainTable))},n.prototype.insertStudyOrShowDialog=function(e,t,n){var o,r,s,a;this.isSymbolicStudy(e)?(o=ee.defaults("study_"+e.id).description,r=this.model(),i.e(19).then(function(s){(0,i(818).showConfirmSymbolInputDialog)(function(i){var n={inputs:{}};n.inputs[e.symbolInputId()]=i,r.insertStudy(e,n,!1,t)},o,n)}.bind(null,i)).catch(i.oe)):this.hasConfirmInputs(e)?(o=ee.defaults("study_"+e.id).description,i.e(16).then(function(){i(695).show(this,e,{title:o,callback:function(i){this.model().insertStudy(e,i,!1,t)}.bind(this)})}.bind(this).bind(null,i)).catch(i.oe)):v.isPointsBasedStudy(e.id)?(s=v.lineToolNameForPointsBasedStudy(e.id),C.tool.setValue(s)):(a="Volume@tv-basicstudies"===e.id,this.insertStudy(e.id,!0,a,null,null,t))},n.prototype.hasConfirmInputs=function(e){var t,i,n=e.inputs;if(void 0===n)return!1;for(t=0;t<n.length;++t)if(i=n[t],void 0!==i.confirm&&i.confirm)return!0;return!1},n.prototype.isSymbolicStudy=function(e){switch(e.id){case"Overlay@tv-basicstudies":case"CorrelationCoefficient@tv-basicstudies":case"Correlation Coeff@tv-basicstudies":return!0;default:return!1}},n.prototype.isPointsBasedStudy=function(e){return v.isPointsBasedStudy(e.id)},n.prototype.insertStudy=function(e,t,i,n,o,s){var a,l=q.findStudyMetaInfo(this._metaInfoRepository.getInternalMetaInfoArray(),e);l=TradingView.clone(l),r(!l.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!"),a=n?{inputs:n}:{},o&&(a=$.extend(a,o)),t?this._model.insertStudy(l,a,i,s):this._model.model().insertStudy(l,a,i,s)},n.prototype.insertStudyStub=function(e){return this.model().insertStudyStub(e)},n.prototype.removeStudyStub=function(e){return this.model().removeStudyStub(e)},n.prototype.getPriceAxisMaxWidthByName=function(e){return"left"===e?this.maxLhsPriceAxisWidth:this.maxRhsPriceAxisWidth},n.prototype.getPriceAxisWidthChangedByName=function(e){
return"left"===e?this.lhsPriceAxisWidthChanged:this.rhsPriceAxisWidthChanged},n.prototype._adjustSize=function(){var e,t,i,n,o,r,s,l,h=this,u=0,d=0,p=0;$.each(this._paneWidgets,function(){h._maximizedPaneWidget&&h._maximizedPaneWidget!==this||(u=Math.max(this.lhsPriceAxisWidget.optimalWidth(),u),d=Math.max(this.rhsPriceAxisWidget.optimalWidth(),d),p+=this.stretchFactor())}),e=this._width(),t=this._height(),i=e-u-d,n=this._paneSeparators.length,o=a.HEIGHT,r=this._timeAxisWidget.optimalHeight(),s=t-o*n-r,l=s/p,$.each(this._paneWidgets,function(e){h._model&&(this._state=h._model.panes()[e]);var t=h._maximizedPaneWidget?h._maximizedPaneWidget===this?s:0:Math.max(Math.round(this.stretchFactor()*l),2);this.setPriceAxisSize(c.LHS,new Z(u,t)),this.setPriceAxisSize(c.RHS,new Z(d,t)),this.setSize(new Z(i,t)),h._model&&this.state()&&h._model.setPaneHeight(this.state(),t)}),this._timeAxisWidget.setSize(new Z(i,r),new Z(u,r),new Z(d,r)),this._model&&this._model.setWidth(i),this._controlBarNavigation&&this._controlBarNavigation.updatePosition(i),this.maxLhsPriceAxisWidth!==u&&(this.maxLhsPriceAxisWidth=u,this.lhsPriceAxisWidthChanged.fire(u)),this.maxRhsPriceAxisWidth!==d&&(this.maxRhsPriceAxisWidth=d,this.rhsPriceAxisWidthChanged.fire(d))},n.prototype._onChartSessionIsConnectedChanged=function(e){e?this._onConnection():this._onDisconnect()},n.prototype._onChartSessionCriticalError=function(e,t){this._disconnected.fire(!0)},n.prototype._onData=function(e){switch(e.method){case"reconnect_bailout":this._reconnectBailout.fire();break;default:this._model.onData(e)}},n.prototype._onConnection=function(){this._online=!0,this._model?(this._model.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):this.requestMetadata()},n.prototype._onDisconnect=function(){this._model&&this._model.disconnect(),this._online=!1,this.update(),this.paint(),this._disconnected.fire()},n.prototype._applyStudiesOverrides=function(){q.overrideDefaults(this._metaInfoRepository.getInternalMetaInfoArray())},n.prototype.requestMetadata=function(){this._addPerfMark("RequestMetadataStart"),this._metaInfoRepository.requestMetaInfo().then(function(){this._addPerfMark("RequestMetadataEnd"),this._inited?this.model().model().setStudiesMetaData(this._metaInfoRepository.getInternalMetaInfoArray(),this._metaInfoRepository.getMigrations()):(this._init(),this.chartWidgetInitialized.fire(),p.enabled("charting_library_base")||te.logDebug("initialized"))}.bind(this))},n.prototype.studiesMetaData=function(){return this._model.studiesMetaData()},n.prototype.getTimeScale=function(){return this._timeAxisWidget},n.prototype.chartWidgetCollection=function(){return this._chartWidgetCollection},n.prototype.setSeriesStyle=function(e,t){this._model.setProperty(e.properties().style,t)},n.prototype.showObjectsTreeDialog=function(e){var t=this;i.e(8).then(function(n){new(0,i(819).ObjectTreeDialog)({chartWidget:t,activeTab:e},t._model).show()}.bind(null,i)).catch(i.oe)},n.prototype.showChartProperties=function(e){
if(!p.enabled("show_chart_property_page"))return Promise.resolve();e&&e.text===window.t("Properties...")&&TVSettings.setValue("properties_dialog.active_tab.chart",window.t("Style"));var t=this;return new Promise(function(e){m(t._model.mainSeries(),t._model,{doNotCloseOnBgClick:!0}).then(function(t){return e(t.isVisible()?t._dialog:null),t}).then(function(e){if(e.isVisible()){var i=function(){e.hide(),t._chartWidgetCollection.activeChartWidget.unsubscribe(i)};t._chartWidgetCollection.activeChartWidget.subscribe(i)}})})},n.prototype.showScriptEditor=function(){TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab()},n.prototype.showCompareOrAdd=function(){this._chartWidgetCollection.showAddCompareDialog()},n.prototype.showIndicators=function(e){if(window.studyMarket)return window.studyMarket.isVisible()?void window.studyMarket.hide():(window.studyMarket.show(e),window.studyMarket)},n.prototype.showScalesProperties=function(e){m(this._model.mainSeries(),this._model,{selectScales:!0})},n.prototype.showTimezoneProperties=function(){m(this._model.mainSeries(),this._model,{selectTmz:!0})},n.prototype.removeSelectedSource=function(){var e=this,t=e._model.selectedSource();!t||t===e._model.mainSeries()||t===e._model.lineBeingCreated()||t instanceof u||(t.hasAlert.value()&&t.isUserDeletable()?J({type:"modal",content:window.t("This drawing is used in alert. If you remove the drawing, the alert will be also removed. Do you want to remove the drawing anyway?")}).then(function(t){t.on("action:yes",function(t){e._model.removeSelectedSource(),t.close()}),t.open()}):t instanceof v&&t.hasChildren()?showDeleteStudyTreeConfirm(e._model.removeSelectedSource.bind(e._model)):e._model.removeSelectedSource())},n.prototype.unlinkSelectedLine=function(){var e=this._model.selectedSource();e instanceof b&&this._model.unlinkLine(e)},n.prototype.copyLineToOtherCharts=function(){var e=this._model.selectedSource();e instanceof b&&this._model.copyToOtherCharts(e)},n.prototype.hideSelectedObject=function(){var e=this._model.selectedSource();e&&this._model.setProperty(e.properties().visible,!1,"Hide "+e.title())},n.prototype.toggleLockSelectedObject=function(){var e,t=this._model.selectedSource();t&&(e=t.properties().frozen.value(),this._model.setProperty(t.properties().frozen,!e,(e?window.t("Unlock"):window.t("Lock"))+" "+t.title()))},n.prototype.editSelectedObject=function(e){var t=this._model.selectedSource();t&&m(t,this._model)},n.prototype.openSelectedObjectSource=function(e){},n.prototype.resetPriceAxisOptimalWidth=function(e){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(e)}),this._redrawPanes.fire()},n.prototype.adjustPriceAxisWidth=function(e){this.resetPriceAxisOptimalWidth(e),this._adjustSize()},n.prototype.setPriceAxisVisible=function(e,t){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(e,t)}),this._timeAxisWidget.setStubVisible(e,t),this._adjustSize(),this._redrawPanes.fire()},n.prototype.setTimeAxisVisible=function(e){this._timeAxisWidget.setVisible(e),this._adjustSize()},
n.prototype.isTextTool=function(e){switch(e){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":return!0}return!1},n.prototype.tags=function(){return this._model?this._model.calculateDefaultTags():[]},n.prototype.state=function(e,t){return this._model.state(e,t)},n.prototype.asyncState=function(e){return this._model.asyncState(e)},n.prototype.metaInfo=function(){var e=this._metaInfo;return this._model&&(e.systemTags=this._model.calculateDefaultTags()),e},n.prototype.image=function(){var e,t,i,n,o,r,s,a,l,c=document.createElement("canvas"),h=c.getContext("2d"),u=0,d=this._timeAxisWidget.size.h,p=this.properties().scalesProperties.lineColor.value();for(t=0;t<this._paneWidgets.length;t++)(e=this._paneWidgets[t])&&e.state()&&(e.state().recalculate(!0),0===t&&(u=e.lhsPriceAxisWidget.size.w+e.size.w+e.rhsPriceAxisWidget.size.w),d+=e.size.h);for(d+=this._paneWidgets.length-1,this._update(),i=25,n=5,c.width=u+2*n,c.height=d+i+2*n,h.fillStyle="#F2F5F8",h.fillRect(0,0,c.width,c.height),o=i+n,r=n,s=this.mainSeriesQuotesAndMetainfo(),s.ohlc&&(a="{0} O:{1} H:{2} L:{3} C:{4}".format(s.meta.symbol,s.ohlc[0],s.ohlc[1],s.ohlc[2],s.ohlc[3]),h.fillStyle="#000",h.font="12px Verdana, Arial",h.fillText(a,r,n+15)),t=0;t<this._paneWidgets.length;t++)e=this._paneWidgets[t],h.drawImage(e.lhsPriceAxisWidget.canvas,r,o),h.drawImage(e.canvas,r+e.lhsPriceAxisWidget.size.w,o),l=e.statusWidget(),null!==l&&l.renderTo(h,r+5,o+5),h.drawImage(e.rhsPriceAxisWidget.canvas,r+e.lhsPriceAxisWidget.size.w+e.size.w,o),o+=e.size.h,t<this._paneWidgets.length-1&&(h.fillStyle=p,h.fillRect(r,o,u,1),o++);return h.drawImage(this._timeAxisWidget.lhsCanvas,r,o),h.drawImage(this._timeAxisWidget.canvas,r+e.lhsPriceAxisWidget.size.w,o),h.drawImage(this._timeAxisWidget.rhsCanvas,r+e.lhsPriceAxisWidget.size.w+e.size.w,o),h.lineWidth=1,h.strokeStyle="#000",h.strokeRect(n+.5,i+n+.5,u-1,d-1),c},n.prototype.images=function(){function e(e){var t,n,o,r,s,a;for(e.paint(O.LIGHT_UPDATE,i._onWidget),t=e.image(i._onWidget),t.containsMainSeries=e.containsMainSeries(),t.studies=[],n=e.state().dataSources(),o=0;o<n.length;o++)r=n[o],s=i.properties().paneProperties.legendProperties,a=r.statusView(),r instanceof v?r.properties().visible.value()&&a&&s.showStudyTitles.value()&&s.showLegend.value()&&t.studies.push(r.statusView().text()):r instanceof d&&a&&s.showLegend.value()&&s.showSeriesTitle.value()&&(t.mainSeriesText=r.statusView().text());return t}var t,i,n,o,r,s,a;if(TradingView.printing=!0,t=this._model&&this._model.selectedSource(),this._model&&this._model.setSelectedSource(null),i=this,n=[],this.isMaximizedPane())n.push(e(this._maximizedPaneWidget));else for(o=0;o<this._paneWidgets.length;o++)r=this._paneWidgets[o],n.push(e(r)),o<this._paneWidgets.length-1&&n.push(this._paneSeparators[o].image());return s=null,this._timeAxisWidget&&(this._timeAxisWidget.paint(O.LIGHT_UPDATE),s=this._timeAxisWidget.image()),TradingView.printing=!1,this._model&&(this._model.setSelectedSource(t),
this._model.invalidate(new O(O.LIGHT_UPDATE))),a=this.mainSeriesQuotesAndMetainfo(),{panes:n,timeAxis:s,colors:{text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}},n.prototype.mainSeriesQuotesAndMetainfo=function(){var e,t,i,n,o,r,s,a=this._model&&this._model.mainSeries();return a&&(n=function(e){return null==e?"":a.formatter().format(e)+""},o=function(e){return null==e?"":e+""},e={resolution:a.interval(),symbol:a.symbol()},r=a.symbolInfo(),r&&(e.symbol=r.full_name,e.description=r.description,e.exchange=r.exchange),s=a.bars().last(),null!==s&&(t=s.value.slice(1,5).map(n)),a.quoteData&&(i={change:n(a.quoteData.change),changePercent:o(a.quoteData.change_percent),last:n(a.quoteData.last_price)})),{meta:e,ohlc:t,quotes:i}},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()},n.prototype.destroy=function(){var e,t,i;for(0!==this._drawRafId&&this._jqParent.prop("ownerDocument").defaultView.cancelAnimationFrame(this._drawRafId),this._model.model().destroy(),null!==this._timingsMeter&&(this._timingsMeter.stopCollect(),this._timingsMeter=null),this._chartSession.criticalError().unsubscribe(this,this._onChartSessionCriticalError),this._chartSession.isConnected().unsubscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.destroy(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].destroy();this._paneWidgets.length=0,this._controlBarNavigation&&(this._controlBarNavigation.destroy(),this._controlBarNavigation=void 0),this._seriesControlWidget&&(this._seriesControlWidget.destroy(),this._seriesControlWidget=null),$(window).off("visibilitychange:chart_"+this._guid),$(window).off("keydown:chart_"+this._guid),this._jqMainDiv&&this._jqMainDiv.remove();for(t in this._actions)i=this._actions[t],i.setActive(!1),i.binder&&i.binder.destroy();null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),this._isDestroyed=!0},n.prototype.title=function(){return window.t("Chart Properties")},n.prototype.symbolProperty=function(){return this._model.mainSeries().properties().shortName?this._model.mainSeries().properties().shortName:this._model.mainSeries().properties().symbol},n.prototype.loadContent=function(e,t){var i,n,o,r,s,a;for(this.screen.show(),i=this,this.isMaximizedPane()&&this.toggleMaximizePane(),n=i._model.model().dataSources(),o=0;o<n.length;o++)(r=n[o])!==i._model.mainSeries()&&i._model.model().removeSource(r,!0);for(this._model.disconnect(),i.activePaneWidget=!1,i._model.mainSeries().purgeSymbolInfo(),e.loading=!0,i._setContent(e),o=0;o<e.panes.length;++o)for(a=0;a<e.panes[o].sources.length;++a)if(e.panes[o].sources[a].state.symbol){s=e.panes[o].sources[a].state;break}if(!s)throw Error("An error occured while determining main series ion the chart");i._properties.mainSeriesProperties.merge({visible:!0,symbol:s.symbol,timeframe:"",
onWidget:i._onWidget,interval:s.interval||"D",style:s.style}),i._init(),R.interval.setValue(s.interval),i._model.undoHistory.clearStack(),i.updateSeriesControlUI()},n.prototype._setContent=function(e){e&&e.panes.forEach(function(e){e.sources=e.sources.filter(function(e){return!!e&&("MainSeries"===e.type||(!e.points||!e.points.some(function(e){return null===e.time_t||!isFinite(e.time_t)})||(te.logNormal("Dropped invalid "+e.type+". Reason: non-numeric point time"),!1)))});var t=function(t){return e.sources&&e.sources.some(function(e){return e.id===t})};e.leftAxisSources&&(e.leftAxisSources=e.leftAxisSources.filter(t)),e.rightAxisSources&&(e.rightAxisSources=e.rightAxisSources.filter(t))}),this._content=e},n.prototype._contentSeriesProperties=function(){var e,t,i;if(this._content)for(e=this._content.panes.length;e-- >0;)for(t=this._content.panes[e].sources,i=t.length;i-- >0;)if("MainSeries"===t[i].type)return t[i].state},n.prototype.updateSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.updateUI()},n.prototype.tickSeriesControlClock=function(){this._seriesControlWidget&&this._seriesControlWidget.tickClock()},n.prototype.resizeSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.resizeUI()},n.prototype.updateUndoRedo=function(){this._model&&(this.actions().undo.setEnabled(!this._model.undoHistory.undoStack().isEmpty()),this.actions().redo.setEnabled(!this._model.undoHistory.redoStack().isEmpty()))},n.prototype.createSessionBreaksActions=function(e){var t,i=this,n=function(){t=new T({text:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"}),t.binder=new f(t,i.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,i.model(),"Session Breaks"),i._actions.sessionBreaks=t};i.model().mainSeries().sessionsStudy()?n():i.model().mainSeries().onSessionsStudyCreated().subscribe(i,function(){n()})},n.prototype.updateActionForIntradayOnly=function(e){!e||!e instanceof T||e.setEnabled(!!this.model().mainSeries().isIntradayInterval())};n.prototype.withModel=function(e,t){this.model()?t.call(e):this.modelCreated().subscribe(e,t,!0)},n.prototype.containsVolume=function(){return this.model().dataSources().some(function(e){return e instanceof v&&"Volume"===e.metaInfo().shortId})},n.prototype.containsStudyByPredicate=function(e){return!!this._model&&this._model.dataSources().some(function(t){if(!(t instanceof v))return!1;var i=t.metaInfo();return e(i)})},n.prototype.containsStudy=function(e){return this.containsStudyByPredicate(function(t){return t.id===e||t.fullId===e})},n.prototype.containsSessions=function(){return this.model().dataSources().some(function(e){return e instanceof v&&"Sessions"===e.metaInfo().shortId})},n.prototype.isSmall=function(){return this._width()<550||this._height()<300},n.prototype.onWidget=function(){return this._onWidget},n.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},n.prototype.widgetCustomer=function(){return this._widgetCustomer},n.prototype._width=function(){
return this._options.width.value()},n.prototype._height=function(){var e=this._options.height.value();return this._chartControlsBar&&(e=Math.max(e-this.controlBarHeight,0)),e},n.prototype.resize=function(){var e={height:this._height()+"px",width:this._width()+"px"};this._jqMainDiv.css(e),this._elMainTable.style.height=e.height,this._elMainTable.style.width=e.width,this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()},n.prototype.chartSession=function(){return this._chartSession},n.prototype.maxLhsPriceAxisWidth=0,n.prototype.maxRhsPriceAxisWidth=0,n.prototype.GUIResetScales=function(){G("GUI","Reset Scales");var e=this.model();e&&e.resetScales()},n.prototype.onLineCancelled=function(){C.resetToCursor()},n.prototype.createIndicatorImage=function(){var e=this;this._indicatorBindingPriceAxisName="right",this._indicatorImageMargin="marginRight",this.indicatorImage=this._jqParent[0].getElementsByClassName("chart-status-picture")[0],this.indicatorImage?this.indicatorImage.innerHTML="":(this.indicatorImage=this._jqParent.prop("ownerDocument").createElement("span"),this.indicatorImage.className="chart-status-picture",this._jqParent.append(this.indicatorImage)),this._options.marketStatusWidgetEnabled&&(this.indicatorText=$('<span class="series-status-text apply-common-tooltip"><span class="js-market-status tv-market-status--series-status"></span></span>'),this.indicatorText.appendTo(this.indicatorImage),this.indicatorDot&&this.indicatorDot.stop(),this.indicatorDot=new X({el:this.indicatorText.find(".js-market-status")[0],classSuffix:"--for-chart"}),this.indicatorDot.start(),p.enabled("display_data_mode")&&($('<span class="js-data-mode tv-data-mode--series-status"></span>').appendTo(this.indicatorText),this.dataModeIndicator&&this.dataModeIndicator.stop(),this.dataModeIndicator=new Q({el:this.indicatorText.find(".js-data-mode")[0],classSuffix:"--for-chart"}),this.dataModeIndicator.start())),e.withModel(null,function(){var t=e._model.mainSeries();t.onStatusChanged().subscribe(null,e.updateIndicatorImage.bind(e)),t.marketStatus.subscribe(e.updateIndicatorImage.bind(e)),e.updateIndicatorImage(),e.checkCompactMode(),e._model.onRearrangePanes().subscribe(null,function(){e.resetIndicatorSize(),e.resizeIndicator()})}),this._indicatorPriceAxisWidthChanged=this.getPriceAxisWidthChangedByName(this._indicatorBindingPriceAxisName),this._indicatorPriceAxisWidthChanged.subscribe(this,this.updateIndicatorImagePosition),this.updateIndicatorImagePosition()},n.prototype.updateIndicatorImage=function(){var e,t,i,n=this,o=this._model;o&&(e=o.mainSeries(),t=e.status(),i=e.quoteData?e.quoteData.update_mode_seconds:null,n._updateDataAndMarketStatus(e.marketStatus.value(),t,i))},n.prototype.checkCompactMode=function(){this._jqMainDiv.toggleClass("i-compact",this._width()<=400),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.clientWidth)},n.prototype.getDataTextStatus=function(e){var t;switch(e){case d.STATUS_LOADING:case d.STATUS_RESOLVING:t="loading";break;case d.STATUS_INVALID_SYMBOL:t="invalid";break;case d.STATUS_NO_BARS:
t="forbidden";break;case d.STATUS_DELAYED:t="delayed";break;case d.STATUS_DELAYED_STREAMING:t="delayed_streaming";break;case d.STATUS_EOD:case d.STATUS_PULSE:t="endofday";break;case d.STATUS_OFFLINE:t="connecting";break;case d.STATUS_SNAPSHOT:t="snapshot";break;case d.STATUS_READY:t="realtime";break;case d.STATUS_REPLAY:t="replay";break;default:t=e}return t},n.prototype._updateDataAndMarketStatus=function(e,t){var i,n;void 0!==this.indicatorText&&(i=this.getDataTextStatus(t),t===d.STATUS_LOADING||t===d.STATUS_RESOLVING?this.indicatorDot.setStatus("loading"):t===d.STATUS_INVALID_SYMBOL?this.indicatorDot.reset():i===t&&te.logWarn("unhandled data mode "+i),p.enabled("display_data_mode")&&this.dataModeIndicator.setMode(i),n=["loading","invalid","replay"],!n.includes(i)&&e?this.indicatorDot.setStatus(e,!0):"invalid"===i?this.indicatorDot.setStatus("invalid",!0):"replay"===i&&this.indicatorDot.setStatus("replay"),this.resizeIndicator())},n.prototype.resetIndicatorSize=function(){var e,t;if(this._paneWidgets[0]&&this._paneWidgets[0].statusWidget()&&ie)for(e=0;e<this._paneWidgets.length;e++)null!==(t=this._paneWidgets[e].statusWidget())&&t.firstTitle().css("padding-right","")},n.prototype.resizeIndicator=function(){var e,t,i,n,o=this._getMainSeriesPaneWidget();null!==o&&null!==(e=o.statusWidget())&&e.firstTitle().css("padding-right",this._indicatorWidth+10),this._options.marketStatusWidgetEnabled&&p.enabled("display_data_mode")&&this.indicatorDot&&this.dataModeIndicator&&(this.indicatorDot.isShortModeEnabled()&&this.dataModeIndicator.isShortModeEnabled()?(t=[this.indicatorDot.getTooltipText(),this.dataModeIndicator.getTooltipText()],t=t.filter(function(e){return e}),i=t.join(", "),this.indicatorText.attr("title",i)):this.indicatorText.attr("title",""),this.indicatorText.get(0).dispatchEvent(new g("common-tooltip-update"))),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.clientWidth),n=this._width(),this._options.marketStatusWidgetEnabled&&this.indicatorDot&&(n>650?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):n>550?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.enableShortMode())),p.enabled("display_data_mode")&&this.dataModeIndicator&&(n>650?(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.disableShortMode()):n>550?(this.dataModeIndicator.setTooltipEnabled(!0),this.dataModeIndicator.enableShortMode()):(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.enableShortMode()))},n.prototype.updateIndicatorImagePosition=function(){this.indicatorImage&&(this.indicatorImage.style[this._indicatorImageMargin]=this.getPriceAxisMaxWidthByName(this._indicatorBindingPriceAxisName)+"px")},n.prototype._getMainSeriesPaneWidget=function(){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e].containsMainSeries())return this._paneWidgets[e];return null},n.prototype.getMarketStatusTooltip=function(){
return this._options.marketStatusWidgetEnabled&&this.indicatorDot?this.indicatorDot.getTooltipText():"-"},n.prototype._startSpinner=function(e){if(!this._spinner){var t=$(e).get(0);t&&(this._spinner=(new Y).spin(t))}},n.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},n.prototype.getLastPaneLeftBottom=function(){var e=this._paneWidgets[this._paneWidgets.length-1].jqPane,t=e.offset();return{left:t.left,bottom:$(document.body).height()-t.top-e.height()}},n.prototype.setDataWindowWidget=function(e){this._dataWindowWidget=e},n.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},p.enabled("datasource_copypaste")&&(n.prototype.onAppClipboardPaste=function(e,t){te.logDebug("[[paste]]"),this._model&&this._model.pasteSourceFromClip(e,t)},n.prototype.onAppClipboardCopy=function(e){if(e||(e=this._model.selectedSource()),e instanceof v&&e.isChildStudy())return void te.logDebug("Can not copy child study");te.logDebug("[[copy]]"),this._model&&this._model.copySourceToClip(e)},n.prototype.onAppClipboardCut=function(e){te.logDebug("[[cut]]"),this._model&&this._model.cutSourceToClip(e||this._model.selectedSource())}),n.prototype.applyOverrides=function(e){applyPropertiesOverrides(this.properties(),null,!1,e),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,e),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,e,"mainSeriesProperties"))},n.prototype.applyStudiesOverrides=function(e){q.setDefaultsOverrides(e),this._applyStudiesOverrides()},n.prototype._setActionsActive=function(e){var t,i=this.actions();for(t in i)i.hasOwnProperty(t)&&this.actions()[t].setActive(e)},n.prototype.setActive=function(e){this._setActionsActive(e),this._isActive=e,this._paneWidgets.forEach(function(e){e.update()}),this._chartControlsBar&&this._chartControlsBar.classList.toggle("chart-controls-bar--inactive",!e)},n.prototype.isActive=function(){return this._isActive},n.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},n.prototype.isMultipleLayout=function(){return oe(this._chartWidgetCollection.layout.value())},n.prototype.id=function(){return this._guid},n.prototype.createBranding=function(){this._modelCreated.subscribe(this,function(){this._model.model().createBrandingSource()},!0)},n.prototype.selectBarMode=function(){return this._model.model().selectBarMode()},n.prototype.toggleSelectBarMode=function(){this._model.model().toggleSelectBarMode()},n.prototype.onBarSelected=function(){return this._model.model().onBarSelected()},n.prototype.trySetChartStyle=function(e){var t=this.model();return!!t&&(t.mainSeries().properties().style.value()===e||!!p.enabled("charting_library_base")&&(this._setChartStyle(e),!0))},n.prototype._setChartStyle=function(e){var t=this.model(),i=t.mainSeries().properties().style;t.setChartStyleProperty(i,e,"Change Series Style")},n.prototype.showReplayOrderConfirmationDialog=function(){if(!this.model().isInReplay())return Promise.resolve()},n.prototype._addPerfMark=function(e){
re("ChartWidget."+this._guid+"."+e)},e.exports.ChartWidget=n}).call(t,i(8))},function(e,t,i){"use strict";(function(t){function n(e,t,o){this._options=Object.assign({},Y,o),this._chart=e,this.dialog=e.dialog,this._state=t,this._state&&this._state.onDestroyed().subscribe(this,n.prototype._onStateDestroyed,!0);var r={contextMenuEnabled:this._options.priceScaleContextMenuEnabled};this.lhsPriceAxisWidget=new l(this,l.LHS,r),this.rhsPriceAxisWidget=new l(this,l.RHS,r),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=N(this._dv,new F(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=N(this._dv,new F(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this._legendWidget=null,this._options.legendWidgetEnabled&&i.e(1).then(function(e){if(!this._isDestroyed){var t=i(814).LegendWidget;this._legendWidget=new t(this,this._chart.model(),this._chart._jqMainDiv,this._options.legendWidget),this._legendWidget.$el.appendTo(this._dv),this._legendWidget.update()}}.bind(this).bind(null,i)).catch(i.oe),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),this._mouseEventHandler=new W($(this.top_canvas),this,!0,this._options.verticalTouchScroll),this._paneControls=null,t&&!this._chart.readOnly()&&i.e(1).then(function(e){if(!this._isDestroyed){var t=i(815);this._paneControls=new t(this,this._chart.model(),this._dv),this.updateControls()}}.bind(this).bind(null,i)).catch(i.oe),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=k.lockDrawings(),this._prevHoveredHittest=null,this._chart.withModel(this,function(){var e=this._chart.model();e.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),e.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)}),this._isDestroyed=!1}
var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y;i(507),i(11),o=i(6).Point,r=i(258).UndoMacroCommand,s=i(34).Study,a=i(180).NonSeriesStudy,l=i(125).PriceAxisWidget,c=i(125).scaleRatioForContextMenuTransformer(7),h=i(45).LineToolOrder,u=i(45).LineToolPosition,d=i(0).LineDataSource,p=i(45).LineToolBrush,_=i(73),f=_.isLineToolName,m=_.isStudyLineToolName,y=i(87).BarsMarksContainer,g=i(39).trackEvent,v=i(106).isFeatureEnabled,S=i(197).showEditObjectDialog,b=i(181).ActionBinder,i(640).makeTimeLimited,w=i(291).createToolbarAction,P=i(7).ensureNotNull,T=i(28).PriceDataSource,x=i(41),C=x.Action,L=x.ActionPlaceholder,I=x.ActionSeparator,A=i(88),k=i(32),E=i(9).HitTestResult,M=i(18),V=i(31),D=i(81),O=D.resizeCanvas,R=D.hardResizeCanvas,B=D.clearRect,N=D.addCanvasTo,F=D.Size,W=i(110).MouseEventHandler,H=i(182),j=i(132),z=i(284).PaneCursorType,U=i(4).getLogger("Chart.PaneWidget"),q=["LineToolOrder","LineToolPosition","AlertLabel"],Y={contextMenuEnabled:!0,priceScaleContextMenuEnabled:!0,legendWidgetEnabled:!0,legendWidget:{},verticalTouchScroll:!1,propertyPagesEnabled:!0,sourceSelectionEnabled:!0},n.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener),this._legendWidget&&(this._legendWidget.destroy(),this._legendWidget.$el.remove(),delete this._legendWidget),null!==this._paneControls&&(this._paneControls.destroy(),delete this._paneControls),this.lhsPriceAxisWidget.destroy(),this.rhsPriceAxisWidget.destroy(),this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)}),this.jqRow.remove(),this.jqRow.find("*").remove(),this._prevHoveredHittest=null,this._state&&this._state.onDestroyed().unsubscribe(this,n.prototype._onStateDestroyed),this._mouseEventHandler.destroy();for(var e in this)delete this[e];this._isDestroyed=!0},n.prototype.cancelZoom=function(){this._zoomSelector.css("display","none"),delete this._firstZoomPoint},n.prototype._onKeyUpListener=function(e){if(27===e.keyCode){this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom();this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip()}},n.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(e){}},n.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()},n.prototype.priceAxisByCanvas=function(e){return e===this.lhsPriceAxisWidget.canvas||e===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:e===this.rhsPriceAxisWidget.canvas||e===this.rhsPriceAxisWidget.top_canvas?this.rhsPriceAxisWidget:null},n.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()),this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())},
n.prototype.chart=function(){return this._chart},n.prototype._chartModel=function(){return this._chart.model().model()},n.prototype.state=function(){return this._state},n.prototype.setState=function(e){this._state&&this._state.onDestroyed().unsubscribe(this,n.prototype._onStateDestroyed),this._state=e,this._state&&this._state.onDestroyed().subscribe(this,n.prototype._onStateDestroyed,!0)},n.prototype._onStateDestroyed=function(){this._state&&this._state.onDestroyed().unsubscribe(this,n.prototype._onStateDestroyed),this._state=null},n.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:0},n.prototype.setStretchFactor=function(e){this._state&&(this._state._stretchFactor=e)},n.prototype.mouseEnterEvent=function(e){var t=this._chart.model();t&&(t.crossHairSource().visible=!0,"function"==typeof this.onMouseEnter&&this.onMouseEnter(this))},n.prototype.hideInplaceEditor=function(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)},n.prototype._processMouseMoveWhileZoom=function(e){var t=Math.floor(this._chart.model().timeScale().coordinateToIndex(e.localX)),i=this._chart.model().timeScale().indexToCoordinate(t)-.5*this._chart.model().timeScale().barSpacing(),n=e.localY,o=Math.abs(i-this._firstZoomPoint.x),r=Math.abs(n-this._firstZoomPoint.y);i<this._firstZoomPoint.x?this._zoomSelector.css("left",i):this._zoomSelector.css("left",this._firstZoomPoint.x),e.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",e.localY):this._zoomSelector.css("top",this._firstZoomPoint.y),this._zoomSelector.width(o),this._zoomSelector.height(r)},n.prototype._finishZoom=function(e){var t=P(this._state),i=t.defaultPriceScale(),n=t.mainDataSource().firstValue(),o=i.coordinateToPrice(e.localY,n),r=Math.round(this._chart.model().timeScale().coordinateToIndex(e.localX));r!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,r,this._firstZoomPoint.price,o,t),this._zoomSelector.css("display","none"),this._firstZoomPoint=null,k.resetToCursor()},n.EvironmentState=function(e){e.shiftKey&&(this.shift=!0),e.ctrlKey&&(this.control=!0)},n.prototype.checkMovepoint=function(e){return e===E.MOVEPOINT||e===E.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()},n.prototype.mouseDownEvent=function(e){var i,r,a,l,c,h,u,p,_,m,y,g,v,S,b;if(this._state&&(document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),V.emit("mouse_down",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),this._updateCommonTooltip(null),i=this._chart.model(),r=new n.EvironmentState(e),i.mainSeries().clearGotoDateResult(),this.hideInplaceEditor(),a=this._state.defaultPriceScale(),!a.isEmpty()&&!i.timeScale().isEmpty())){if(l=i.crossHairSource(),
TradingView.supportTouch()&&"LineToolBrush"!==k.tool.value()||i.setAndSaveCurrentPosition(e.localX,e.localY,this._state),c=l.price,h=l.index,l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),r.shift&&k.toolIsCursor(k.tool.value())&&k.tool.setValue("measure"),"measure"===k.tool.value()&&!l.startMeasurePoint())return void l.startMeasuring({price:c,index:h,x:e.localX,y:e.localY},this._state);if(l.startMeasurePoint()&&!l.endMeasurePoint())return l.finishMeasure({price:c,index:h,x:e.localX,y:e.localY}),void k.resetToCursor();if(this._firstZoomPoint)return void this._finishZoom(e);if("zoom"===k.tool.value()&&t.enabled("chart_zoom"))return u=i.timeScale().indexToCoordinate(h)-.5*i.timeScale().barSpacing(),this._firstZoomPoint={price:c,index:h,x:u,y:e.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",u),this._zoomSelector.css("top",e.localY),this._zoomSelector.width(0),void this._zoomSelector.height(0);if(!this._isSelectBarModeEnabled()&&(f(k.tool.value())||i.lineBeingCreated()))return void((!t.enabled("charting_library_base")||h>=0)&&this._mouseDownEventForLineTool(e,r,h,c));if(p=this.dataSourceAtPoint(e.localX,e.localY),_=p&&p.source&&p.source.customization?p.source.customization:{},p.hittest&&p.hittest.result()===E.CUSTOM&&(m=p.hittest.data().mouseDownHandler)&&m(e),!this._chart.readOnly()){if(p&&p.hittest&&p.hittest.result()===E.CUSTOM_MOVE&&(m=p.hittest.data().pressedMouseMoveHandler))return void i.startCustomMoving(p.source,new o(e.localX,e.localY),m);if(p&&!_.disableSelection&&(y=p.hittest&&p.hittest.result()>E.MOVEPOINT_BACKGROUND,y=y||p.hittest&&p.hittest.result()===E.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),y?i.setSelectedSource(p.source,p.hittest&&p.hittest.data()):i.setSelectedSource(null)),p.source&&"eraser"===k.tool.value()&&!_.disableErasing&&(TradingView.isInherited(p.source.constructor,d)||TradingView.isInherited(p.source.constructor,s)))return g=p.hittest.eraseMarker(),void(e.ctrlKey&&void 0!==g&&p.source.processErase?p.source.processErase(i,g):i.removeSource(p.source));if(v=p.source&&TradingView.isInherited(p.source.constructor,d)&&p.source.isLocked(),!(this._lockDrawingsProperty.value()||v)){if(p.source&&p.source.userEditEnabled&&!p.source.userEditEnabled())return;if(p.hittest&&p.hittest.result()===E.CHANGEPOINT)return S=this._state.mainDataSource().firstValue(),a=p.source.priceScale(),c=a.coordinateToPrice(e.localY,S),i.startChangingLinetool(p.source,{index:h,price:c},p.hittest.data(),r),void this._updateTooltip(e.localX,e.localY);if(p.hittest&&this.checkMovepoint(p.hittest.result()))return b=p.source.properties(),r.control&&b.clonable&&b.clonable.value()?void(this._clonningAtMoveLineTool=p.source):void(p.source.isFixed&&p.source.isFixed()?i.startMovingSource(p.source,new o(e.localX,e.localY),p.hittest.data()):(S=this._state.mainDataSource().firstValue(),a=p.source.priceScale(),c=a.coordinateToPrice(e.localY,S),i.startMovingSource(p.source,{index:h,price:c},p.hittest.data())))}
if(p.source&&TradingView.isInherited(p.source.constructor,T)&&p.source.isDraggable())return void(this._chart.draggingSource=p.source)}p.hittest&&p.hittest.result()===E.REGULAR||(this._processing=!0)}},n.prototype.drawRightThere=function(e){var t,i;f(e)&&(t=this._chart.model(),i=t.crossHairSource(),t.createLineTool(P(this._state),{index:i.index,price:i.price},e))},n.prototype._finishTool=function(e){var t,i=this._chart.model(),n=k.tool.value();k.resetToCursor(),this._hideTooltip(),i.setSelectedSource(e),this._chart.isTextTool(n)&&(t=i.createUndoCheckpoint(),S(e,i,null,t).then(function(e){e.focusOnText()}))},n.prototype._mouseDownEventForLineTool=function(e,t,i,n){var r,s,a,l,c,h,u,d,_,m,y,g,v,S,b,w,P;if(this._state){if(r=this._chart.model(),s=!1,a=null,l=e.localX,c=e.localY,h=this._chart.model().model().crossHairSource(),u=k.tool.value(),k.hideAllDrawings().setValue(!1),k.lockDrawings().setValue(!1),TradingView.supportTouch()&&f(u)&&"LineToolBrush"!==u&&!r.lineBeingCreated()&&(this._startTouchPoint=new o(l,c),this._initCrossHairPosition=h.currentPoint()),!r.lineBeingCreated()||r.lineBeingCreated()instanceof p)TradingView.supportTouch()&&"LineToolBrush"!==u||(P={index:i,price:n},a=r.createLineTool(this._state,P,u),r.lineBeingCreated()||(s=!0));else if(d=r.lineBeingCreated().ownerSource().firstValue(),TradingView.supportTouch()){if(!this._startTouchPoint)return this._startTouchPoint=new o(l,c),_=r.lineBeingCreated().points(),m=_[_.length-1],y=r.timeScale().indexToCoordinate(m.index),n=m.price,g=r.lineBeingCreated().priceScale(),v=g.priceToCoordinate(n,d),void(this._lastDrawingPoint=new o(y,v))}else a=r.lineBeingCreated(),S=r.paneForSource(a),S!==this._state?(b=this._dv.offset(),l=e.localX+b.left,c=e.localY+b.top,w=this._chart.paneByState(S),b=w._dv.offset(),l-=b.left,c-=b.top,n=a.priceScale().coordinateToPrice(c,d),i=Math.round(r.timeScale().coordinateToIndex(l)),s=r.coninueCreatingLine({index:i,price:n},t)):s=r.coninueCreatingLine({index:i,price:n},t);r.setSelectedSource(a),s?this._finishTool(a):TradingView.supportTouch()&&"LineToolBrush"!==u||this._updateTooltip(e.localX,e.localY)}},n.prototype._equalsCursorCache=function(e,t){return k.toolIsCursor(e.tool)?e.tool===t.tool&&e.theme===t.theme&&e.crosshair===t.crosshair:e.tool===t.tool&&e.theme===t.theme},n.prototype._setCursorClassName=function(e){var t="";e&&(t="pane--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this.jqPane.removeClass(this._currentCursorClassName),t&&this.jqPane.addClass(t),this._currentCursorClassName=t,this.jqPane.css("cursor"))},n.prototype.setCursorForTool=function(e,t){var i,n=k.tool.value();if(k.toolIsCursor(n)){if(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved())return void this._setCursorClassName("grabbing");if(e&&this._options.sourceSelectionEnabled)return void this._setCursorClassName("pointer")}
return"eraser"===n?void this._setCursorClassName("eraser"):"zoom"===n?void this._setCursorClassName("zoom-in"):"dot"===(i=k.cursorTool.value())?void this._setCursorClassName("dot"):"arrow"===i?void this._setCursorClassName("default"):void this._setCursorClassName("")},n.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing")},n.prototype.gestureStartEvent=function(e){this._prev_pinch_scale=1,this._pinching=!0},n.prototype.gestureChangeEvent=function(e){var t,i,n=e.center.x-5,o=this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,r=this._chart.model().timeScale().width();o&&(n=Math.max(0,n-o)),n=Math.min(n,r),t=2*(n/r-.5),i=5*(e.scale-this._prev_pinch_scale),i>0?this._chart.model().zoomIn(t,i):i<0&&this._chart.model().zoomOut(t,-i),this._prev_pinch_scale=e.scale},n.prototype.gestureEndEvent=function(e){this._pinching=!1},n.prototype._updateCommonTooltip=function(e){var t,i,n,o=this._lastCommonTooltipData,r=null;if(e&&e.hittest&&e.hittest.result()===E.CUSTOM&&(t=e.hittest.data())&&(r=t.tooltip||null),null!=o||null!=r)return null==r?(this._lastCommonTooltipData=null,void j.hide()):void(o&&r.text===o.text&&r.rect.x===o.rect.x&&r.rect.y===o.rect.y&&r.rect.w===o.rect.w&&r.rect.h===o.rect.h||(this._lastCommonTooltipData=r,i=TradingView.clone(r),n=this.jqPane.offset(),i.rect.x+=n.left,i.rect.y+=n.top,j.show(i)))},n.prototype._processMouseMoveForCustomHandler=function(e){var t,i,n,o=this.dataSourceAtPoint(e.localX,e.localY),r=o.hittest&&o.hittest.result()===E.CUSTOM;!r||null!==this._prevHoveredHittest&&this._prevHoveredHittest.renderer===o.renderer||(t=o.hittest.data().mouseEnterHandler,t&&t(e),this._prevHoveredHittest=o),r&&(i=o.hittest.data().mouseMoveHandler)&&i(e),null!==this._prevHoveredHittest&&this._prevHoveredHittest.renderer!==o.renderer&&(n=this._prevHoveredHittest.hittest.data().mouseLeaveHandler,n&&n(e),this._prevHoveredHittest=null)},n.prototype.mouseMoveEvent=function(e){var t,i,o,r,s,a,l,c,h,u,d,p,_,m,y;if(this._state&&(this._processMouseMoveForCustomHandler(e),t=this._chart.model())){if(i=e.localX,o=e.localY,r=new n.EvironmentState(e),this._firstZoomPoint)return void this._processMouseMoveWhileZoom(e);if(s=!1,!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())&&(a=k.tool.value(),l=null,c=null,h=null,this._processing||!k.toolIsCursor(a)&&"eraser"!==a||(l=this.dataSourceAtPoint(e.localX,e.localY),u=l&&l.source,s=!!u&&-1!==q.indexOf(u.toolname),l.hittest&&l.hittest.result()>E.MOVEPOINT_BACKGROUND?(c=l.source,h=l.hittest.result(),!l.source||"eraser"===a&&l.source.constructor===TradingView.Series?t.setHoveredSource(null):t.setHoveredSource(l.source,l.hittest.data())):t.setHoveredSource(null)),this._options.sourceSelectionEnabled&&(this._isSelectBarModeEnabled()?this._setCursorClassName("pointer"):this.setCursorForTool(c,h)),this._updateCommonTooltip(l),null!==l&&null!==l.hittest&&l.hittest.result()===E.CUSTOM_MOVE))switch(d=l.hittest.data()||{},d.cursorType){case z.VerticalResize:this._setCursorClassName("ns-resize")}
if(this._chart.model().crossHairSource().setLinesShouldBeHidden(s),this._chart.readOnly()&&this._options.sourceSelectionEnabled&&(l=this.dataSourceAtPoint(e.localX,e.localY),null!==l.source?t.setHoveredSource(l.source,l.hittest.data()):t.setHoveredSource(null,null)),this._chart.model().lineBeingCreated()&&(p=this._chart.model().lineBeingCreated(),(_=this._chart.model().paneForSource(p))!==this._state))return m=this._dv.offset(),i+=m.left,o+=m.top,y=this._chart.paneByState(_),m=y._dv.offset(),i-=m.left,o-=m.top,void t.setAndSaveCurrentPosition(i,o,_);a=k.tool.value(),TradingView.supportTouch()&&f(a)||(t.setAndSaveCurrentPosition(i,o,this._state,r),this._updateTooltip(i,o))}},n.prototype.pressedMouseMoveEvent=function(e){var i,r,s,a,l,c,h,u,_,m,y,g,v,S,b,w,P,T,x,C,L,I,A,E,M,V,D,O,R,B,N;if(this._state&&!this._pinching){if(this._touchMove=!0,i=new n.EvironmentState(e),r=this._chart.model(),s=e.localX,a=e.localY,this._firstZoomPoint)return this._processMouseMoveWhileZoom(e),void(this._firstZoomPoint.draggingMode=!0);if(l=k.tool.value(),TradingView.supportTouch()&&this._startTouchPoint&&f(l)&&"LineToolBrush"!==l&&!r.lineBeingCreated()&&!this._isSelectBarModeEnabled())return c=this._initCrossHairPosition,h=new o(s,a),u=h.subtract(this._startTouchPoint),_=c.add(u),this._chart.model().setAndSaveCurrentPosition(_.x,_.y,this._state),void this._updateTooltip(_.x,_.y);if(TradingView.supportTouch()&&r.lineBeingCreated()&&!(r.lineBeingCreated()instanceof p))return void(this._startTouchPoint&&(m=r.lineBeingCreated(),y=e.localX-this._startTouchPoint.x,g=e.localY-this._startTouchPoint.y,v=this._lastDrawingPoint.x+y,S=this._lastDrawingPoint.y+g,b=this._chart.model().paneForSource(m),r.setAndSaveCurrentPosition(v,S,b),this._updateTooltip(v,S)));if(r.setAndSaveCurrentPosition(s,a,this._state,i),this._updateTooltip(s,a),w=k.tool.value(),P=this._isSelectBarModeEnabled(),(!f(w)||"LineToolBrush"===l||P)&&(0===e.button||Modernizr.touch)){if("LineToolBrush"===w&&!P){if(T=this._state.defaultPriceScale(),T.isEmpty())return;if(!(x=this._chart.model().lineBeingCreated()))return;return C=x.ownerSource().firstValue(),L=T.coordinateToPrice(e.localY,C),I=Math.round(this._chart.model().timeScale().coordinateToIndex(e.localX)),void((!t.enabled("charting_library_base")||I>=0)&&this._chart.model().coninueCreatingLine({index:I,price:L}))}if(this._chart.draggingSource&&(A=e.target,E=this._chart.paneByCanvas(A),E&&(E!==this?E.setDragToAnotherPaneCursor():E.setCursorForTool()),M=this._chart.priceAxisByCanvas(A),M&&M.setCursor("grabbing"),(V=this._chart.timeAxisByCanvas(A))&&V.setCursor("grabbing")),r.timeScale().isEmpty())return;if(r.customMoveBeingProcessed())return void r.processCustomMove(new o(s,a));if(r.lineBeingEdited())return I=Math.round(this._chart.model().timeScale().coordinateToIndex(s)),(!t.enabled("charting_library_base")||I>=0)&&r.changeLinePoint({x:s,y:a},i),this._updateTooltip(s,a),void this.setCursorForTool();if(r.sourceBeingMoved()){if(D=r.sourceBeingMoved(),T=D.priceScale(),T.isEmpty())return;if(O=D.ownerSource(),
C=(O||this._state.mainDataSource()).firstValue(),I=this._chart.model().timeScale().coordinateToIndex(e.localX),L=T.coordinateToPrice(e.localY,C),this.setCursorForTool(),t.enabled("charting_library_base")&&!D.onlyYMoving()&&(R=D.points(),0!==R.length&&R.reduce(function(e,t){return t.index<e.index?t:e}).index-((D._currentMovingPoint||D._startMovingPoint).index-I)<0))return;return TradingView.isInherited(D.constructor,d)&&D.isFixed()?void r.moveSource(new o(s,a)):void r.moveSource({index:I,price:L},i)}if(i.control&&this._clonningAtMoveLineTool)return m=this._clonningAtMoveLineTool,B=this.cloneLineTool(m,!0),N=this._chart.model().model().dataSourceForId(B),this._chart.model().setSelectedSource(N),C=this._state.mainDataSource().firstValue(),r.startMovingSource(N,{index:this._chart.model().timeScale().coordinateToIndex(e.localX),price:m.priceScale().coordinateToPrice(e.localY,C)}),void(this._clonningAtMoveLineTool=null);T=this._state.defaultPriceScale(),!this._startScrollingPos&&t.enabled("chart_scroll")&&(this._startScrollingPos={x:e.clientX,y:e.clientY}),this._startScrollingPos&&(this._startScrollingPos.x===e.clientX&&this._startScrollingPos.y===e.clientY||this._isScrolling||(r.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),T.isEmpty()||r.startScrollPrice(this._state,T,e.localY),r.startScrollTime(e.localX),this._isScrolling=!0,this.setCursorForTool())),this._isScrolling&&(T.isEmpty()||r.scrollPriceTo(this._state,T,e.localY),r.scrollTimeTo(e.localX))}}},n.prototype._processMouseUpForCustomHandler=function(e){var t,i=this.dataSourceAtPoint(e.localX,e.localY);i.hittest&&i.hittest.result()===E.CUSTOM&&(t=i.hittest.data().mouseUpHandler)&&t(e)},n.prototype.mouseUpEvent=function(e){var t,i,n,o,s,a,l,c,h,u,d,_,m,y,g,v,S,b,w,P,T,x,C,L,I,A,E,D,O,R,B,N,F;if(this._state){if(this._processMouseUpForCustomHandler(e),this._clonningAtMoveLineTool=null,t=this,V.emit("mouse_up",{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),i=this._chart.model(),n=this._touchMove,delete this._touchMove,o=k.tool.value(),TradingView.supportTouch()&&!n&&"LineToolBrush"!==o&&f(o)&&!i.lineBeingCreated())return s=i.crossHairSource().currentPoint(),a=this._state.defaultPriceScale(),l=this._state.mainDataSource().firstValue(),c=a.coordinateToPrice(s.y,l),h=Math.round(i.timeScale().coordinateToIndex(s.x)),u={index:h,price:c},d=i.createLineTool(this._state,u,o),i.setSelectedSource(d),i.lineBeingCreated()||this._finishTool(d),this._updateTooltip(s.x,s.y),void delete this._startTouchPoint;if(i.lineBeingCreated()&&!(i.lineBeingCreated()instanceof p)&&this._startTouchPoint)return _=!1,delete this._startTouchPoint,n||(d=i.lineBeingCreated(),m=d.points()[d.points().length-1],c=m.price,_=i.coninueCreatingLine({index:m.index,price:c},{}),delete this._lastDrawingPoint),void(_&&this._finishTool(d));if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)return void this._finishZoom(e);if(0===e.button||TradingView.supportTouch()){if(this._processing=!1,i=this._chart.model(),
i.customMoveBeingProcessed()&&i.endCustomMoving(),i.lineBeingEdited())return i.endChangingLinetool(),void this._hideTooltip();if("LineToolBrush"===o&&!this._isSelectBarModeEnabled()){if(i.finishLineTool(),a=this._state.defaultPriceScale(),a.isEmpty())return;if(!(y=this._chart.model().lineBeingCreated()))return;return l=y.ownerSource().firstValue(),c=a.coordinateToPrice(e.localY,l),h=Math.round(this._chart.model().timeScale().coordinateToIndex(e.localX)),void this._chart.model().coninueCreatingLine({index:h,price:c})}if(g=i.sourceBeingMoved())return i.endMovingSource(),this._hideTooltip(),this.setCursorForTool(g),void i.invalidate(new M(M.UPDATE_CURSOR_ONLY));if(this._chart.readOnly()||(v=this.dataSourceAtPoint(e.localX,e.localY),S=this._chart.model().crossHairSource(),b=e.localX>=0&&e.localX<this.size.w,v&&v.source===S||!b||(w=t._chart.model().timeScale().coordinateToIndex(e.localX),t._chart.model().model().onSyncScrollNeeded(w))),P=this._isScrolling&&this._chart.model().undoHistory.undoStack().head()instanceof r,this._isScrolling&&(a=this._state.defaultPriceScale(),i.endScrollPrice(this._state,a),t=this,T=function(){i.endScrollTime(),i.endUndoMacro(),t._startScrollingPos=void 0,t._isScrolling=!1,t.setCursorForTool()},TradingView.supportTouch()?(x=i.timeScale().m_scrollStartPoint,C=.05*(e.localX-x),L=null,I=function(t){var n,o;null===L&&(L=t),n=.01*Math.min(100,3*(t-L)),n=Math.sqrt(n),o=e.localX+C*n,i.scrollTimeTo(o),n>=1?T():requestAnimationFrame(I)},requestAnimationFrame(I)):T()),this._chart.draggingSource)for(A=e.target,E=this._chart.paneByCanvas(A),E&&E!==this&&(D=E._state.findSuitableScale(this._chart.draggingSource),P&&(P=!1,this._chart.model().undoHistory.undo()),this._chart.model().move(this._chart.draggingSource,E._state,D)),O=this._chart.timeAxisByCanvas(A),O&&(P&&(P=!1,this._chart.model().undoHistory.undo()),this._chart.model().move(this._chart.draggingSource,null,null)),this._chart.draggingSource=null,R=this._chart.getTimeScale(),R&&R.restoreDefaultCursor(),v=this.dataSourceAtPoint(e.localX,e.localY),B=this._chart.paneWidgets(),N=0;N<B.length;N++)F=B[N],F===this&&v?F.setCursorForTool(v.source,v.hittest||null):F.setCursorForTool(),F.lhsPriceAxisWidget.restoreDefaultCursor(),F.rhsPriceAxisWidget.restoreDefaultCursor()}delete this._touchMove}},n.prototype.mouseLeaveEvent=function(e){var t,i;this._state&&(t=this._chart.model())&&(TradingView.isMobile.any()||t.model().clearCurrentPosition(),t.setHoveredSource(null),null!==this._prevHoveredHittest&&(i=this._prevHoveredHittest.hittest.data().mouseLeaveHandler,i&&i(e),this._prevHoveredHittest=null),this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this))},n.prototype.mouseClickEvent=function(e){var t,i,n,o;this._state&&(t=this.dataSourceAtPoint(e.localX,e.localY),i=this._chart.model(),n=t.source,this._lastClickedSource!==n&&(this._lastClickedSource&&(this._lastClickedSource.onClickOutside(e),i.chartModel().updateSource(this._lastClickedSource)),this._lastClickedSource=n),
t.hittest&&t.hittest.result()===E.CUSTOM&&(o=t.hittest.data().mouseClickHandler)&&(o(e),i.chartModel().updateSource(n)),i.hoveredSource()instanceof y&&i.hoveredSource().onClicked())},n.prototype.showEditDialogForSource=function(e){if(this._options.propertyPagesEnabled&&(!e.userEditEnabled||e.userEditEnabled())){var t=this;S(e,this._chart.model()).then(function(e){t._editDialog=e})}},n.prototype.mouseDoubleClickEvent=function(e){var t,i,n;this._state&&(t=!this._chart.readOnly()&&!f(k.tool.value())&&this.dataSourceAtPoint(e.localX,e.localY),i=t&&t.hittest&&t.source,i&&t.hittest.result()<=E.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(i=null),i&&i.customization&&i.customization.disableSelection&&(i=null),i&&i._metaInfo&&"Sessions@tv-basicstudies"===i._metaInfo.id&&(i=this._chart.model().mainSeries()),i?(n=!1,n?TradingView.alertsDispatcher.openEditDialog(t.source.alert()):this.showEditDialogForSource(i)):this._chart.readOnly()||f(k.tool.value())||this._chart.model().lineBeingCreated()||this._chart.model().selectedSource()||this._chart.toggleMaximizePane(this))},n.prototype.showContextMenuForSource=function(e,t){e.hasContextMenu()&&(this._chart.model().setSelectedSource(e),e.constructor===TradingView.Series?this._seriesContextMenu(e).show(t):TradingView.isInherited(e.constructor,s)?this._studyContextMenu(e).show(t):TradingView.isInherited(e.constructor,h)||TradingView.isInherited(e.constructor,u)?this._tradingDrawingsContextMenu(e).show(t):TradingView.isInherited(e.constructor,d)?this._lineContextMenu(e).then(function(e){e.show(t)}):e===this._chart.model().crossHairSource()&&e.handleContextMenuEvent(t))},n.prototype.contextMenuEvent=function(e,t){var i,n,o,r;if(this._chart.model().crossHairSource().startMeasurePoint())return void this._chart.model().crossHairSource().clearMeasure();if(!this._pinching&&(this._firstZoomPoint&&this.cancelZoom(),!this.hideInplaceEditor())){if(!k.toolIsCursor(k.tool.value())&&!this._isSelectBarModeEnabled()){if(TradingView.isMobile.any())return;return k.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),void(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())}this._options.contextMenuEnabled&&(this._chart.model().mainSeries().createSessStudy(),this._contextMenuX=e.localX,this._contextMenuY=e.localY,i=this.dataSourceAtPoint(e.localX,e.localY),n=i?i.source:null,o=i&&i.hittest?i.hittest.result():0,r=o>=E.REGULAR||o>=E.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),this._chart.updateActions(),null!==n&&r?this.showContextMenuForSource(n,e):(this._contextMenu(e).then(function(t){return t.show(e)}),this._chart.model().setSelectedSource(null)),this.paint())}},n.prototype._contextMenu=function(e){function t(e){return null===e.text}var i=this;return Promise.all(this._initActions(e)).then(function(e){var n,o,r=i._customActions();for(e=e.filter(function(e){return null!==e}),r.remove.forEach(function(t){for(var i=0;i<e.length;i++)if(e[i].text===t){e.splice(i,1);break}}),n=r.top.concat(e).concat(r.bottom),
o=n.length-1;o>0;o--)t(n[o])&&t(n[o-1])&&n.splice(o,1);return n.length&&t(n[0])&&n.splice(0,1),n.length&&t(n[n.length-1])&&n.splice(n.length-1,1),A.createMenu(n,{statName:"ChartContextMenu"})})},n.prototype.createRemoveMenu=function(){var e,t=this._chart.actions(),i=new C({text:window.t("Remove"),statName:"Remove"});return i.subActions||(i.subActions=[]),e=i.subActions,e.push(t.paneRemoveAllStudies,t.paneRemoveAllDrawingTools,t.paneRemoveAllStudiesDrawingTools),i},n.prototype.createDrawingMenu=function(){var e,i,n=this._chart.actions(),o=new C({text:window.t("Drawing Tools"),statName:"DrawingTools"});return o.subActions||(o.subActions=[]),e=o.subActions,t.enabled("left_toolbar")&&e.push(n.drawingToolbarAction),t.enabled("items_favoriting")&&null!==(i=w())&&e.push(i),0!==o.subActions.length&&e.push(new I),e.push(n.magnetAction,n.stayInDrawingModeAction),this._chart.isMultipleLayout()&&e.push(n.syncModeAction),e.push(new I,n.lockDrawingsAction,n.hideAllDrawingsAction,n.paneRemoveAllDrawingTools),o},n.prototype._initActions=function(e){var i,n,o,r,s,a=this,l=this._chart.actions(),c=[];return t.enabled("datasource_copypaste")&&(!(i=H.get())||"study"!==i.type&&"drawing"!==i.type||(n=new C({text:window.t("Paste %s").replace("%s",window.t(i.title||i.type)),shortcut:"Ctrl-V",statName:"Paste"}),n.callbacks().subscribe(null,function(){a._chart.onAppClipboardPaste(a.state())}),c.push(n))),l.gotoDate&&c.push(l.gotoDate),c.length&&c.push(new I),c.push(l.chartReset,l.symbolSearch,l.changeInterval),o=window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist),o&&l.addToWatchlist&&c.push(l.addToWatchlist),t.enabled("text_notes")&&v("text_notes")&&c.push(l.addToTextNotes),t.enabled("symbol_info")&&c.push(l.showSymbolInfoDialog),c.push(new I,this._createLockTimeAxisAction(e),new I,l.paneObjectTree,l.insertIndicator),t.enabled("charting_library_base")||c.push(l.applyStudyTemplate),t.enabled("compare_symbol")&&c.push(l.compareOrAdd),c.push(this.createDrawingMenu()),t.enabled("charting_library_base")&&c.push(l.hideAllMarks),c.push(this.createRemoveMenu(),new I),r=this._priceAxisMenu(),r&&c.push(r),s=this._timeAxisMenu(),s&&c.push(s),t.enabled("charting_library_base")||c.push(l.applyColorTheme),t.enabled("show_chart_property_page")&&c.push(l.chartProperties),pro.hasPackage("mtp-mtpredictor")&&P(this._state).containsMainSeries()&&c.push(new I,this._createMTPredictorActions()),c},n.prototype._customActions=function(){var e,i,n,o={top:[],bottom:[],remove:[]},r=this._chart.model(),s=r.timeScale(),a=this._state&&this._state.defaultPriceScale();return t.enabled("custom_items_in_context_menu")?(e=s.isEmpty()?void 0:s.indexToUserTime(s.coordinateToIndex(this._contextMenuX)),a&&!a.isEmpty()&&(n=this._state.mainDataSource().firstValue(),i=a.coordinateToPrice(this._contextMenuY,n)),V.emit("onContextMenu",{unixtime:e?e/1e3:void 0,price:i,callback:function(e){[].concat(e).forEach(function(e){if(e.text)if(e.text.length>1&&"-"===e.text[0])o.remove.push(e.text.slice(1));else{var t;"-"===e.text?t=new I:(t=new C({
text:e.text}),t.callbacks().subscribe(null,e.click)),e.position&&"top"===e.position?o.top.push(t):o.bottom.push(t)}})}}),o):o},n.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var e=this._chart.getTimeScale();return new C({text:window.t("Time Scale"),subActions:e.getContextMenuActions(),statName:"TimeScale"})},n.prototype.getDefaultPriceAxisWidget=function(){if(!this._state)return null;var e=this._state.defaultPriceScale();return e.isEmpty()?null:e===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget()},n.prototype._priceAxisMenu=function(){var e=this.getDefaultPriceAxisWidget();return e?new C({text:window.t("Price Scale"),subActions:e.getContextMenuActions(),statName:"PriceScale"}):null},n.prototype._seriesContextMenu=function(e){var i,n,o,r,s,a=this._chart.actions(),l=e.properties().visible.value(),c=null;if(this._chart.readOnly())i=[l?a.seriesHide:this.createActionShow(e),new I,this.createActionShowCountdown(e),new I,this.createActionScaleLeft(e),this.createActionScaleRight(e),this.createActionNoScale(e)],t.enabled("countdown")||i.splice(3,1),c=A.createMenu(i);else{if(n=this._mergeContentMenuItems(e),o=[a.showSymbolInfoDialog,a.compare,l?a.seriesHide:this.createActionShow(e),this.createVisualOrderAction(e),new I,this.createActionShowCountdown(e),new I],t.enabled("countdown")||o.splice(5,2),t.enabled("compare_symbol")||o.splice(1,1),t.enabled("symbol_info")||o.splice(0,1),!this.chart().onWidget()&&t.enabled("show_chart_property_page")&&o.unshift(a.format),r=this.createActionLockScale(e),r&&o.push(r,new I),n.length>0){for(s=0;s<n.length;s++)o.push(n[s]);o.push(new I)}o.push(this.createActionScaleLeft(e),this.createActionScaleRight(e),this.createActionNoScale(e)),pro.hasPackage("mtp-mtpredictor")&&o.push(new I,this._createMTPredictorActions()),c=A.createMenu(o)}return c},n.prototype.toggleLockTimeAxis=function(e,t){var i,n,o;"boolean"!=typeof t&&(t=!k.lockTimeAxis().value()),t&&(i=this._chart.model().timeScale(),n=i.coordinateToIndex(e),o=i.points().roughTime(n),k.lockTimeAxisTime.setValue(o)),k.lockTimeAxis().setValue(t)},n.prototype._createLockTimeAxisAction=function(e){var t=new C({text:window.t("Lock Cursor in Time"),checkable:!0,statName:"ToggleLockCursorInTime"}),i=k.lockTimeAxis().value();return t.setChecked(i),t.callbacks().subscribe(null,this.toggleLockTimeAxis.bind(this,e.localX,!i)),t},n.prototype._createHVLineAction=function(e,t){t="vertical"===t&&"vertical"||"horizontal";var i=new C({text:"vertical"===t?window.t("Create Vertical Line"):window.t("Create Horizontal Line"),statName:"vertical"===t?"CreateVerticalLine":"CreateHorizontalLine"});return i.callbacks().subscribe(this,function(){var i=P(this._state),n=i.mainDataSource().firstValue(),o=this._chart.model().timeScale().coordinateToIndex(e.localX),r=i.defaultPriceScale().coordinateToPrice(e.localY,n),s=this._chart.model().createLineTool(i,{index:o,price:r},"vertical"===t&&"LineToolVertLine"||"LineToolHorzLine");this._finishTool(s)}),i},
n.prototype._createMTPredictorActions=function(){var e=this,t=function(t,i,n){var o=new C({text:t});return o.callbacks().subscribe(e,function(){var e,t,o,r=this._chart.model(),s=r.timeScale(),a=P(this._state),l=a.defaultPriceScale();s.isEmpty()||l.isEmpty()||(n?(e=a.mainDataSource().firstValue(),t=l.coordinateToPrice(this._contextMenuY,e),o=Math.round(s.coordinateToIndex(this._contextMenuX)),r.createLineTool(a,{index:o,price:t},i)):k.tool.setValue(i))}),o};return new C({text:window.t("MTPredictor"),subActions:[t(window.t("Apply Manual Risk/Reward"),"LineStudyMtpRiskReward",!1),t(window.t("Apply Manual Decision Point"),"LineStudyMtpDecisionPoint",!0),t(window.t("Analyze Trade Setup"),"LineStudyMtpAnalysis",!0),new C({text:window.t("Apply Elliot Wave"),subActions:[t(window.t("Apply Elliot Wave Intermediate"),"LineStudyMtpElliotWaveMain",!0),t(window.t("Apply Elliot Wave Major"),"LineStudyMtpElliotWaveMajor",!0),t(window.t("Apply Elliot Wave Minor"),"LineStudyMtpElliotWaveMinor",!0)]}),new C({text:window.t("Apply WPT Up Wave"),subActions:[t(window.t("Up Wave 1 or A"),"LineStudyMtpUpWave1OrA",!1),t(window.t("Up Wave 2 or B"),"LineStudyMtpUpWave2OrB",!1),t(window.t("Up Wave C"),"LineStudyMtpUpWaveC",!1),t(window.t("Up Wave 3"),"LineStudyMtpUpWave3",!1),t(window.t("Up Wave 4"),"LineStudyMtpUpWave4",!1),t(window.t("Up Wave 5"),"LineStudyMtpUpWave5",!1)]}),new C({text:window.t("Apply WPT Down Wave"),subActions:[t(window.t("Down Wave 1 or A"),"LineStudyMtpDownWave1OrA",!1),t(window.t("Down Wave 2 or B"),"LineStudyMtpDownWave2OrB",!1),t(window.t("Down Wave C"),"LineStudyMtpDownWaveC",!1),t(window.t("Down Wave 3"),"LineStudyMtpDownWave3",!1),t(window.t("Down Wave 4"),"LineStudyMtpDownWave4",!1),t(window.t("Down Wave 5"),"LineStudyMtpDownWave5",!1)]})]})},n.prototype.createEarningsShow=function(e){var t=this._chart.model().mainSeries().properties().esdShowEarnings,i=new C({checkable:!0,text:window.t("Show Earnings"),enabled:!0,checked:t.value(),statName:"ToggleShowEarnings"});return i.callbacks().subscribe(this,function(e){this._chart.model().setProperty(t,e.checked,"Show Earnings")}),i},n.prototype.createDividendsShow=function(e){var t=this._chart.model().mainSeries().properties().esdShowDividends,i=new C({checkable:!0,text:window.t("Show Dividends"),enabled:!0,checked:t.value(),statName:"ToggleShowDividends"});return i.callbacks().subscribe(this,function(e){this._chart.model().setProperty(t,e.checked,"Show Dividends")}),i},n.prototype.createSplitsShow=function(e){var t=this._chart.model().mainSeries().properties().esdShowSplits,i=new C({checkable:!0,text:window.t("Show Splits"),enabled:!0,checked:t.value(),statName:"ToggleShowSplits"});return i.callbacks().subscribe(this,function(e){this._chart.model().setProperty(t,e.checked,"Show Splits")}),i},n.prototype._studyEsdContextMenu=function(e){var t=[];return this._chart.readOnly()||t.push(this.createDividendsShow(e),this.createSplitsShow(e),this.createEarningsShow(e)),A.createMenu(t)},n.prototype._studyContextMenu=function(e){
var i,n,o,r,s,l=this._chart.actions(),c=e.properties().visible.value(),h=[];return e.userEditEnabled()?(i=this._chart,this._chart.readOnly()?(h=[c?l.studyHide:this.createActionShow(e),new I],TradingView.isInherited(e.constructor,a)||(h.push(this.createActionScaleLeft(e)),h.push(this.createActionScaleRight(e)),h.push(this.createActionNoScale(e)))):(n=[],o=e.metaInfo(),o.pine&&(n=[l.viewSourceCode],l.viewSourceCode.setEnabled(!0),ScriptLib.isAuthToGetPineSourceCode(o.scriptIdPart,o.pine.version).done(function(e){e||l.viewSourceCode.setEnabled(!1)}).fail(function(e){U.logError("Failed isAuthToGetPineSourceCode, reason: "+e)})),h=[],t.enabled("study_on_study")&&e.canHaveChildren()&&h.push(this.createActionAddChildStudy(e)),t.enabled("property_pages")&&h.push(l.format),h=h.concat(n),h=h.concat([c?l.studyHide:this.createActionShow(e),this.createVisualOrderAction(e),new I]),TradingView.isInherited(e.constructor,a)||(r=this._mergeContentMenuItems(e),!r.length||e.properties().linkedToSeries&&e.properties().linkedToSeries.value()||(r.push(new I),h=h.concat(r)),h.push(this.createActionScaleLeft(e),this.createActionScaleRight(e),this.createActionNoScale(e),new I)),t.enabled("datasource_copypaste")&&!e.isChildStudy()&&(s=new C({text:window.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),s.callbacks().subscribe(null,function(){i.onAppClipboardCopy(e)}),h.push(s)),h.push(l.studyRemove)),A.createMenu(h)):A.createMenu(h)},n.prototype.createLineToolTemplateAction=function(e){var t,i,n,o,r,s,a;return window.lineToolPropertiesToolbar?(t=window.lineToolPropertiesToolbar.templatesList(),i=new C({text:window.t("Templates"),statName:"Templates"}),i.subActions||(i.subActions=[]),n=i.subActions,o=new C({text:window.t("Save As..."),statName:"SaveAs"}),o.callbacks().subscribe(this,function(){t.showSaveDialog(function(i){var n=JSON.stringify(e.template());t.saveTemplate(i,n)})}),n.push(o),r=new C({text:window.t("Apply Default"),statName:"ApplyDefault"}),r.callbacks().subscribe(this,function(){this._chart.model().restoreLineToolFactoryDefaults(e,"Load default drawing template"),window.lineToolPropertiesToolbar.onSourceChanged(e)}),n.push(r),s=$.Deferred(),t.templatesLoaded().then(function(){var e=t.getData(),i=[];0!==e.length&&i.push(new I),$.each(e,function(e,n){function o(e){return function(){var i=this.getTopLevelMenu();return i&&i.hide(),t.deleteAction(e),!0}}var r=new C({text:n,statName:"ApplyTemplate"});r.callbacks().subscribe(this,function(){t.loadTemplate(n)}),r.deleteButton={action:o(r.text)},i.push(r)}),s.resolve(i)}),a=new L(s),n.push(a),i):null},n.prototype._lineContextMenu=function(e){var o=[],r=this._chart,s=r.actions(),a=this;return new Promise(function(l){i.e(27).then(function(c){var h,u,d,p,_,f,m=i(693).hasStylesPropertyPage;if(r.readOnly())o.push(s.lineHide);else if(e.userEditEnabled()&&(t.enabled("alerts")&&!a.chart().onWidget()&&e.hasAlert.value()&&o.push(a._createEditAlertDrawingAction(e)),t.enabled("property_pages")&&m(e,r.model())&&o.push(s.format),o.push(s.paneObjectTree),
t.enabled("charting_library_base")||null!==(h=a.createLineToolTemplateAction(e))&&o.push(h),o.push(a.createVisualOrderAction(e),new I,s.lineHide,s.lineToggleLock),e.properties().clonable&&e.properties().clonable.value()&&(u=new C({text:window.t("Clone"),callbackContext:{target:e},shortcut:"Ctrl+Drag",doNotBindShortcut:!0,statName:"Clone"}),u.callbacks().subscribe(a,n.prototype.cloneLineTool.bind(a,e,!1)),o.push(u)),t.enabled("datasource_copypaste")&&!e.properties().blockCopying&&(d=new C({text:window.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),d.callbacks().subscribe(null,function(){r.onAppClipboardCopy(e)}),o.push(d)),t.enabled("support_multicharts")&&(e.linkKey?a.chart().isMultipleLayout()&&o.push(s.lineUnlink):a.chart().isMultipleLayout()&&o.push(s.lineCopyToCharts)),o.push(s.lineRemove),e.additionalActions))for(o.push(new I),p=e.additionalActions(r.model()),_=0;_<p.length;_++)o.push(p[_]);f=A.createMenu(o),l(f)}.bind(null,i)).catch(i.oe)})},n.prototype._tradingDrawingsContextMenu=function(e){return A.createMenu(e.contextMenuItems())},n.prototype._chartEventsContextMenu=function(e){var i,n,o,r=[];return t.enabled("property_pages")&&(i=this._chart,n=new C({text:window.t("Format..."),enabled:!0,statName:"Format"}),n.callbacks().subscribe(this,function(e){TVSettings.setValue("properties_dialog.active_tab.chart",window.t("Events & Alerts")),i.showChartProperties()}),r.push(n)),o=new C({text:window.t("Hide Events on Chart"),enabled:!0,statName:"HideEvents"}),o.callbacks().subscribe(this,function(t){e.properties().visible.setValue(!1)}),r.push(o),A.createMenu(r)},n.prototype._createAlertToggleHorzLineLabelAction=function(e){var t=e.properties().line.visible,i=new C({checkable:!0,text:window.t("Extend Alert Line"),enabled:!0,checked:t.value(),statName:"ToggleExtendAlertLine"});return i.callbacks().subscribe(this,function(e){var i=e.checked,n=i?window.t("Show alert label line"):window.t("Hide alert label line");this._chart.model().setProperty(t,i,n)}),i.setEnabled(e.globalProperties().line.visible.value()),i},n.prototype._createShowGlobalAlertPropertiesLabelAction=function(e){var t=this.chart(),i=new C({text:window.t("Visual settings..."),statName:"VisualSettings"});return i.callbacks().subscribe(this,function(e){t.showChartProperties({selectAlertEvent:!0})}),i},n.prototype._createEditAlertDrawingAction=function(e){if(e.hasAlert.value()){var t=new C({text:window.t("Edit {0} Alert...").format(e.title()),statName:"EditAlert"});return t.callbacks().subscribe(null,function(){runOrSignIn(function(){e.editAlert()},{source:"Alert edit from pane context menu"})}),t}},n.prototype.cloneLineTool=function(e,t){return this._chart.model().cloneLineTool(e,t)},n.prototype.setPriceAxisSize=function(e,t){this._priceAxisWidget(e).setSize(t)},n.prototype.setPriceAxisVisible=function(e,t){this._priceAxisWidget(e).setVisible(t),this._cachedStatus=null},n.prototype.resetPriceAxisOptimalWidth=function(e){this._priceAxisWidget(e).resetOptimalWidth(),this._cachedStatus=null},n.prototype.setSize=function(e){
this.size&&this.size.equals(e)||(this.size=e,O(this.canvas,e),O(this.top_canvas,e),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(e.w),this.jqPane.height(e.h),this._cachedStatus=null,this.jqRow.toggleClass("js-hidden",0===e.h))},n.prototype.dataSourceAtPoint=function(e,t){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S=null,b=null,w=null;if(!this._state)return null;for(i=this._state.hitTestSources(),n=new o(e,t),r=i.length;0<r--;)if(s=i[r],a=s.paneViews(this._state))for(l=a.length;0<l--;)(c=a[l].renderer(t))&&c.hitTest&&(h=c.hitTest(n))&&(u=w?w.result():0,h.result()>u&&(w=h,S=s,b=c));if(this.containsMainSeries()){for(d=this._chart.model().barsMarksSources(),r=0;r<d.length;++r)for(s=d[r],a=s.paneViews(),l=0;l<a.length;l++)if(c=a[l].renderer(t),p=c.hitTest(n)){w=p,S=s,b=c;break}_=this._chart.model().activeStrategySource().value(),f=_&&_._strategyOrdersPaneView,f&&(m=f.renderer())&&(y=m.hitTest(n))&&(w=y,S=_,b=m)}return null===S&&null!==this._legendWidget&&(S=this._legendWidget.dataSourceAtPoint(e,t)),g=this._chart.model().brandingSource(),g&&(v=g.paneViews(this._state),v.forEach(function(e){var t=e.renderer().hitTest(n);t&&(w=t,S=g,b=e.renderer())})),{source:S,hittest:w,renderer:b}},n.prototype.update=function(){this.lhsPriceAxisWidget.update(),this.rhsPriceAxisWidget.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()},n.prototype.updateControls=function(){null!==this._paneControls&&this._paneControls.update()},n.prototype.drawBackground=function(e,t){B(e,0,0,this.size.w,this.size.h,t)},n.prototype.drawGrid=function(e){var t,i,n=P(this._state),o=this._chart.model().gridSource(),r=o.paneViews(n),s=n.height(),a=n.width();for(t=0;t<r.length;t++)e.save(),i=r[t].renderer(s,a),i&&i.draw(e),e.restore()},n.prototype.drawWatermark=function(e){var t,i,n,o,r,s,a=this._chart.model().watermarkSource();if(null!==a)for(t=P(this._state),i=a.paneViews(t),n=t.height(),o=t.width(),r=0;r<i.length;r++)e.save(),s=i[r].renderer(n,o),s&&s.draw(e),e.restore()},n.prototype.drawBranding=function(e){var t,i,n,o,r,s,a=this._chart.model().brandingSource();if(a)for(t=P(this._state),i=a.paneViews(t),n=t.height(),o=t.width(),r=0;r<i.length;r++)(s=i[r].renderer(n,o))&&(e.save(),s.draw(e),e.restore())},n.prototype.drawCrossHair=function(e){var t=this._chart.model().crossHairSource();t.linesShouldBeHidden()||(!t.visible&&k.lockTimeAxis().value()&&(t.setLockedPosition(P(this._state)),t.updateAllViews()),this._drawSource(t,e))},n.prototype._drawSource=function(e,t){var i,n,o,r,s=P(this._state),a=e.paneViews(s);if(a)for(i=s.height(),n=s.width(),o=0;o<a.length;o++)(r=a[o].renderer(i,n))&&(t.save(),r.draw(t),t.restore())},n.prototype._drawSourceStrategyOrders=function(e,t){var i,n=e._strategyOrdersPaneView;n&&(i=n.renderer())&&(t.save(),i.draw(t),t.restore())},n.prototype._drawSourceBackground=function(e,t){var i,n,o,r,s=P(this._state),a=e.paneViews(s);if(a)for(i=s.height(),n=s.width(),o=0;o<a.length;o++)(r=a[o].renderer(i,n))&&r.drawBackground&&(t.save(),r.drawBackground(t),t.restore())},
n.prototype.drawActiveLineTool=function(e){var t,i,n=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(t=0;t<n.length;t++)(i=n[t])&&this._chart.model().paneForSource(i)===P(this._state)&&this._drawSource(i,e)},n.prototype.disableDrawOnTop=function(e){return e&&e.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===e._metaInfo.id},n.prototype.drawSources=function(e){var t,i,n,o,r,s=P(this._state),a=s.orderedSources(),l=s.model(),c=this._chart.model().selectedSource(),h=this._chart.model().hoveredSource(),u=l.crossHairSource(),d=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(this.disableDrawOnTop(c)&&(c=void 0),this.disableDrawOnTop(h)&&(h=void 0),t=this._chart.model().model().panes(),i=t.length-1;i>=0;i--)t[i].createDrawingsCaches();for(i=0;i<a.length;i++)this._drawSourceBackground(a[i],e);for(i=0;i<a.length;i++)(n=a[i])!==u&&n!==c&&n!==h&&-1===d.indexOf(n)&&this._drawSource(n,e);for(o=null,c&&-1===d.indexOf(c)&&-1!==a.indexOf(c)&&(o=c,this._drawSource(c,e)),h&&h!==o&&-1===d.indexOf(h)&&-1!==a.indexOf(h)&&this._drawSource(h,e),r=this._chart.model().activeStrategySource().value(),r&&this.containsMainSeries()&&this._drawSourceStrategyOrders(r,e),i=t.length-1;i>=0;i--)t[i].clearDrawingCaches()},n.prototype.recalculatePriceScale=function(){var e,t,i,n=P(this._state);for(n.recalculatePriceScale(n.m_rightPriceScale),n.recalculatePriceScale(n.m_leftPriceScale),e=n.dataSources(),t=0;t<e.length;++t)i=e[t],n.isOverlay(i)&&(i instanceof d||n.recalculatePriceScale(i.priceScale()),i.updateAllViews())},n.prototype.containsMainSeries=function(){return P(this._state).containsMainSeries()},n.prototype.drawBarsMarks=function(e,t){var i,n;this.containsMainSeries()&&!t&&(i=this._chart.model().barsMarksSources(),n=this,i.forEach(function(t){n._drawSource(t,e)}))},n.prototype._syncOverlays=function(){var e,t,i=P(this._state).orderedSources(),n={},o=this;$.each(i,function(){var e,t,i=this.paneViews(o._state);if(i)for(e=0;e<i.length;e++)t=i[e],t.uid&&(n[t.uid()]=t)});for(e in this._overlays)n[e]||(this._dv.remove(this._overlays[e]),this._overlays[e]=void 0);for(e in n)this._overlays[e]||(t=n[e].overlay(),this._dv.append(t),this._overlays[e]=t)},n.prototype.hardResetCanvas=function(){this.size&&(R(this.canvas,this.size),R(this.top_canvas,this.size),this.lhsPriceAxisWidget.hardResetCanvas(),this.rhsPriceAxisWidget.hardResetCanvas())},n.prototype.paint=function(e,t){if(e&&this._chart.model()&&this._state)if(this.lhsPriceAxisWidget.paint(e),this.rhsPriceAxisWidget.paint(e),e===M.FULL_UPDATE&&(this._cachedStatus=null),e===M.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var i=this.ctx;this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawBackground(i,this.backgroundColor()),this._state&&(this.recalculatePriceScale(),this.drawGrid(i),this.drawWatermark(i),this.drawSources(i),
this.drawBarsMarks(i,t),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx),this.drawBranding(i))}},n.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget},n.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget},n.prototype._priceAxisWidget=function(e){return l.isLeft(e)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget},n.prototype.statusWidget=function(){return this._legendWidget},n.prototype.onScaleLeft=function(e){var t=P(this._state),i=e.callbackContext();-1===t.leftPriceScale().dataSources().indexOf(i)&&this.chart().model().move(i,t,t.leftPriceScale())},n.prototype.onScaleRight=function(e){var t=P(this._state),i=e.callbackContext();-1===t.rightPriceScale().dataSources().indexOf(i)&&this.chart().model().move(i,t,t.rightPriceScale())},n.prototype.onNoScale=function(e){var t=P(this._state),i=e.callbackContext();t.isOverlay(i)||this.chart().model().move(i,t,null)},n.prototype.onRiskReward=function(e){},n.prototype.createActionRiskReward=function(e){var t=new C({checkable:!1,text:window.t("Risk/Reward"),enabled:!0,statName:"RiskReward"});return t.setCallbackContext(e),t.callbacks().subscribe(this,n.prototype.onRiskReward),t},n.prototype.createActionScaleLeft=function(e){var t=new C({checkable:!0,text:window.t("Scale Left"),enabled:!0,statName:"ToggleScaleLeft"});return t.setCallbackContext(e),t.setChecked(-1!==P(this._state).leftPriceScale().dataSources().indexOf(e)),t.callbacks().subscribe(this,n.prototype.onScaleLeft),t},n.prototype.createActionScaleRight=function(e){var t=new C({checkable:!0,text:window.t("Scale Right"),enabled:!0,statName:"ToggleScaleRight"});return t.setCallbackContext(e),t.setChecked(-1!==P(this._state).rightPriceScale().dataSources().indexOf(e)),t.callbacks().subscribe(this,n.prototype.onScaleRight),t},n.prototype.createActionNoScale=function(e){var t=this._chart.model().paneForSource(e),i=t.actionNoScaleIsEnabled(e),o=new C({checkable:!0,text:window.t("Screen (No Scale)"),enabled:i,statName:"ToggleNoScale"});return o.setCallbackContext(e),o.setChecked(P(this._state).isOverlay(e)),o.callbacks().subscribe(this,n.prototype.onNoScale),o},n.prototype.createActionShowCountdown=function(e){var t=new C({checkable:!0,text:window.t("Show Countdown"),enabled:!0,statName:"ToggleShowCountdown"}),i=this._chart.model().mainSeries().properties();return t._binding=new b(t,i.showCountdown,this._chart.model(),t.text),t._binding.setValue(i.showCountdown.value()),t},n.prototype.createActionLockScale=function(e){var t,i,n;return e instanceof TradingView.Series?(t=c(e.priceScale(),this._chart.model().model().mainSeriesScaleRatio()),i=new C({checkable:e.priceScale().isLockScale(),text:window.t("Lock Scale")+" "+t,enabled:!0,statName:"LockScale"}),n=function(t){var i={lockScale:t.checked};this._undoModel.setPriceScaleMode(i,e.priceScale(),this._undoText)},i._binding=new b(i,e.priceScale().properties().lockScale,this._chart.model(),"Lock Scale",n),i):null},n.prototype.createActionMergeUp=function(e){
if(!this._chart.model().model().isMergeUpAvailableForSource(e))return null;var t=new C({checkable:!1,text:window.t("Merge Up"),enabled:!0,statName:"MergeUp"});return t.setCallbackContext(e),t.callbacks().subscribe(this,n.prototype.onMergeUp),t},n.prototype.onMergeUp=function(e){var t=e.callbackContext();this._chart.model().mergeSourceUp(t)},n.prototype.createActionUnmergeUp=function(e){if(!this._chart.model().model().isUnmergeAvailableForSource(e))return null;var t=new C({checkable:!1,text:window.t("Unmerge Up"),enabled:!0,statName:"UnmergeUp"});return t.setCallbackContext(e),t.callbacks().subscribe(this,n.prototype.onUnmergeUp),t},n.prototype.onUnmergeUp=function(e){var t=e.callbackContext();this._chart.model().unmergeSourceUp(t)},n.prototype.createActionMergeDown=function(e){if(!this._chart.model().model().isMergeDownAvailableForSource(e))return null;var t=new C({checkable:!1,text:window.t("Merge Down"),enabled:!0,statName:"MergeDown"});return t.setCallbackContext(e),t.callbacks().subscribe(this,n.prototype.onMergeDown),t},n.prototype.onMergeDown=function(e){var t=e.callbackContext();this._chart.model().mergeSourceDown(t)},n.prototype.createActionUnmergeDown=function(e){if(!this._chart.model().model().isUnmergeAvailableForSource(e))return null;var t=new C({checkable:!1,text:window.t("Unmerge Down"),enabled:!0,statName:"UnmergeDown"});return t.setCallbackContext(e),t.callbacks().subscribe(this,n.prototype.onUnmergeDown),t},n.prototype.onUnmergeDown=function(e){var t=e.callbackContext();this._chart.model().unmergeSourceDown(t)},n.prototype._mergeContentMenuItems=function(e){var t=[],i=this.createActionMergeUp(e);return i&&t.push(i),i=this.createActionUnmergeUp(e),i&&t.push(i),i=this.createActionMergeDown(e),i&&t.push(i),i=this.createActionUnmergeDown(e),i&&t.push(i),t},n.prototype.createActionShow=function(e){var t=new C({checkable:!0,text:window.t("Show"),enabled:!0,statName:"ToggleShow"});return t._binding=new b(t,e.properties().visible,this._chart.model(),t.text),t._binding.setValue(e.properties().visible.value()),t},n.prototype.createActionAddChildStudy=function(e){var t=new C({text:window.t("Apply Indicator on {0} ...").format(e.title(!0)),enabled:!0,statName:"ApplyIndicator"});return t.callbacks().subscribe(this,function(){var t,i,n=this._chart.showIndicators(e);n&&(t=function(){g("SOS","Apply SOS","Apply by RC menu")},i=this._chart.model().model().studyInserted(),i.subscribe(this,t),n.visibilityChanged.subscribe(this,function(e){e||i.unsubscribe(this,t)},!0))}),t},n.prototype.bringObjectForward=function(e){var t=this._chart.model().selectedSource();t&&this._chart.model().changeZOrder(t,1)},n.prototype.sendObjectToBack=function(e){var t=this._chart.model().selectedSource();t&&this._chart.model().sendToBack(t)},n.prototype.bringObjectToFront=function(e){var t=this._chart.model().selectedSource();t&&this._chart.model().bringToFront(t)},n.prototype.sendObjectBackward=function(e){var t=this._chart.model().selectedSource();t&&this._chart.model().changeZOrder(t,-1)},n.prototype.createVisualOrderAction=function(e){
var t,i,o,r,s,a,l=new C({text:window.t("Visual Order"),statName:"VisualOrder"});return l.subActions||(l.subActions=[]),t=new C({text:window.t("Bring to Front"),statName:"BringToFront"}),t.callbacks().subscribe(this,n.prototype.bringObjectToFront),l.subActions.push(t),i=new C({text:window.t("Send to Back"),statName:"SendToBack"}),i.callbacks().subscribe(this,n.prototype.sendObjectToBack),l.subActions.push(i),o=new C({text:window.t("Bring Forward"),statName:"BringForward"}),o.callbacks().subscribe(this,n.prototype.bringObjectForward),l.subActions.push(o),r=new C({text:window.t("Send Backward"),statName:"SendBackward"}),r.callbacks().subscribe(this,n.prototype.sendObjectBackward),l.subActions.push(r),s=this._chart.model().paneForSource(e),a=s.getZOrderMinMax(),i.setEnabled(!0),o.setEnabled(!0),r.setEnabled(!0),t.setEnabled(!0),e.zorder()===a.minZOrder&&(i.setEnabled(!1),r.setEnabled(!1)),e.zorder()===a.maxZOrder&&(o.setEnabled(!1),t.setEnabled(!1)),l},n.prototype.image=function(){var e={};return e.leftAxis=this.leftPriceAxisWidget().image(),e.rightAxis=this.rightPriceAxisWidget().image(),e.content=this.canvas.toDataURL(),e.contentWidth=this.size.w,e.contentHeight=this.size.h,e},n.prototype._updateTooltip=function(e,t){if(!this._rafSet){var i=this;requestAnimationFrame(function(){i._state&&(i._updateTooltipImpl(e,t),i._rafSet=!1)}),this._rafSet=!0}},n.prototype._updateTooltipImpl=function(e,t){function i(i){function o(){return TradingView.isMobile.any()?{left:e-n._tooltipSelector.outerWidth()-16,top:t-n._tooltipSelector.outerHeight()-16}:{left:e+16,top:t+16}}TradingView[r].getTooltipText&&(i=TradingView[r].getTooltipText(a)||i),n._tooltipSelector.html(i).removeClass("tooltip-selector-hidden").css(o())}var n,o,r,s,a,l;if(this._chart){for(n=this,o=this._chart.paneWidgets(),r=k.tool.value(),s=P(this._state).model(),a=s.lineBeingCreated(),l=o.length-1;l>=0;l--)o[l]._hideTooltip();this._isSelectBarModeEnabled()||(m(r)&&!TradingView.isMobile.any()?i(window.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&f(r)&&!n._chart.model().lineBeingCreated()?i(window.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&f(r)&&i(window.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor")))}},n.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")},n.prototype._updateCrosshairOnZoom=function(){var e,t;k.lockTimeAxis().value()&&(e=this._chart.model(),t=e.crossHairSource(),t.setPosition(t.index,t.price,P(this._state)))},n.prototype._isSelectBarModeEnabled=function(){return this._chart.model().crossHairSource().selectBarMode().value()},e.exports=n}).call(t,i(5))},function(e,t){},function(e,t,i){"use strict";function n(e,t){this._source=t,this._properties=e,this._points=[new l(-1,-1)],this._invalidated=!0,this._lineRenderer=new h}function o(){this._data=null}function r(e){this._source=e,this._points=[],this._bandBgRenderer=new o
}function s(e,t,i){this._source=e,this._points=[],a(t.type===u.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+t.type),this._initBandIndexes(t.objAId,t.objBId),this._fillStyleProps=i,this._bandBgRenderer=new o}var a=i(7).assert,l=i(6).Point,c=i(50).clamp,h=i(109).HorizontalLineRenderer,u=i(26),d=i(29);n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i=this._source.priceScale();if(!i||i.isEmpty())return void(this._points[0]=new l(-1,-1));e=this._properties.value.value(),isNumber(e)?(t=this._source.firstValue(),this._points[0]=new l(-1,i.priceToCoordinate(e,t))):this._points[0]=new l(-1,NaN)},n.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var e={};return e.width=this._source.model().timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._properties.color.value(),e.linewidth=this._properties.linewidth.value(),e.linestyle=this._properties.linestyle.value(),this._lineRenderer.setData(e),this._lineRenderer},o.prototype.setData=function(e){this._data=e},o.prototype.draw=function(e){var t,i,n;null!==this._data&&0!==this._data.points.length&&(t=e.canvas.width,e.fillStyle=d.generateColor(this._data.backcolor,this._data.transparency),i=Math.min(this._data.points[0],this._data.points[1]),n=Math.max(this._data.points[0],this._data.points[1]),e.fillRect(0,i,t,n-i))},o.prototype.hitTest=function(e){return null},r.prototype.update=function(){var e,t,i,n,o;this._points=[],e=this._source.properties().bandsBackground,e.fillBackground.value()&&(t=this._source.properties().bands[0],i=this._source.properties().bands[1],(n=this._source.priceScale())&&!n.isEmpty()&&(o=this._source.firstValue(),this._points.push(n.priceToCoordinate(t.value.value(),o)),this._points.push(n.priceToCoordinate(i.value.value(),o))))},r.prototype.renderer=function(){var e={};return e.points=this._points,e.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),e.transparency=this._source.properties().bandsBackground.transparency.value(),this._bandBgRenderer.setData(e),this._bandBgRenderer},s.prototype._initBandIndexes=function(e,t){var i,n;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)n=this._source.metaInfo().bands[i],null!==this._bandAKey||n.id!==e?null!==this._bandBKey||n.id!==t||(this._bandBKey=i):this._bandAKey=i},s.prototype.update=function(){var e,t,i,n;this._points=[],this._fillStyleProps.visible.value()&&(e=this._source.properties().bands[this._bandAKey],t=this._source.properties().bands[this._bandBKey],(i=this._source.priceScale())&&!i.isEmpty()&&(n=this._source.firstValue(),this._points.push(i.priceToCoordinate(e.value.value(),n)),this._points.push(i.priceToCoordinate(t.value.value(),n))))},s.prototype.renderer=function(){var e,t=this._fillStyleProps.transparency.value();return t=c(t,0,100),e={},e.points=this._points,e.backcolor=d.generateColor(this._fillStyleProps.color.value(),t),e.transparency=this._fillStyleProps.transparency.value(),
this._bandBgRenderer.setData(e),this._bandBgRenderer},t.BandPaneView=n,t.BandBackgroundPaneView=r,t.HlineFillPaneView=s},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._updateRendererData=function(e){e.visible=!1;var t=this._source.lastValueData(this._data.plotIndex,!1);t.noData||(e.background=t.color,e.color=this.generateTextColor(t.color),e.coordinate=t.coordinate,e.floatCoordinate=t.floatCoordinate,e.text=t.text,e.visible=!0)},t}(o.a)},function(e,t,i){"use strict";function n(e,t,i,n){var o,r;for(this.m_study=e,this.m_series=t,this.m_model=i,this._plotName=n,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=K.enabled("source_selection_markers"),o=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,r=0;r<o.length;r++)o[r].id===this._plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&o[r].target===this._plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[o[r].palette],this._paletterProps=this.m_study.properties().palettes[o[r].palette])}function o(e,t,i,n){var o,r;for(this._study=e,this._series=t,this._model=i,this._plotName=n,this._items=[],this._invalidated=!0,this._isMarkersEnabled=K.enabled("source_selection_markers"),o=this._study.metaInfo().plots,r=0;r<o.length;r++)o[r].id===this._plotName&&(this._plotIndex=r,d(this._study.isBgColorerPlot(r),"Plot '"+this._plotName+"' is not a background colorer!"))}function r(e,t,i,n){var o,r;for(this.m_study=e,this.m_series=t,this.m_model=i,this.m_plotName=n,this.m_items=[],this.m_invalidated=!0,this._isMarkersEnabled=K.enabled("source_selection_markers"),this.m_selectionData=null,this.m_plotIndex=null,o=this.m_study.metaInfo().plots,r=0;r<o.length;r++)if(o[r].id===this.m_plotName){this.m_plotIndex=r;break}for(o=this.m_study.metaInfo().plots,this._colorer=null,this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,r=0;r<o.length;r++)o[r].id===this.m_plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&o[r].target===this.m_plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[o[r].palette],this._paletterProps=this.m_study.properties().palettes[o[r].palette]),this.m_study.isTextColorerPlot(r)&&o[r].target===this.m_plotName&&(this._textColorer=r,this._textPalette=this.m_study.metaInfo().palettes[o[r].palette],this._textPaletterProps=this.m_study.properties().palettes[o[r].palette])}function s(e,t,i,n){r.call(this,e,t,i,n)}function a(e,t,i,n){s.call(this,e,t,i,n)}function l(e,t,i,n){r.call(this,e,t,i,n),this._maxAbsValue=0}function c(e,t,i,n){var o,r;for(this.m_study=e,this.m_series=t,this.m_model=i,this.m_plotName=n,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=K.enabled("source_selection_markers"),o=this.m_study.metaInfo().plots,
this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},r=0;r<o.length;r++)o[r].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(r)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=r),this.m_study.isOHLCHighPlot(r)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=r),this.m_study.isOHLCLowPlot(r)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=r),this.m_study.isOHLCClosePlot(r)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=r),this.m_study.isOHLCColorerPlot(r)&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[o[r].palette],this._paletterProps=this.m_study.properties().palettes[o[r].palette]))}function h(e,t,i,n){c.call(this,e,t,i,n)}function u(e,t,i,n){c.call(this,e,t,i,n)}var d=i(7).assert,p=i(6).Point,_=i(24),f=_.rgbToHsl,m=_.hslToRgb,y=_.rgbToHexString,g=_.parseRgb,v=_.parseRgba,S=i(9).HitTestResult,b=i(190),w=b.SelectionRenderer,P=b.SelectionRendererArrowsUpDown,T=i(263).PaneRendererBars,x=i(511).PaneRendererHistogram,C=i(512).PaneRendererColumns,L=i(136).PaneRendererLine,I=i(264).PaneRendererArea,A=i(210).PaneRendererCandles,k=i(513).PaneRendererCross,E=i(514).PaneRendererCircles,M=i(167).PaneRendererArrowsUpDownItem,V=i(167).PaneRendererArrowsUpDown,D=i(339).PaneRendererUnicodeChar,O=i(515).PaneRendererBackground,R=i(516).PaneRendererStepLine,B=i(265),N=i(69).CompositeRenderer,F=i(266),W=i(50).clamp,H=i(211),j=i(86),z=j.PlotType,U=j.PlotSymbolSize,q=i(212).MarkLocation,$=i(517),Y=i(29),G=i(17).PlotRowSearchMode,K=i(5);i(518),i(519),i(520),i(521),i(522),i(523),i(524),i(525),i(526),n.isIndexValid=function(e,t){return null!==e&&e>=0&&e<t._length()},n.prototype.items=function(){return this.m_items},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,o,r,s,a,l,c,h,u,d,_,f,m,y,g,v,b,w,P,T,x,C,L,I;if(this._histogramBase=null,this.m_items=[],!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(e=this.m_model.timeScale().visibleBars())||(t=this.m_series.nearestIndex(e.firstBar(),G.NearestRight),i=this.m_series.nearestIndex(e.lastBar(),G.NearestLeft),o=this.m_study.offset(this._plotName),o>0?(t-=o,i+=o):(t+=o,i-=o),(r=this.m_study.getMinFirstBarIndexForPlot(this._plotName))>i))){if(t=Math.max(r,t),s=this.m_study.properties().styles[this._plotName],a=s.plottype.value(),l=[z.Line,z.Area,z.Circles,z.Cross].indexOf(a)>=0,c=this.m_study.data(),h=this.m_study.firstValue(),l&&c._length()>0){for(u=c._bsearch(t);n.isIndexValid(u,c)&&void 0===c._valueAt(u)[this._plotIndex+1];)u-=1;for(t=n.isIndexValid(u,c)?c._indexAt(u):t,d=c._bsearch(i);n.isIndexValid(d,c)&&void 0===c._valueAt(d)[this._plotIndex+1];)d+=1;i=n.isIndexValid(d,c)?c._indexAt(d):i}if(_=c.range(t,i),f=this.m_study.priceScale(),m=W(this._getTranspValue(),0,100),y={},g=function(e,t){var i=e+"@"+t;return y[i]||(this._plotName&&"vol"===this._plotName?y[i]=Y.generateColor(e,t):y[i]=Y.generateColor(e,t,!0)),y[i]}.bind(this),_.each(function(e,t){var i,n,r,a,c,h,u,d,_;return e+=o,e=Math.floor(e),i=t[this._plotIndex+1],n=void 0===i||null===i,i=n?NaN:i,
(!l||!n)&&(r=new p(e,i),a=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&a&&(i=t[this._colorer+1],r.style={},null!=i?(c=this._palette.valToIndex?this._palette.valToIndex[i]:i,h=this._paletterProps.colors[c],u=h.color.value(),r.style.color=Y.isHexColor(u)?g(u,m):u):(u=s.color.value(),r.style.color=g(u,100)),d=void 0!==c?h.width.value():s.linewidth.value(),_=void 0!==c?h.style.value():s.linestyle.value(),r.style.width=d,r.style.style=_),this.m_items.push(r),!1)}.bind(this)),f.pointsArrayToCoordinates(this.m_items,h),this.m_model.timeScale().indexesToCoordinates(this.m_items),s.histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(s.histogramBase.value(),h)),this.m_study===this.m_model.selectedSource())for(v=F(t,i),this._selectionData={points:[]},this._selectionData.hittestResult=S.REGULAR,b=0;b<v.length;b++)w=v[b],P=this.m_study.data().valueAt(w),w+=o,null!==P&&(T=P[this._plotIndex+1],x=this.m_model.timeScale().indexToCoordinate(Math.floor(w)),C=this.m_study.priceScale().priceToCoordinate(T,h),this._selectionData.points.push(new p(x,C)));L=s,this._lineColor=Y.generateColor(L.color.value(),m),this._lineWidth=L.linewidth.value(),I=L.color.value(),this._colorer&&null!=(T=this._paletterProps.colors[0])&&(I=T.color.value(),this._lineWidth=T.width.value(),this._lineColor=Y.generateColor(T.color.value(),m)),this._color2=Y.generateColor(I,m),this._color1=Y.generateColor(n.addHueForColor(I),m)}},n.addHueForColor=$(function(e){var t=f(g(e)),i=t[0]+.05;return t[0]=i-Math.floor(i),y(m(t))}),n.prototype._getTranspValue=function(){var e=this.m_study.properties(),t=e.styles[this._plotName],i=0,n=0,o=this.m_study.metaInfo();return"Volume@tv-basicstudies"===o.id&&o.version<=46&&"transparency"in e?(i=e.transparency.value(),i=isNumber(i)?i:n):(t.transparency&&(i=t.transparency.value(),i=isNumber(i)?i:n),i)},n.prototype.renderer=function(){var e,t,i,n,o,r=this.m_study.properties().styles[this._plotName];if(r.visible.value()&&this.m_study.priceScale()){switch(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.barSpacing=this.m_model.timeScale().barSpacing(),e.items=this.m_items,e.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height(),e.lineIndex=0,e.lineStyle=r.linestyle.value(),e.lineColor=this._lineColor,e.lineWidth=this._lineWidth,e.lineWidth=isNumber(e.lineWidth)?e.lineWidth:1,e.color1=this._color1,e.color2=this._color2,e.bottom=e.histogramBase,this._colorer||(e.simpleMode=!0),t=new N,i=!!r.joinPoints&&r.joinPoints.value(),r.plottype.value()){case z.Line:case z.LineWithBreaks:t.append(new L(e));break;case z.Area:case z.AreaWithBreaks:t.append(new I(e));break;case z.Histogram:t.append(new x(e));break;case z.Columns:t.append(new C(e));break;case z.Cross:t.append(new k(e)),i&&(n=TradingView.merge({},e),n.lineWidth=1,n.forceLineWidth=!0,t.append(new L(n)));break;case z.Circles:t.append(new E(e)),i&&(n=TradingView.merge({},e),n.lineWidth=1,n.ignorePaletteLineWidth=!0,t.append(new L(n)));break;case z.StepLine:o=new R,
o.setData(e),t.append(o);break;default:t.append(new L(e))}return this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new w(this._selectionData)),t}},o.prototype.items=function(){return this._items},o.prototype.update=function(){this._invalidated=!0},o.prototype._scalesReady=function(){var e=this._model.timeScale(),t=this._study.priceScale();return e&&t&&!e.isEmpty()&&!t.isEmpty()},o.prototype._getTranspValue=function(){var e=this._study.properties(),t=e.styles[this._plotName],i=0;return t.transparency&&(i=t.transparency.value(),i=isNumber(i)?i:40),i},o.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,_;this._items=[],d(this._scalesReady(),"Scales must be ready!"),null!==(e=this._model.timeScale().visibleBars())&&(t=this._study.metaInfo().plots,i=t[this._plotIndex].palette,n=this._study.properties().palettes[i],o=n.colors,r=this._study.metaInfo().palettes[i],s=this._getTranspValue(),a=this._series.nearestIndex(e.firstBar(),G.NearestRight),l=this._series.nearestIndex(e.lastBar(),G.NearestLeft),c=this._study.offset(this._plotName),c>0?(a-=c,l+=c):(a+=c,l-=c),(h=this._study.getMinFirstBarIndexForPlot(this._plotName))>l||(a=Math.max(h,a),u=this._study.data(),_=u.range(a,l),_.each(function(e,t){var i,n,a,l;return e+=c,i=t[this._plotIndex+1],n=new p(Math.floor(e)-.5),a=isNumber(s)?s:50,a=Math.min(a,100),a=Math.max(a,0),null!=i?(l=r.valToIndex?r.valToIndex[i]:i,n.color=Y.generateColor(o[l].color.value(),a)):n.color=null,this._items.push(n),!1}.bind(this)),this._model.timeScale().indexesToCoordinates(this._items)))},o.prototype.renderer=function(){var e,t;if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},t=new N,t.append(new O(e)),t},r.prototype.items=function(){return this.m_items},r.prototype.update=function(){this.m_invalidated=!0},r.prototype._scalesReady=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();return e&&t&&!e.isEmpty()&&!t.isEmpty()},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m;this.m_items=[],this._scalesReady()&&(e=this.m_model.timeScale(),t=this.m_study.priceScale(),null!==(i=e.visibleBars())&&(n=this.m_series.nearestIndex(i.firstBar(),G.NearestRight),o=this.m_series.nearestIndex(i.lastBar(),G.NearestLeft),r=this.m_study.offset(this.m_plotName),r>0?(n-=r,o+=r):(n+=r,o-=r),(s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>o||(n=Math.max(s,n),a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(n,o),h=this._getTranspValue(),u=F(n,o),d=this.m_study===this.m_model.selectedSource(),this.m_selectionData=d?{points:[],hittestResult:S.REGULAR,vertOffset:0}:null,p=this.m_series.properties().style.value(),_=p===TradingView.Series.STYLE_LINE?"lineStyle":p===TradingView.Series.STYLE_AREA?"areaStyle":null,
_?(f=this.m_series.properties()[_].priceSource.value(),m=f):(f="high",m="low"),this._topCoord=t.coordinateToPrice(t.height()*t.topMargin(),l),this._bottomCoord=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),l),c.each(function(e,t){var i,n,o,s,a,l,c,p=Math.floor(e+r),_=t[this.m_plotIndex+1];return null!==_&&void 0!==_&&(i=this._createItem(p,_,f,m),void 0!==i&&null!==i?(n=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&n&&(_=t[this._colorer+1],i.style={},null!=_?(s=this._palette.valToIndex?this._palette.valToIndex[_]:_,o=this._paletterProps.colors[s].color.value(),i.style.color=Y.generateColor(o,h)):(o=this.m_study.properties().styles[this.m_plotName].color.value(),i.style.color=Y.generateColor(o,100)),a=h>9?h-10:0,i.style.borderColor=Y.generateColor(o,a)),l=void 0!==t[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&l&&(_=t[this._textColorer+1],i.style||(i.style={}),null!=_?(s=this._textPalette.valToIndex?this._textPalette.valToIndex[_]:_,c=this._textPaletterProps.colors[s].color.value(),i.style.textColor=Y.generateColor(c,h)):(c=this.m_study.properties().styles[this.m_plotName].textColor.value(),i.style.textColor=Y.generateColor(c,100))),d&&-1!==u.indexOf(e)&&this.m_selectionData.points.push(i),this.m_items.push(i),!1):void 0)}.bind(this)),this._convertItemsToCoordinates())))},r.prototype._getSeriesVal=function(e,t){var i;e=e||"close",i=null;try{i=this.m_series[e](t)}catch(e){}return i},r.prototype._getTranspValue=function(){var e,t=0;return this.m_study.properties().transparency&&(t=this.m_study.properties().transparency.value(),t=isNumber(t)?t:50),e=this.m_study.properties().styles[this.m_plotName],e.transparency&&(t=e.transparency.value(),t=isNumber(t)?t:50),W(t,0,100)},r.prototype._createItem=function(e,t,i,n){var o,r,s,a=this.m_study.properties().styles[this.m_plotName].location.value();if(!t&&a!==q.Absolute)return null;switch(a){case q.AboveBar:if(void 0===(o=this._getSeriesVal(i,e))||null==o)return null;r=o;break;case q.BelowBar:if(void 0===(s=this._getSeriesVal(n,e))||null==s)return null;r=s;break;case q.Top:r=this._topCoord;break;case q.Bottom:r=this._bottomCoord;break;case q.Absolute:r=t;break;default:throw Error("Bad value: "+a)}return new p(e,r)},r.prototype._convertItemsToCoordinates=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();e.indexesToCoordinates(this.m_items),t.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue())},r.prototype._calculateVerticalOffset=function(e,t){var i=0;switch(e){case q.AboveBar:case q.Bottom:i=-t;break;case q.BelowBar:case q.Top:i=t}return i},r.prototype._calculateShapeHeight=function(e,t){var i=e;switch(t){case U.Tiny:i=.3*e;break;case U.Small:i=.6*e;break;case U.Normal:i=e;break;case U.Large:i=1.5*e;break;case U.Huge:i=2*e}return i},r.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l,c
;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return e=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},i=this._getTranspValue(),n=e.barSpacing(),o=this._calculateShapeHeight(n),r=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(r,o+o/2),t.barSpacing=n,t.items=this.m_items,t.color=Y.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),t.height=o,t.vertOffset=s,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=H.plotShapesData[a],c=new N,l&&c.append(new TradingView[l.paneRendererClass](t)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=s,c.append(new w(this.m_selectionData))),c},inherit(s,r),s.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S=this.m_study.properties().styles[this.m_plotName];if(S.visible&&S.visible.value()&&this._scalesReady())return e=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},i=this._getTranspValue(),n=e.barSpacing(),S.size?(r=S.size.value(),o=this._calculateShapeHeight(25,r)):o=Math.round(n/2),s=S.location.value(),a=Y.generateColor(S.color.value(),i),l=i>19?i-10:0,c=this._calculateVerticalOffset(s,Math.round(1.5*o)),t.barSpacing=n,t.items=this.items(),t.color=a,t.borderColor=Y.generateColor(S.color.value(),l),t.height=o,t.vertOffset=c,h=S.plottype.value(),u=H.plotShapesData[h],d=new N,p=S.text?S.text.value():void 0,void 0!==p&&""!==p.trim()&&(_=p.trim().replace(/\\n/gm,"\n"),_=TradingView.cleanButAmpersand(_,!0),f=!1,m=!1,y="Arial",g=12,t.textCache=new B(_,f,m,y,g),v=S.textColor?S.textColor.value():void 0,t.textColor=v?Y.generateColor(v,i):a),null!=u&&d.append(new TradingView[u.paneRendererClass](t)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=c,d.append(new w(this.m_selectionData))),d},inherit(a,s),a.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y=this.m_study.properties().styles[this.m_plotName];if(y.visible&&y.visible.value()&&this._scalesReady())return e=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},i=this._getTranspValue(),n=e.barSpacing(),y.size?(r=y.size.value(),o=this._calculateShapeHeight(50,r)):o=Math.round(n),s=y.location.value(),a=Y.generateColor(y.color.value(),i),l=this._calculateVerticalOffset(s,o),t.items=this.items(),t.char=y.char.value(),t.height=o,t.vertOffset=l,t.color=a,c=new N,h=y.text?y.text.value():void 0,void 0!==h&&""!==h.trim()&&(u=h.trim().replace(/\\n/gm,"\n"),u=TradingView.cleanButAmpersand(u,!0),d=!1,p=!1,_="Arial",f=12,t.textCache=new B(u,d,p,_,f),m=y.textColor?y.textColor.value():void 0,t.textColor=m?Y.generateColor(m,i):a),c.append(new D(t)),
this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=l,c.append(new w(this.m_selectionData))),c},inherit(l,r),l.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},t=W(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),e.items=this.m_items,e.barSpacing=i,e.colorup=Y.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),t),e.colordown=Y.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),t),n=v(e.colorup),o=n?100*(1-n[3]):0,r=v(e.colordown),s=r?100*(1-r[3]):0,e.colorBorderUp=Y.generateColor("#000000",o),e.colorBorderDown=Y.generateColor("#000000",s),e.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),e.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),a=new N,a.append(new V(e)),this.m_study===this.m_model.selectedSource()&&null!==this.m_selectionData&&(l=this.m_selectionData,l.barSpacing=i,a.append(new P(l))),a},l.prototype._createItem=function(e,t,i,n){var o,r,s,a;if(0!==t){if(Math.abs(t)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(t)),o=t>0){if(void 0===(s=this._getSeriesVal(n,e))||null==s)return null;r=s}else{if(void 0===(a=this._getSeriesVal(i,e))||null==a)return null;r=a}return new M(e,r,t,o)}},l.prototype._convertItemsToCoordinates=function(){var e,t,i,n,o,r,s,a,l,c=this.m_model.timeScale(),h=this.m_study.priceScale();for(c.indexesToCoordinates(this.m_items),h.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue()),e=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),t=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),e>t&&(i=e,e=t,t=i),n=t-e,o=n/this._maxAbsValue,r=this.m_items,s=0;s<r.length;s++)a=r[s],l=Math.abs(a.height),a.height=l*o+e},c.prototype.update=function(){this._invalidated=!0},c.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,_,v,b,w,P,T;if(this.m_bars.length=0,!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(e=this.m_model.timeScale().visibleBars())||(t=this.m_series.nearestIndex(e.firstBar(),G.NearestRight),i=this.m_series.nearestIndex(e.lastBar(),G.NearestLeft),(n=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>i||(t=Math.max(n,t),o=this.m_study.data(),r=this.m_study.firstValue(),s=o.range(t,i),a=0,l=this.m_study.properties().ohlcPlots[this.m_plotName],c={},h=function(e,t){var i=e+"@"+t;return c[i]||(c[i]=Y.generateColor(e,t)),c[i]},s.each(function(e,t){var i,n,o,r,s,c,u,d,p,_,v,S,b,w,P,T;for(e=Math.floor(e),i=!0,n={},o=TradingView.OPEN_PLOT;o<=TradingView.CLOSE_PLOT;++o){if(void 0===(r=t[this._ohlcPlotIndexes[o]+1])||null===r){i=!1;break}n[o]=r}return!!i&&(s=n[TradingView.OPEN_PLOT],c=n[TradingView.CLOSE_PLOT],
u=Math.max(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],c),d=Math.min(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],c),p={},p.time=Math.round(e),p.open=s,p.high=u,p.low=d,p.close=c,_=l.color.value(),v=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&v&&null!=(r=t[this._colorer+1])&&(S=this._palette.valToIndex?this._palette.valToIndex[r]:r,b=this._paletterProps.colors[S],_=b.color.value()),p.color=h(_,a),w=f(g(_)),P=w[2]>.25?w[2]-.26:w[2]+.75,T=m(w[0],w[1],P),p.borderColor=h(y(T),a),p.hollow=null,this.m_bars.push(p),!1)}.bind(this)),u=this.m_study.priceScale(),u.barPricesToCoordinates(this.m_bars,r),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study!==this.m_model.selectedSource()))))for(d=F(t,i),this._selectionData={points:[],hittestResult:S.REGULAR},_=0;_<d.length;_++)v=d[_],null!==(b=this.m_study.data().valueAt(v))&&(w=b[this._plotIndex+1],P=this.m_model.timeScale().indexToCoordinate(Math.floor(v)),T=this.m_study.priceScale().priceToCoordinate(w,r),this._selectionData.points.push(new p(P,T)))},c.prototype.items=function(){return this.m_bars},inherit(h,c),h.prototype.renderer=function(){var e,t;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),t=new N,t.append(new T(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&t.append(new w(this._selectionData)),t},inherit(u,c),u.prototype.renderer=function(){var e,t,i,n=this.m_study.properties().ohlcPlots[this.m_plotName];if(n.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={},e.bars=this.m_bars,e.barSpacing=this.m_model.timeScale().barSpacing(),e.drawWick=n.drawWick.value(),e.drawBorder=n.drawBorder.value(),t=n.wickColor.value(),e.borderColor=t,e.wickColor=t,i=new N,i.append(new A(e)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new w(this._selectionData)),i},t.StudyPaneView=n,t.StudyBackgroundPaneView=o,t.StudyPlotShapesPaneView=s,t.StudyPlotCharsPaneView=a,t.StudyPlotArrowsPaneView=l,t.StudyPlotCandlesPaneView=u,t.StudyPlotBarsPaneView=h},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.histogramBase=e.histogramBase,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth}var o=i(6).Point,r=i(30).distanceToSegment,s=i(27).selectionTolerance,a=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r;for(e.translate(.5,.5),e.fillStyle=this.lineColor,t=this.lineWidth,i=0;i<this.items.length;++i)n=this.items[i],o=n.x,r=n.y,n.style&&(e.fillStyle=n.style.color,t=n.style.width),e.fillRect(Math.round(o-.5*t),r,t,this.histogramBase-r)},n.prototype.hitTest=function(e){var t,i,n,l,c,h=s(this.lineWidth);for(c=0;c<this.items.length;++c)if(t=this.items[c],i=t.x,n=t.y,l=r(new o(i,n),new o(i,this.histogramBase),new o(e.x,e.y)),
l.distance<=h)return new a(a.REGULAR);return null},t.PaneRendererHistogram=TradingView.PaneRendererHistogram=n},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.histogramBase=e.histogramBase,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth}var o=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m;if(0!==this.items.length){for(t=this.barSpacing,i=this.lineColor,n=this.histogramBase,e.translate(.5,.5),o={},r=this.items,s=null,a=0;a<r.length;++a)l=r[a],c=0===a?null:r[a-1],h=l.style?l.style.color:i,u=o[h]||[],d=Math.floor(l.x-.5*t),p=Math.ceil(d+t),s&&(_=p-d>5?1:0,s.right=d-_),f={item:l,prev:c,left:d,right:p},u.push(f),s=f,o[h]=u;for(h in o){for(u=o[h],e.fillStyle=h,e.strokeStyle=h,e.lineWidth=1,e.beginPath(),a=0;a<u.length;a++)l=u[a],m=l.item.y,d=l.left,p=l.right,e.rect(d,m,p-d,n-m);e.fill()}}},n.prototype.hitTest=function(e){var t,i,n,r=.5*this.barSpacing+this.lineWidth,s=e.x-r,a=e.x+r,l=this.items;for(t=l.length;t--;)if((i=l[t].x)>=s&&i<=a&&(n=l[t].y,e.y>=Math.min(n,this.histogramBase)&&e.y<=Math.max(n,this.histogramBase)))return new o(o.REGULAR);return null},t.PaneRendererColumns=TradingView.PaneRendererColumns=n},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth,this.lineStyle=e.lineStyle}var o=i(6).Point,r=i(30).distanceToSegment,s=i(27).selectionTolerance,a=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c=!1;for(n=0;n<this.items.length;++n)o=this.items[n],r=o.x,s=o.y,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=o.style?(a=o.style.color,t=o.style.width):(a=this.lineColor,t=this.lineWidth),a!==i&&(i=a,c&&e.fill(),e.beginPath(),e.fillStyle=a),l=3*t,e.rect(r-l/2,s-t/2,l,t),e.rect(r-t/2,s-l/2,t,l),c=!0);c&&e.fill()},n.prototype.hitTest=function(e){var t,i,n,l,c,h,u=s(this.lineWidth);for(h=1;h<this.items.length;++h)if(t=this.items[h-1],i=this.items[h],n=t.x,l=i.x,c=r(new o(n,t.y),new o(l,i.y),new o(e.x,e.y)),c.distance<=u)return new a(a.REGULAR);return null},t.PaneRendererCross=TradingView.PaneRendererCross=n},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.lineColor=e.lineColor||e.color,this.radius=e.lineWidth||e.height/2,this.vertOffset=e.vertOffset||0}var o=i(6).Point,r=i(27).selectionTolerance,s=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l=2*Math.PI,c=!1;for(n=0;n<this.items.length;++n)o=this.items[n],r=o.x,s=o.y+this.vertOffset,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=o.style?(a=o.style.color,t=o.style.width):(a=this.lineColor,t=this.radius),a!==i&&(i=a,c&&e.fill(),e.beginPath(),e.fillStyle=a),e.moveTo(r+t,s),e.arc(r,s,t,0,l,!1),c=!0);c&&e.fill()},n.prototype.hitTest=function(e){var t,i,n,a=2*this.radius,l=this.vertOffset,c=r(a);for(t=0;t<this.items.length;++t)if((i=this.items[t])&&(n=new o(i.x,i.y+l),n.subtract(e).length()+this.radius<=c))return new s(s.REGULAR);return null},t.PaneRendererCircles=TradingView.PaneRendererCircles=n
},function(e,t,i){"use strict";function n(e){this._items=e.items,this._y=e.y,this._h=e.h,this._w=e.w}n.prototype.draw=function(e){},n.prototype.drawBackground=function(e){var t,i,n;for(e.save(),e.translate(-.5,-.5),t=0;t<this._items.length;++t)i=this._items[t],null!=i.color&&(e.fillStyle=i.color,n=t===this._items.length-1?this._w:this._items[t+1].x-i.x,e.fillRect(i.x,this._y,n,this._h));e.restore()},n.prototype.hitTest=function(e){return null},t.PaneRendererBackground=TradingView.PaneRendererBackground=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PaneRendererStepLine",function(){return c}),n=i(9),o=i(6),i.n(o),r=i(46),i.n(r),s=i(78),a=i(30),i.n(a),l=i(27),c=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,n,o,s,a,l,c,h,u;if(null!==this._data&&0!==this._data.items.length){for(t=this._data,i=t.lineWidth,n=t.lineStyle,o=t.lineColor,s=t.items,e.save(),e.lineCap="square",e.strokeStyle=o,e.lineWidth=i,i%2==0&&e.translate(-.5,-.5),void 0!==n&&Object(r.setLineStyle)(e,n),e.beginPath(),e.moveTo(s[0].x,s[0].y),a=s.length,l=0;l<a;l++)c=s[l],e.lineTo(c.x,c.y),(h=s[l+1])&&(u=Math.round((c.x+h.x)/2),e.lineTo(u,c.y),e.lineTo(u,h.y));e.stroke(),e.restore()}},e.prototype.hitTest=function(e){var t,i,r,c,h,u,d,p,_,f,m,y,g;if(null===this._data||0===this._data.items.length)return null;for(t=this._data,i=t.items,r=t.lineWidth,c=Object(l.selectionTolerance)(r),h=Object(s.lowerbound)(i,e,function(e,t){return e.x<=t.x}),u=Math.max(0,h-1),d=Math.min(i.length-1,h+1),p=u;p<d;p++)if(_=i[p],(f=i[p+1])&&(m=Math.round((_.x+f.x)/2),y=new o.Point(m,_.y),g=new o.Point(m,f.y),Math.min(Object(a.distanceToSegment)(_,y,e).distance,Object(a.distanceToSegment)(y,g,e).distance,Object(a.distanceToSegment)(g,f,e).distance)<=c))return new n.HitTestResult(n.HitTestResult.REGULAR);return null},e}()},function(e,t,i){"use strict";function n(e,t){var i=function i(n){var o=i.cache,r=""+(t?t.apply(this,arguments):n);return o.hasOwnProperty(r)||(o[r]=e.apply(this,arguments)),o[r]};return i.cache={},i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,i){"use strict";function n(e){s.call(this,e),this.width=this._calculateWidth(e.barSpacing),this._isUp=!1}function o(e){n.call(this,e),this._isUp=!0}function r(e){n.call(this,e),this._isUp=!1}var s=i(44).PaneRendererAbstractShape;inherit(n,s),n.prototype._calculateWidth=function(e){return e=e||this.barSpacing,Math.round(e/4)},n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=!1,h=this.width,u=Math.abs(this.height),d=h<4,p=Math.max(parseInt(h/2),1),_=Math.round(this.width/2),f=Math.round(this.width),m=this._isUp?-1:1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],r=o.x,s=o.y+this._vertOffset+m*Math.round(u/2),o.style&&null!=o.style.color?(a=o.style.color,l=o.style.borderColor):(a=this._color,l=this._borderColor),a!==t&&(t=a,c&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=a,e.strokeStyle=l),e.translate(r,s),d?(e.moveTo(0,0),
e.lineTo(-_,-_*m),e.moveTo(0,0),e.lineTo(_,-_*m),e.moveTo(0,0),e.lineTo(0,-u*m),e.moveTo(-_,-u*m),e.lineTo(_,-u*m),e.lineWidth=p):(e.moveTo(0,0),u<f?(e.lineTo(h,-u*m),e.lineTo(-h,-u*m)):(e.lineTo(h,-f*m),e.lineTo(_,-f*m),e.lineTo(_,-u*m),e.lineTo(-_,-u*m),e.lineTo(-_,-f*m),e.lineTo(-h,-f*m)),e.lineTo(0,0)),e.translate(-r,-s),c=!0;c&&(e.fill(),e.stroke())},inherit(o,n),inherit(r,n),t.PaneRendererArrowBase=TradingView.PaneRendererArrowBase=n,t.PaneRendererArrowUp=TradingView.PaneRendererArrowUp=o,t.PaneRendererArrowDown=TradingView.PaneRendererArrowDown=r},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=Math.max(this.width,this.height)/2,h=this._vertOffset,u=2*Math.PI,d=!1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,d&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x,l=o.y+h,e.moveTo(a+c,l),e.arc(a,l,c,0,u,!1),d=!0;d&&(e.fill(),e.stroke())},t.PaneRendererCircleShape=TradingView.PaneRendererCircleShape=n},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c,h,u;for(e.lineWidth=2,t=this.width,i=this.height,n=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==o&&(o=c,r&&e.stroke(),e.beginPath(),e.strokeStyle=c),h=l.x-t/2,u=l.y-i/2+n,e.moveTo(h+t/2,u),e.lineTo(h+t/2,u+i),e.moveTo(h,u+i/2),e.lineTo(h+t,u+i/2),r=!0;r&&e.stroke()},t.PaneRendererCrossShape=TradingView.PaneRendererCrossShape=n},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,c&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x,l=o.y+this._vertOffset,e.moveTo(a,l-h),e.lineTo(a+h,l),e.lineTo(a,l+h),e.lineTo(a-h,l),e.lineTo(a,l-h),c=!0;c&&(e.fill(),e.stroke())},t.PaneRendererDiamond=TradingView.PaneRendererDiamond=n},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=this.width,h=this.height,u=h/2,d=this._vertOffset,p=3,_=(c-p)/3,f=!1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,f&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x-c/2,l=o.y-u+d,e.moveTo(a,l),e.lineTo(a+p,l),e.bezierCurveTo(a+_,l-_,a+2*_,l+_,a+c,l),e.lineTo(a+c,l+u),e.bezierCurveTo(a+c-_,l+u+_,a+c-2*_,l+u-_,a+p,l+u),e.lineTo(a+p,l+h),e.lineTo(a,l+h),
e.lineTo(a,l),f=!0;f&&(e.fill(),e.stroke())},t.PaneRendererFlagShape=TradingView.PaneRendererFlagShape=n},function(e,t,i){"use strict";function n(e,t){l.call(this,e),this._isUp=t,this._stepX=Math.round(this.height/2*.65)+.5,this._stepY=Math.round(this.height/2)+.5,this._textCache?(this._padding=this._stepX/2,this._shapeWidth=this._textImageWidth+2*this._stepX,this._shapeHeight=this._textImageHeight+2*this._padding+this._stepY,0===this._vertOffset?this._isUp?this._textVertOffset=this._stepY+this._padding+this._textImageHeight:this._textVertOffset=-this._stepY-this._padding:this._textVertOffset=this._vertOffset>0?this._stepY+this._padding:-this._stepY-this._padding):(this._padding=0,this._shapeWidth=2*this._stepX,this._shapeHeight=2.5*this._stepY)}function o(e){n.call(this,e,!0)}function r(e){n.call(this,e,!1)}var s=i(6).Point,a=i(9).HitTestResult,l=i(44).PaneRendererAbstractShape;inherit(n,l),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=!1,h=this._isUp?1:-1,u=Math.round(this._shapeWidth/2)-.5,d=Math.round(this._shapeHeight)-.5,p=0;for(0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(p=-h*Math.round(d+this._stepY)),i=0,n=this.items.length;i<n;i++)o=this.items[i],r=o.x+.5,s=o.y+this._vertOffset+p+.5,o.style&&null!=o.style.color?(a=o.style.color,l=o.style.borderColor):(a=this._color,l=this._borderColor),a!==t&&(t=a,c&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=a,e.strokeStyle=l),e.translate(r,s),e.moveTo(0,0),e.lineTo(this._stepX,this._stepY*h),e.lineTo(u,this._stepY*h),e.lineTo(u,d*h),e.lineTo(-u,d*h),e.lineTo(-u,this._stepY*h),e.lineTo(-this._stepX,this._stepY*h),e.lineTo(0,0),e.translate(-r,-s),c=!0;c&&(e.fill(),e.stroke())},n.prototype.hitTest=function(e,t){var i,n,o,r,l,c,h,u,d,p,_,f,m,y,g=this._stepY/2,v=this._vertOffset,S=this._isUp?1:-1;for(n=0;n<this.items.length;++n)if(o=this.items[n]){if(r=S*g,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-S*(this._shapeHeight+g)),i=new s(o.x,o.y+v+r),i.subtract(e).length()<=g)return new a(a.REGULAR);if(l=this._shapeWidth/2,r=0,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-S*(this._shapeHeight+this._stepY)),c=o.y+v+r,h=this._isUp?this._stepY:-this._shapeHeight,u=this._isUp?this._shapeHeight:-this._stepY,d=e.x,p=e.y,_=o.x-l,f=c+h,m=o.x+l,y=c+u,d>_&&d<m&&p>f&&p<y)return new a(a.REGULAR)}return null},inherit(o,n),inherit(r,n),t.PaneRendererLabelBase=TradingView.PaneRendererLabelBase=n,t.PaneRendererLabelUp=TradingView.PaneRendererLabelUp=o,t.PaneRendererLabelDown=TradingView.PaneRendererLabelDown=r},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,c&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x-h,l=o.y+this._vertOffset-h,e.rect(a,l,this.height,this.height),c=!0;c&&(e.fill(),e.stroke())},
t.PaneRendererSquare=TradingView.PaneRendererSquare=n},function(e,t,i){"use strict";function n(e){s.call(this,e)}function o(e){s.call(this,e)}function r(e){s.call(this,e)}var s=i(44).PaneRendererAbstractShape;inherit(n,s),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-2*u,p=!1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,p&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x,l=o.y+d,e.moveTo(a,l),e.lineTo(a+c/2,l+h),e.lineTo(a-c/2,l+h),e.lineTo(a,l),p=!0;p&&(e.fill(),e.stroke())},inherit(o,s),o.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-u,p=!1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],o.style&&null!=o.style.color?(r=o.style.color,s=o.style.borderColor):(r=this._color,s=this._borderColor),r!==t&&(t=r,p&&(e.fill(),e.stroke()),e.beginPath(),e.fillStyle=r,e.strokeStyle=s),a=o.x-c/2,l=o.y+d,e.moveTo(a,l),e.lineTo(a+c,l),e.lineTo(a+c/2,l+h),e.lineTo(a,l),p=!0;p&&(e.fill(),e.stroke())},inherit(r,s),r.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l=this.width,c=this.height,h=this._vertOffset,u=!1;for(i=0,n=this.items.length;i<n;i++)o=this.items[i],r=o.style&&null!=o.style.color?o.style.color:this._color,r!==t&&(t=r,u&&e.fill(),e.beginPath(),e.fillStyle=r),s=o.x+l/2,a=o.y-c/2+h,e.moveTo(s,a),e.lineTo(s,a+c),e.lineTo(s-l,a+c/2),e.lineTo(s,a),u=!0;u&&e.fill()},t.PaneRendererTriangleApexUp=TradingView.PaneRendererTriangleApexUp=n,t.PaneRendererTriangleApexDown=TradingView.PaneRendererTriangleApexDown=o,t.PaneRendererTriangleApexLeft=TradingView.PaneRendererTriangleApexLeft=r},function(e,t,i){"use strict";function n(e){o.call(this,e)}var o=i(44).PaneRendererAbstractShape;inherit(n,o),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a,l,c,h,u;for(e.lineWidth=2,t=this.width,i=this.height,n=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==o&&(o=c,r&&e.stroke(),e.beginPath(),e.strokeStyle=c),h=l.x-t/2,u=l.y-i/2+n,e.moveTo(h,u),e.lineTo(h+t,u+i),e.moveTo(h,u+i),e.lineTo(h+t,u),r=!0;r&&e.stroke()},t.PaneRendererXCross=TradingView.PaneRendererXCross=n},function(e,t,i){"use strict";function n(){this._data=null}function o(e){this._source=e,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=e.model().timeScale().barSpacing.bind(e.model().timeScale()),this._invalidated=!0,this._areaRenderer=new n,this._plIndex1=null,this._plIndex2=null}function r(e){o.call(this,e)}function s(e,t,i){var n,r;if(o.call(this,e),this._isHlineFill=t.type===h.FilledArea.TYPE_HLINES,a(this._isHlineFill||t.type===h.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+t.type),this._isHlineFill&&this._initBandIndexes(t.objAId,t.objBId),this._fillMetaInfo=t,this._fillStyleProps=i,n=e._metaInfo,t.palette)for(r in n.plots)if(n.plots[r].palette===t.palette){
this._colorPlotOffset=parseInt(r),this._colorsMap=n.palettes[t.palette].valToIndex,this._colorValues=e.properties().palettes[t.palette].colors;break}}var a=i(7).assert,l=i(9).HitTestResult,c=i(27).coordinateIsValid,h=i(26),u=i(29),d=i(50).clamp,p=i(17).PlotRowSearchMode;n.prototype.setData=function(e){this._data=e},n.prototype.hitTest=function(e){var t,i,n;if(null===this._data)return null;for(n=1;n<this._data.points1.length;++n)if(t=this._data.points1[n],i=this._data.points2[n],this._data.timePoints[n]===e.x&&(e.y>=t&&e.y<=i||e.y<=t&&e.y>=i))return new l(l.REGULAR);return null},n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,h,d,p,_,f,m,y,g,v,S;if(null!==this._data&&((t=this._data.isHlineFill)||0!==this._data.points1.length&&0!==this._data.points2.length)){for(i=this._data.timePoints,n=this._data.points1,o=this._data.points2,r=this._data.colors,s=isNumber(this._data.transparency)?this._data.transparency:50,s=Math.min(s,100),s=Math.max(s,0),a={},l=[],d=0;d<this._data.timePoints.length;d++)p={point1:t?this._data.level1:n[d],point2:t?this._data.level2:o[d],timePoint:i[d]},_=c(p.point1)&&c(p.point2),_&&(h=r&&r[d]?r[d]:this._data.backcolor,l.push(p)),(d===this._data.timePoints.length-1||r&&h!==r[d+1]||!_)&&(l.length>0&&(f=a[h]||[],f.push(l),a[h]=f),l=_?[p]:[]);for(m in a){for(y=a[m],e.beginPath(),g=0;g<y.length;g++){for(v=y[g],e.moveTo(v[0].timePoint,v[0].point1),S=1;S<v.length;S++)e.lineTo(v[S].timePoint,v[S].point1);for(S=v.length-1;S>=0;S--)e.lineTo(v[S].timePoint,v[S].point2)}e.closePath(),e.fillStyle=u.generateColor(m,s),e.fill()}}},o.prototype.update=function(){this._invalidated=!0},o.prototype._plotNames=function(){return this._source.metaInfo().plots.map(function(e){return e.id})},o.prototype._plotIndex1=function(){return null===this._plIndex1&&(this._plIndex1=this._plotNames().indexOf(this._plotAId())+1),this._plIndex1},o.prototype._plotIndex2=function(){return null===this._plIndex2&&(this._plIndex2=this._plotNames().indexOf(this._plotBId())+1),this._plIndex2},o.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,_,f,m,y,g,v,S,b,w,P,T,x,C;if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()&&(e=this._source.priceScale(),t=this._source._model.timeScale(),e&&!e.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!(this._source._series.bars().isEmpty()||(this._isHlineFill&&(i=this._source.firstValue(),n=this._source.properties().bands[this._bandAKey],o=this._source.properties().bands[this._bandBKey],this._level1=e.priceToCoordinate(n.value.value(),i),this._level2=e.priceToCoordinate(o.value.value(),i)),null===(r=this._source._model.timeScale().visibleBars())||(s=this._source._series.nearestIndex(r.firstBar(),p.NearestRight),a=this._source._series.nearestIndex(r.lastBar(),p.NearestLeft),(s=this._correctStartBarIndex(s))>a))))){if(l=this._source.data().range(s,a),l.size()>0)for(c=l.firstIndex(),h=l.lastIndex(),u=this._source.offset(this._plotAId()),d=this._source.offset(this._plotBId()),_=Math.max(u,d),f=Math.min(u,d),m=c+_,
y=this._source.data().firstIndex(),c>y&&(m=c<_+y?_+y:c),g=h+f,v=this._source.data().lastIndex(),h>v+f&&h<v&&(g=v+f),f<0&&h<=v+f&&(g=h),S=m<c?c+_:m>h?c+_:m,b=m;b<=g;++b)this._timePoints.push(t.indexToCoordinate(S++)),this._colors&&null!=(w=this._source.data().valueAt(b-f)[this._colorPlotOffset+1])&&this._colors.push(this._colorValues[this._colorsMap[w]].color.value()),this._isHlineFill||(P=this._source.data().valueAt(b-u),T=this._source.data().valueAt(b-d),x=P[this._plotIndex1()],C=T[this._plotIndex2()],this._points1.push(x),this._points2.push(C));i=this._source.firstValue(),e.pricesArrayToCoordinates(this._points1,i),e.pricesArrayToCoordinates(this._points2,i)}},o.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var e={};return e.points1=this._points1,e.points2=this._points2,e.timePoints=this._timePoints,e.getBarSpacing=this._getBarSpacing,e.backcolor=this._color(),e.transparency=this._transparency(),e.isHlineFill=this._isHlineFill,e.level1=this._level1,e.level2=this._level2,this._colors&&(e.colors=this._colors),this._areaRenderer.setData(e),this._areaRenderer},o.prototype._plotAId=function(){a(!1,"Pure virtual call!")},o.prototype._plotBId=function(){a(!1,"Pure virtual call!")},o.prototype._color=function(){a(!1,"Pure virtual call!")},o.prototype._transparency=function(){a(!1,"Pure virtual call!")},o.prototype._visible=function(){a(!1,"Pure virtual call!")},o.prototype._correctStartBarIndex=function(e){return e},inherit(r,o),r.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},r.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},r.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},r.prototype._transparency=function(){var e=this._source.properties().areaBackground.transparency.value();return d(e,0,100)},r.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(s,o),s.prototype._initBandIndexes=function(e,t){var i,n;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)n=this._source.metaInfo().bands[i],null!==this._bandAKey||n.id!==e?null!==this._bandBKey||n.id!==t||(this._bandBKey=i):this._bandAKey=i},s.prototype._plotAId=function(){return this._fillMetaInfo.objAId},s.prototype._plotBId=function(){return this._fillMetaInfo.objBId},s.prototype._color=function(){return this._fillStyleProps.color.value()},s.prototype._transparency=function(){return this._fillStyleProps.transparency.value()},s.prototype._visible=function(){return this._fillStyleProps.visible.value()},s.prototype._correctStartBarIndex=function(e){var t=this._source.getMinFirstBarIndexForPlot(this._fillMetaInfo.id);return Math.max(t,e)},t.PlotFillPaneView=s,t.AreaBackgroundPaneView=r},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyLegendView",function(){return r}),n=i(1),o=i(117),r=function(e){function t(t,i){var n=e.call(this,t,i)||this
;return n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n._showStudyValues.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.additional=function(){return null},t.prototype.destroy=function(){this._showStudyValues.unsubscribeAll(this)},t}(o.StudyDataWindowView)},function(e,t,i){"use strict";function n(e){return new Promise(function(t){i.e(24).then(function(n){var r=Object.keys(e.metaInfo().graphics);r.sort(function(e,t){return o(e)-o(t)}),t(r.map(function(t){var n,o,r=i(703).VertLinePaneView;return n={backgrounds:null,hhists:null,horizlines:null,hlines:null,lines:null,polygons:null,shapemarks:null,textmarks:null,trendchannels:null,vertlines:r},o=n[t],null===o?(h.logWarn(t+" is not supported by this build of graphics subsystem, skipping"),null):new o(e,e.model())}).filter(function(e){return null!==e}))}.bind(null,i)).catch(i.oe)})}function o(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function r(e){var t,i,n,o=Object.keys(e.metaInfo().graphics),r=[],s=function(e){return h.logWarn(e+" is not supported by this build of graphics subsystem, skipping"),"continue"};for(t=0,i=o;t<i.length;t++)n=i[t],s(n);return r}var s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.createGraphicsPaneViews=n,t.createGraphicsPriceAxisViews=r,s=i(4),a=i(165),i.d(t,"isStudyGraphicsEmpty",function(){return a.c}),l=i(262),i.d(t,"StaticStudyGraphics",function(){return l.a}),i.d(t,"emptyStudyGraphics",function(){return l.b}),i.d(t,"loadStudyGraphics",function(){return l.c}),i.d(t,"saveStudyGraphics",function(){return l.d}),c=i(261),i.d(t,"LiveStudyGraphics",function(){return c.a}),h=Object(s.getLogger)("Chart.StudyGraphics")},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PLACE_HOLDER",function(){return s}),i.d(t,"VolumeFormatter",function(){return a}),n=i(105),o=i(12),i.n(o),r=i(83),i.n(r),i(11),s="---",a=function(){function e(e){this.type="volume",this._numericFormatter=new n.NumericFormatter,this._fractionalValues=void 0!==e&&e>0,this._precision=e}return e.prototype.state=function(){return{precision:this._precision}},e.prototype.format=function(e){if(!Object(o.isNumber)(e))return s;var t="";return e<0&&(t="-",e=-e),e>=1e100?window.t("N/A"):(!this._fractionalValues||e>=995?e=Math.round(e):this._fractionalValues&&(e=+e.toFixed(this._precision)),e<995?t+this._formatNumber(e):e<999995?t+this._formatNumber(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this._formatNumber(e/1e6)+"M"):(e=1e6*Math.round(e/1e6),t+this._formatNumber(e/1e9)+"B"))},e.prototype.parse=function(e){var t,i,n;return"---"===e?{error:"not a number",res:!1,value:NaN}:(t={K:1e3,M:1e6,B:1e9},i=e.slice(-1),t.hasOwnProperty(i)?(n=this._numericFormatter.parse(e.slice(0,-1)),Object(o.isNumber)(n)?{res:!0,value:n*t[i]}:{error:"not a number",res:!1,value:NaN}):(n=this._numericFormatter.parse(e),Object(o.isNumber)(n)?{res:!0,value:n}:{error:"not a number",res:!1,value:NaN
}))},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.precision)},e.prototype._formatNumber=function(e){return this._fractionalValues&&(e=Object(r.fixComputationError)(e)),this._numericFormatter.format(e).replace(/(\.[1-9]*)0+$/,function(e,t){return t})},e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"tzData",function(){return n});var n={"America/New_York":{time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{
time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{
time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,1541289600,1550361600,1572739200,1581811200,1604188800,1613865600,1636243200,1645315200,1667692800,1677369600,1699142400,1708214400,1730592e3,1739664e3,1762041600,1771718400,1793491200,1803168e3,1825545600,1834617600,1856995200,1866067200,1888444800,1897516800,1919894400,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{
time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{
time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Luxembourg":{time:[-2069712e3,-1692493200,-1680476400,-1662339600,-165015e4,-1632002400,-1618693200,-1612656e3,-1604278800,-1585515600,-1574038800,-1552255200,-1539997200,-1520546400,-1507510800,-1490569200,-1473642e3,-1459116e3,-1444006800,-142767e4,-1411866e3,-1396220400,-1379293200,-1364770800,-1348448400,-1333321200,-1316394e3,-1301266800,-1284339600,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-935182800,-85725e4,-844552800,-828219600,-812498400,-797979600,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[1476,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Madrid":{time:[-2177453684,-1631926800,-1616886e3,-1601168400,-158535e4,-1442451600,-142767e4,-1379293200,-1364770800,-1348448400,-1333321200,-1316390400,-1301266800,-1284339600,-1269817200,-1026954e3,-1017615600,-1001898e3,-999478800,-986083200,-951433200,-940208400,-873075600,-862614e3,-842835600,-828313200,-811386e3,-796863600,-779936400,-765414e3,-748486800,-733964400,-652323600,-639010800,135126e3,150253200,166575600,181702800,196815600,212547600,22887e4,243997200,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3259094400,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931132800,-922752e3,-917827200,-892425600,-875836800,-857347200,-781056e3,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-621820800,-60696e4,-590025600,-575424e3,-235612800,-228268800,-177724800,-165715200,10540800,23846400,41990400,55296e3,74044800,87350400,107917200,12123e4,133927200,152686800,165369600,183513600,202435200,215568e3,228873600,245808e3,260323200,277257600,308793600,323838e3,340243200,354682800,371692800,386132400,403142400,428457600,433900800,482803200,496713600,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-683769600,-672274800,-654739200,-640825200,-620265600,-609375600,-588816e3,-577926e3,1925024400],offset:[33539,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{
time:[-1948752e3,-1830384e3,-767318400,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-3645216e3,-3155673600,-2019686400,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,19270,19800,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021e3,-694470600,-683757e3,-668032200,-654726600,-636582600,-623277e3,-605133e3,-591827400,-573683400,-559773e3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],
offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232e4,-636415200,-62208e4,-608936400,-59184e4,-572475600,-558568800,-542840400,-527724e3,-514414800,-490838400,-482976e3,-459468e3,-451526400,-428544e3,-418251600,-400024800,-387417600,142387200,150854400,167184e3,178675200,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],
offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuwait":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],
offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-769429800,-765410400,-712188e3,1924956e3],
offset:[-37886,-37800,-34200,-37800,-34200,-34200,-37800,-36e3]},"America/Mexico_City":{time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Cairo":{time:[-2185401600,-929836800,-923097600,-906163200,-892857600,-875836800,-857779200,-844300800,-825811200,-812678400,-794188800,-779846400,-762652800,-399081600,-38664e4,-368323200,-355104e3,-336783600,-323643600,-305161200,-292021200,-273625200,-260485200,-242089200,-228949200,-210553200,-197413200,-178930800,-165790800,-147394800,-134254800,-115858800,-102632400,-84322800,-71096400,-52700400,-39474e3,-21164400,-7938e3,10371600,23598e3,41907600,55134e3,7353e4,86756400,105066e3,118292400,136602e3,149828400,168138e3,181364400,199760400,212986800,231296400,244522800,262832400,276058800,294368400,307594800,325990800,339217200,357526800,370753200,396406800,402289200,426819600,433825200,452221200,465447600,483757200,496983600,515293200,528519600,546829200,560055600,578451600,591678e3,610419600,623214e3,641523600,65475e4,673059600,686286e3,704682e3,717908400,736218e3,749444400,767754e3,780980400,799027200,812332800,830476800,843782400,861926400,875232e3,893376e3,906681600,925430400,938736e3,95688e4,970185600,988329600,1001635200,1019779200,1033084800,1051228800,1064534400,1083283200,1096588800,1114732800,1128038400,1146182400,1158883200,1177632e3,1189123200,1209081600,1219968e3,1240531200,1250812800,1272585600,1281484800,1284076800,1285891200,1400198400,1403827200,1406851200,1411689600,1924999200],
offset:[7509,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"Europe/Helsinki":{time:[-2890252800,-1535932800,-875664e3,-859762800,354679200,370407600,386128800,401857200,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5989,5989,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Stockholm":{
time:[-2871676800,-2208988800,-1692493200,-1680476400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4332,3614,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Copenhagen":{time:[-2524521600,-2398291200,-1692493200,-1680483600,-935107200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-769381200,-747007200,-736376400,-715212e3,-706741200,-683157600,-675291600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[3020,3020,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Atlantic/Reykjavik":{time:[-1956614400,-1668214800,-1647212400,-1636678800,-161343e4,-1605142800,-1581894e3,-1539565200,-153135e4,-968029200,-952293600,-942012e3,-920239200,-909961200,-888789600,-877906800,-857944800,-846457200,-826495200,-815007600,-795045600,-783558e3,-762991200,-752108400,-731541600,-717634800,-700092e3,-686185200,-668642400,-654735600,-636588e3,-623286e3,-605743200,-591836400,-573688800,-559782e3,-542239200,-528332400,-510789600,-496882800,-47934e4,-465433200,-447890400,-433983600,-415836e3,-401929200,-384386400,-370479600,-352936800,-33903e4,-321487200,-307580400,-290037600,-276130800,-258588e3,-244681200,-226533600,-212626800,-195084e3,-181177200,-163634400,-149727600,-132184800,-118278e3,-100735200,-86828400,-68680800,-54774e3,1924992e3],offset:[-5280,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0]},"Europe/Tallinn":{time:[-2840140800,-1638316800,-1632002400,-1618693200,-1593820800,-1535932800,-927936e3,-892944e3,-85725e4,-844552800,-828219600,-812498400,-797644800,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909288e3,92259e4,941342400,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5940,5940,3600,7200,3600,5940,7200,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Riga":{time:[-2840140800,-1632002400,-1618693200,-1601676e3,-1597266e3,-1377302400,-928022400,-899510400,-85725e4,-844552800,-828219600,-812498400,-79677e4,-795830400,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,843966e3,859690800,877838400,891140400,909288e3,92259e4,941342400,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5794,5794,9394,5794,9394,5794,7200,10800,7200,3600,7200,3600,7200,3600,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Vilnius":{
time:[-2840140800,-1672531200,-1585094400,-1561248e3,-1553558400,-928195200,-900115200,-85725e4,-844552800,-828219600,-812498400,-802137600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891140400,909284400,922586400,941338800,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[6076,5040,5736,3600,7200,3600,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,7200,3600,7200,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"America/Lima":{time:[-2524521600,-1938556800,-1009843200,-1002067200,-986774400,-971049600,-955324800,-9396e5,504921600,512697600,536457600,544233600,631152e3,638928e3,757382400,765158400,1924974e3],offset:[-18492,-18516,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Santiago":{
time:[-2524521600,-1892678400,-1688428800,-1619222400,-1593820800,-1336003200,-13176e5,-1304380800,-1286064e3,-1272844800,-1254528e3,-1241308800,-1222992e3,-1209772800,-1191369600,-1178150400,-870566400,-865296e3,-740534400,-736387200,-718070400,-713667600,-36633600,-23932800,-3369600,7516800,24451200,37756800,55900800,69206400,87955200,100656e3,118195200,132105600,150854400,163555200,182304e3,195609600,213753600,227059200,245203200,258508800,277257600,289958400,308707200,321408e3,340156800,353462400,371606400,384912e3,403056e3,416361600,434505600,447811200,46656e4,479260800,498009600,510710400,529459200,545184e3,560908800,574214400,592358400,605664e3,624412800,637113600,653443200,668563200,687312e3,700617600,718761600,732067200,750211200,763516800,781660800,794966400,813715200,826416e3,845164800,85968e4,876614400,88992e4,906854400,923184e3,939513600,952819200,971568e3,984268800,1003017600,1015718400,1034467200,1047168e3,1065916800,1079222400,1097366400,1110672e3,1128816e3,1142121600,1160870400,1173571200,119232e4,1206835200,1223769600,1237075200,1255219200,1270339200,1286668800,1304812800,1313884800,1335657600,1346544e3,1367107200,1378598400,1398556800,1410048e3,1463270400,1471132800,149472e4,1502582400,1526169600,1534032e3,1554595200,1567900800,1586044800,1599350400,1617494400,16308e5,1648944e3,1662249600,1680393600,1693699200,1712448e3,1725753600,1743897600,1757203200,1775347200,1788652800,1806796800,1820102400,1838246400,1851552e3,1870300800,1883001600,1901750400,1915056e3,19332e5],offset:[-16966,-16966,-18e3,-16966,-14400,-16966,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-10800,-14400,-18e3,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800]},"Asia/Bahrain":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Jakarta":{time:[-3231273600,-1451693568,-117288e4,-876614400,-766022400,-683856e3,-620784e3,-189388800,1925017200],offset:[25632,25632,26400,27e3,32400,27e3,28800,27e3,25200]},"Africa/Lagos":{time:[-1588464e3,1924995600],offset:[816,3600]},"Pacific/Norfolk":{time:[-2177452800,-599616e3,152071200,162957600,1443924e3,1925031600],offset:[40312,40320,41400,45e3,41400,39600]},"America/Juneau":{
time:[-3225169588,-2188987200,-880236e3,-769420800,-765410400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[54139,-32261,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-28800,-28800,-25200,-28800,-25200,-28800,-25200,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Asia/Ho_Chi_Minh":{time:[-2004048e3,-1851552e3,-852080400,-782614800,-767836800,-718070400,-457747200,-315622800,171849600,1925017200],offset:[25600,25590,25200,28800,32400,25200,28800,25200,28800,25200]},"Australia/Perth":{time:[-2337897600,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,152071200,162961200,436327200,447217200,690343200,699418800,1165111200,1174791600,1193536800,1206846e3,1224986400,1238295600,1925020800],offset:[27804,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Europe/Oslo":{
time:[-2366755200,-1691881200,-1680566400,-927507600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-340840800,-324507600,-308786400,-293058e3,-277336800,-261608400,-245887200,-230158800,-214437600,-198709200,-182988e3,-166654800,-147909600,-135205200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]}}},function(e,t,i){"use strict";function n(e){this._studyId=e,this._maxToVers=o.ZERO,this._maxFromVers=o.ZERO,this._migrs=[]}var o=i(163).Version,r=i(4).getLogger("Chart.StudyMigration");n.prototype.addMigration=function(e,t,i){var n=o.parse(e),r=o.parse(t);n.isGreater(this._maxFromVers)&&(this._maxFromVers=n),r.isGreater(this._maxToVers)&&(this._maxToVers=r),this._migrs.push({fromVers:n,toVers:r,rules:i})},n.prototype.updateInputs=function(e,t,i){var n,o,s;if(!i)return i;for(n=TradingView.clone(i),o=e;o.isLess(t)&&null!=(s=this._findMigration(o));){if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),n=this._applyMigration(n,s),!o.isLess(s.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=s.toVers}return o>e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(n)),n},n.prototype._findMigration=function(e){
var t,i,n=-1,o=this._maxFromVers;for(t=0;t<this._migrs.length;t++)i=this._migrs[t],i.fromVers.isLess(e)||i.fromVers.isLessOrEqual(o)&&(o=i.fromVers,n=t);return n<0?null:this._migrs[n]},n.prototype._applyMigration=function(e,t){var i,n,o,r=e;for(i=0;i<t.rules.length;i++)n=t.rules[i],o=this._getApplyRuleFun(n.type),r=o(r,n);return r},n.prototype._getApplyRuleFun=function(e){if("inputRemoved"===e)return n._applyInputRemovedRule;if("inputChangedType"===e)return n._applyInputChangedTypeRule;if("inputChangedMinMax"===e)return n._applyInputChangedMinMaxRule;if("inputChangedOptions"===e)return n._applyInputChangedOptionsRule;throw Error("Unknown migration rule type: "+e)},n._applyInputRemovedRule=function(e,t){if(!(t.inputId in e))return e;if("removeVal"!==t.action)throw Error("Unexpected rule.action="+t.action+" in rule.type="+t.type);var i=e[t.inputId];return delete e[t.inputId],r.logNormal("Input "+t.inputId+"="+i+" removed"),e},n._applyInputChangedTypeRule=function(e,t){var i=e[t.inputId];if("resetToDefVal"===t.action)return e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal),e;if("convertVal"===t.action){if(null==i)return e;if("float"===t.inputTypeFrom&&"integer"===t.inputType)return e[t.inputId]=Math.round(e[t.inputId]),r.logNormal("Input "+t.inputId+"="+i+" converted to value "+e[t.inputId]),e;if("integer"===t.inputTypeFrom&&"float"===t.inputType)return e;if("text"===t.inputTypeFrom&&"source"===t.inputType)return n._isValidSource(i,t.options)?e:(e[t.inputId]=t.defVal,e);throw Error("Cannot convertVal from "+t.inputTypeFrom+" to "+t.inputType)}throw Error("Unknown action "+t.action+" for rule with type "+t.type)},n._isValidSource=function(e,t){return e.indexOf("$")>=0||t.indexOf(e)>=0},n._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return i<t.minVal?e[t.inputId]=t.minVal:i>t.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},n._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=n},function(e,t,i){"use strict";(function(t,n,o,r){function s(e){return e instanceof M}function a(e){return e.isNoScale()?null:e.priceScale()}function l(e,t,i,n,o){if(void 0!==o)switch(o){case"right":return e.rightPriceScale();case"left":return e.leftPriceScale();case"no-scale":return null;case"as-series":if(!e.isMainPane()){Y.logWarn('BEWARE: Attempt to set "as-series" price scale to study, but series and study are on different panes');break}return a(t);default:Y.logWarn("Unknown override for priceScale type - "+o+", default will be used")}var r=i.priceScale
;return n?null:(s(t)||e.isMainPane()&&void 0===r)&&i.is_price_study?a(t):r===N.None?i.is_price_study?null:(Y.logWarn("Cannot add study "+i.id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),e.rightPriceScale()):r===N.Left?e.leftPriceScale():e.rightPriceScale()}function c(e,i,r,s,a,l,h,u){var d,p,_;for(u=Object.assign({},Z,u),this._version=c.version,this._readOnly=u.readOnly,this._undoModel=l,this._studiesMetaInfoRepository=a,this._properties=r,this._modelIntervals=[],this._isSnapshot=u.isSnapshot,this.setStudiesMetaData(this._studiesMetaInfoRepository.getInternalMetaInfoArray(),this._studiesMetaInfoRepository.getMigrations()),this.m_timeScale=new x(this,u.timeScale),H.init(),d=this,this.m_panes=[],this.m_gridSource=new P,this.m_crossHairSource=new S(this,H.properties(),{additionalMenuEnabled:u.crossHairMenuEnabled}),this.m_crossHairSource.selectBarMode().subscribe(function(e){if(e&&d.lineBeingCreated()){var t=H.tool.value();d.cancelCreatingLine(),H.tool.setValue(t)}}),this.m_width=0,this._tagsChanged=new t,this._lineCancelled=new t,this._magnet=new T(H.properties().magnet,this.m_timeScale,r.paneProperties.magnetSensivity),p=new j("chartproperties.mainSeriesProperties"),p.addExclusion("minTick"),p.addExclusion("priceAxisProperties.lockScale"),p.addExclusion("priceAxisProperties.percentage"),p.addExclusion("priceAxisProperties.log"),this.createPane(void 0,{rightAxisProperties:p.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*b.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new t,this._chartApi=e,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,c.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,function(){d._chartApi&&d._chartApi.connected()&&d._chartApi.switchTimezone(d.timezone())}),this.m_timeScale.defaultRightOffsetProperty().listeners().subscribe(null,function(){d.recalculateAllPanes()}),p.merge(r.mainSeriesProperties.state()),this.m_mainSeries=new W(this,p,s),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this._mainSeriesPriceScaleNameChanged=new t,this._mainSeriesPriceScaleNameProperty=new K(this),this._mainSeriesScaleRatioProperty=new G(this),this.m_mainSeries.dataEvents().completed().subscribe(this,function(){if(d.clearCurrentPosition(),d._scrollingState&&d.gotoTime(),n.enabled("fix_left_edge")&&this.m_mainSeries.endOfData()){var e=this.m_mainSeries.bars().first();null!==e&&this.m_timeScale.setLeftEdgeFix(e.index)}}.bind(this)),this.m_mainSeries.onIntervalChanged().subscribe(this,function(){this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1}),this.m_mainSeries.dataEvents().barReceived().subscribe(this,c.prototype.updateTimeScaleBaseIndex),this.m_mainSeries.properties().symbol.listeners().subscribe(this,this.setPriceAutoScaleForAllMainSources),this._readOnly||(p.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),
this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(e){e.value()||d._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=h(this),_=0;_<this._barsMarksSources.length;_++)this._barsMarksSources[_].setOwnerSource(this.m_mainSeries);this._syncPointCache={},this.m_watermarkSource=u.watermarkEnabled?new w(this.m_mainSeries):null,this._brandingSource=null,this.strategySources=[],this.strategySources.change=new t,this._activeStrategySource=new o(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",H.hideAllDrawings().subscribe(this,this.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,c.prototype.fullUpdate),this._id=q.guid(),this._studyInserted=new t,this._chartThemeLoaded=new t,this._resetScales=new t,this._isScalesResetAvailableChanged=new t,this._isScalesResetAvailable=!1,this._studyShiftColorStartOffset=void 0}var h=i(7).ensureNotNull,u=i(6).Point,d=i(24),p=d.parseRgb,_=d.rgbToBlackWhiteString,f=i(73),m=f.createLineTool,y=f.isLineToolName,g=f.isLineTool,v=f.isStudyLineTool,S=i(598).CrossHair,b=i(176).Pane,w=i(614).Watermark,P=i(615).Grid,T=i(616),x=i(617).TimeScale,C=i(177).PriceScale,L=i(87).BarsMarksContainer,I=i(622).Branding,A=i(28).PriceDataSource,k=i(18),E=i(34),M=E.Study,V=i(180).NonSeriesStudy,D=i(285).createStudy,O=E.prepareStudyProperties,R=i(168),B=i(124),N=i(211).ScaleType,F=i(17).PlotRowSearchMode,W=i(63).Series,H=i(32),j=i(3).DefaultProperty,z=i(39).trackEvent,U=i(632).TimeSynchronizer,q=i(33),Y=i(4).getLogger("Chart.ChartModel"),G=i(633).MainSeriesScaleRatioProperty,K=i(634).MainSeriesPriceScaleNameProperty,Z={isSnapshot:!1,readOnly:!1,watermarkEnabled:!0,crossHairMenuEnabled:!1};c.prototype.applyPreferences=function(e){var t,i;for(t in e)void 0!==this._properties[t]&&"m_mainSeries"!==this._properties[t]&&this._properties[t].mergeAndFire(e[t]);void 0!==e.mainSeriesPriceScaleName&&this.setMainSeriesPriceScaleName(this.mainSeriesPriceScaleName(),e.mainSeriesPriceScaleName),this.m_timeScale.defaultRightOffsetProperty().setValue(e.timeScale.defaultRightOffset),this._properties.saveDefaults(),this.m_mainSeries.checkSessStudy(),i=this.m_mainSeries.sessionsStudy(),i&&i.applyPreferences(e.sessionsStudy),this.m_mainSeries.applyPreferences(e.mainSeries),this.recalculateAllPanes(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.setStudiesMetaData=function(e,t){this._studiesMetaData=e,this._studyVersioning=new R(this._studiesMetaData,t)},c.prototype.isSnapshot=function(){return this._isSnapshot},c.prototype.currentTool=function(){return this._currentTool},c.prototype.setCurrentTool=function(e){this._currentTool=e},c.prototype.timezone=function(){return this._properties.timezone.value()},c.prototype.version=function(){return this._version},c.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},c.prototype.dumpViews=function(){var e,t,i,n,o={};for(o.panes=[],
e=0;e<this.m_panes.length;e++)o.panes.push(this.m_panes[e].dumpViews());for(o.dataWindow=[],t=this.dataSources(),e=0;e<t.length;e++)i=t[e],(n=i.dataWindowView())&&o.dataWindow.push(n.dump());return o},c.prototype._paneInvalidationMask=function(e,t){var i=new k,n=this.m_panes.indexOf(e);return void 0===t&&(t=k.LIGHT_UPDATE),i.invalidatePane(n,t),i},c.prototype.updatePane=function(e){var t=this._paneInvalidationMask(e);this.invalidate(t)},c.prototype.fullUpdate=function(){this.invalidate(new k(k.FULL_UPDATE))},c.prototype.lightUpdate=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateSource=function(e){var t=this.paneForSource(e),i=this._paneInvalidationMask(t);this.invalidate(i)},c.prototype.studiesMetaData=function(){return this._studiesMetaData},c.prototype.studyVersioning=function(){return this._studyVersioning},c.prototype.disconnect=function(){var e,t,i=this.dataSources();for(t=0;t<i.length;t++)e=i[t],e.disconnect&&e.disconnect()},c.prototype.restart=function(){var e,t,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),e=this.dataSources(),t=0;t<e.length;t++)i=e[t],i.restart&&i!==this.m_mainSeries&&i.restart()},c.prototype.startNotStartedStudies=function(){var e,t;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(e=this.dataSources(),t=0;t<e.length;t++)s(e[t])&&!e[t].isStarted()&&e[t].restart&&e[t]!==this.m_mainSeries&&e[t].restart()},c.prototype.updateLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.tryCreateServerPoints(),t.checkAlert&&t.checkAlert())},c.prototype.realignLineTools=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;e++)g(i[e])&&(t=i[e],t.calcIsActualSymbol());for(e=0;e<this.m_panes.length;e++)this.m_panes[e].invalidateSourcesCache()},c.prototype.readOnly=function(){return this._readOnly},c.prototype.properties=function(){return this._properties},c.prototype.lineCancelled=function(){return this._lineCancelled},c.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},c.prototype.chartApi=function(){return this._chartApi},c.prototype.propertyChangeHandler=function(){this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateAllPaneViews=function(){var e,t;for(e=0;e<this.m_panes.length;e++)t=this.m_panes[e],t.updateAllViews()},c.prototype.mainSeries=function(){return this.m_mainSeries},c.prototype.timeScale=function(){return this.m_timeScale},c.prototype.panes=function(){return this.m_panes},c.prototype.gridSource=function(){return this.m_gridSource},c.prototype.watermarkSource=function(){return this.m_watermarkSource},c.prototype.brandingSource=function(){return this._brandingSource},c.prototype.crossHairSource=function(){return this.m_crossHairSource},c.prototype.publishedChartsTimelineSource=function(){return null},c.prototype.barsMarksSources=function(){return this._barsMarksSources},c.prototype.width=function(){
return this.m_width},c.prototype.setPaneHeight=function(e,t){e.setHeight(t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.setWidth=function(e){var t,i;for(this.m_width=e,this.m_timeScale.setWidth(this.m_width),t=0;t<this.m_panes.length;++t)i=this.m_panes[t],i.setWidth(e);this.recalculateAllPanes(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.createPane=function(e,t){var i,n;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),i=this._properties.paneProperties,t&&i.merge(t),n=new b(this.m_timeScale,i,this),"number"==typeof e&&isFinite(e)){if(e<0||e>this.m_panes.length)return void Y.logDebug("ChartModel.createPane: invalid index: "+e);this.m_panes.splice(e,0,n)}else this.m_panes.push(n);return n.onTagsChanged().subscribe(this,c.prototype.onPaneTagsChanged),n},c.prototype.removePane=function(e){var t,i;this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),e.destroy(),t=this.m_panes.indexOf(e),-1!==t&&this.m_panes.splice(t,1),i=this.crossHairSource(),i.pane===e&&this.clearCurrentPosition(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},c.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},c.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,k.LIGHT_UPDATE))},c.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},c.prototype.startScaleTime=function(e){this.m_timeScale.startScale(e)},c.prototype.mainSeriesPriceScaleNameProperty=function(){return this._mainSeriesPriceScaleNameProperty},c.prototype.mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries),t=this._mainSeriesPriceScaleName(),i=null;return"left"===t||"right"===t?i=t:e.isOverlay(this.m_mainSeries)&&(i="none"),i},c.prototype.setMainSeriesPriceScaleName=function(e,t){var i,n=this.paneForSource(this.m_mainSeries);e===t||"none"===t&&!n.actionNoScaleIsEnabled(this.m_mainSeries)||(i=n.priceScaleByName(t),
this.move(this.m_mainSeries,n,i))},c.prototype.mainSeriesPriceScaleNameChanged=function(){return this._mainSeriesPriceScaleNameChanged},c.prototype.onMainSeriesPriceScaleNameChanged=function(){this._mainSeriesPriceScaleNameChanged.fire()},c.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},c.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},c.prototype._mainSeriesPriceScaleName=function(){var e=this.paneForSource(this.m_mainSeries);return e.priceScaleName(e.priceScaleForSource(this.m_mainSeries))},c.prototype.mainSeriesScaleRatio=function(){var e=this.paneForSource(this.m_mainSeries);return"left"===this._mainSeriesPriceScaleName()?e.leftPriceScaleRatio():e.rightPriceScaleRatio()},c.prototype.setMainSeriesScaleRatio=function(e){var t=this.paneForSource(this.m_mainSeries);"left"===this._mainSeriesPriceScaleName()?t.applyLeftPriceScaleRatio(e):t.applyRightPriceScaleRatio(e)},c.prototype.scaleTimeTo=function(e){this.m_timeScale.scaleTo(e),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},c.prototype.startScrollTime=function(e){this.m_timeScale.startScroll(e),this._isTimeScrolling=!0},c.prototype.scrollTimeTo=function(e){this.m_timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new k(k.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},c.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(e){v(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()})},c.prototype.recalcVisibleRangeStudy=function(e,t){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(e,t)},500)},c.prototype._recalcVisibleRangeStudy=function(e,t){var i,n,o,r,a,l,c,h,u,d,p,_,f,m,y,g;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),n=this.mainSeries().nearestData(i.firstBar(),F.NearestRight),o=this.mainSeries().nearestData(i.lastBar(),F.NearestLeft),r=this.mainSeries().bars().lastIndex(),a=n?n.index:void 0,l=o?o.index:void 0,c=a===this._oldStartVisibleIndex,h=l===this._oldEndVisibleIndex,!c||!h||t))for(this._oldStartVisibleIndex=a,this._oldEndVisibleIndex=l,u={first_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),subscribeRealtime:o&&o.index===r},d=0;d<e.length;d++)if(s(e[d])){for(p=e[d],_=p.metaInfo().inputs,f=[],m=0;m<_.length;m++)u.hasOwnProperty(_[m].id)&&f.push(_[m].id)
;for(y=p.properties().inputs,m=0;m<f.length;m++)g=f[m],y[g].setValueSilently(u[g]);f.length>0&&y.listeners().fire(y)}},c.prototype.onResetScales=function(){return this._resetScales},c.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._resetScales.fire(),this._setScalesResetAvailable(!1)},c.prototype.restoreTimeScaleState=function(e){this.m_timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new k(k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},c.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.restoreDefaults=function(e){e.restoreDefaults(this._studyVersioning),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},c.prototype.setSelectedSource=function(e,t){if(!(this.m_selectedSource===e&&this._lastHittestData===t||e&&e.customization&&e.customization.disableSelection)){this._lastHittestData=t;var i=new k;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!1)})),this.m_selectedSource=e,this._selectedSourceChanged.fire(e),e&&(e.updateAllViews(),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!0)})),i.force=!0,this.invalidate(new k(k.LIGHT_UPDATE)),this.setHoveredSource(e,t)}},c.prototype.checkLineToolSelection=function(){this.m_selectedSource&&g(this.m_selectedSource)&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},c.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},c.prototype.setHoveredSource=function(e,t){if(this.m_hoveredSource!==e||this._lastHittestData!==t){this._lastHittestData=t;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new k),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),k.LIGHT_UPDATE))),this.m_hoveredSource=e,e&&(e.updateAllViews(),i||(i=new k),i.merge(this._paneInvalidationMask(this.paneForSource(e),k.LIGHT_UPDATE)),TradingView.alertsDispatcher&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("hovered",!0)})),i&&this.invalidate(i)}},c.prototype.selectedSource=function(){return this.m_selectedSource},c.prototype.hoveredSource=function(){return this.m_hoveredSource},c.prototype.lastHittestData=function(){return this._lastHittestData},c.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},
c.prototype.dataSources=function(){var e,t,i,n=[];for(n.push(this.m_crossHairSource),e=0;e<this.m_panes.length;++e)for(t=this.m_panes[e].dataSources(),i=0;i<t.length;i++)n.push(t[i]);return n},c.prototype.orderedDataSources=function(e){var t,i,n=[];for(n.push(this.m_crossHairSource),t=0;t<this.m_panes.length;t++)i=this.m_panes[t].orderedSources().slice(),e&&i.reverse(),n=n.concat(i);return n},c.prototype.dataSourceForId=function(e){var t,i;for(i=0;i<this.m_panes.length;++i)if(t=this.m_panes[i].dataSourceForId(e))return t;return null},c.prototype.children=function(e,t){return this.dataSources().filter(function(i){return(!0!==t||!s(i)||!i.isChildStudy())&&i.ownerSource()===e})},c.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_crossHairSource.saveOriginCoord(e,t),this.setCurrentPosition(e,t,i,n)},c.prototype.setCurrentPosition=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,S=NaN,b=Math.round(this.m_timeScale.coordinateToIndex(e));if(i&&(o=i.defaultPriceScale(),o.isEmpty()||(r=i.mainDataSource().firstValue(),S=o.coordinateToPrice(t,r))),(this._lineBeingCreated||y(this.currentTool()))&&(S=this._magnet.align(S,b,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,S,i);for(this.m_crossHairSource.setOnHoveredChartWidget(!0),this.m_crossHairSource.setPosition(b,S,i),this.m_crossHairSource.dataWindowView().update(),s=this.m_panes,a=s.length;a--;)for(l=s[a].dataSources(),c=l.length;c--;)h=l[c].dataWindowView(),h&&h.update(),(u=l[c].legendView())&&u.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:b,price:S},n),this._lineBeingCreated.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new k(k.LIGHT_UPDATE)):this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(d=this._undoModel._chartWidget,d._chartWidgetCollection&&(p=this.mainSeries(),(_=p.syncModel())&&(f=this.m_timeScale.points().roughTime(b,_.projectTime.bind(_)),m={timeStamp:f},g=i.mainDataSource(),g instanceof W&&(m.price=S,m.symbol=g.symbol()),m.syncModel=_,v=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,v=v&&H.drawOnAllCharts().value(),d._chartWidgetCollection.syncCrosshair(m,d,v,n))))},c.prototype.clearCurrentPosition=function(){var e,t,i,n,o,r,s,a=this.crossHairSource();for(a.clearPosition(),a.dataWindowView().update(),e=this.m_panes,t=e.length;t--;)for(i=e[t].dataSources(),n=i.length;n--;)o=i[n].dataWindowView(),o&&o.update(),(r=i[n].legendView())&&r.update();this.invalidate(new k(k.UPDATE_CURSOR_ONLY)),s=this._undoModel._chartWidget,s._chartWidgetCollection&&s._chartWidgetCollection.syncCrosshair(NaN,s)},c.prototype.onSyncScrollNeeded=function(e){var t,i,n,o=this._undoModel._chartWidget;o._chartWidgetCollection&&(t=this.mainSeries(),(i=t.syncModel())&&(n=1e3*this.m_timeScale.points().roughTime(e,i.projectTime.bind(i)),o._chartWidgetCollection.syncScroll(n,this)))},c.prototype.gotoTime=function(e,t){function i(){
return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-e}function n(t){var n,o,r,s,a;if(i()<0){for(n=p.tickMarks().nearestIndex(e),o=h(_.bars().lastIndex()),n=Math.min(n,o),r=p.tickMarks().indexToTime(n).valueOf();r<e&&n<o;)n++,r=p.tickMarks().indexToTime(n).valueOf();return s=p.visibleBars(),a=s.lastBar()-s.firstBar(),!t&&s.contains(n)||(p.zoomToBarsRange(n-a/2,n+a/2),_.requestMoreData()),{timestamp:p.indexToTimePoint(n)}}}var o,r,s,a,l,c,u,d,p=this.timeScale(),_=this.mainSeries();if(t&&t.model&&(o=_.syncModel())&&(r=this._createSyncPoint(t.model.mainSeries().syncModel(),o),e=1e3*r.sourceTimeToTargetTime(e/1e3)),t=t||{centerIfVisible:!0},e)this._scrollingState&&this._scrollingState.deferred.reject(),s=$.Deferred(),this._scrollingState={targetDate:e,deferred:s,centerIfVisible:t.centerIfVisible};else{if(!this._scrollingState)return Y.logError("scrollTo called without an argument"),$.Deferred().reject().promise();e=this._scrollingState.targetDate,s=this._scrollingState.deferred}return a=n(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,c=p.visibleBars(),u=c.lastBar()-c.firstBar(),_.endOfData()?(p.zoomToBarsRange(l-u/2,l+u/2),a={timestamp:p.indexToTimePoint(l),eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(e),_.requestMoreData(Math.ceil(d+u/2)))),a&&(this.fullUpdate(),this._scrollingState=null,s.resolve(a)),s.promise()},c.prototype._createSyncPoint=function(e,t){var i,n,o=this._syncPointCache[e.uniqueId()];if(o){if(i=o[t.uniqueId()])return i}else this._syncPointCache[e.uniqueId()]={};return n=new U(e,t),this._syncPointCache[e.uniqueId()][t.uniqueId()]=n,n},c.prototype.setExternalPosition=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.crossHairSource();if(f.setOnHoveredChartWidget(!1),!Number.isNaN(e)&&isNumber(e.timeStamp)&&(n=this.mainSeries(),(o=n.syncModel())&&(r=this._createSyncPoint(e.syncModel,o),s=r.sourceTimeToTargetTime(e.timeStamp),i=this.m_timeScale.points().roughIndex(s,o.distance.bind(o)))),this.mainSeries().symbol()===e.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),c=a.mainDataSource().firstValue(),h=this.mainSeries().priceScale().priceToCoordinate(e.price,c,!0),this.setCurrentPosition(l,h,a,t||{}),f.setOnHoveredChartWidget(!1),void delete this._isSettingsExternalPosition;for(isFinite(i)?f.setPosition(i,NaN,null):(f.clearPosition(),f.dataWindowView().update()),u=this.dataSources(),d=u.length;d--;)p=u[d].dataWindowView(),p&&p.update(),(_=u[d].legendView())&&_.update();this.invalidate(new k(k.UPDATE_CURSOR_ONLY))},c.prototype.updateCrossHair=function(){this.m_crossHairSource.update()},c.prototype.updateTimeScale=function(e,t,i,n,o,r){var s,a,l;if(r)for(this.m_timeScale.reset(),s=this.dataSources(),a=0;a<s.length;a++)s[a].clearData&&s[a].clearData();if(n.length>0)for(s=this.dataSources(),a=0;a<s.length;a++)s[a].moveData&&s[a].moveData(n);this.m_timeScale.update(e,t,i,o),l="ChartModel.prototype.updateTimeScale("+e+","+t+","+i.length+","+n.length+","+o.length+","+r+")",
l+="TimeScale: {first:"+this.m_timeScale.m_points.firstIndex()+",last:"+this.m_timeScale.m_points.lastIndex()+"}",Y.logDebug(l),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.updateTimeScaleBaseIndex=function(e){var t,i,n,o,r,s,a=this.mainSeries().bars();a.isEmpty()||(t=this.timeScale(),i=t.baseIndex(),n=h(a.lastIndex()),o=t.visibleBars(),null!==o&&(r=o.contains(i),e&&e.index>0&&!r&&(s=n-i,t.setRightOffset(t.rightOffset()-s))),t.setBaseIndex(n))},c.prototype.recalculatePane=function(e){e&&e.recalculate()},c.prototype.paneForSource=function(e){for(var t=this.m_panes.length-1;t>=0;t--)if(-1!==this.m_panes[t].dataSources().indexOf(e))return this.m_panes[t];return e instanceof L?this.paneForSource(this.m_mainSeries):null},c.prototype.recalculateAllPanes=function(){for(var e=0;e<this.m_panes.length;++e)this.m_panes[e].recalculate();this.updateAllPaneViews()},c.prototype._invalidateBarColorerCaches=function(){var e,t,i=this.dataSources();for(e=0;e<i.length;++e)(t=i[e])instanceof W&&t.invalidateBarColorerCache()},c.prototype.addStrategySource=function(e){~this.strategySources.indexOf(e)||(this.strategySources.push(e),this.strategySources.change.fire())},c.prototype.removeStrategySource=function(e){var t,i,n=this.strategySources.indexOf(e);~n&&(t=this.strategySources.splice(n,1),t[0]===this._activeStrategySource.value()&&this.unsetActiveStrategySource(),this.strategySources.length>0&&(i=this.strategySources[this.strategySources.length-1],this.setActiveStrategySource(i)),this.strategySources.change.fire())},c.prototype.setActiveStrategySource=function(e){~this.strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},c.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},c.prototype.activeStrategySource=function(){return this._activeStrategySource},c.prototype.insertStudy=function(e,t,i,n,o){var r,s,a,c;return null!==n&&void 0!==n||(n=this.mainSeries()),r=["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"],-1===r.indexOf(e.id)&&z("studies","Study_"+e.id),s=null,i||e.is_price_study?s=this.paneForSource(n):(s=this.createPane(),t&&t.paneSize&&s.setPaneSize(t.paneSize)),"Compare@tv-basicstudies"===e.id&&(z("compare","symbol:"+t.inputs.symbol),this.m_mainSeries.priceScale().setMode({log:!1,percentage:!0})),a=O(e,t,s,this.studyVersioning(),n),c=D(this,a,n,e),this._recalcVisibleRangeStudy([c],!0),c.start(),c.childStudyByRebind().subscribe(null,function(){z("SOS","Apply SOS","Rebind SOS")}),s.addDataSource(c,l(s,n,c.metaInfo(),i,o)),c.properties().linkedToSeries&&c.properties().linkedToSeries.value()&&c.setOwnerSource(this.mainSeries()),this.recalculatePane(s),this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(c),c},c.prototype.studyInserted=function(){return this._studyInserted},c.prototype.replaceStudyStub=function(e,t){
var i,n,o,r=this.paneForSource(e);return null!==r&&(i=e.isNoScale()?null:e.priceScale(),n=e.zorder(),o=e.ownerSource(),r.insertDataSource(t,i,n),t.setOwnerSource(o),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===e&&i.setOwnerSource(t)})}),this.removeSource(e),t.start(),this.recalculatePane(r),this.invalidate(new k(k.FULL_UPDATE)),!0)},c.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=this.paneForSource(t),n=new B(this,null,e);return i.addDataSource(n,null),this.recalculatePane(i),this.invalidate(new k(k.FULL_UPDATE)),n},c.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return void 0===t?(Y.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},c.prototype.detachSource=function(e,t){var i=this.paneForSource(e);if(i)return i.removeDataSource(e),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,t),!0):(this.invalidate(new k(k.FULL_UPDATE)),this._alertsList&&this._alertsList.trigger("reset"),!1)},c.prototype.removeSource=function(e,t){var i,n,o,r;if(e===this.m_selectedSource&&this.setSelectedSource(null),e===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),e===this._lineBeingEdited&&(this._lineBeingEdited=null),e===this._lineBeingCreated&&(this._lineBeingCreated=null),e.stop&&e.stop(),i=this.detachSource(e,t),e.metaInfo&&e.metaInfo()&&"Compare@tv-basicstudies"===e.metaInfo().id){for(n=this.paneForSource(this.m_mainSeries),o=n.dataSources(),r=0;r<o.length;r++)if(o[r].metaInfo&&"Compare@tv-basicstudies"===o[r].metaInfo().id)return;this.m_mainSeries.priceScale().setMode({percentage:!1})}return this.invalidate(new k(k.FULL_UPDATE)),this._invalidateBarColorerCaches(),e.linkKey&&H.removeLineTool({model:this,linkKey:e.linkKey}),s(e)&&e.isChildStudy()&&e.source().unsetChild(e),e.destroy&&e.destroy(),i},c.prototype._unmergeAvailable=function(e){return TradingView.isInherited(e.constructor,M)&&!TradingView.isInherited(e.constructor,V)||e===this.m_mainSeries},c.prototype.isMergeUpAvailableForSource=function(e){return!!this._unmergeAvailable(e)&&this.paneForSource(e)!==this.panes()[0]},c.prototype.mergeSourceUp=function(e){var t,i,n,o;this.isMergeUpAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i-1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isMergeDownAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),i=this.panes(),t!==i[i.length-1])},c.prototype.mergeSourceDown=function(e){var t,i,n,o;this.isMergeDownAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.panes()[i+1],o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isUnmergeAvailableForSource=function(e){var t,i;return!!this._unmergeAvailable(e)&&(t=this.paneForSource(e),i=t.dataSources().filter(function(e){return TradingView.isInherited(e.constructor,A)&&e.showInObjectTree()}),i.length>1)},c.prototype.unmergeSourceUp=function(e){
var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.unmergeSourceDown=function(e){var t,i,n,o;this.isUnmergeAvailableForSource(e)&&(t=this.paneForSource(e),i=this.panes().indexOf(t),n=this.createPane(i+1),o=n.findSuitableScale(e),this.move(e,n,o))},c.prototype.isLeftPriceScaleVisible=function(){return this._properties.scalesProperties.showLeftScale.value()},c.prototype.isRightPriceScaleVisible=function(){return this._properties.scalesProperties.showRightScale.value()},c.prototype.setLeftPriceScaleVisible=function(e){this._properties.scalesProperties.showLeftScale.value()!==e&&this._properties.scalesProperties.showLeftScale.setValue(e)},c.prototype.setRightPriceScaleVisible=function(e){this._properties.scalesProperties.showRightScale.value()!==e&&this._properties.scalesProperties.showRightScale.setValue(e)},c.prototype.setPriceScaleVisibility=function(e,t){"left"===e&&this.setLeftPriceScaleVisible(t),"right"===e&&this.setRightPriceScaleVisible(t)},c.prototype.move=function(e,t,i){var n,o,r,s,a=this.children(e,!0),l=this.paneForSource(e),c=t?t.priceScaleName(i):"right";if(l===t){for(n=t.priceScaleByName(c),o=0;o<a.length;o++)t.move(a[o],n);t.move(e,n)}else{for(r=t||this.createPane(),s=r.priceScaleByName(c),o=0;o<a.length;o++)this.detachSource(a[o]);for(this.detachSource(e),r.addDataSource(e,s),o=0;o<a.length;o++)r.addDataSource(a[o],s)}this._alertsList&&this._alertsList.trigger("reset"),e===this.m_mainSeries&&this.onMainSeriesPriceScaleNameChanged(),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.isSingleInstanceLineTool=function(e){return"LineStudyMtpRiskReward"===e||"LineStudyMtpAnalysis"===e},c.prototype._externalTimeStamp=function(e){var t=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(e,t&&t.projectTime.bind(t))},c.prototype.createLineTool=function(e,t,i,n,o){var r,s,a,l,c,h,d,p,_,f,g,v;return y(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&z("drawings","Study_Drawing_"+i),n&&(r=n.state(),s=TradingView.factoryDefaults("linetool"),a=i.toLowerCase(),TradingView.merge(s,TradingView.factoryDefaults(a)),n=TradingView[i].prototype.createPropertiesObject(a,s),n.merge(r)),l=m(i,this,n,null,e.mainDataSource()),n||(n=l.properties()),c=!l.linkKey&&!o,H.drawOnAllCharts().value()?l.linkKey=o||q.randomHash():l.linkKey=o,l.toolname=i,l.setOwnerSource(e.mainDataSource()),h=e.defaultPriceScale(),e.addDataSource(l,h),l.isFixed()?(p=e.mainDataSource().firstValue(),_=this.m_timeScale.indexToCoordinate(t.index),f=h.priceToCoordinate(t.price,p),d=l.addFixedPoint(new u(_,f))):(g=l.constructor,g.skipMagnetting||(t.price=this._magnet.align(t.price,t.index,e)),d=l.addPoint(t)),d||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=e),c&&l.enableCurrentIntervalVisibility(),this.invalidate(new k(k.FULL_UPDATE)),o||!H.drawOnAllCharts().value()||l.properties().singleChartOnly||(v=this._externalTimeStamp(t.index),H.createLineTool({
point:{price:t.price,timeStamp:v},linetool:i,properties:n,symbol:this.mainSeries().symbol(),model:this,linkKey:l.linkKey})),l):null},c.prototype.lineBeingCreated=function(){return this._lineBeingCreated},c.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},c.prototype.coninueCreatingLine=function(e,t,i,n){var o,r,s,a,l,c=this.paneForSource(this._lineBeingCreated);return e.price=this._magnet.align(e.price,e.index,c),o=this._lineBeingCreated.addPoint(e,t,i),r=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),s=new k(k.LIGHT_UPDATE),a=null,o&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,s.force=!0),this.invalidate(s),n||!H.drawOnAllCharts().value()||r.properties().singleChartOnly||(l=this._externalTimeStamp(e.index),H.continueLineTool({point:{price:e.price,timeStamp:l},envState:t,finalState:a,model:this})),o},c.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),H.drawOnAllCharts().value()&&!e.properties().singleChartOnly&&H.cancelLineTool({model:this})}},c.prototype.startChangingLinetool=function(e,t,i,n){var o,r,s;this._lineBeingEdited=e,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,t),o=this.paneForSource(e),t.price=this._magnet.align(t.price,t.index,o),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,t),this._lineBeingEdited.setPoint(i,t,n),this._lineBeingEdited.updateAllViews(),r=this._paneInvalidationMask(o,k.LIGHT_UPDATE),r.force=!0,this.invalidate(r),e.linkKey&&!e.properties().singleChartOnly&&(s=this._externalTimeStamp(t.index),H.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:s},pointIndex:i,envState:n}))},c.prototype.lineBeingEdited=function(){return this._lineBeingEdited},c.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},c.prototype.changeLinePoint=function(e,t){var i,n,o,r,s,a=this.paneForSource(this._lineBeingEdited);void 0!==e.x&&void 0!==e.y?(o=this._lineBeingEdited.priceScale(),r=a.mainDataSource().firstValue(),i=o.coordinateToPrice(e.y,r),n=Math.round(this.timeScale().coordinateToIndex(e.x)),i=this._magnet.align(i,n,a),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:n},t)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t),this._lineBeingEdited.updateAllViews(),this.invalidate(new k(k.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this._externalTimeStamp(n),H.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:t}))},c.prototype.endChangingLinetool=function(e){var t,i,n=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,e),this._lineBeingEdited=null,this._linePointBeingEdited=null,
t=new k(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishChangingLineTool({model:this,linkKey:n.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},c.prototype.startMovingSource=function(e,t,i){var n,o,r;this._sourceBeingMoved=e,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(t,i),n=this.paneForSource(this._sourceBeingMoved),o=this._paneInvalidationMask(n,k.LIGHT_UPDATE),o.force=!0,this.invalidate(o),e.linkKey&&!e.properties().singleChartOnly&&(r=this._externalTimeStamp(t.index),H.startMovingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:r}}))},c.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},c.prototype.moveSource=function(e){if(this._sourceBeingMoved.move(e,this._linePointBeingMoved),this.invalidate(new k(k.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var t=this._externalTimeStamp(e.index);H.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:e.price,timeStamp:t}})}},c.prototype.endMovingSource=function(e){var t,i,n=this._sourceBeingMoved,o=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(e),this._sourceBeingMoved=null,this._linePointBeingMoved=null,t=this._paneInvalidationMask(o,k.LIGHT_UPDATE),t.invalidateAll(k.LIGHT_UPDATE),t.force=!0,this.invalidate(t),g(n)&&(i={points:n._timePoint,interval:this.mainSeries().interval()},n.linkKey&&!n.properties().singleChartOnly&&H.finishMovingLineTool({linkKey:n.linkKey,model:this,finalState:i}))},c.prototype.finishLineTool=function(e){var t=this.lineBeingCreated();t&&(t.finish&&t.finish(),!e&&H.drawOnAllCharts().value()&&t.linkKey&&!t.properties().singleChartOnly&&H.finishLineTool({linkKey:t.linkKey,model:this}))},c.prototype.calculateDefaultTags=function(){var e,t,i=[],n=this.dataSources();for(e=0;e<n.length;e++)t=n[e],t.tags&&(i=i.concat(t.tags()));return i},c.prototype.changeZOrder=function(e,t){this.paneForSource(e).changeZOrder(e,t),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.sendToBack=function(e){this.paneForSource(e).sendToBack(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.bringToFront=function(e){this.paneForSource(e).bringToFront(e),this.invalidate(new k(k.FULL_UPDATE))},c.prototype.onTagsChanged=function(){return this._tagsChanged},c.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},c.prototype.setTimeViewport=function(e,t){this.timeScale().zoomToBarsRange(e,t),this.recalculateAllPanes(),this.invalidate(new k(k.LIGHT_UPDATE))},c.prototype.zoomToViewport=function(e,t,i,n,o){var s,a,l;this.setTimeViewport(e,t),s=Math.min(i,n),a=Math.max(i,n),l=o.defaultPriceScale(),l.isPercentage()||l.setMode({autoScale:!1}),l.isLog()&&(s=l.priceToLogical(s),a=l.priceToLogical(a)),l.setPriceRange(new r(s,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(o,k.LIGHT_UPDATE)),this._setScalesResetAvailable(!0)},
c.prototype.clearAllStudies=function(){var e,t=this.dataSources();for(e=0;e<t.length;e++)t[e].clearData&&t[e].clearData()},c.prototype.allStudies=function(){return this._getAllSources(s)},c.prototype.allLineTools=function(){return this._getAllSources(g)},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return null!==t&&s(t)?t:null},c.prototype.getLineToolById=function(e){var t=this.dataSourceForId(e);return null!==t&&g(t)?t:null},c.prototype._getAllSources=function(e){var t,i,n,o,r,s,a=[],l=this.m_panes,c=l.length;for(t=0;t<c;++t)for(i=l[t],n=i.dataSources(),o=n.length,r=0;r<o;++r)s=n[r],e(s)&&a.push(s);return a},c.prototype.getStudyById=function(e){var t=this.dataSourceForId(e);return t instanceof M?t:null},c.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},c.prototype.backgroundCounterColor=function(){return"black"===_(p(this.backgroundColor()),150)?"white":"black"},c.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},c.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&n.enabled("chart_zoom")},c.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&n.enabled("chart_zoom")},c.prototype.updateAllVolumeStudies=function(){var e,t,i,n,o,r,a=this.m_panes;for(e=a.length;e--;)for(t=!1,i=a[e],n=i.dataSources(),o=n.length;o--;)r=n[o],s(r)&&"Volume"===r.metaInfo().shortId&&(r.updateAllViews(),t||(this.updatePane(i),t=!0))},c.prototype.alertsList=function(){return this._alertsList},c.prototype.setAlertsStudiesList=function(e){this._alertsStudiesList=$.map($.grep(e,function(e){var t,i=e.plots||[];for(t=0;t<i.length;t++)if("line"===i[t].type)return!0;return!1}),function(e){return e.id})},c.prototype.canCreateAlertForDataSource=function(e){if(!n.enabled("alerts"))return!1},c.prototype.setInterval=function(e,t){var i=setInterval(e,t);return this._modelIntervals.push(i),i},c.prototype.clearInterval=function(e){clearInterval(e);var t=this._modelIntervals.indexOf(e);t>-1&&this._modelIntervals.splice(t,1)},c.prototype.clearIntervals=function(){for(var e=0;e<this._modelIntervals.length;e++)clearInterval(this._modelIntervals[e]);this._modelIntervals=[]},c.prototype.destroy=function(){var e;for(e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(this.clearIntervals(),H.hideAllDrawings().unsubscribe(this,this.visibilityChangeHandler),this.resetDeferredStudies(),this._brandingSource&&this._brandingSource.destroy(),e=0;e<this._barsMarksSources.length;e++)this._barsMarksSources[e].destroy();for(e=0;e<this.m_panes.length;e++)this.m_panes[e].destroy();this.m_panes.length=0},c.prototype.countUserStudies=function(e){var t,i,n,o,r,a,l=0;for(e=e||{},t=0;t<this.m_panes.length;t++)for(i=this.m_panes[t].dataSources(),n=0;n<i.length;n++)if(o=i[n],s(o)&&o.showInObjectTree()){if(r=o.metaInfo&&o.metaInfo()){if(a=r.id,e.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(e.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(e.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}l++}return l
},c.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},c.prototype.undoModel=function(){return this._undoModel},c.prototype.copyToOtherCharts=function(e){var t,i,n,o;e.linkKey=e.linkKey||q.randomHash(),t=this,i=e.state(),n=this.mainSeries(),(o=n.syncModel())&&(i.points=e._timePoint.map(function(e){var i=t.timeScale().timePointToIndex(e.time_t)+e.offset;return{price:e.price,timeStamp:t._externalTimeStamp(i)}}),i.linetool=e.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),i.finalState={points:e._timePoint,interval:this.mainSeries().interval()},H.copyLineTool(i))},c.prototype.restoreSource=function(e,t,i,n,o){var r,s,a,l,c,h,u,d;return r=e?this.createPane(t):this.panes()[t],a=n.type,s=a.toLowerCase().startsWith("study")?r._restoreStudy(n):r._restoreLineTool(n),l=s.ownerSource()?s.ownerSource().priceScale():r.priceScaleByName(o),l?(s.setPriceScale(l),l.addDataSource(s)):(l=new C(this.properties().scalesProperties),l.setHeight(r.m_height),c=s.metaInfo&&"Volume@tv-basicstudies"===s.metaInfo().id,h=c?.75:r.m_rightPriceScale.topMargin(),u=c?0:r.m_rightPriceScale.bottomMargin(),l.setTopMargin(h),l.setBottomMargin(u),l.addDataSource(s),s.setPriceScale(l),s._isOverlay=!0),d=null,n.ownerSource&&(d=r.dataSourceForId(n.ownerSource)),s.setOwnerSource(d),s.setPriceScale(l),s.start(),s.restore&&s.restore(),e&&r.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new k(k.FULL_UPDATE,!0)),s.linkKey&&H.restoreLineTool({model:this,linkKey:s.linkKey,state:{restorePane:e,paneIndex:t,paneState:i,sourceState:n,priceScaleName:o}}),s},c.prototype.restoreLineToolState=function(e,t){e.restorePoints(t.points,t.indexes||[]),e.properties().merge(t.state),e.restoreData&&e.restoreData(t),e.createServerPoints(),this.invalidate(new k(k.FULL_UPDATE)),e.linkKey&&H.restoreLineToolState({model:this,linkKey:e.linkKey,state:t})},c.prototype.createBrandingSource=function(){this._brandingSource=new I(this)},c.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},c.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},c.prototype.selectBarMode=function(){return this.m_crossHairSource.selectBarMode()},c.prototype.toggleSelectBarMode=function(){this.m_crossHairSource.toggleSelectBarMode()},c.prototype.onBarSelected=function(){return this.m_crossHairSource.onBarSelected()},c.prototype.isSeriesStyleSupported=function(e){return this.m_mainSeries.isStyleSupported(e)},c.prototype.getStudyShiftColorStartOffset=function(){return this._studyShiftColorStartOffset},c.prototype.setStudyShiftColorStartOffset=function(e){this._studyShiftColorStartOffset=e},c.prototype.setPriceAutoScaleForAllMainSources=function(){var e,t;for(e=0;e<this.m_panes.length;++e)null===(t=this.m_panes[e].mainDataSource())||t.priceScale().isLockScale()||t.priceScale().setMode({autoScale:!0})},c.prototype.isInReplay=function(){return this.m_mainSeries.isInReplay()},c.prototype.switchToReplay=function(e){},c.prototype.switchToRealtime=function(){},
c.prototype.defaultResolutions=function(){return this.chartApi().chartApi().defaultResolutions()},c.prototype._setScalesResetAvailable=function(e){this._isScalesResetAvailable!==e&&(this._isScalesResetAvailable=e,this._isScalesResetAvailableChanged.fire())},c.prototype.isScalesResetAvailable=function(){return this._isScalesResetAvailable},c.prototype.isScalesResetAvailableChanged=function(){return this._isScalesResetAvailableChanged},e.exports=c}).call(t,i(8),i(5),i(16),i(48).PriceRange)},function(e,t,i){"use strict";function n(e,t){this.array=[];for(var i in e)e[i].key=i,this.array.push(e[i]);this.rearrange(t)}n.prototype.rearrange=function(e){if("function"!=typeof e)throw Error("sort param is not a function");return this.array.sort(e)},n.byValue=function(e){return function(e,t){return e-t}},n.byField=function(e){return function(t,i){return t[e]>i[e]?1:t[e]<i[e]?-1:t[e]===i[e]?0:void 0}},n.byOrder=function(e){return function(t,i){return e.indexOf(t.key)-e.indexOf(i.key)}},e.exports=n},function(e,t,i){"use strict";function n(){s.call(this)}function o(e,t){this._constructor="LineToolFibRetracement";var r=t||this.createPropertiesObject("linetoolfibretracement");a.call(this,e,r),this.version=o.version,this._properties._stateVersion=1,e._fibRetracementLabelsCache||(e._fibRetracementLabelsCache=new n),i.e(0).then(function(e){var t=i(753).FibRetracementPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(68),a=i(0).LineDataSource,l=i(2).propertyPages;inherit(n,s),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,a),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){a.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Retracement"},o.prototype.name=function(){return"Fib Retracement"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibRetracementStylesPropertyPage},t.LineToolFibRetracement=o},function(e,t,i){"use strict";(function(t){function i(e){t.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(e)}inherit(i,t),i.prototype.reloadProperties=function(e){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var t=0;t<e.length;++t)this._initValues.push(e[t].defaultValue),this.addChild(t,e[t].property);this.checkSelfColor()},i.prototype.setValue=function(e,i){if(this._value!==e||i){var n=this;this._childs.forEach(function(t){n[t].setValue(e||n._initValues[t])}),t.prototype.setValue.call(this,e,i)}},i.prototype.checkSelfColor=function(){var e,i=!0
;for(e=0;e<this._initValues.length;++e)if(this[e].value()!==this[0].value()){i=!1;break}t.prototype.setValue.call(this,i?this[0].value():"")},e.exports=i}).call(t,i(13))},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibChannel";var s=t||this.createPropertiesObject("linetoolfibchannel");r.call(this,e,s),this.version=o.version,e._fibChannelLabelsCache||(e._fibChannelLabelsCache=new n),i.e(0).then(function(e){var t=i(754).FibChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=24,o.version=2,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.migrateVersion=function(e,t,i){i.properties.removeProperty("reverse")},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Fib Channel"},o.prototype.name=function(){return"Fib Channel"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,24],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibChannelStylesPropertyPage},t.LineToolFibChannel=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibSpeedResistanceArcs";var o=t||this.createPropertiesObject("linetoolfibspeedresistancearcs");r.call(this,e,o),e._fibSpeedResistanceArcsLabelsCache||(e._fibSpeedResistanceArcsLabelsCache=new n),i.e(0).then(function(e){var t=i(755).FibSpeedResistanceArcsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Speed Resistance Arcs"},o.prototype.name=function(){return"Fib Speed Resistance Arcs"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibSpeedResistanceArcsStylesPropertyPage},t.LineToolFibSpeedResistanceArcs=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolProjection";var n=t||this.createPropertiesObject("linetoolprojection");l.call(this,e,n),i.e(0).then(function(e){var t=i(756).ProjectionLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(19),s=i(270).LineToolFibWedge,a=i(68),l=i(0).LineDataSource,c=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return 1},
inherit(o,s),o.prototype.title=function(){return"Projection"},o.prototype.name=function(){return"Projection"},o.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new n),this._model._projectionLabelsCache},o.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,1]})},o.prototype.getStylesPropertyPage=function(){return c.LineToolProjectionStylesPropertyPage},t.LineToolProjection=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolTrendBasedFibExtension";var s=t||new this.createPropertiesObject("linetooltrendbasedfibextension");r.call(this,e,s),this.version=o.version,e._trendBasedFibExtensionLabelsCache||(e._trendBasedFibExtensionLabelsCache=new n),i.e(0).then(function(e){var t=i(757).TrendBasedFibExtensionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},n.prototype.points=function(e){return[e.points()[0],e.points()[1]]},n.prototype.startPoint=function(e,t){return e.points()[2]},n.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],o=i[1];return t?n.price-o.price:o.price-n.price},n.prototype.sourceIsReady=function(e){return e.points().length>=3},inherit(o,r),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Trend-Based Fib Extension"},o.prototype.name=function(){return"Trend-Based Fib Extension"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},t.LineToolTrendBasedFibExtension=o},function(e,t,i){"use strict";function n(){a.call(this)}function o(e,t){this._constructor="LineToolFibCircles";var o=t||this.createPropertiesObject("linetoolfibcircles");r.call(this,e,o),e._fibCirclesLabelsCache||(e._fibCirclesLabelsCache=new n),i.e(0).then(function(e){var t=i(758).FibCirclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(0).LineDataSource,s=i(19),a=i(68),l=i(2).propertyPages;inherit(n,a),n.prototype.levelsCount=function(){return o.LevelsCount},inherit(o,r),o.LevelsCount=11,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Circles"},o.prototype.name=function(){return"Fib Circles"},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible
;e.setProperty(n,!1,"Erase level line")},o.prototype.createPropertiesObject=function(e,t,i){return new s(e,t,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolFibCirclesStylesPropertyPage},t.LineToolFibCircles=o},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolVertLine";var n=t||new r("linetoolvertline");this._timeAxisView=new a(this,e),o.call(this,e,n),i.e(0).then(function(e){var t=i(759).VertLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages,a=i(271).LineToolVertLineTimeAxisView;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Vertical Line"},n.prototype.name=function(){return"Vertical Line"},n.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._timeAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]},n.prototype.getInputsPropertyPage=function(){return s.LineToolVertLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return s.LineToolVertLineStylesPropertyPage},t.LineToolVertLine=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolCrossLine",function(){return c}),n=i(1),o=i(3),i.n(o),r=i(174),s=i(271),a=i(0),i.n(a),l=i(2),i.n(l),c=function(e){function t(t,n){var a=e.call(this,t,n||new o.DefaultProperty("linetoolcrossline"))||this;return a._constructor="LineToolCrossLine",a._priceAxisView=new r.LineToolHorzLinePriceAxisView(a),a._timeAxisView=new s.LineToolVertLineTimeAxisView(a,t),i.e(0).then(function(e){var t=i(760).CrossLinePaneView;a._setPaneViews([new t(a,a._model)])}.bind(null,i)).catch(i.oe),a}return n.c(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.title=function(){return"Cross Line"},t.prototype.name=function(){return"Cross Line"},t.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},t.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},t.prototype.updateAllViews=function(){e.prototype.updateAllViews.call(this),this._priceAxisView.update(),this._timeAxisView.update()},t.prototype.canHasAlert=function(){return!1},t.prototype.getInputsPropertyPage=function(){return l.propertyPages.LineToolCrossLineInputsPropertyPage},t.prototype.getStylesPropertyPage=function(){return l.propertyPages.LineToolCrossLineStylesPropertyPage},t.prototype.lineColor=function(){return this.properties().linecolor.value()},t.prototype.lineWidth=function(){return this.properties().linewidth.value()
},t.prototype.lineStyle=function(){return this.properties().linestyle.value()},t}(a.LineDataSource),c.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBarsPattern";var r=t||new s("linetoolbarspattern");o.call(this,e,r),r.mirrored.listeners().subscribe(this,n.prototype.mirror),r.flipped.listeners().subscribe(this,n.prototype.flip),r.addExclusion("mirrored"),r.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged),i.e(0).then(function(e){var t=i(761).BarsPatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(41).Action,s=i(3).DefaultProperty,a=i(17).PlotRowSearchMode,l=i(2).propertyPages,c=i(203).LineToolBarsPatternMode;inherit(n,o),n.version=2,n.prototype.onModeChanged=function(){var e=this.patternPriceDiff();e*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+e},n.prototype.additionalActions=function(e){var t,i,n=new r({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),o=new r({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return n.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().mirrored,!n.properties().mirrored.value(),"Bats Pattern Mirroring"),n.updateAllViews(),n._model.updateSource(n)}),o.callbacks().subscribe(null,function(t){var i=t.callbackContext(),n=i.target;e.setProperty(n.properties().flipped,!n.properties().flipped.value(),"Bats Pattern Flipping"),n.updateAllViews(),n._model.updateSource(n)}),t=new r({checkable:!0,text:$.t("Restore Size")}),i=this,t.callbacks().subscribe(null,function(t){var n=i.points()[0],o=i.patternPriceDiff(),r=n.price+o,s=n.index+i._pattern.length-1;e.startChangingLinetool(i,{price:r,index:s},1,{}),e.changeLinePoint({price:r,index:s},{}),e.endChangingLinetool()}),[n,o,t]},n.prototype.pointsCount=function(){return 2},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.pattern=this._pattern,t},n.prototype.restoreData=function(e){e.pattern&&(this._pattern=e.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.name=function(){return"Bars Pattern"},n.prototype.cloneData=function(e){this._pattern=TradingView.clone(e._pattern)},n.prototype.mirror=function(){var e,t,i,n,o,r=this._pattern,s=r[0][TradingView.HIGH_PLOT],a=Math.min(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]),l=Math.max(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]);for(e=1;e<r.length;e++)a=Math.min(a,r[e][TradingView.LOW_PLOT]),l=Math.max(l,r[e][TradingView.HIGH_PLOT]);if(a<l)for(t=(a+l)/2,i=function(e){return t-(e-t)},e=0;e<r.length;e++)r[e][TradingView.HIGH_PLOT]=i(r[e][TradingView.HIGH_PLOT]),r[e][TradingView.LOW_PLOT]=i(r[e][TradingView.LOW_PLOT]),r[e][TradingView.OPEN_PLOT]=i(r[e][TradingView.OPEN_PLOT]),
r[e][TradingView.CLOSE_PLOT]=i(r[e][TradingView.CLOSE_PLOT]);n=r[0][TradingView.HIGH_PLOT]-s,o=r[r.length-1][TradingView.LOW_PLOT]-r[0][TradingView.HIGH_PLOT],this._points[0].price+=n,this._points[1].price=this._points[0].price+o,this.updateAllViews()},n.prototype.flip=function(){var e,t,i;for(this._points[0].price=this._points[1].price,e=0;e<this._pattern.length/2;e++)t=this._pattern[e],this._pattern[e]=this._pattern[this._pattern.length-e-1],this._pattern[this._pattern.length-e-1]=t;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(e={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[0][t])},n.prototype.lastPatternPrice=function(){var e,t,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(e={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},t=e[i],this._pattern[this._pattern.length-1][t])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var e=this.patternPriceDiff(),t=this.points()[0].price,i=this.points()[1].price,n=i-t,o=n/e;return this._pressCoeff=o,o},n.prototype.addPoint=function(e,t){var i,n,r,s,l,h,u,d,p,_,f,m=this._model.mainSeries(),y=m.nearestIndex(e.index,a.NearestRight);if(this.properties().mode.value()===c.Bars?e.price=m.bars().valueAt(y)[TradingView.HIGH_PLOT]:e.price=m.bars().valueAt(y)[TradingView.CLOSE_PLOT],i=this.priceScale(),n=this.ownerSource().firstValue(),r=.05*i.height(),s=i.priceToCoordinate(e.price,n)-r,e.price=i.coordinateToPrice(s,n),l=o.prototype.addPoint.call(this,e,t,!0)){for(h=Math.min(this.points()[0].index,this.points()[1].index),u=Math.max(this.points()[0].index,this.points()[1].index),y=this._model.mainSeries().nearestIndex(h,a.NearestRight),d=this._model.mainSeries().nearestIndex(u,a.NearestLeft),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],p=y;p<=d;p++)_=this._model.mainSeries().data().valueAt(p),this._pattern.push(TradingView.clone(_));this._pattern.length>0&&(f=this.patternPriceDiff(),this._points[1].price=this._points[0].price+f,this._points[1].index=this._points[0].index+(d-y),this.normalizePoints(),this.createServerPoints())}return l},n.prototype.setPoint=function(e,t,i){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),o.prototype.setPoint.call(this,e,t,i)},
n.prototype.migrateVersion=function(e,t,i){if(1===e&&this._pattern.length>0){var n=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+n),2===this._points.length&&(this._points[1].price=this._points[0].price+n)}},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolBarsPatternStylesPropertyPage},t.LineToolBarsPattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrendBasedFibTime";var r=t||new this.createPropertiesObject("linetooltrendbasedfibtime");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(762).TrendBasedFibTimePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.name=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(e,t,i){},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibTimeStylesPropertyPage},t.LineToolTrendBasedFibTime=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibTimeZone";var r=t||this.createPropertiesObject("linetoolfibtimezone");o.call(this,e,r),this.version=n.version,i.e(0).then(function(e){var t=i(763).FibTimeZonePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.version=2,n.prototype.migrateVersion=function(e,t,i){var n;if(1===e){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),n=2;n<=11;n++)i.properties["level"+n].color.setValue(i.properties.linecolor.value());for(n=1;n<=11;n++)i.properties["level"+n].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+n].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"},n.prototype.name=function(){return"Fib Time Zone"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibTimeZoneStylesPropertyPage},t.LineToolFibTimeZone=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCircleLines";var n=t||new r("linetoolcirclelines");o.call(this,e,n),i.e(0).then(function(e){var t=i(764).LineToolCircleLinesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),
n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},n.prototype.name=function(){return"Cyclic Lines"},n.prototype.getStylesPropertyPage=function(){return s.LineToolCircleLinesStylesPropertyPage},t.LineToolCircleLines=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateRange";var n=t||new r("linetooldaterange");o.call(this,e,n),i.e(0).then(function(e){var t=i(765).DateRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},n.prototype.name=function(){return"Date Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolDateRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceRange";var n=t||new r("linetoolpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(766).PriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},n.prototype.name=function(){return"Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},t.LineToolPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateAndPriceRange";var n=t||new r("linetooldateandpricerange");o.call(this,e,n),i.e(0).then(function(e){var t=i(767).DateAndPriceRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},n.prototype.name=function(){return"Date and Price Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateAndPriceRangeStylesPropertyPage},t.LineToolDateAndPriceRange=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolParallelChannel";var n=t||new r("linetoolparallelchannel");o.call(this,e,n),i.e(0).then(function(e){var t=i(768).ParallelChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.addPoint=function(e){var t,i=o.prototype.addPoint.call(this,e);return i&&(t=this.points()[0],this._points[2].index=t.index,this._points[2].price=t.price+this._priceOffset),i},n.prototype.calculatePriceDiff=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(3===this.points().length){if(e=this.points()[0],t=this.points()[1],i=this.points()[2],e.index===t.index)return;if(null===(n=this.priceScale()))return;if(n.isLog()){if(o=this._model.timeScale(),o.isEmpty())return;r=this.ownerSource().firstValue(),
s=o.indexToCoordinate(e.index),a=o.indexToCoordinate(t.index),l=n.priceToCoordinate(e.price,r),c=n.priceToCoordinate(t.price,r),h=o.indexToCoordinate(i.index),u=(c-l)/(a-s),d=l+u*(h-s),p=n.priceToCoordinate(i.price,r),_=p-d,r=this.ownerSource().firstValue(),f=.5*(l+c),m=n.coordinateToPrice(f,r),y=f+_,g=n.coordinateToPrice(y,r),this._priceOffset=g-m}else u=(t.price-e.price)/(t.index-e.index),v=e.price+u*(i.index-e.index),this._priceOffset=i.price-v}},n.prototype.setLastPoint=function(e,t){t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.setLastPoint.call(this,e),this.calculatePriceDiff()},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),e&&e.length>=3&&(this._priceOffset=e[2].price-e[0].price)},n.prototype.setPoint=function(e,t,i){i&&i.shift&&e<2&&this._snapPoint45Degree(t,this.points()[1-e]),o.prototype.setPoint.call(this,e,t,i),2===e&&this.calculatePriceDiff();var n=this.points()[0];this._points[2].index=n.index,this._points[2].price=n.price+this._priceOffset},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Parallel Channel"},n.prototype.name=function(){return"Parallel Channel"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]),o.prototype.addPoint.call(this,e,t)},n.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},n.prototype.cloneData=function(e){this._priceOffset=e._priceOffset},n.prototype.restoreData=function(e){e.priceOffset&&(this._priceOffset=e.priceOffset)},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.priceOffset=this._priceOffset,t},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){function e(e,t){return e.index<=t.index?[e,t]:[t,e]}var t,i,n,o,r,s,a,l,c=[].concat(this._points).splice(0,2);return c=c.concat([{price:c[0].price+this._priceOffset,time:c[0].time,index:c[0].index},{price:c[1].price+this._priceOffset,time:c[1].time,index:c[1].index}]),t=e(c[0],c[1]),i=e(c[2],c[3]),this._priceOffset<0?(o=i,n=t):(o=t,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c[0].index<=c[1].index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolParallelChannelStylesPropertyPage},t.LineToolParallelChannel=n},function(e,t,i){"use strict";(function(e){function n(e,t){this._constructor="LineToolTrendAngleLine";var o=t||new s("linetooltrendangle");r.call(this,e,o),this._properties.addProperty("angle"),this._properties.angle=new n.AngleProperty(this),i.e(0).then(function(e){var t=i(769).TrendAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.AngleProperty=function(t){e.call(this),
this._lineSource=t},inherit(n.AngleProperty,e),n.AngleProperty.prototype.value=function(){var e=this._lineSource._angle,t=180*e/Math.PI;return Math.round(t)},n.AngleProperty.prototype.setValue=function(e){var t,i,n,r,s,a,l=e*Math.PI/180;this._lineSource._angle=l,t=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),n=-Math.sin(this._lineSource._angle),r=new o(i,n),s=t.addScaled(r,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Trend Angle"},n.prototype.name=function(){return"Trend Angle"},n.prototype._calculateAngle=function(){var e,t=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],n=i.subtract(t);n.length()>0?(n=n.normalized(),this._angle=Math.acos(n.x),n.y>0&&(this._angle=-this._angle),this._distance=i.subtract(t).length()):delete this._angle,e=this.properties(),e.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},n.prototype.addPoint=function(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i},n.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this.points().length>1&&this._calculateAngle()},n.prototype.axisPoints=function(){var e,t,i,n,r,s;return this.points().length<2?[]:(e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,n=-Math.sin(this._angle)*this._distance,r=t.add(new o(i,n)),s=this.screenPointToPoint(r),e.push(s),e)},n.prototype.setPoint=function(e,t,i){r.prototype.setPoint.call(this,e,t,i),this.points().length>1&&1===e&&this._calculateAngle()},n.prototype.restoreData=function(e){this._angle=e.angle,this._distance=e.distance},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t},n.prototype.cloneData=function(e){this._angle=e._angle,this._distance=e._distance},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},n.prototype.getInputsPropertyPage=function(){return a.LineToolTrendAngleInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return a.LineToolTrendAngleStylesPropertyPage},t.LineToolTrendAngle=n}).call(t,i(13))},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolInfoLine",function(){return a}),n=i(1),o=i(3),i.n(o),r=i(100),i.n(r),s=i(2),i.n(s),a=function(e){function t(t,i){var n=e.call(this,t,i||new o.DefaultProperty("linetoolinfoline"))||this;return n._constructor="LineToolInfoLine",n}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){
return"Info Line"},t.prototype.name=function(){return"Info Line"},t.prototype.getStylesPropertyPage=function(){return s.propertyPages.LineToolInfoLineStylesPropertyPage},t}(r.LineToolTrendLine),a.prototype.superclass=r.LineToolTrendLine},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfan";var n=t||this.createPropertiesObject("linetoolpitchfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(772).PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.name=function(){return"Pitchfan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},t.LineToolPitchfan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannSquare";var n=t||this.createPropertiesObject("linetoolgannsquare");s.call(this,e,n),i.e(0).then(function(e){var t=i(773).GannSquarePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o,r,s=i(0).LineDataSource,a=i(19),l=i(2).propertyPages;inherit(n,s),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Box"},n.prototype.name=function(){return"Gann Box"},o=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var e=[],t=1e10,i=o.length-1,n=1,r=0,s=0;s<t;)s=o[r]*n,e.push(Math.round(s)),e.push(Math.ceil(-s)),r===i-1&&(n*=10),r=(r+1)%i;return e.sort(function(e,t){return e<t?-1:e>t?1:0}),e}(),n.prototype._alignPriceOnPattern=function(e,t){var i,n,r,s,a,l,c=Math.round(1e6*(e.price-t.price))/1e6;if(0===c)return t.price;for(i=o[0],n=o[o.length-1],r=1,s=Math.abs(c);s<i*r||n*r<s;)s<i*r?r*=.1:n*r<s&&(r*=10);for(a=n*r,l=o.length-2;l>=0&&!(o[l]*r<s);--l)a=o[l]*r;return e.price=t.price+(c>=0?a:-a),e},n.prototype._alignTimeOnPattern=function(e,t){var i,n=e.index-t.index;if(0===n)return 0;for(i=r.length-2;i>=0&&!(r[i]<n);--i);return i+=n>0?1:0,e.index=t.index+r[i],e},n.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},n.prototype._preparePoint=function(e,t){return t&&t.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),s.prototype._preparePoint.call(this,e,t)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift){var n=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,n)}s.prototype.setPoint.call(this,e,t,i)},n.prototype.createPropertiesObject=function(e,t,i){return new a(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},t.LineToolGannSquare=n},function(e,t,i){"use strict";function n(e,t){
this._constructor="LineToolFibSpeedResistanceFan";var n=t||this.createPropertiesObject("linetoolfibspeedresistancefan");o.call(this,e,n),i.e(0).then(function(e){var t=i(774).FibSpeedResistanceFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Fan"},n.prototype.name=function(){return"Fib Speed Resistance Fan"},n.prototype.processErase=function(e,t){var i="h"===t.type?"hlevel"+t.index:"vlevel"+t.index,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceFanStylesPropertyPage},t.LineToolFibSpeedResistanceFan=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannComplex",function(){return u}),n=i(1),o=i(6),i.n(o),r=i(7),i.n(r),s=i(193),a=i(0),i.n(a),l=i(121),c=i(2),i.n(c),h=i(273),u=function(e){function t(t,n){var o,r=e.call(this,t,null==n?Object(h.a)("linetoolganncomplex"):n)||this;return r.version=2,r._constructor="LineToolGannComplex",r._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),i.e(0).then(function(e){var t=i(775).GannComplexPaneView;r._setPaneViews([new t(r,r.model())])}.bind(null,i)).catch(i.oe),o=r.properties(),r._adjustScaleRatio(o),o.subscribe(r,r._adjustScaleRatio),o.scaleRatio.subscribe(r,r._correctFirstPoint),r._syncStateExclusions=["scaleRatio"],o.addExclusion("scaleRatio"),r._onRestoringFactoryDefaults.subscribe(r,r._handleRestoringFactoryDefaults),r._onTemplateApplying.subscribe(r,r._handleTemplateApplying),r._onTemplateApplied.subscribe(r,r._correctFirstPoint),r}return n.c(t,e),t.prototype.migrateVersion=function(e,t,i){var n=this;1===e&&(this._points.length>=this.pointsCount()?setTimeout(function(){return n._migratePoint()}):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},t.prototype.destroy=function(){var e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.scaleRatio.unsubscribe(this,this._correctFirstPoint),this._onRestoringFactoryDefaults.unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint)},t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Gann Square"},t.prototype.name=function(){return"Gann Square"},t.prototype.addPoint=function(t,i,n){var o,s,a;return this._points.length>1&&this._points.pop(),o=e.prototype.addPoint.call(this,t,i,n),s=this.priceScale(),a=Object(r.ensureNotNull)(s).isLog(),!a&&o&&this._correctFirstPoint(),o},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,i,n),
void 0!==n&&n.shift?this._correctPoint(t):this._correctScaleRatio()},t.prototype.setLastPoint=function(t,i){var n=this.priceScale();Object(r.ensureNotNull)(n).isLog()||(this._points[1]=t,this._correctPoint(1)),e.prototype.setLastPoint.call(this,t,i)},t.prototype.createPropertiesObject=function(e,t,i){return Object(h.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return c.propertyPages.LineToolGannComplexStylesPropertyPage},t.prototype.isReversed=function(){return this.properties().reverse.value()},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype.isLabelsVisible=function(){return this.properties().showLabels.value()},t.prototype.getLabelsStyle=function(){var e=this.properties(),t=e.labelsStyle,i=t.font,n=t.fontSize,o=t.bold,r=t.italic,s=e.levels.childCount();return{textColor:e.levels[s-1].color.value(),font:i.value(),fontSize:n.value(),bold:o.value(),italic:r.value()}},t.prototype.getScaleRatioStep=function(){return 1e-7},t.prototype.getScaleRatioFormatter=function(){return this._scaleRatioFormatter},t.prototype.getPriceDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.price-e.price)},t.prototype.getIndexDiff=function(){var e,t,i=this.points();return i.length<2?null:(e=i[0],t=i[1],t.index-e.index)},t.prototype.getScaleRatio=function(){var e=this.getPriceDiff(),t=this.getIndexDiff();return null!==e&&null!==t&&0!==t?Math.abs(e/t):null},t.prototype._correctScaleRatio=function(){var e=this.properties(),t=this.getScaleRatio();e.scaleRatio.setValue(t)},t.prototype._getAdjustedScaleRatio=function(){var e=this.model().mainSeries().priceScale(),t=this.model().timeScale();return Object(l.scaleRatio)(t,e)},t.prototype._adjustScaleRatio=function(e){var t=e.scaleRatio.value();""!==t&&null!==t||e.scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._correctPoint=function(e){var t,i,n,o,r,s,a,l;this._points.length<2||null!==(t=this.getIndexDiff())&&(i=this.properties(),
n=i.scaleRatio.value(),null!==n&&(o=this._points[e],r=0===e?this._points[1]:this._points[0],s=o.price-r.price>0,a=o.index-r.index>0,l=s&&!a||!s&&a?-1:1,0===e&&(l=-l),o.price=r.price+l*t*n,this._pointChanged.fire(e)),this.normalizePoints())},t.prototype._correctFirstPoint=function(){this._correctPoint(this.isReversed()?0:1)},t.prototype._handleRestoringFactoryDefaults=function(){this.properties().scaleRatio.setValue(this._getAdjustedScaleRatio())},t.prototype._handleTemplateApplying=function(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())},t.prototype._migratePoint=function(){var e,t;this.points().length<this.pointsCount()||null!==(e=this._getScreenPoints())&&(t=this.screenPointToPoint(e[1]),this.setPoint(1,t),this._pointAdded.unsubscribe(this,this._migratePoint))},t.prototype._getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u,d=this._calcAngle();return null===d?null:(t=this.points(),i=t[0],n=t[1],this.isReversed()&&(e=[n,i],i=e[0],n=e[1]),r=this.pointToScreenPoint(i)[0],s=this.pointToScreenPoint(n)[0],a=Math.sqrt(Math.pow(r.x-s.x,2)+Math.pow(r.y-s.y,2)),l=new o.Point(Math.cos(d),-Math.sin(d)),c=l.normalized(),h=c.x<0?-1:1,u=c.y<0?-1:1,[r.addScaled(l,a),r.add(new o.Point(5*a*h,5*a*u))])},t.prototype._calcAngle=function(){var e,t=this.points(),i=t[0],n=t[1],o=this.pointToScreenPoint(i)[0],r=this.pointToScreenPoint(n)[0],s=r.subtract(o);return s.length()>0?(s=s.normalized(),e=Math.acos(s.x),s.y>0&&(e=-e),e):null},t}(a.LineDataSource),u.prototype.superclass=a.LineDataSource},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolGannFixed",function(){return l}),n=i(1),o=i(6),i.n(o),r=i(0),i.n(r),s=i(273),a=i(2),i.n(a),l=function(e){function t(t,n){var o=e.call(this,t,null==n?Object(s.a)("linetoolgannfixed"):n)||this;return o._constructor="LineToolGannFixed",i.e(0).then(function(e){var t=i(776).GannFixedPaneView;o._setPaneViews([new t(o,o.model())])}.bind(null,i)).catch(i.oe),o.properties().reverse.subscribe(o,o._reversePoints),o}return n.c(t,e),t.prototype.pointsCount=function(){return 2},t.prototype.title=function(){return"Gann Square Fixed"},t.prototype.name=function(){return"Gann Square Fixed"},t.prototype.createPropertiesObject=function(e,t,i){return Object(s.a)(e,t,i)},t.prototype.getStylesPropertyPage=function(){return a.propertyPages.LineToolGannFixedStylesPropertyPage},t.prototype.axisPoints=function(){var e=this.points(),t=this.getScreenPoints();return e.length<2||t.length<2?[]:[e[0],this.screenPointToPoint(t[1])]},t.prototype.getScreenPoints=function(){var e,t,i,n,r,s,a,l,c,h,u=this.points();return u.length<2?[]:null===(e=this._calcAngle())?[]:(t=u[0],i=u[1],n=this.pointToScreenPoint(t)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2)),a=new o.Point(Math.cos(e),-Math.sin(e)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[n.addScaled(a,s),n.add(new o.Point(5*s*c,5*s*h))])},t.prototype.levelsCount=function(){return this.properties().levels.childCount()},t.prototype.levels=function(){
var e,t,i=[],n=this.properties(),o=n.levels.childCount();for(e=0;e<o;e++)t=n.levels[e],i.push({index:e,visible:t.visible.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},t.prototype.fanLines=function(){var e,t,i=[],n=this.properties(),o=n.fanlines.childCount();for(e=0;e<o;e++)t=n.fanlines[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsCount=function(){return this.properties().arcs.childCount()},t.prototype.arcs=function(){var e,t,i=[],n=this.properties(),o=n.arcs.childCount();for(e=0;e<o;e++)t=n.arcs[e],i.push({index:e,visible:t.visible.value(),x:t.x.value(),y:t.y.value(),color:t.color.value(),width:t.width.value()});return i},t.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},t.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},t.prototype._calcAngle=function(){var e,t,i,n,o,r,s=this.points();return s.length<2?null:(e=s[0],t=s[1],i=this.pointToScreenPoint(e)[0],n=this.pointToScreenPoint(t)[0],o=n.subtract(i),o.length()<=0?null:(o=o.normalized(),r=Math.acos(o.x),o.y>0&&(r=-r),r))},t.prototype._reversePoints=function(){var e=this._points,t=e[0],i=e[1];this._points[0]=i,this._points[1]=t,this.normalizePoints(),this.restart()},t}(r.LineDataSource),l.prototype.superclass=r.LineDataSource},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolGannFan";var n=t||this.createPropertiesObject("linetoolgannfan");o.call(this,e,n),i.e(0).then(function(e){var t=i(777).GannFanPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(19),s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Gann Fan"},n.prototype.name=function(){return"Gann Fan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.createPropertiesObject=function(e,t,i){return new r(e,t,i,{range:[1,9]})},n.prototype.getStylesPropertyPage=function(){return s.LineToolGannFanStylesPropertyPage},t.LineToolGannFan=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDisjointAngle";var s=t||new r("linetooldisjointangle");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(779).DisjointAnglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Disjoint Angle"},n.prototype.name=function(){return"Disjoint Angle"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)
},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){var n,r,s,a=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===e&&(n=0,this._snapPoint45Degree(t,this.points()[n])),e<3&&o.prototype.setPoint.call(this,e,t),0!==e&&2!==e&&(1===e?(r=this._points[1].price-a,this._points[2].price=this._points[1].price-2*r):3===e&&(s=t.price,r=s-this._points[2].price,this._points[0].price=this._points[1].price-r,this._points[0].index=t.index))},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price+(h.price-c.price),time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",r,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolDisjointAngleStylesPropertyPage},t.LineToolDisjointAngle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlatBottom";var s=t||new r("linetoolflatbottom");o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(780).FlatBottomPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Flat Bottom"},n.prototype.name=function(){return"Flat Bottom"},n.prototype.addPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)},n.prototype.setLastPoint=function(e,t){return t&&t.shift&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift&&1===e){this._snapPoint45Degree(t,this.points()[0])}e<3?o.prototype.setPoint.call(this,e,t):this._points[0].index=t.index},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),e=this._points[2],e.time=h.time,e.index=h.index,t={price:e.price,time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),u[0].price>i[0].price?(n=u,o=i):i[0].price>u[0].price?(n=i,o=u):i[1].price>u[1].price?(n=i,o=u):(n=u,o=i),
a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",a,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},t.LineToolFlatBottom=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolIcon";var s=t||new r("linetoolicon");s.addExclusion("angle"),s.addExclusion("scale"),o.call(this,e,s),this.version=n.version,i.e(0).then(function(e){var t=i(781).IconPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.version=1,n.anchorLimit=80,n.prototype.getAnchorLimit=function(){return n.anchorLimit},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Icon"},n.prototype.name=function(){return"Icon"},n.prototype.startChanging=function(e,t){var i,r;o.prototype.startChanging.call(this,e,t),i=this.properties(),r=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[r],i.size.value()<n.anchorLimit?this._sizeScale=i.size.value()/n.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<n.anchorLimit?this._resizeRatio=this._startChangeWidth/n.anchorLimit:this._resizeRatio=1},n.prototype.endChanging=function(){o.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},n.prototype.setPoint=function(e,t,i){var o,r,s,a,l,c,h,u,d,p=$.extend({},t);i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(p,this.points()[0]),o=this.pointToScreenPoint(this.points()[0])[1],r=this.pointToScreenPoint(p)[1],0===e||1===e?(s=r.subtract(o).normalized(),a=2*r.subtract(o).length(),a*=this._sizeScale,this._properties.size.setValue(a),l=-s.x,c=Math.acos(l),Math.asin(s.y)>0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),this._properties.angle.setValue(c)):(h=this._startChangeWidth,u=r.subtract(o).length(),this._origScale*h<n.anchorLimit?(d=n.anchorLimit/2,this._properties.scale.setValue(this._origScale*u/d)):(d=h/2,this._properties.scale.setValue(u/d)))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolIconStylesPropertyPage},n.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().icon.value())}},t.LineToolIcon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRotatedRectangle";var n=t||new a("linetoolrotatedrectangle");s.call(this,e,n),i.e(0).then(function(e){var t=i(782).RotatedRectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o,a
;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this._paneViews[0],n=i._points[0],o=i._points[1],a=i._points[2],this._distance=r(n,o,a).distance)},n.prototype.setPoint=function(e,t,i){var n,r,a,l,c,h,u;s.prototype.setPoint.call(this,e,t,i),0!==e&&1!==e||(n=this._paneViews[0],n.update(),r=n._points[0],a=n._points[1],l=a.subtract(r),c=new o(l.y,-l.x).normalized().scaled(this._distance),h=r.add(c),u=this.screenPointToPoint(h),this._points[2]=u)},n.prototype.endChanging=function(){delete this._distance},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Rotated Rectangle"},n.prototype.name=function(){return"Rotated Rectangle"},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolRectangleStylesPropertyPage},t.LineToolRotatedRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFibSpiral";var n=t||new r("linetoolfibspiral");o.call(this,e,n),i.e(0).then(function(e){var t=i(783).FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Spiral"},n.prototype.name=function(){return"Fib Spiral"},n.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpiralStylesPropertyPage},t.LineToolFibSpiral=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHeadAndShoulders";var n=t||new r("linetoolheadandshoulders");o.call(this,e,n),i.e(0).then(function(e){var t=i(784).LineToolHeadAndShouldersPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Head and Shoulders"},n.prototype.name=function(){return"Head and Shoulders"},n.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},t.LineToolHeadAndShoulders=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTriangle";var n=t||new r("linetooltriangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(785).TrianglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Triangle"},n.prototype.name=function(){return"Triangle"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTriangleStylesPropertyPage},t.LineToolTriangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrianglePattern";var n=t||new r("linetooltrianglepattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(786).LineToolTrianglePatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}
var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"Triangle Pattern"},n.prototype.name=function(){return"Triangle Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},t.LineToolTrianglePattern=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolThreeDrivers";var n=t||new r("linetoolthreedrivers");o.call(this,e,n),i.e(0).then(function(e){var t=i(787).LineToolThreeDrivesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return"Three Drives Pattern"},n.prototype.name=function(){return"Three Drives Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolABCDPatternStylesPropertyPage},t.LineToolThreeDrivers=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolABCD";var n=t||new r("linetoolabcd");o.call(this,e,n),i.e(0).then(function(e){var t=i(788).ABCDPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(275).DateTimeFormatter,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return"ABCD Pattern"},n.prototype.name=function(){return"ABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},n.prototype._updateTooltip=function(){var e,t,i,n,o=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(e=this._model.timeScale().indexToUserTime(r[0].index),o.time0.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,o.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(t=this._model.timeScale().indexToUserTime(r[1].index),o.time1.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,o.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),o.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,o.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(n=this._model.timeScale().indexToUserTime(r[3].index),o.time3.value=n?new s(this._model.mainSeries().isDWM()).format(n):0,o.price3.value=this._model.mainSeries()._formatter.format(r[3].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},n.prototype.getStylesPropertyPage=function(){return a.LineToolABCDPatternStylesPropertyPage},t.LineToolABCD=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),
i.d(t,"LineToolRiskRewardPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,r;e.visible=!1,t=this._source.priceScale(),0===this._source.points().length||null===t||t.isEmpty()||(i=this._source.ownerSource(),null!=(n=null!==i?i.firstValue():null)&&(o=this._data.priceProperty.value(),r=this._data.colorProperty.value(),e.background=r,e.color=this.generateTextColor(r),e.coordinate=t.priceToCoordinate(o,n),e.text=t.formatPrice(o,n),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPolyline";var n;t?n=t:(n=new s("linetoolpolyline"),n.filled.setValue(!1)),r.call(this,e,n),n.addExclusion("filled"),i.e(0).then(function(e){var t=i(790).PolylinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,r),n.prototype.pointsCount=function(){return-1},n.prototype.title=function(){return"Polyline"},n.prototype.name=function(){return"Polyline"},n.prototype.addPoint=function(e){var t,i,n,s,a,l,c,h,u=this._model.timeScale().indexToCoordinate(e.index),d=e.price,p=this.ownerSource().firstValue(),_=this.priceScale().priceToCoordinate(d,p),f=5;if(this._points.length>0){if(t=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(t.index),n=t.price,s=this.priceScale().priceToCoordinate(n,p),new o(u,_).subtract(new o(i,s)).length()<f)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(a=this._points[0],l=this._model.timeScale().indexToCoordinate(a.index),c=a.price,h=this.priceScale().priceToCoordinate(c,p),new o(u,_).subtract(new o(l,h)).length()<f)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return r.prototype.addPoint.call(this,e)},n.prototype.setPoint=function(e,t){var i,n,s,a,l,c,h;r.prototype.setPoint.call(this,e,t),this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||e!==this._points.length-1&&0!==e||(i=5,n=this.ownerSource().firstValue(),s=this._model.timeScale().indexToCoordinate(t.index),a=this.priceScale().priceToCoordinate(t.price,n),l=e===this._points.length-1?this._points[0]:this._points[this._points.length-1],c=this._model.timeScale().indexToCoordinate(l.index),h=this.priceScale().priceToCoordinate(l.price,n),new o(s,a).subtract(new o(c,h)).length()<i&&this._properties.filled.setValue(!0))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return a.LineToolPolylineStylesPropertyPage},t.LineToolPolyline=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPrediction";var n=t||new s("linetoolprediction");n.merge({status:l.AlertStatus.Waiting}),r.call(this,e,n),i.e(0).then(function(e){var t=i(791).PredictionPaneView;this._setPaneViews([new t(this,this._model)])
}.bind(this).bind(null,i)).catch(i.oe)}var o=i(7).ensureNotNull,r=i(0).LineDataSource,s=i(3).DefaultProperty,a=i(2).propertyPages,l=i(353);inherit(n,r),n.prototype.status=function(){return this._properties.status.value()},n.prototype.setStatus=function(e){return this._properties.status.setValue(e)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Forecast"},n.prototype.name=function(){return"Forecast"},n.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this.checkAlert()},n.prototype.checkAlert=function(){var e,t,i,n;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(e=this._points[1],this.status())return void(e.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting));t=this._model.mainSeries().bars().valueAt(e.index),null!==t&&(i=this.direction(),i===l.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price?this.setStatus(l.AlertStatus.Success):(n=o(this._model.mainSeries().bars().lastIndex()),e.index!==n&&this.setStatus(l.AlertStatus.Failure)))}},n.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t},n.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.onData=function(e){r.prototype.onData.call(this,e),this.checkAlert()},n.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.direction=function(){var e,t;return this.points().length<2?l.Direction.Up:(e=this.points()[0],t=this.points()[1],t.price>e.price?l.Direction.Up:l.Direction.Down)},n.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},t.LineToolPrediction=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPriceLabel";var n=t||new r("linetoolpricelabel");o.call(this,e,n),i.e(0).then(function(e){var t=i(792).PriceLabelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Price Label"},n.prototype.name=function(){return"Price Label"},n.prototype.getStylesPropertyPage=function(){return s.LineToolPriceLabelStylesPropertyPage},t.LineToolPriceLabel=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBrush";var n=t||new r("linetoolbrush");o.call(this,e,n),this._finished=!1,i.e(0).then(function(e){var t=i(794).BrushPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return-1},n.prototype.finished=function(){return this._finished},n.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),
this.createServerPoints()},n.prototype.title=function(){return"Brush"},n.prototype.name=function(){return"Brush"},n.prototype.percentDistance=function(e,t){return Math.abs((t-e)/e)},n.prototype.addPoint=function(e){var t,i,n;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(t=this._points[this._points.length-1],i=this.pointToScreenPoint(t)[1],n=this.pointToScreenPoint(e)[1],n.subtract(i).length()<2)?this._finished:(o.prototype.addPoint.call(this,e),this._finished))},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._finished=!0},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolBrushStylesPropertyPage},t.LineToolBrush=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArc";var o=t||new d("linetoolarc");u.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(795).ArcPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(321),a=s.rotationMatrix,l=s.scalingMatrix,c=s.translationMatrix,h=s.transformPoint,u=i(0).LineDataSource,d=i(3).DefaultProperty,p=i(2).propertyPages;inherit(n,u),n.prototype.startChanging=function(e,t){var i,n,s,a,l,c,h;u.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,s).distance,a=n.subtract(i),l=new o(-a.y,a.x),c=i.add(n).scaled(.5),h=s.subtract(c),h.dotProduct(l)<0&&(this._dist=-this._dist))},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Arc"},n.prototype.name=function(){return"Arc"},n.prototype.setPoint=function(e,t){var i,n,s,u,d,p,_,f,m,y,g,v,S=$.extend({},t),b=this.pointToScreenPoint(this._points[0])[0],w=this.pointToScreenPoint(this._points[1])[0],P=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:b=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[0]=S,this._points[2]=P;break;case 1:u=r(b,w,P).distance,w=this.pointToScreenPoint(S)[0],i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(this._dist)),P=this.screenPointToPoint(P),this._points[1]=S,this._points[2]=P;break;case 2:S=this.pointToScreenPoint(S)[0],u=r(b,w,S).distance,i=w.subtract(b),n=b.add(w).scaled(.5),s=new o(-i.y,i.x),s=s.normalized(),P=n.add(s.scaled(u)),d=n.add(s.scaled(-u)),p=i.length(),_=i.x/p,f=i.y/p,m=Math.acos(_),f<0&&(m=-m),y=c(-n.x,-n.y),S=h(y,S),g=h(y,P),y=a(-m),S=h(y,S),g=h(y,g),y=l(1,p/(2*u)),S=h(y,S),g=h(y,g),v=S.y*g.y>=0?new o(P.x,P.y):new o(d.x,d.y),v=this.screenPointToPoint(v),this._points[2]=v}this.normalizePoints()},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o;1===e&&2===this._points.length&&(n=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:n,
index:this._points[1].index})),1===e&&2===this._timePoint.length&&(n=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,o={price:n,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(o))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return p.LineToolArcStylesPropertyPage},t.LineToolArc=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCallout";var n=t||new a("linetoolcallout");n.hasChild("text")||n.addChild("text",new s($.t("Text"))),n.addExclusion("text"),o.call(this,e,n),this._barOffset=0,this._timeScale=e.timeScale(),i.e(0).then(function(e){var t=i(796).CalloutPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(28).DataSource,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages,c=i(354).CalloutConsts;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Callout"},n.prototype.name=function(){return"Callout"},n.prototype.correctPoints=function(e){var t=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,n=e[1];n.index+=t,n.price+=i,e[1]=n},n.prototype.addPoint=function(e){var t=o.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},n.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},n.prototype.setLastPoint=function(e){o.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},n.prototype.setPoint=function(e,t){var i,n,r,s,a;switch(e){case 0:o.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(n=this._points,r=this._dragStartLeftEdgeIndex,s=Math.round((t.index-r)/2),isFinite(r)&&isFinite(s)){if(n[1]={index:r+s,price:n[1].price},this._calculateBarOffset(),this.normalizePoints(),a=this._timeScale.indexToCoordinate(r+2*s)-this._timeScale.indexToCoordinate(r)-c.RoundRadius-c.TextMargins,!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(c.MinWidth,a));break}n[1]=t,this._calculateBarOffset(),this.normalizePoints()}},n.prototype.startDragPoint=function(e,t){var i=this.properties();1===e&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-t.index)},n.prototype.move=function(e){o.prototype.move.call(this,e),this._calculateBarOffset()},n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},n.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},n.prototype.setPriceScale=function(e){r.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},n.prototype._calculatePoint2=function(){var e,t;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(e=this.points()[0],t=this.points()[1],
this._points[1]={price:t.price,index:e.index+this._barOffset}))},n.prototype.getStylesPropertyPage=function(){return l.LineToolCalloutStylesPropertyPage},t.LineToolCallout=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBalloon";var n=t||new s("linetoolballoon");n.hasChild("text")||n.addChild("text",new r($.t("Comment"))),n.addExclusion("text"),o.call(this,e,n),i.e(0).then(function(e){var t=i(797).BalloonPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(13),s=i(3).DefaultProperty,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Balloon"},n.prototype.name=function(){return"Balloon"},n.prototype.getStylesPropertyPage=function(){return a.LineToolBalloonStylesPropertyPage},t.LineToolBalloon=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzLine";var n=t||new a("linetoolhorzline");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(798).HorzLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.state=function(e){var t=o.prototype.state.call(this,e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Line"},n.prototype.name=function(){return"Horizontal Line"},n.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this.points()[0].price]},n.prototype.getInputsPropertyPage=function(){return l.LineToolHorzLineInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzLine=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHorzRay";var n=t||new a("linetoolhorzray");n.hasChild("text")||n.addChild("text",new s("")),n.addExclusion("text"),this._priceAxisView=new r(this),o.call(this,e,n),i.e(0).then(function(e){var t=i(799).HorzRayPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(174).LineToolHorzLinePriceAxisView,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Horizontal Ray"},n.prototype.name=function(){return"Horizontal Ray"},n.prototype.priceAxisViews=function(e,t){
return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},n.prototype.updateAllViews=function(){o.prototype.updateAllViews.call(this),this._priceAxisView.update()},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e=this._points[0],t={index:e.index+1,price:e.price};return[this._linePointsToAlertPlot([e,t],null,!1,!0)]},n.prototype.getStylesPropertyPage=function(){return l.LineToolHorzLineStylesPropertyPage},t.LineToolHorzRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRectangle";var n=t||new r("linetoolrectangle");o.call(this,e,n),i.e(0).then(function(e){var t=i(800).RectanglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Rectangle"},n.prototype.name=function(){return"Rectangle"},n.prototype.setPoint=function(e,t,i){var n,r,s;if(e<2)return void o.prototype.setPoint.call(this,e,t,i);i&&i.shift&&this._properties.snapTo45Degrees&&(n=this.points()[0],r=this.points()[1],s={price:2===e?n.price:r.price,index:2===e?r.index:n.index},this._snapPoint45Degree(t,s)),3===e?(this._points[0].price=t.price,this._points[1].index=t.index):(this._points[1].price=t.price,this._points[0].index=t.index),this.normalizePoints()},n.prototype.getStylesPropertyPage=function(){return s.LineToolRectangleStylesPropertyPage},t.LineToolRectangle=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolEllipse";var o=t||new a("linetoolellipse");s.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(801).EllipsePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(30).distanceToLine,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,s),n.prototype.startChanging=function(e,t){var i,n,o;s.prototype.startChanging.call(this,e,t),0!==e&&1!==e||(i=this.pointToScreenPoint(this._points[0])[0],n=this.pointToScreenPoint(this._points[1])[0],o=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,n,o).distance||0)},n.prototype._preparePoint=function(e,t){var i=this._preparePointInternal(e,t,!1);return t&&t.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},n.prototype._preparePointInternal=function(e,t,i){var n,r,a,l,c,h,u,d,p,_,f=$.extend({},e);if(t&&t.shift){if(n=this.points().length,!this._fakePointAdded&&3===n&&!i)return f;(this._fakePointAdded||2===n||i)&&(this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,s.prototype._addPointIntenal.call(this,e)),r=this.pointToScreenPoint(this._points[0])[0],a=this.pointToScreenPoint(this._points[1])[0],l=a.x-r.x,c=a.y-r.y,h=Math.sqrt(l*l+c*c)/2,u=a.subtract(r),d=r.add(a).scaled(.5),
p=new o(-u.y,u.x),p=p.normalized(),_=d.add(p.scaled(h)),f=this.screenPointToPoint(_),(TradingView.isNaN(f.price)||TradingView.isNaN(f.index))&&(f=this.screenPointToPoint(d)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return f},n.prototype._fixVerticalDiameterPoints=function(e,t,i){var n=this.pointToScreenPoint(e)[0],o=this.pointToScreenPoint(t)[0],r=this._model.timeScale(),s=r.indexToCoordinate(e.index),a=r.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=t.price>e.price?1:-1,e.price=this.screenPointToPoint({x:n.x,y:o.y+l}).price},n.prototype.addPoint=function(e,t,i){var n=s.prototype.addPoint.call(this,e,t,i);return n&&(this._fakePointAdded=!1),n},n.prototype.setPoint=function(e,t,i){var n,s,a,l,c=$.extend({},t),h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift){this._snapPoint45Degree(c,this._points[1]),this._points[0]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}h=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=c,this._points[2]=d;break;case 1:if(i&&i.shift){this._snapPoint45Degree(c,this._points[0]),this._points[1]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}u=this.pointToScreenPoint(c)[0],n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=c,this._points[2]=d;break;case 2:case 3:c=this.pointToScreenPoint(c)[0],l=r(h,u,c).distance,n=u.subtract(h),s=h.add(u).scaled(.5),a=new o(-n.y,n.x),a=a.normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Ellipse"},n.prototype.name=function(){return"Ellipse"},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o,r;1===e&&2===this._points.length&&(n=this._points[0].price,o=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:o,index:this._points[0].index},this._points[1]={price:o,index:this._points[1].index},this._points.push({price:n,index:this._points[0].index})),1===e&&2===this._timePoint.length&&(n=this._timePoint[0].price,o=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=o,this._timePoint[1].price=o,r={price:n,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},t.LineToolEllipse=n},function(e,t,i){"use strict"
;function n(e,t){this._constructor="LineToolTimeCycles";var n=t||new r("linetooltimecycles");o.call(this,e,n),i.e(0).then(function(e){var t=i(802).TimeCyclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Time Cycles"},n.prototype.name=function(){return"Time Cycles"},n.prototype.setPoint=function(e,t,i){var n=$.extend({},t),o=this._points[0],r=this._points[1];o.price=n.price,r.price=n.price,this._points[e]=n,this.normalizePoints()},n.prototype.addPoint=function(e,t,i){var n,r,s=o.prototype.addPoint.call(this,e,t,!0);return s&&(n=this._points[0],r=this._points[1],r.price=n.price,i||(this.normalizePoints(),this.createServerPoints())),s},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolTimeCycles=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolSineLine";var n=t||new r("linetoolsineline");o.call(this,e,n),i.e(0).then(function(e){var t=i(803).SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Sine Line"},n.prototype.name=function(){return"Sine Line"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},t.LineToolSineLine=n},function(e,t,i){"use strict";function n(e,t,i){this._source=e,this._index=t,this._bars=i||[]}function o(e,t,i){this._source=e,l.call(this,"linetoolghostfeed",t,i)}function r(e,t,n){var s,l;this._constructor="LineToolGhostFeed",t?(s=t,s._source=this):s=new o(this),n||(l=Math.round(this.calculateATR(e)),s.averageHL.setValue(l)),a.call(this,e,s),this._segments=[],s.averageHL.listeners().subscribe(this,r.prototype.regenerate),s.variance.listeners().subscribe(this,r.prototype.regenerate),s.points||s.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),i.e(0).then(function(e){var t=i(804).GhostFeedPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(50).sign,a=i(0).LineDataSource,l=i(3).DefaultProperty,c=i(2).propertyPages;n.prototype.setBars=function(e){this._bars=e||[]},n.prototype.clone=function(e){return new n(e,this._index,TradingView.clone(this._bars))},n.prototype.createBar=function(){var e,t,i,n,o,r=this._source.properties().averageHL.value(),s=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),c=r*(1-2*l)*s;return l=Math.random(),e=r*(1+(.5-l)*s),t=c-e/2,i=t+e,n=t+Math.random()*e,o=t+Math.random()*e,{o:n/a,h:i/a,l:t/a,c:o/a}},n.prototype.generate=function(){var e,t,i,n,o,r;if(this._bars=[],e=this._source.points(),t=e[this._index],i=e[this._index+1],
t&&i&&t.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,n=this._index?t.index+1:t.index,o=s(i.index-t.index),r=n;r!==i.index;r+=o)this._bars.push(this.createBar())},n.prototype.bars=function(){return this._bars},n.prototype.setSize=function(e){if(e<this._bars.length)this._bars.splice(e,this._bars.length-e);else for(;this._bars.length<e;)this._bars.push(this.createBar())},inherit(o,l),o.prototype.restoreFactoryDefaults=function(){l.prototype.restoreFactoryDefaults.call(this);var e=Math.round(this._source.calculateATR());this.averageHL.setValue(e)},inherit(r,a),r.prototype.createPropertiesObject=function(e,t,i){return new o(null,t,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(e){e.generate()}),this.updateAllViews(),this._model.updateSource(this)},r.prototype.propertiesChanged=function(){a.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.name=function(){return"Ghost Feed"},r.prototype.segmentBars=function(e){return this._segments[e].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(e){this._segments.length<=e&&this._segments.push(new n(this,e)),this._segments[e].generate()},r.prototype.addPoint=function(e){var t,i,n;if(this._points.length>0&&(t=this._points[this._points.length-1],t.index===e.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return n=a.prototype.addPoint.call(this,e),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),n||this._finished},r.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(e,t,i){var n,o,r;a.prototype.setPoint.call(this,e,t,i),e>0&&(n=this.points()[e-1],o=t.index-n.index,this._segments[e-1].setSize(Math.abs(o))),e<this.points().length-1&&(r=this.points()[e+1],o=r.index-t.index,this._segments[e].setSize(Math.abs(o)))},r.prototype.state=function(e){var t=a.prototype.state.call(this,e);return t.segments=this._segments.map(function(e){return{bars:e.bars()}}),t},r.prototype.restoreData=function(e){var t=this;e.segments&&(this._segments=e.segments.map(function(e,i){return new n(t,i,[].concat(e.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(e){if(a.prototype.onData.call(this,e),0===this.properties().points._childs.length)for(var t=0;t<this._points.length;t++)this._createPointProperty(t)
;this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(e){var t=this;this._segments=e._segments.map(function(e){return e.clone(t)})},r.prototype.calculateATR=function(e){var t,i=(void 0!==e?e:this._model).mainSeries(),n=[];return i.bars().each(function(e,t){n.push(t[TradingView.HIGH_PLOT]-t[TradingView.LOW_PLOT])}),t=0===n.length?0:n.reduce(function(e,t){return e+t},0)/n.length,t*=i.base()},r.prototype.getInputsPropertyPage=function(){return c.LineToolGhostFeedInputsPropertyPage},r.prototype.getStylesPropertyPage=function(){return c.LineToolGhostFeedStylesPropertyPage},t.LineToolGhostFeed=r},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierQuadro";var n=t||new r("linetoolbezierquadro");o.call(this,e,n),i.e(0).then(function(e){var t=i(805).BezierQuadroPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Curve"},n.prototype.name=function(){return"Curve"},n.prototype.controlPoint=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.5),r=o.add(n);return this.screenPointToPoint(r)},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoint=this.controlPoint()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoint(),this._points.push(n),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierQuadro=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierCubic";var n=t||new r("linetoolbeziercubic");o.call(this,e,n),i.e(0).then(function(e){var t=i(806).BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Double Curve"},n.prototype.name=function(){return"Double Curve"},n.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.33),r=e.add(t).scaled(.67),s=o.add(n),a=r.subtract(n);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},n.prototype.addPoint=function(e,t,i){
var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoints(),delete this._controlPoints,this._points.push(n[0]),this._points.push(n[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},t.LineToolBezierCubic=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolArrow";var i=t||new r("linetoolarrow");o.call(this,e,i)}var o=i(100).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Arrow"},n.prototype.name=function(){return"Arrow"},t.LineToolArrow=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolRay";var i=t||new r("linetoolray");o.call(this,e,i)}var o=i(100).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Ray"},n.prototype.name=function(){return"Ray"},t.LineToolRay=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolExtended";var i=t||new r("linetoolextended");o.call(this,e,i)}var o=i(100).LineToolTrendLine,r=i(3).DefaultProperty;inherit(n,o),n.prototype.title=function(){return"Extended Line"},n.prototype.name=function(){return"Extended Line"},t.LineToolExtended=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},n.prototype.name=function(){return"Modified Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolschiffpitchfork2");r.call(this,e,i),this._constructor="LineToolSchiffPitchfork2"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Schiff Pitchfork")},n.prototype.name=function(){return"Schiff Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolSchiffPitchfork2=n},function(e,t,i){"use strict";function n(e,t){var i=t||this.createPropertiesObject("linetoolinsidepitchfork");r.call(this,e,i),this._constructor="LineToolInsidePitchfork"}var o=i(19),r=i(122).LineToolPitchfork;inherit(n,r),n.prototype.title=function(){return $.t("Inside Pitchfork")},n.prototype.name=function(){return"Inside Pitchfork"},n.prototype.createPropertiesObject=function(e,t,i){return new o(e,t,i,{range:[0,8]})},t.LineToolInsidePitchfork=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlagMark";var n=t||new s("linetoolflagmark");r.call(this,e,n),i.e(0).then(function(t){var n=i(351).MarkPaneView,r=new n(this,e,this.image,25,25,-8,-21)
;r.setAnchors(new o(0,0)),this._setPaneViews([r])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(6).Point,r=i(0).LineDataSource,s=i(3).DefaultProperty;inherit(n,r),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Flag Mark"},n.prototype.name=function(){return"Flag Mark"},n.prototype.version=2,t.LineToolFlagMark=n},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCypherPattern";var n=t||new r("linetoolcypherpattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(807).CypherPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(274).LineTool5PointsPattern;inherit(n,s),t.LineToolCypherPattern=n},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0}function o(e,t){var o,s,a,l,u,d;this._adapter=new n(this),this._constructor="LineToolPosition",o=t||new c("linetoolposition"),r.call(this,e,o),i.e(0).then(function(e){var t=i(808).PositionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe),s=e.mainSeries().symbolInfo(),a=null!==s?s.pricescale:100,l=null!==s&&s.fractional?s.minmov:1,u=null!==s&&s.fractional,d=null!==s?s.minmove2:void 0,this._formatter=new h(a,l,u,d)}var r=i(173),s=i(0).LineDataSource,a=i(596).PositionAveragePriceAxisView,l=i(131),c=i(3).DefaultProperty,h=i(21).PriceFormatter;n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},n.prototype.setExtendLeft=function(e){
return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},n.prototype.setLineLength=function(e){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return l.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return l.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return l.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return l.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){return l.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){return l.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return l.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return l.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},n.prototype.getQuantityBackgroundColor=function(){
return l.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return l.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return l.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return l.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return l.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getReverseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},n.prototype.setReverseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},n.prototype.getReverseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},n.prototype.setReverseButtonBackgroundColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},n.prototype.getReverseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},n.prototype.setReverseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},n.prototype.getCloseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},n.prototype.setCloseButtonBorderColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},n.prototype.getCloseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},n.prototype.setCloseButtonBackgroundColor=function(e){
return l.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},n.prototype.getCloseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},n.prototype.setCloseButtonIconColor=function(e){return l.setColorToProperties(e,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onReverse=function(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this},n.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},n.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},n.prototype.onClose=function(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this},n.prototype.setCloseEnabled=function(e){return this._closeEnabled===e?this:(this._closeEnabled=e,this._onCloseCallback&&this._line.updateAllViewsAndRedraw(),this)},n.prototype.isCloseEnabled=function(){return this._closeEnabled},n.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},n.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(o,r),o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.skipMagnetting=!0,o.prototype.title=function(){return"Position"},o.prototype.name=function(){return"Position"},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new a(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},
o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.formatter=function(){return this._formatter},t.LineToolPosition=o}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PositionAveragePriceAxisView",function(){return r}),n=i(1),o=i(169),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._formatPrice=function(e,t){return this._source.formatter().format(e)},t}(o.LineToolPriceAxisView)},function(e,t,i){"use strict";(function(e){function n(e){this._line=e,this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function o(e,t){this._adapter=new n(this),this._constructor="LineToolOrder";var o=t||new c("linetoolorder");r.call(this,e,o),i.e(0).then(function(e){var t=i(809).OrderPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(173),s=i(169).LineToolPriceAxisView,a=i(131),l=i(0).LineDataSource,c=i(3).DefaultProperty;n.prototype.setEditable=function(e){return this._editable=e,this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},n.prototype.getText=function(){return this._data.bodyText},n.prototype.setText=function(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.getQuantity=function(){return this._data.quantityText},n.prototype.setQuantity=function(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this},n.prototype.getExtendLeft=function(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e},n.prototype.setExtendLeft=function(e){return this._line.properties().extendLeft.setValue(e),this},n.prototype.getLineLength=function(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e},n.prototype.setLineLength=function(e){
return this._line.properties().lineLength.setValue(Math.max(0,Math.min(e,100))),this},n.prototype.getLineColor=function(){return a.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},n.prototype.setLineColor=function(e){return a.setColorToProperties(e,this._line.properties().lineColor,this._line.properties().lineTransparency),this},n.prototype.getLineStyle=function(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e},n.prototype.setLineStyle=function(e){return this._line.properties().lineStyle.setValue(e),this},n.prototype.getLineWidth=function(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e},n.prototype.setLineWidth=function(e){return this._line.properties().lineWidth.setValue(e),this},n.prototype.getBodyBorderColor=function(){return a.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},n.prototype.setBodyBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},n.prototype.getBodyBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},n.prototype.setBodyBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},n.prototype.getBodyTextColor=function(){return a.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},n.prototype.setBodyTextColor=function(e){return a.setColorToProperties(e,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},n.prototype.getBodyFont=function(){return a.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},n.prototype.setBodyFont=function(e){return a.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},n.prototype.getQuantityBorderColor=function(){return a.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},n.prototype.setQuantityBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},n.prototype.getQuantityBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},n.prototype.setQuantityBackgroundColor=function(e){
return a.setColorToProperties(e,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},n.prototype.getQuantityTextColor=function(){return a.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},n.prototype.setQuantityTextColor=function(e){return a.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},n.prototype.getQuantityFont=function(){return a.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},n.prototype.setQuantityFont=function(e){return a.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},n.prototype.getCancelButtonBorderColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},n.prototype.setCancelButtonBorderColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},n.prototype.getCancelButtonBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},n.prototype.setCancelButtonBackgroundColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},n.prototype.getCancelButtonIconColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},n.prototype.setCancelButtonIconColor=function(e){return a.setColorToProperties(e,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},n.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},n.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},n.prototype.isFunction=function(e){return"function"==typeof e},n.prototype.onCancel=function(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this},n.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},n.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},n.prototype.onModify=function(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this},n.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},
n.prototype.onMove=function(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this},n.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},n.prototype.onContextMenu=function(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this},n.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},n.prototype.shouldShowModifyOrder=function(){return!!this._onModifyCallback},inherit(o,r),o.skipMagnetting=!0,o.prototype.setPoint=function(e,t,i){this._points[e]=t,this.normalizePoints()},o.prototype.addPoint=function(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype.title=function(){return"Order"},o.prototype.name=function(){return"Order"},o.prototype.endMoving=function(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;r.prototype.endMoving.call(this),!e&&t&&this._adapter.callOnMove()},o.prototype.createPriceAxisView=function(e){return this._priceAxisView=new s(this,{pointIndex:e,backgroundProperty:this.properties().lineColor}),this._priceAxisView},o.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.paneViews.call(this,t):null},o.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.priceAxisViews.call(this,t,i):null},o.prototype.hasContextMenu=function(){return!0},o.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},o.prototype.onlyYMoving=function(){return!0},o.prototype.userEditEnabled=function(){return this._adapter.shouldShowModifyOrder()},t.LineToolOrder=o}).call(t,i(5))},function(e,t,i){"use strict";(function(e){function n(t,i,n){n=n||{},n=Object.assign({},M,n);var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new h(this,t),this._priceAxisView=new c(this),this._startMeasurePriceAxisView=new c(this),this._endMeasurePriceAxisView=new c(this),this._timeAxisView=new u(this,t),this._startMeasureTimeAxisView=new u(this,t,"measureStartX"),this._endMeasureTimeAxisView=new u(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(e){o.areLinesVisible="arrow"!==e},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._linesShouldBeHidden=this._model.readOnly(),this._selectBarMode=new I(!1),this._barSelectedDelegate=new e,this._mouseClickBoundedHandler=this._mouseClickHandler.bind(this),
this._isOnHoveredChartWidget=!1}function o(e,t){this._source=e,this._pane=t,this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new d,this._vertTrenRenderer=new d,this._bgRenderer=new _,this._labelRenderer=new p({})}function r(e,t,i,n){this.source=e,this.pane=t,this._horzVisible=i,this._mouseClickHandler=n}function s(e,t,i){this.source=e,this.pane=t,this._axis=i||"x"}var a=i(6).Point,l=i(73).isLineToolName,c=i(599).CrossHairPriceAxisView,h=i(600),u=i(601),d=i(185).TrendLineRenderer,p=i(186).TextRenderer,_=i(303).RectangleRenderer,f=i(28).DataSource,m=i(32),y=i(602).PaneRendererCrossHair,g=i(603).PaneRendererCrossHairLock,v=i(69).CompositeRenderer,S=i(18),b=i(70).PercentageFormatter,w=i(318).TimeSpanFormatter,P=i(315).PipFormatter,T=i(29),x=i(103).LineEnd,C=i(84),L=i(12).isNaN,I=i(16),A=i(38),k=A.forceLTRStr,E=A.startWithLTR,M={additionalMenuEnabled:!1};inherit(n,f),n.prototype.index=0,n.prototype.price=NaN,n.prototype.pane=null,n.prototype.color="white",n.prototype.style="",n.prototype.customization={disableSelection:!0},n.prototype.properties=function(){return this._properties},n.prototype.moved=function(){return this._movedDelegate},n.prototype.saveOriginCoord=function(e,t){this._originX=e,this._originY=t},n.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},n.prototype.setPosition=function(e,t,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,n.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(e,t,i)},n.prototype.update=function(){var e,t,i,n,o,r;this.visible&&(e=this._priceScaleByPane(this.pane),t=this._originX||this.x,i=this._originY||this.y,n=this._model.timeScale().coordinateToIndex(t),o=NaN,null!==e&&(r=this.pane.mainDataSource().firstValue(),o=e.coordinateToPrice(i,r)),this._tryToUpdateViews(n,o,this.pane))},n.prototype._priceScaleByPane=function(e){return e&&!e.defaultPriceScale().isEmpty()?e.defaultPriceScale():null},n.prototype._tryToUpdateViews=function(e,t,i){this._tryToUpdateData(e,t,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},n.prototype._tryToUpdateData=function(e,t,i){var n,o=this.x,r=this.y,s=this.price,a=this.index,l=this.pane,c=this._priceScaleByPane(i);return this.index=e,this.x=L(e)?NaN:this._model.timeScale().indexToCoordinate(e),null!==c?(this.pane=i,this.price=t,n=i.mainDataSource().firstValue(),this.y=c.priceToCoordinate(t,n)):(this.pane=null,this.price=NaN,this.y=NaN),o!==this.x||r!==this.y||a!==this.index||s!==this.price||l!==this.pane},n.prototype.setLockedPosition=function(e){delete this.lockedIndex,delete this.lockedX,e!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},n.prototype.clearPosition=function(){this.visible=!1;var e=this._model.mainSeries().bars().lastIndex();this.index=null!==e?e:NaN,
this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null,this.clearOriginCoord()},n.prototype.measureStartY=function(){var e=this._startMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},n.prototype.measureEndY=function(){var e=this._endMeasurePoint.price,t=this._measurePane,i=t.mainDataSource().firstValue();return t.defaultPriceScale().priceToCoordinate(e,i)},n.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},n.prototype.paneViews=function(e){var t=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=e===this.pane&&!t,n=[new r(this,e,i,this._mouseClickBoundedHandler)];return e===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new o(this,e)),this._measurePaneView.update(),n.push(this._measurePaneView)),m.lockTimeAxis().value()&&n.push(this._timeLockPaneView=this._timeLockPaneView||new s(this,e)),n},n.prototype.dataWindowView=function(){return this._dataWindowView},n.prototype.priceAxisViews=function(e,t){var i,n;return this._linesShouldBeHidden||!this.visible||this.pane!==e||t!==e.defaultPriceScale()?null:(i=[],n=this._selectBarMode.value()&&this._isOnHoveredChartWidget,n||i.push(this._priceAxisView),this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i)},n.prototype.timeAxisView=function(){if(this._linesShouldBeHidden||!this.visible&&!m.lockTimeAxis().value())return null;var e=[this._timeAxisView];return this._startMeasurePoint&&e.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&e.push(this._endMeasureTimeAxisView),e},n.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},n.prototype.startMeasurePoint=function(){return this._startMeasurePoint},n.prototype.startMeasuring=function(e,t){this._startMeasurePoint=e,this._measurePane=t},n.prototype.finishMeasure=function(e){this._endMeasurePoint=e},n.prototype.endMeasurePoint=function(){return this._endMeasurePoint},n.prototype.clearMeasure=function(e){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype.measurePoints=function(){this.updateAllViews();var e=[this._startMeasurePoint];return this._endMeasurePoint?e.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e.push(this._lastValidMeasurePoint)),e},n.prototype.currentPoint=function(){return new a(this.x,this.y)},n.prototype.appliedIndex=function(){
return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},n.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},n.prototype.selectBarMode=function(){return this._selectBarMode},n.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},n.prototype.onBarSelected=function(){return this._barSelectedDelegate},n.prototype._setSelectBarModeState=function(e){this._selectBarMode.setValue(e),this._model.invalidate(new S(S.LIGHT_UPDATE))},n.prototype._mouseClickHandler=function(){var e;this._model.mainSeries().bars().contains(this.index)&&null!==(e=this._model.timeScale().indexToTimePoint(this.index))&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(e))},n.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},n.prototype.setOnHoveredChartWidget=function(e){this._isOnHoveredChartWidget=e},n.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},n.prototype.setLinesShouldBeHidden=function(e){this._linesShouldBeHidden=e},n.prototype.linesShouldBeHidden=function(){return this._linesShouldBeHidden},o.prototype.update=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,f,m,y,g,v,S,T,x,C;if(this._source._endMeasurePoint)e=this._source._endMeasurePoint.price,t=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)e=this._source.price,t=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;e=this._source._lastValidMeasurePoint.rawPrice,t=this._source._lastValidMeasurePoint.index}i=e-this._source._startMeasurePoint.price,n=t-this._source._startMeasurePoint.index,o=k(n),r=this._source._startMeasurePoint.price,s=this._source._measurePane.mainDataSource(),l=s.formatter().format(i),this._source._startMeasurePoint.price&&(c=i/this._source._startMeasurePoint.price,l+=" ("+(new b).format(100*c)+")"),h=k(l),this._label=h+"\n"+$.t("{0} bars").format(o),r=this._source._model._magnet.align(r,this._source._startMeasurePoint.index,this._source._measurePane),e=this._source._model._magnet.align(e,t,this._source._measurePane),u=s.firstValue(),d=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),p=this._source._model.timeScale().indexToCoordinate(t),_=this._source._measurePane.defaultPriceScale().priceToCoordinate(r,u),f=this._source._measurePane.defaultPriceScale().priceToCoordinate(e,u),this._p1=new a(d,_),this._p2=new a(p,f),m=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),y=this._source._model.timeScale().indexToUserTime(t),g=this._pane.model().mainSeries().symbolInfo(),g&&g!==this._lastSymbolInfo&&(this._pipFormatter=new P(g.pricescale,g.minmov,g.type,g.minmove2),this._lastSymbolInfo=g),m&&y&&(v=(y.valueOf()-m.valueOf())/1e3,S=this._pipFormatter?this._pipFormatter.format(i):"",T=S?" , "+S:S,x=(new w).format(v),C=E(x),this._label=k(h+T)+"\n"+$.t("{0} bars").format(o)+", "+C)},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p=new v,_={}
;return _.points=[this._p1,this._p2],_.width=this._source._model.timeScale().width(),_.height=this._source._measurePane.defaultPriceScale().height(),_.color="#D3E7FF",_.linewidth=0,_.fillBackground=!0,_.transparency=60,_.backcolor="#BADAFF",this._bgRenderer.setData(_),p.append(this._bgRenderer),e=this._p1.add(this._p2).scaled(.5),t=new a(this._p1.x,e.y),i=new a(this._p2.x,e.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._horzTrenRenderer.setData(n),p.append(this._horzTrenRenderer),t=new a(e.x,this._p1.y),i=new a(e.x,this._p2.y),n={points:[t,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._vertTrenRenderer.setData(n),p.append(this._vertTrenRenderer),o={x:0,y:10},r=function(e,t){return{points:[t],text:e,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:o.x,offsetY:o.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:T.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},s=.5*(this._p1.x+this._p2.x),l=this._p2.y,c=new a(s,l),h=r(this._label,c),this._labelRenderer.setData(h),u=this._labelRenderer.measure(),d={x:s+h.backgroundHorzInflate+u.textBgPadding-u.width/u.textBgPadding,y:this._p1.y>this._p2.y?c.y-u.height-2*u.textBgPadding-o.y>0?l-u.height-o.y+u.textBgPadding:o.y-2*u.textBgPadding:c.y+u.height+u.textBgPadding+o.y>_.height?_.height-u.height-o.y:l+u.textBgPadding},this._labelRenderer.setPoints([new a(d.x,d.y)]),p.append(this._labelRenderer),p},r.prototype.update=function(){},r.prototype.renderer=function(){var e,t,i,n,o,r,s={},a=this.source.visible&&this.source.areLinesVisible,c=m.lockTimeAxis().value();return s.horzLinesVisible=a&&this._horzVisible,s.vertLinesVisible=a||c,e=this.pane._model.readOnly(),t=e?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=this.source.selectBarMode().value()&&this.source.isOnHoveredChartWidget(),n=TradingView.isMobile.any()&&l(this.source._model.currentTool())&&!i,o=n?"#a000a0":e?t.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),r=e?t.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!n&&r>0&&(o=T.generateColor(o,r)),s.color=o,s.lineWidth=e?t.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=e?t.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=n&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,i&&(s.x=Math.max(0,this.source.x-1),s.vertLinesVisible=!0,s.lineStyle=C.LINESTYLE_SOLID,s.mouseClickHandler=this._mouseClickHandler,s.lineWidth=2,s.color="#ff0000"),new y(s)},s.prototype.update=function(){},
s.prototype.renderer=function(){var e,t,i,n,o=this.source.visible&&this.source.areLinesVisible,r=m.lockTimeAxis().value(),s=o&&this._horzVisible,a=o||r;if(("y"!==this._axis||s)&&a)return e=9,t=11,i="y"===this._axis?this.pane.width()-e/2:this.source.lockedX+1,n="y"===this._axis?this.source.y:this.pane.height()-t/2-1,new g({x:i,y:n,width:e,height:t,bodyHeight:7})},t.CrossHair=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CrossHairPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._background="#4c525e",i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o;e.visible=!1,null!==(t=this._source.pane)&&(i=t.defaultPriceScale(),n=t.mainDataSource(),o=null!==n?n.firstValue():null,this._source.visible&&!i.isEmpty()&&null!=o&&(e.background=this._background,e.color=this.generateTextColor(this._background),e.coordinate=this._source.y,e.text=i.formatPrice(this._source.price,o),e.visible=!0))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){r.call(this),this._header=null,this._crossHair=e,this._model=t,this._items.push(new s("Date","")),this._items.push(new s("Time","")),this._items.push(new s("Price","")),this._defaultFormatter=new a(100)}var o=i(118),r=o.DataWindowView,s=o.DataWindowItem,a=i(21).PriceFormatter,l=i(201).DateFormatter,c=i(130).TimeFormatter;inherit(n,r),n.prototype.update=function(){var e,t,i,n,o,r,s=this._model.mainSeries().isDWM();this._items[1].setVisible(!s),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(e=this._crossHair.appliedIndex(),t=this._model.timeScale().indexToUserTime(e),null===t?(this._items[0].setValue("n/a"),s||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(t)),s||this._items[1].setValue((new c).format(t))),(i=this._crossHair.pane)&&(n=i.defaultPriceScale(),n.isEmpty()||(o=n.mainSource(),r=o?o.formatter():this._defaultFormatter,this._items[2].setValue(r.format(this._crossHair.price)))))},e.exports=n},function(e,t,i){"use strict";function n(e,t){o.call(this),this._invalidated=!0,this._crosshair=e,this._model=t,this._renderer=new r,this._rendererData={visible:!1,background:"#4c525e",color:"white",text:"",width:0}}var o=i(170).TimeAxisView,r=i(171).TimeAxisViewRenderer,s=i(172).AbbreviatedDateTimeFormatter;inherit(n,o),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i=this._rendererData;i.visible=!1,e=this._model.timeScale(),e.isEmpty()||(i.width=e.width(),i.coordinate=this._crosshair.appliedX(),(t=e.indexToUserTime(this._crosshair.appliedIndex()))&&(i.text=new s(this._model.mainSeries().isDWM()).format(t),i.visible=!0))},n.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData(this._rendererData),this._renderer},e.exports=n},function(e,t,i){"use strict";function n(e){this.data=e}var o=i(9).HitTestResult
;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l;this.data&&(t=this.data.vertLinesVisible,i=this.data.horzLinesVisible,(t||i)&&(e.lineStyle=this.data.lineStyle,e.lineWidth=this.data.lineWidth,e.strokeStyle=this.data.color,e.fillStyle=this.data.color,n=e.lineStyle===CanvasEx.LINESTYLE_DASHED||e.lineStyle===CanvasEx.LINESTYLE_DOTTED||e.lineStyle===CanvasEx.LINESTYLE_SPARSE_DOTTED,o=this.data.lineWidth%2==0?.5:0,r=this.data.x+1+o,s=this.data.y+o,a=this.data.w,l=this.data.h,t&&r>=0&&(n?CanvasEx.drawDashedLineVertical(e,r,0,l):CanvasEx.drawSolidLine(e,r,0,r,l)),i&&s>=0&&(n?CanvasEx.drawDashedLineHorizontal(e,0,s,a):CanvasEx.drawSolidLine(e,0,s,a,s)),this.data.drawCenter&&(e.beginPath(),e.arc(r,s,3,0,2*Math.PI,!0),e.fillStyle=this.data.color,e.fill())))},n.prototype.hitTest=function(e){return this.data.mouseClickHandler?new o(o.CUSTOM,{mouseClickHandler:this.data.mouseClickHandler}):null},t.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=n},function(e,t,i){"use strict";function n(e){this._data=e}n.prototype._drawShackle=function(e){var t=this._data.width-3,i=t/2,n=this._data.height-this._data.bodyHeight;e.moveTo(1.5,i),e.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),n>i&&(e.moveTo(1.5,i),e.lineTo(1.5,n),e.moveTo(this._data.width-1.5,i),e.lineTo(this._data.width-1.5,n))},n.prototype.draw=function(e){var t,i,n,o;e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),t="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",n="#777",o="rgba(255,255,255,.7)",e.strokeStyle=t,e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle=i,e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle=n,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle=o,e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle=n,e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},t.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=n},function(e,t,i){"use strict";function n(e,t){o.call(this,t),this._series=e,this._series.onRestarted().subscribe(this,n.prototype.invalidate),this._series.dataEvents().symbolResolved().subscribe(this,n.prototype.invalidate),this._series.dataEvents().completed().subscribe(this,n.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,n.prototype.invalidate)}var o=i(267),r=i(278).getTranslatedSymbolDescription,s=i(605),a=s.generateTitleForGui,l=s.generateSplitTitleForGui;inherit(n,o),n.prototype.invalidate=function(){delete this._text,this.update()},n.prototype.getSeriesPrecision=function(){var e=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(e=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),e},n.prototype.round=function(e){
var t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i||""},n.prototype.update=function(){"_text"in this||(this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=a(this._getTitleGenerationOptions()))},n.prototype.getSplitTitle=function(){return l(this._getTitleGenerationOptions())},n.prototype._getTitleGenerationOptions=function(){var e=this._series.symbolInfo()||{};return{description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?e.name:r({pro_name:e.pro_name,description:e.description,local_description:e.local_description,language:e.language}),exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?e.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()}},e.exports=n},function(e,t,i){"use strict";function n(e){var t,i,n=e||{},o="QUANDL"===n.exchange,r={symbolDescription:"",interval:"",exchange:"",chartStyle:"",extended:""};switch(n.description&&o?2===n.description.split("/").length?r.symbolDescription=n.description.split("/")[1]:(t=n.description.split("'").filter(function(e){return e.length}),t.forEach(function(e){e=e&&("/"===e[0]||/\d+\/\(?/.test(e))?[e]:e.split("/").filter(function(e){return e.length}),r.symbolDescription+=e[2===e.length?1:0]})):n.description?r.symbolDescription=n.description:r.symbolDescription=n.symbol,n.interval&&(r.interval=a(n.interval)),o&&n.description&&(i=/[\w_]+\/[\w_]+/.exec(n.description),i&&i[0]?r.provider=i[0].split("/")[0]:r.provider=n.description.split("/")[0]),n.exchange&&(r.exchange=n.exchange),n.style){case l.STYLE_HEIKEN_ASHI:r.chartStyle=$.t("Heikin Ashi")}return n.extended&&(r.extended=window.t("ext",{context:"shorthand_for_extended_session"})),r}function o(e){var t=n(e),i=t.symbolDescription+(t.interval?", "+t.interval:"")+s(t);return i=i.replace(/\'/g,"")}function r(e){var t,i=n(e),o=s(i),r=i.symbolDescription.replace(/\'/g,"");return o=o.replace(/\'/g,""),t=i.interval?", "+i.interval:"",[r,t,o]}function s(e){return(e.provider?", "+e.provider:"")+(e.exchange?", "+e.exchange:"")+(e.chartStyle?", "+e.chartStyle:"")+(e.extended?", "+e.extended:"")}var a=i(123).translatedIntervalString,l=i(40);e.exports={generateSplitTitleForGui:r,generateTitleForGui:o}},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ProjectionSeriesPriceAxisView",function(){return l}),n=i(1),o=i(7),i.n(o),r=i(17),s=i(279),a=i(40),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},t.prototype._updateRendererData=function(e){var t,i,n,s,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T;e.visible=!1,
t=this._getData().model,t.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._getSource(),n=i.priceScale(),s=t.timeScale(),l=this.lastPrice(),s.isEmpty()||n.isEmpty()||void 0===l||null!==(c=s.visibleBars())&&(h=c.firstBar(),u=c.lastBar(),d=i.data(),null!==(p=d.search(u,r.PlotRowSearchMode.NearestLeft))&&void 0!==(_=i.nearestIndex(h,r.PlotRowSearchMode.NearestRight))&&(f=Object(o.ensureNotNull)(d.valueAt(_))[TradingView.CLOSE_PLOT],m=e.background,y="",g=!1,v=i.properties(),S=v.style.value()===a.STYLE_HEIKEN_ASHI,S&&v.haStyle.showRealLastPrice.value()?(this._isCountdownEnabled()&&v.showCountdown.value()&&(y=this._countdownText()),b=i.lastValueData(TradingView.CLOSE_PLOT,!0),b.noData||b.color===e.background||(m=b.color),w=i.lastValueData(TradingView.CLOSE_PLOT,!1),b.noData||w.noData||(g=b.index===w.index)):(P=i.barColorer(),T=P.barStyle(p.index,!0),m=T.barColor,g=!0),e.background=m,e.secondLine=y,e.visible=g,e.color=this.generateTextColor(m),e.coordinate=n.priceToCoordinate(l,f),e.text=n.formatPrice(l,f))))},t}(s.SeriesPriceAxisView)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesLegendView",function(){return l}),n=i(1),o=i(280),r=i(42),s=!0,a={open:window.t("O",{context:"in_legend"}),high:window.t("H",{context:"in_legend"}),low:window.t("L",{context:"in_legend"}),close:window.t("C",{context:"in_legend"}),hl2:window.t("HL2",{context:"in_legend"}),hlc3:window.t("HLC3",{context:"in_legend"}),ohlc4:window.t("OHLC4",{context:"in_legend"})},l=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._items[0].setTitle(a.open),n._items[1].setTitle(a.high),n._items[2].setTitle(a.low),n._items[3].setTitle(a.close),n._items[5].setTitle(""),n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n._items[4].setTitle(a[t.priceSource()]),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return null},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[4].setVisible(o),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setTitle(a[this._series.priceSource()])},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.SeriesDataWindowView)},function(e,t,i){"use strict";function n(e){
var t,i;if(0===e.length)return!1;if(-1===(t=e.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))return!1;for(i=e.length-1;i>t&&!Object(l.coordinateIsValid)(e[i].y);)i--;return!(t>=i)}function o(e,t){var i,n,o,a,c,h=[],u=[],d=null;for(i=0;i<e.length;i++){if(n=e[i],o=e[i+1]||{},Object(l.coordinateIsValid)(n.y))n.y<=t&&h.push(n),n.y>=t&&u.push(n),d=n;else{if(null===d)continue;n=d}Object(l.coordinateIsValid)(o.y)&&((n.y>t&&o.y<t||n.y<t&&o.y>t)&&(Math.abs(n.x-o.x)<1?(a=new r.Point(n.x,t),h.push(a),u.push(a)):null!==(c=Object(s.intersectLineSegments)(n,o,new r.Point(n.x,t),new r.Point(o.x,t)))&&(a=n.add(o.subtract(n).scaled(c)),h.push(a),u.push(a))))}return{topItems:h,bottomItems:u}}var r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),t.itemsRangeIsValid=n,t.splitItems=o,i.d(t,"PaneRendererBaseline",function(){return u}),r=i(6),i.n(r),s=i(129),i.n(s),a=i(30),i.n(a),l=i(27),c=i(78),h=i(9),u=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,r,s,a,l,c,h,u,d,p,_,f,m,y;null!==this._data&&(t=this._data,i=t.items,r=t.baseLevelCoordinate,s=t.bottom,a=t.bottomFillColor1,l=t.bottomFillColor2,c=t.topFillColor1,h=t.topFillColor2,u=t.topLineColor,d=t.bottomLineColor,p=t.topLineWidth,_=t.bottomLineWidth,n(i)&&(f=o(i,r),m=f.topItems,y=f.bottomItems,e.lineCap="round",e.lineJoin="round",e.translate(.5,.5),0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,r),this._makeLine(e,m,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,c,h,r-s,r),e.fill(),e.beginPath(),this._makeLine(e,m,!1,0),e.lineWidth=p,e.strokeStyle=u,e.stroke()),0!==y.length&&(e.beginPath(),e.moveTo(y[0].x,r),this._makeLine(e,y,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,a,l,r,r+s),e.fill(),e.beginPath(),this._makeLine(e,y,!1,1),e.lineWidth=_,e.strokeStyle=d,e.stroke())))},e.prototype.hitTest=function(e){var t,i,n,o,s,u,d,p,_,f,m;if(null===this._data)return null;for(t=this._data,i=t.items,n=t.topLineWidth,o=t.bottomLineWidth,s=Object(l.selectionTolerance)((n+o)/2),u=Object(c.lowerbound)(i,e,function(e,t){return e.x<=t.x}),d=Math.max(1,u-1),p=Math.min(i.length-1,u+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],Object(a.distanceToSegment)(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(e.x,e.y)).distance<=s)return new h.HitTestResult(h.HitTestResult.REGULAR);return null},e.prototype._makeLine=function(e,t,i,n){var o,r,s,a,c,h,u,d,p,_;if(null!==this._data&&-1!==(o=t.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))for(r=this._data,s=r.barSpacing,a=r.baseLevelCoordinate,c=.25*s,u=t.length,d=o;d<u;d++)if(p=t[d],_=t[d+1]||{},Object(l.coordinateIsValid)(p.y)){if(0===n){if(h&&h.y>=a&&p.y>=a){e.moveTo(p.x,p.y);continue}}else if(h&&h.y<=a&&p.y<=a){e.moveTo(p.x,p.y);continue}if(h&&Object(l.coordinateIsValid)(h.y))e.lineTo(p.x,p.y),i&&!Object(l.coordinateIsValid)(_.y)&&e.lineTo(p.x,a);else if(_&&Object(l.coordinateIsValid)(_.y))i?(d!==o&&e.lineTo(p.x,a),e.lineTo(p.x,p.y)):e.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==o&&e.lineTo(p.x-c,a),
e.lineTo(p.x-c,p.y),e.lineTo(p.x+c,p.y),e.lineTo(p.x+c,a)}else e.moveTo(p.x-c,p.y),e.lineTo(p.x+c,p.y);h=p}},e.prototype._makeLinearGradient=function(e,t,i,n,o){var r=e.createLinearGradient(0,n,0,o);return r.addColorStop(0,t),r.addColorStop(1,i),r},e}()},function(e,t,i){"use strict";(function(t){var i=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],n=function(){function e(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function n(e){return e.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function o(){}function r(e){this.value=e}function s(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}function _(e){this.value=e}function f(e){this.value=e}function m(e){this.value=e}function y(){_.apply(this,arguments)}function g(){f.apply(this,arguments)}function v(e,t){var i,n,o,s,a,l,c,h,u=[];e:for(;i=H.exec(e);){for(n=j.length;n--;)if(i[n+1]){j[n].ctor&&(o=new j[n].ctor(i[n+1]),o._offset=i.index,u.push(o));continue e}s=new m(i[0]),s._offset=i.index,u.push(s)}if(t&&t.recover)for(n=u.length;n--;)l=u[n],l instanceof f||l instanceof _?(void 0!==a&&(c=new _(""),h=u.splice(n,a-n+1,c),c.value=h.map(function(e){return e.value}).join("")),a=n):l instanceof r||(a=void 0);return u}function S(e){var i,n,o,c,h,u,d,p,y,g;if(t.enabled("charting_library_base"))return{currentState:"var"};for(i="init",n="var",o="operator",c=i,h={warnings:[],errors:[],isEmpty:!0},u=[],d=0;d<e.length;d++)if(!((p=e[d])instanceof r))if(delete h.isEmpty,p.isIncomplete&&(y={status:"incomplete",reason:"incomplete_token",offset:p._offset,token:p},p.incompleteSuggest&&(y.recover={append:p.incompleteSuggest()}),h.warnings.push(y),d!==e.length-1))y.status="error";else if(p instanceof _||p instanceof f){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=n}else if(p instanceof l){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=o}else if(p instanceof s){if(c===n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}u.push(p),c=i}else if(p instanceof a){if(c!==n){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}g=u.pop(),g||h.errors.push({status:"error",reason:"unbalanced_brace",offset:p._offset,token:p,recover:{prepend:new s}}),c=n}else p instanceof m&&h.errors.push({status:"error",reason:"unparsed_entity",offset:p._offset,token:p});for(h.braceBalance=u.length,c!==n&&h.warnings.push({status:"incomplete"}),g=null;u.length;)p=u.pop(),y={status:"incomplete",reason:"unbalanced_brace",offset:p._offset,token:p},c===n&&(y.recover={append:new a}),h.warnings.push(y);return h.currentState=c,
0===h.warnings.length&&delete h.warnings,0===h.errors.length&&delete h.errors,h}function b(e){var t,i=[];for(t=0;t<e.length;t++)e[t]instanceof r||i.push(e[t]);return i}function w(e){var t,i,n,o,r,c,h;for(e=b(e),t=[],i=[],o=0;o<e.length;o++)r=e[o],r instanceof l?i.length&&i[i.length-1].minPrecedence>r.precedence&&(i[i.length-1].minPrecedence=r.precedence):r instanceof s?i.push(n={minPrecedence:1/0,openBraceIndex:o}):r instanceof a&&(n=i.pop(),c=e[n.openBraceIndex-1],(h=e[o+1])instanceof l&&!(h.precedence<=n.minPrecedence)||!(!(c instanceof l)||c.precedence<n.minPrecedence||c.precedence===n.minPrecedence&&c.commutative)||(t.unshift(n.openBraceIndex),t.push(o),i.length&&i[i.length-1].minPrecedence>n.minPrecedence&&(i[i.length-1].minPrecedence=n.minPrecedence)));for(o=t.length;o--;)e.splice(t[o],1);return e}function P(e){for(var t=0;t<e.length;t++)e[t].parse&&e[t].parse();return e}function T(e){var t=x(e);return w(t?t:[new f("1"),new d,new s].concat(e).concat(new a))}function x(e){var t,i,n,o=0,c=1,h=2,u=3,p=o,_=0;for(i=0;i<e.length;i++)if(!((n=e[i])instanceof r))switch(p){case o:if(!(n instanceof f&&1==+n.value))return!1;p=c;break;case c:if(!(p===c&&n instanceof d))return!1;p=h,t=i+1;break;case h:if(n instanceof s)p=u,_=1;else if(n instanceof l)return!1;break;case u:n instanceof s?_++:n instanceof a&&--_<=0&&(p=h)}return e.slice(t)}function C(e){return new _(e).ticker()}function L(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return e=v(e),e.filter(function(e){return e instanceof _}).map(function(e){return e.exchange()}).filter(function(e){return e})}function I(e){return e=L(e),1!==e.length?null:e[0]}function A(e,t){return e=L(e),e.some(function(e){return!!~t.indexOf((e||"").toUpperCase())})}function k(e){return A(e,["BATS"])}function E(e){return(e=I(e))&&-1!==e.toUpperCase().indexOf("_EOD")}function M(e){return A(e,["CHXEUR"])}function V(e){return A(e,["CHXJPY"])}function D(e){return A(e,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map(function(e){return e.exchange.toUpperCase()+"_DLY"}))}function O(e,t){return!!(e=I(e))&&e.substr(0,t.length)===t}function R(e){if("string"!=typeof e)throw new TypeError("expression must be a string");var t=w(b(v(e)));return t.forEach(function(e){e instanceof _&&e.exchange(null)}),N(t)}function B(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return N(w(b(v(e))))}function N(e){return e.join("")}var F,W,H,j=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:g},{pattern:t.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:y},{pattern:/[\0-\x20\s]+/,ctor:r}];return o.prototype.toString=function(){return this.value},e(r,o),e(s,o),
s.prototype.value="(",e(a,o),a.prototype.value=")",e(l,o),e(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,e(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,e(u,l),u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,e(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,e(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1,F=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,W=/[\+\-\/\*]/,e(_,o),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=W.test(this._ticker)?"'":"";return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},_.prototype.parse=function(){var e=F.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},_.prototype.parseAsFutures=function(){var e,t,n;for(this.hasOwnProperty("_ticker")||this.parse(),e=function(e){return i.some(function(t){return t.t===e})},t=2;t>=1;--t)if(n=this._ticker.slice(0,t),e(n)){this._root=n,this._contract=this._ticker.slice(t);break}},_.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===e||void 0===e?delete this._exchange:this._exchange=e+""},_.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===e||void 0===e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},_.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===e||void 0===e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},e(f,o),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},e(y,_),y.prototype.isIncomplete=!0,y.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},e(g,f),g.prototype.isIncomplete=!0,H=RegExp(j.map(function(e){return"("+("string"==typeof e.pattern?n(e.pattern):e.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:v,validate:S,factorOutBraces:w,normalizeTokens:P,flip:T,hasBatsSymbols:k,hasEodSymbols:E,hasChxeurSymbols:M,hasChxjpySymbols:V,hasFreeDelaySymbols:D,getExchange:I,isExchange:O,SymbolToken:_,IncompleteSymbolToken:y,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:s,CloseBraceToken:a,ticker:C,shortName:R,normalize:B}}();e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SyncModel",function(){return r}),n=i(37),i.n(n),o=0,r=function(){
function e(e,t){this._session=new n.Session,this._extrapolatedData=[],this._modelId=o++,this._builderCache=null,this._resolution=t,this._symbolInfo=e,this._valid=!!e.timezone&&!!e.session,this._session.init(e.timezone,e.session)}return e.prototype.getSymbolInfo=function(){return this._symbolInfo},e.prototype.getSession=function(){return this._session},e.prototype.getResolution=function(){return this._resolution},e.prototype.uniqueId=function(){return this._modelId},e.prototype.distance=function(e,t){var i,o,r,s,a;return this.isValid()?(i=this._extrapolatedData.length,o=0!==i?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||null!==r&&1e3*t>r)&&(s=Object(n.extrapolateBarsFrontToTime)(this._barBuilder(),r||1e3*e,1e3*t,2e3),this._extrapolatedData=this._extrapolatedData.concat(s),i=this._extrapolatedData.length),(r=this._extrapolatedData[i-1])<1e3*t?{success:!1}:(a=this._extrapolatedData.indexOf(1e3*t),-1===a?{success:!1}:{success:!0,result:a})):{success:!1}},e.prototype.projectTime=function(e,t){var i,o,r,s;return this.isValid()?(i=this._extrapolatedData.length,o=i>0?this._extrapolatedData[0]:null,r=null!==o?this._extrapolatedData[i-1]:null,1e3*e!==o&&(this._extrapolatedData=[1e3*e],o=null,r=null),(null===o||t>=i)&&(s=Object(n.extrapolateBarsFrontByCount)(this._barBuilder(),r||1e3*e,t-i+1),this._extrapolatedData=this._extrapolatedData.concat(s)),i<t?e:this._extrapolatedData[t]/1e3):e},e.prototype.isValid=function(){return this._valid},e.prototype._barBuilder=function(){return null===this._builderCache&&(this._builderCache=Object(n.newBarBuilder)(this._resolution,this._session,this._session)),this._builderCache},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesHorizontalBaseLinePaneView",function(){return s}),n=i(1),o=i(6),i.n(o),r=i(178),s=function(e){function t(t){return e.call(this,t)||this}return n.c(t,e),t.prototype._updateImpl=function(){var e,t;this._lineRendererData.visible=!1,e=this._series.priceScale().mode(),(e.percentage||e.indexedTo100)&&null!=(t=this._series.firstValue())&&(this._lineRendererData.visible=!0,this._lineRendererData.points=[new o.Point(0,this._series.priceScale().priceToCoordinate(t,t))],this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.color=this._series.properties().baseLineColor.value())},t}(r.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesPriceLinePaneView",function(){return a}),n=i(1),o=i(6),i.n(o),r=i(178),s=i(84),a=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=s.LINESTYLE_DOTTED,i}return n.c(t,e),t.prototype._updateImpl=function(){if(this._lineRendererData.visible=!1,this._series.properties().showPriceLine.value()){var e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,
this._lineRendererData.points=[new o.Point(0,e.coordinate)],this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}},t}(r.a)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesDataEvents",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(){this._completed=new o.a,this._error=new o.a,this._symbolError=new o.a,this._symbolResolved=new o.a,this._seriesError=new o.a,this._symbolNotPermitted=new o.a,this._symbolGroupNotPermitted=new o.a,this._extendedHoursNotPermitted=new o.a,this._chartTypeNotPermitted=new o.a,this._intradaySpreadNotPermitted=new o.a,this._intradayExchangeNotPermitted=new o.a,this._customIntervalNotPermitted=new o.a,this._tickMarksRangeChanged=new o.a,this._barReceived=new o.a,this._messageReceived=new o.a}return e.prototype.completed=function(){return this._completed},e.prototype.error=function(){return this._error},e.prototype.symbolError=function(){return this._symbolError},e.prototype.symbolResolved=function(){return this._symbolResolved},e.prototype.seriesError=function(){return this._seriesError},e.prototype.symbolNotPermitted=function(){return this._symbolNotPermitted},e.prototype.symbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},e.prototype.extendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},e.prototype.chartTypeNotPermitted=function(){return this._chartTypeNotPermitted},e.prototype.intradaySpreadNotPermitted=function(){return this._intradaySpreadNotPermitted},e.prototype.intradayExchangeNotPermitted=function(){return this._intradayExchangeNotPermitted},e.prototype.customIntervalNotPermitted=function(){return this._customIntervalNotPermitted},e.prototype.tickMarksRangeChanged=function(){return this._tickMarksRangeChanged},e.prototype.barReceived=function(){return this._barReceived},e.prototype.messageReceived=function(){return this._messageReceived},e.prototype.fireCompleted=function(){this._completed.fire()},e.prototype.fireError=function(){this._error.fire()},e.prototype.fireSymbolError=function(e){this._symbolError.fire(e),this.fireError()},e.prototype.fireSymbolResolved=function(e){this._symbolResolved.fire(e)},e.prototype.fireSeriesError=function(e){this._seriesError.fire(e),this.fireError()},e.prototype.fireSymbolNotPermitted=function(e){this._symbolNotPermitted.fire(e),this.fireError()},e.prototype.fireSymbolGroupNotPermitted=function(e){this._symbolGroupNotPermitted.fire(e),this.fireError()},e.prototype.fireExtendedHoursNotPermitted=function(){this._extendedHoursNotPermitted.fire(),this.fireError()},e.prototype.fireChartTypeNotPermitted=function(e){this._chartTypeNotPermitted.fire(e),this.fireError()},e.prototype.fireIntradaySpreadNotPermitted=function(){this._intradaySpreadNotPermitted.fire(),this.fireError()},
e.prototype.fireIntradayExchangeNotPermitted=function(){this._intradayExchangeNotPermitted.fire(),this.fireError()},e.prototype.fireCustomIntervalNotPermitted=function(){this._customIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireTickMarksRangeChanged=function(e){this._tickMarksRangeChanged.fire(e)},e.prototype.fireBarReceived=function(e){this._barReceived.fire(e)},e.prototype.fireMessageReceived=function(e){this._messageReceived.fire(e)},e}()},function(e,t,i){"use strict";function n(e){function t(e,t){var i=e.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(t)||(a[i][t]=e.measureText(t).width),a[i][t]}function i(){var i=n.width(),a=n.height();return{draw:function(n){var c,h,u,d,p,_,f,m,y,g=e.symbolInfo();if(g){for(n.fillStyle=o.generateColor(l.color.value(),l.transparency.value()),c=g.name,/QUANDL/.test(g.exchange)&&(h=c.split(/\//),h.length&&(c=h[h.length-1])),u={description:g.description,pro_name:g.pro_name,short_name:g.name},d=[{text:c?c+", "+r(e.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:117,vertOffset:0},{text:s(u)||"",font:"48px Verdana, Arial, sans-serif",lineHeight:58,vertOffset:5}],p=0,_=0;_<d.length;_++)f=d[_],f.text&&(n.font=f.font,m=t(n,f.text),f.zoom=m>i?i/m:1,p+=f.lineHeight*f.zoom);for(y=Math.max((a-p)/2,0),_=0;_<d.length;_++)f=d[_],f.text&&(n.save(),n.translate(i/2,y),n.textBaseline="top",n.textAlign="center",n.font=f.font,n.scale(f.zoom,f.zoom),n.fillText(f.text,0,f.vertOffset),n.restore(),y+=f.lineHeight*f.zoom)}}}}var n=null,a={},l=e.model().properties().symbolWatermarkProperties,c={renderer:i,update:function(){}};this.paneViews=function(e){return e.containsMainSeries()?(n=e,[c]):[]}}var o=i(29),r=i(123).translatedIntervalString,s=i(278).getTranslatedSymbolDescription;t.Watermark=n},function(e,t,i){"use strict";function n(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function o(e,t){this.source=e,this.pane=t,this._renderer=new r}function r(){this.data=null}n.prototype.paneViews=function(e){return[new o(this,e)]},o.prototype.update=function(){},o.prototype.renderer=function(){var e={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(e.horzLinesVisible=!0,e.vertLinesVisible=!0,e.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),e.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),e.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),e.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),e.priceMarks=this.pane.defaultPriceScale().marks(),e.timeMarks=this.pane.timeScale().marks(),e.w=this.pane.width(),e.h=this.pane.height(),this._renderer.setData(e),this._renderer)},r.prototype.setData=function(e){this.data=e},r.prototype.draw=function(e){var t;if(null!==this.data){if(e.lineWidth=1,this.data.vertLinesVisible){
for(e.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(e,this.data.vertLineStyle),e.beginPath(),t=0;t<this.data.timeMarks.length;t++)e.moveTo(this.data.timeMarks[t].coord+1,0),e.lineTo(this.data.timeMarks[t].coord+1,this.data.h);e.stroke()}if(this.data.horzLinesVisible){for(e.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(e,this.data.horzLineStyle),e.beginPath(),t=0;t<this.data.priceMarks.length;t++)e.moveTo(0,this.data.priceMarks[t].coord),e.lineTo(this.data.w,this.data.priceMarks[t].coord);e.stroke()}}},t.Grid=n},function(e,t,i){"use strict";function n(e,t,i){this._magnetProperty=e,this._timeScale=t}var o=i(63).Series;n.prototype.align=function(e,t,i){var n,r,s,a,l,c,h,u,d,p,_=50,f=i.defaultPriceScale(),m=e;if(!this._magnetProperty.value())return m;for(n=f.dataSources(),r=null,s=0;s<n.length;s++)if(n[s]instanceof o){r=n[s];break}if(r&&(a=r.bars(),a.contains(t)&&(l=a.valueAt(t),c=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],f=r.priceScale(),!f.isEmpty()))){for(h=[],u=r.firstValue(),s=0;s<c.length;s++)h.push({y:f.priceToCoordinate(c[s],u),price:c[s]});d=f.priceToCoordinate(e,u),h.sort(function(e,t){return Math.abs(e.y-d)-Math.abs(t.y-d)}),p=h[0],Math.abs(p.y-d)<_&&(m=p.price)}return m},e.exports=n},function(e,t,i){"use strict";(function(e){function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function o(t,i){this._options=Object.assign({},P,i),this._model=t,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._baseIndex=null,this._defaultRightOffsetProperty=new f(w),this.m_rightOffset=w,this._defaultRightOffsetProperty.listeners().subscribe(this,function(e){this.setRightOffset(e.value())}),this.m_points=new u,this._barSpacingChanged=new e,this.m_barSpacing=b,this._options.preserveBarSpacing&&(this.m_barSpacing=this._scalesProperties.barSpacing.value()||b),this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._commonTransitionStartState=null,this.m_tickmarks=new l,this._formattedBySpan={},this._onScroll=new e,this._visibleBars=null,this._visibleBarsInvalidated=!0,this._visibleBarsChanged=new e,this._leftEdgeIndex=null}var r=i(50).clamp,s=i(214).BarsRange,a=i(618),l=i(619),c=i(18),h=i(21).numberToStringWithLeadingZero,u=i(620).TimePoints,d=i(161),p=i(4).getLogger("Chart.TimeScale"),_=i(5),f=i(13),m=i(3).saveDefaultProperties,y=null,g=50,v=_.enabled("high_density_bars")?.025:.5,S=5,b=d.DEFAULT_BAR_SPACING,w=5,P={preserveBarSpacing:!1,lockVisibleTimeRangeOnResize:!1};o.prototype.tickMarks=function(){return this.m_tickmarks},o.prototype.reset=function(){this._visibleBarsInvalidated=!0,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState(),this.m_tickmarks.reset(),this._leftEdgeIndex=null},o.prototype.restoreDefault=function(){this._visibleBarsInvalidated=!0,this.setBarSpacing(b),this.resetRightOffset()},
o.prototype.restoreRightOffsetPropertyToDefault=function(){this._defaultRightOffsetProperty.setValue(w)},o.prototype.setLeftEdgeFix=function(e){var t,i;this._leftEdgeIndex=e,(t=this.visibleBars().firstBar()-e)<0&&(i=this.m_rightOffset-t-1,this.scrollToOffsetAnimated(i,500))},o.prototype.baseIndex=function(){return this._baseIndex||0},o.prototype.rightOffset=function(){return this.m_rightOffset},o.prototype.defaultRightOffsetProperty=function(){return this._defaultRightOffsetProperty},o.prototype.rightOffsetForTimePoint=function(e){var t=this.timeToCoordinate(e);return null===t?null:this._rightOffsetForCoordinate(t)},o.prototype._rightOffsetForCoordinate=function(e){return(this.m_width+1-e)/this.m_barSpacing},o.prototype.scrollToRealtime=function(e,t){var i,n,o,r,s=this._defaultRightOffsetProperty.value();if(s<0&&(s=w),e)return i=this,n=this.m_rightOffset,o=this.maxRightOffset(),o>0&&s>o&&(s=o),r=this._model,void $({offset:n}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",complete:t,step:function(e){i._visibleBarsInvalidated=!0,i.m_rightOffset=e,i._correctOffset(),r.recalculateAllPanes(),r.invalidate(new c(c.LIGHT_UPDATE)),r.recalcVisibleRangeStudy(r.dataSources())}});this._visibleBarsInvalidated=!0,this.m_rightOffset=s,this._correctOffset(),void 0!==t&&t()},o.prototype.points=function(){return this.m_points},o.prototype.width=function(){return this.m_width},o.prototype.setWidth=function(e){var t,i;!isFinite(e)||e<=0||this.m_width!==e&&(this._visibleBarsInvalidated=!0,this._options.lockVisibleTimeRangeOnResize&&this.m_width&&(t=this.m_barSpacing*e/this.m_width,this._tryToUpdateBarSpacing(this.m_barSpacing,t)),null!==this._leftEdgeIndex&&this.visibleBars().firstBar()<=this._leftEdgeIndex&&(i=this.m_width-e,this.m_rightOffset-=Math.round(i/this.m_barSpacing)+1),this.m_width=e,this._correctOffset())},o.prototype.barSpacing=function(){return this.m_barSpacing},o.prototype.setBarSpacing=function(e){if(void 0===e)return void p.logDebug("setBarSpacing: invalid argument");this._tryToUpdateBarSpacing(this.m_barSpacing,e)&&(this._correctOffset(),this._options.preserveBarSpacing&&(m(!0),this._scalesProperties.barSpacing.setValue(this.m_barSpacing),m(!1)))},o.prototype._tryToUpdateBarSpacing=function(e,t){return e!==t&&(this._visibleBarsInvalidated=!0,this.m_barSpacing=t,this._barSpacingChanged.fire(e,t),!0)},o.prototype.barSpacingChanged=function(){return this._barSpacingChanged},o.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setRightOffset(w),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),g)))},o.prototype.visibleBars=function(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars},o.prototype._updateVisibleBars=function(){var e,t,i,n,o;if(this.isEmpty())return void(null!==this._visibleBars&&(this._visibleBars=null,this._visibleBarsChanged.fire()));e=this.baseIndex(),t=Math.ceil(this.m_width/this.m_barSpacing)-1,i=Math.round(this.m_rightOffset+e),n=i-t,
o=this._visibleBars,this._visibleBars=new s(n,i),null!==o&&this._visibleBars.equals(o)||this._visibleBarsChanged.fire()},o.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},o.prototype.indexToCoordinate=function(e,t){var i,n,o;return this.isEmpty()?0:TradingView.isInteger(e)?(i=this.baseIndex(),n=i+this.m_rightOffset-e,o=this.m_width-(n+.5)*this.m_barSpacing,t?o:Math.round(o)):0},o.prototype.barIndexesToCoordinates=function(e){var t,i,n,o,r=this.baseIndex();for(t=0;t<e.length;t++)i=e[t].time,n=r+this.m_rightOffset-i,o=this.m_width-(n+.5)*this.m_barSpacing,e[t].time=Math.round(o),e[t].exactTime=o},o.prototype.indexesToCoordinates=function(e){var t,i,n,o=this.baseIndex(),r=o+this.m_rightOffset,s=this.m_width-r*this.m_barSpacing-.5*this.m_barSpacing;for(t=0;t<e.length;t++)i=e[t].x,n=s+i*this.m_barSpacing,e[t].x=Math.round(n)},o.prototype.coordinateToIndex=function(e){var t=this._rightOffsetForCoordinate(e),i=this.baseIndex(),n=i+this.m_rightOffset-t,o=Math.round(1e6*n)/1e6;return Math.ceil(o)},o.prototype.timeToCoordinate=function(e){function t(e){return e<=0||e>=l.m_width}var i,n,o,r=this.m_points.closestIndexLeft(e),s=this.m_points.valueAt(r),a=this.indexToCoordinate(r,!0),l=this;return t(a)?null:(i=this.barSpacing(),n=function(){var e=this.baseIndex();return this.m_points.valueAt(e)-this.m_points.valueAt(e-1)}.bind(this)(),o=Math.round(a+(e-s)/n*i)+1,t(o)?null:o)},o.prototype.alignCoordinate=function(e){if(this.isEmpty())return e;var t=this.coordinateToIndex(e);return this.indexToCoordinate(t)},o.prototype.timePointToIndex=function(e){return this.m_points.indexOf(e,!0)},o.prototype.indexToTimePoint=function(e){return this.m_points.valueAt(e)},o.prototype.indexToUserTime=function(e){return this.m_tickmarks.indexToTime(e)},o.prototype.marks=function(){var e,t,i,n,o,r,s,a,l,c,h,u;if(this.isEmpty())return null;for(e=this.m_barSpacing,t=this._scalesProperties.fontSize.value()||0,i=5*(t+4),n=Math.round(i/e),o=this.visibleBars(),r=Math.max(o.firstBar(),o.firstBar()-n),s=Math.max(o.lastBar(),o.lastBar()-n),a=this.m_tickmarks.build(e,i),l=[],c=0;c<a.length;++c)h=a[c],r<=h.index&&h.index<=s&&null!==(u=this.m_tickmarks.indexToTime(h.index))&&l.push({coord:this.indexToCoordinate(h.index),label:this.formatLabel(u,h.span),span:h.span,major:h.label>=d.DAY_SPAN?1:0});return l},o.prototype.state=function(e){var t={};return t.m_barSpacing=this.barSpacing(),t.m_rightOffset=e?this.m_rightOffset:this._defaultRightOffsetProperty.value(),e&&(t.points=this.m_points.state(),t.tickmarks=this.m_tickmarks.state(),t.width=this.m_width),t},o.prototype.restoreState=function(e,t){var i,n,o;return void 0===e.m_barSpacing?void p.logDebug("restoreState: invalid state"):void 0===e.m_rightOffset?void p.logDebug("restoreState: invalid state"):(i=e.m_barSpacing,n=e.m_rightOffset<0&&!t?w:e.m_rightOffset,o=n<0?w:Math.round(n),this._defaultRightOffsetProperty.setValue(o),this.m_rightOffset=n,t&&(this.m_points.restoreState(e.points),this.m_tickmarks.restoreState(e.tickmarks),e.width&&this.m_width>0&&(i*=this.m_width/e.width)),
this._tryToUpdateBarSpacing(this.m_barSpacing,i),void this._correctOffset())},o.prototype.setBaseIndex=function(e){if("number"!=typeof e)return void p.logDebug("setBaseIndex: invalid argument");this._visibleBarsInvalidated=!0,this._baseIndex=e,this._correctOffset()},o.prototype.setRightOffset=function(e){if(void 0===e)return void p.logDebug("setRightOffset: invalid argument");this._visibleBarsInvalidated=!0,this.m_rightOffset=e,this._correctOffset()},o.prototype.resetRightOffset=function(){this.setRightOffset(this._defaultRightOffsetProperty.value())},o.prototype._correctOffset=function(){var e,t=this.maxRightOffset();this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsInvalidated=!0),null!==(e=this.minRightOffset())&&this.m_rightOffset<e&&(this.m_rightOffset=e,this._visibleBarsInvalidated=!0)},o.prototype.minRightOffset=function(){var e,t=this.m_points.firstIndex(),i=this._baseIndex;return null===t||null===i?null:null!==this._leftEdgeIndex?(e=this.m_width/this.m_barSpacing,this._leftEdgeIndex-i+e-1):t-i-1+S},o.prototype.maxRightOffset=function(){return this.m_width/this.m_barSpacing-S},o.prototype.startScale=function(e){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scaleStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype._saveCommonTransitionsStartState=function(){this._commonTransitionStartState={barSpacing:this.barSpacing(),rightOffset:this.rightOffset()}},o.prototype._clearCommonTransitionsStartState=function(){this._commonTransitionStartState=null},o.prototype.scaleTo=function(e){var t,i;null!==this._commonTransitionStartState&&(t=r(this.m_width-e,0,this.m_width),i=r(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==t&&0!==i&&this.setBarSpacing(this.getValidBarSpacing(this._commonTransitionStartState.barSpacing*t/i)))},o.prototype.getValidBarSpacing=function(e){return void 0===e&&(e=this.barSpacing()),e<v?v:e>g?g:e},o.prototype.isValidBarSpacing=function(e){return e>=v&&e<=g},o.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.startScroll=function(e){null===this.m_scrollStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scrollStartPoint=e,this._saveCommonTransitionsStartState()))},o.prototype.scrollTo=function(e){if(this._visibleBarsInvalidated=!0,null!==this.m_scrollStartPoint){var t=(this.m_scrollStartPoint-e)/this.barSpacing();this.m_rightOffset=this._commonTransitionStartState.rightOffset+t,this._correctOffset(),this._onScroll.fire()}},o.prototype.scrollToOffsetAnimated=function(e,t){var i,n,o,r;if(!isFinite(e))throw new RangeError("offset is required and must be finite number");if(void 0===t&&(t=400),!isFinite(t)||t<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,n=this.m_rightOffset,o=+new Date,r=this._model,function s(){i._visibleBarsInvalidated=!0;var a=(new Date-o)/t;if(a>=1)return i.m_rightOffset=e,
i._correctOffset(),i._visibleBarsInvalidated=!0,r.recalculateAllPanes(),void r.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=n+(e-n)*a,i._correctOffset(),r.recalculateAllPanes(),setTimeout(s,20)}()},o.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this._clearCommonTransitionsStartState())},o.prototype.update=function(e,t,i,n){this._visibleBarsInvalidated=!0,i.length>0&&this.m_points.merge(e,t,i),this.m_tickmarks.merge(n),this._correctOffset()},o.prototype.addTail=function(e,t,i){var n,o,r;for(this.m_tickmarks.removeTail(t),n=e.params,o=this.m_tickmarks.maxIndex+(i?0:1),r=0;r<n.marks.length;r++)n.marks[r].index=o+r;this.m_tickmarks.addTail(n.marks),this.m_points.addTail(n.changes,i),this.m_rightOffset-=n.changes.length},o.prototype.formatLabel=function(e,t){if(this._formattedBySpan[t])return this._formattedBySpan[t].format(e.valueOf());var i=this;return this._formattedBySpan[t]=new a(function(e){return i.formatLabelImpl(new Date(e),t)}),this._formattedBySpan[t].format(e)},o.prototype.formatLabelImpl=function(e,t){if(!(e&&e instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return t<d.MINUTE_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2)+":"+h(e.getUTCSeconds(),2):t<d.DAY_SPAN&&!i?h(e.getUTCHours(),2)+":"+h(e.getUTCMinutes(),2):t<d.WEEK_SPAN?e.getUTCDate():t<d.MONTH_SPAN?e.getUTCDate():t<d.YEAR_SPAN?(y||(y=n()),y[e.getUTCMonth()]):e.getUTCFullYear()},o.prototype.normalizeBarIndex=function(e){var t=0,i=0,n=this.baseIndex();return e<this.m_points.firstIndex()?(t=this.m_points.valueAt(this.m_points.firstIndex()),i=e-this.m_points.firstIndex()):e>n?(t=this.m_points.valueAt(n),i=e-n):(t=this.m_points.valueAt(e),i=0),{time_t:t,offset:i}},o.prototype.denormalizeTimePoint=function(e){var t=this.m_points.indexOf(e.time_t);if(null!==t)return t+e.offset},o.prototype.zoomToBarsRange=function(e,t){if(!(t<=e)){var i=this.baseIndex();this.m_rightOffset=t-i,this.setBarSpacing(this.width()/(t-e+1)),this._visibleBarsInvalidated=!0}},o.prototype.canZoomIn=function(){return this.m_barSpacing<g},o.prototype.canZoomOut=function(){return this.m_barSpacing>v},o.prototype.minBarSpacing=function(){return v},o.prototype.maxBarSpacing=function(){return g},o.prototype.onScroll=function(){return this._onScroll},o.prototype.preserveBarSpacing=function(){return this._options.preserveBarSpacing},o.prototype.visibleBarsChanged=function(){return this._visibleBarsChanged},t.TimeScale=o}).call(t,i(8))},function(e,t,i){"use strict";function n(e,t){this._formatter=e,this._maxSize=t||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}n.prototype.format=function(e){var t,i;return this._cache[e]?this._cache[e].string:(this._actualSize===this._maxSize&&(t=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[t],this._oldestTick++,this._actualSize--),i=this._formatter(e),this._cache[e]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=e,this._actualSize++,
this._usageTick++,i)},e.exports=n},function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new t}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(e){var t,i,n,o,r,s=this._marksBySpan,a={};for(t=0;t<e.length;t++){if(i=e[t],n=i.index,o=i.span,r=this._marksByIndex[i.index]){if(r.index===i.index&&r.span===i.span){r.time=i.time;continue}this._removeTickmark(r)}this._marksByIndex[n]=i,this.minIndex<=n||(this.minIndex=n),this.maxIndex>=n||(this.maxIndex=n),s[o]||(s[o]=[]),s[o].push(i),a[o]=!0}for(o=s.length;o--;)s[o]&&(s[o].length||delete s[o],a[o]&&s[o].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(e){var t,i,n=e.index;this._marksByIndex[n]===e&&(delete this._marksByIndex[n],n<=this.minIndex&&this.minIndex++,n>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),t=this._marksBySpan[e.span],-1!==(i=t.indexOf(e))&&t.splice(i,1))},i.prototype._sortByIndexAsc=function(e,t){return e.index-t.index},i.prototype.removeTail=function(e){var t,i={};this.maxIndex=0;for(t in this._marksByIndex)this._marksByIndex[t].time<e&&(i[t]=this._marksByIndex[t],this.maxIndex=Math.max(this.maxIndex,t));this._marksByIndex=i},i.prototype.addTail=function(e){for(var t=0;t<e.length;t++)e[t].index=this.maxIndex+t+1;this.merge(e)},i.prototype.indexToTime=function(e){var t=this._marksByIndex[e];return t?new Date(1e3*t.time):null},i.prototype.density=function(){var e,t=this.maxIndex-this.minIndex;if(0!==t)return e=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*e/t},i.prototype.estimateLeft=function(e){var t,i=this.density();if(i)return t=1e3*this._marksByIndex[this.minIndex].time-e,t/i},i.prototype.nearestIndex=function(e){for(var t,i=this.minIndex,n=this.maxIndex;n-i>2;){if(1e3*this._marksByIndex[i].time===e)return i;if(1e3*this._marksByIndex[n].time===e)return n;t=Math.round((i+n)/2),1e3*this._marksByIndex[t].time>e?n=t:i=t}return i},i.prototype.build=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p,_,f,m=Math.ceil(t/e);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],n=this._marksBySpan.length;n--;)if(this._marksBySpan[n]){for(o=i,i=[],r=o.length,s=0,a=this._marksBySpan[n],l=a.length,c=1/0,h=-1/0,u=0;u<l;u++){for(d=a[u],p=d.index;s<r;){if(_=o[s],!((f=_.index)<p)){c=f;break}s++,i.push(_),h=f,c=1/0}c-p>=m&&p-h>=m&&(i.push(d),h=p)}for(;s<r;s++)i.push(o[s])}return this._cache=i,this._cache},i.prototype.state=function(){var e,t=[];for(e=this._marksBySpan.length;e--;)this._marksBySpan[e]&&(t=t.concat(this._marksBySpan[e]));return t=t.map(function(e){return[e.span,e.time,e.index]}),{marks:t,version:2}},i.prototype.restoreState=function(e){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,
e&&e.marks&&e.marks.length)if(2===e.version){var t=e.marks.map(function(e){return{span:e[0],time:e[1],index:e[2]}});this.merge(t)}else this.merge(e.marks)},e.exports=i}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimePoints",function(){return r}),n=i(4),o=Object(n.getLogger)("Chart.TimePoints"),r=function(){function e(){this._zoffset=0,this._items=[]}return e.prototype.clear=function(){this._zoffset=0,this._items=[]},e.prototype.size=function(){return this._items.length},e.prototype.firstIndex=function(){return this._offsetToIndex(0)},e.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},e.prototype.merge=function(e,t,i){var n,r,s,a,l,c,h,u;if(0===i.length)return o.logError("merge: 'values' does not contain any time points"),[];if(t>this._zoffset&&e+t>0)return o.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=t,[{change:"rebuild",index:this._validOffsetToIndex(0)}];if((n=e+this._zoffset)<0){if(r=Math.abs(n),i.length<r)return o.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+e+", previous 'zoffset': "+this._zoffset+", new 'zoffset': "+t+", 'values.length': "+i.length),[];for(this._items=Array(r).concat(this._items),this._zoffset=t,s=0;s<i.length;++s)this._items[e+s+t]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}for(a=[],l=n;l<this._items.length&&l-n<i.length;++l)this._items[l]=i[l-n],a.push({change:"update",index:this._validOffsetToIndex(l),value:i[l-n]});if((c=n+i.length)>this._items.length)for(r=c-this._items.length,h=l;h<l+r;++h)u=this._items.length,this._items.push(i[h-n]),a.push({change:"append",index:this._validOffsetToIndex(u),value:i[h-n]});return this._zoffset=t,a},e.prototype.addTail=function(e,t){for(var i=t?1:0;i<e.length;i++)this._items.push(e[i])},e.prototype.remove=function(e){var t,i,n,o=this._indexToOffset(e);if(null===o)return[];for(t=this._items.splice(o),i=[],n=0;n<t.length;n++)i.push({change:"remove",index:e+n,value:t[n]});return i},e.prototype.valueAt=function(e){var t=this._indexToOffset(e);return null!==t?this._items[t]:null},e.prototype.indexOf=function(e,t){if(this._items.length<1)return null;if(e>this._items[this._items.length-1])return t?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;i<this._items.length;++i){if(e===this._items[i])return this._validOffsetToIndex(i);if(e<this._items[i])return t?this._validOffsetToIndex(i):null}return null},e.prototype.state=function(){return{items:this._items,zoffset:this._zoffset}},e.prototype.restoreState=function(e){null!==e&&(this._items=e.items,this._zoffset=e.zoffset)},e.prototype.roughTime=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),null!==(i=this.valueAt(e))?i:(n=this._items,!n.length||n.length<2?null:(o=0,r=n.length-1,s=this._validOffsetToIndex(o),a=this._validOffsetToIndex(r),l=n[o],c=n[r],h=(c-l)/(a-s),
e<s?(u=s-e,d=u*h,l-d):(p=500,e>a?(u=e-a)<p&&null!=t?t(c,u):(d=u*h,c+d):null)))},e.prototype.roughIndex=function(e,t){var i,n,o,r,s,a,l,c,h,u,d,p;return void 0===t&&(t=null),i=this._items,!i.length||i.length<2?null:(n=0,o=i.length-1,r=this._validOffsetToIndex(n),s=this._validOffsetToIndex(o),a=i[n],l=i[o],e>=a&&e<=l?this.closestIndexLeft(e):(c=(l-a)/(s-r),e<a?(h=a-e,u=Math.round(h/c),r-u):(d=500,e>l?(h=e-l,u=Math.trunc(h/c),u<d&&null!==t&&(p=t(l,e),p.success&&(u=p.result)),s+u):null)))},e.prototype.closestIndexLeft=function(e){var t,i,n,o,r,s,a=this._items;if(!a.length)return null;if(Number.isNaN(e))return null;if(t=a.length-1,i=a[t],e>=i)return this._validOffsetToIndex(t);if(n=0,o=a[n],e<o)return null;if(e===o)return this._validOffsetToIndex(n);for(;t>n+1;)if(r=n+t>>1,(s=a[r])>e)t=r;else{if(!(s<e))return s===e?this._validOffsetToIndex(r):null;n=r}return this._validOffsetToIndex(n)},e.prototype._validOffsetToIndex=function(e){return e-this._zoffset},e.prototype._offsetToIndex=function(e){return 0<=e&&e<this.size()?this._validOffsetToIndex(e):null},e.prototype._indexToOffset=function(e){var t=e+this._zoffset;return 0<=t&&t<this.size()?t:null},e}()},function(e,t,i){"use strict";function n(e,t){this.tooltips={},this.tooltipFactory=e,this.source=t}function o(e,t){this.renderer=e,this._tooltip=t,this.visible=!1}n.prototype.findOrCreateTooltip=function(e){var t=this.tooltips[e.id];return null==t&&(e.hovered||e.pinned)&&(t=this._createTooltip(),this.tooltips[e.id]=t),t},n.prototype.showPlate=function(e,t){var i=this.findOrCreateTooltip(e);null!=i&&(i._drawPlate(e,t),i.plateData=e)},n.prototype.draw=function(e,t){this.hoveredId=null;for(var i=0;i<e.length;i++)e[i].hovered&&(this.hoveredId=e[i].id);e.forEach(function(e){this.showPlate(e,t)}.bind(this))},n.prototype.endDraw=function(){var e,t,i=this;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.toggleVisibility(),i.hoveredId&&t.plateData.id!==i.hoveredId&&!t.plateData.pinned&&(t.remove(),delete this.tooltips[e]))},n.prototype.removeAll=function(){var e,t;for(e in this.tooltips)this.tooltips.hasOwnProperty(e)&&(t=this.tooltips[e],t.remove());this.tooltips={}},n.prototype.removeTooltip=function(e){delete this.tooltips[e]},n.prototype._createTooltip=function(){return new o(this,this.tooltipFactory())},o.prototype._drawPlate=function(e,t){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(e,t),e.hovered||e.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(e.id)})},o.prototype.remove=function(){this._tooltip._removeLayout()},o.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},t.TooltipRenderer=n},function(e,t,i){"use strict";function n(e){var t,i;if(e&&e.__esModule)return e;if(t={},null!=e)for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,i){var n,o=2*J,r=document.createElement("canvas")
;return r.width=t*o,r.height=i*o,r.style.width=t+"px",r.style.height=i+"px",n=r.getContext("2d"),n.setTransform(o,0,0,o,0,0),n.drawImage(e,0,0,t,i),r}function s(e,t){return function(){i.e(11).then(function(){X=i(811),e.call(t)}.bind(null,i)).catch(i.oe)}}function a(e){return!x||e>L}function l(e){return!T||e>C}var c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D,O,R,B,N,F,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee;Object.defineProperty(t,"__esModule",{value:!0}),t.Branding=void 0,c=function(){function e(e,t){var i,n,o=[],r=!0,s=!1,a=void 0;try{for(i=e[Symbol.iterator]();!(r=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(s)throw a}}return o}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){var i,n;for(i=0;i<t.length;i++)n=t[i],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),u=i(6),d=i(60),p=i(5),_=n(p),f=i(9),m=i(184),y=i(29),g=i(194),v=i(46),S=i(24),b=i(257).debounce,w=i(623),P=!1,T=_.enabled("adaptive_logo"),x=_.enabled("small_no_display"),P=_.enabled("38914"),C=500,L=480,I="TradingView",A="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ",I),k="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ",I),E="by{3}{4}".format("",""," "," ",I),M=P?E:k,V="site_branding",D="widget_branding",O="widget_referral_branding",R="widget_custom_branding",B="widget_custom_no_powered_branding",N="fundamental_branding",F="fundamental_custom_branding",W="fundamental_custom_no_powered_branding",H="library_branding",j="library_custom_branding",z="library_custom_no_powered_branding",U=.2,q=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Y=q&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,G=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),K=function(){var e,t=window.navigator.userAgent,i=t.indexOf("MSIE ");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):t.indexOf("Trident/")>0&&(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10))}(),Z=window.urlParams||{},window.initData,J=window.hidpiCanvasRatio||1,X=null,Q=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.symbol,a=void 0===r?"":r,l=t.model,c=t.onReadyCallback;o(this,e),this._model=l,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=n,this._symbol=a,this.showAnimatedBranding=_.enabled("show_animated_logo"),this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=m.color.brandNew,this._colorOldBlue=m.color.brandDown,this._colorOldGray=m.color.black30,this._strokeColor=m.color.black255,
this._brandCircleShadowColor=m.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=G?1:2,this._verticalTextShift=q?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(w,"tvLogo"),this._createFillText()):this._loadImage(w,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,y.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>U?(this._brandCircleColor=m.color.black255,this._animatedColorBg=m.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=m.color.black27,this._animatedColorBg=m.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i,n=this;this._needDisplayImage&&(this._image=new Image,this.showAnimatedBranding&&(this._imageWhite=new Image),K?(this._image.src=X.fallbackImages[t+"Blue"],this.showAnimatedBranding&&(this._imageWhite.src=X.fallbackImages[t+"White"])):(i=e.replace(/fill="#[\da-f]{6}"/i,'fill="#FFFFFF"'),this._image.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this.showAnimatedBranding&&(this._imageWhite.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i))),this._image.addEventListener("load",function(){Y&&(n._image=r(n._image,n._imageWidth,n._imageHeight)),n._imageReady=!0,"function"==typeof n._onReadyCallback&&n._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case D:case O:case R:case N:case F:case j:case H:this.show=!0;break;case V:case B:case W:case z:this.show=!1}switch(this._layout){case H:this._needDisplayImage=!0,this._txt=$.t(A);break;case j:this._txt=$.t(M)}}},{key:"_drawTextStroke",value:function(e){var t,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),t=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),t.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=t.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*J,this._strokeCanv.height=(this._fontSize+2*i)*this._upscaleRatio*J,this._strokeCanv.width%2==0&&(this._strokeCanv.width+=1,this._strokeCanv.height+=1),t.textBaseline="top",t.textAlign="start",t.font=this._fontSize*this._upscaleRatio+this._font,t.strokeStyle=this._strokeColor,t.lineWidth=this._strokeWidth*this._upscaleRatio*J,t.lineJoin="round",t.strokeText(this._txt,i,this._verticalTextShift)),e.save(),e.globalAlpha=this._strokeOpacity,
e.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio/J,this._strokeCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawTextFill",value:function(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio/J,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_createFillText",value:function(){var e,t;null===this._fillCanv&&(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),t=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)),this._setSizeFillTextCanvas(t),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift))}},{key:"_updateFillTextWithColor",value:function(e){var t=Math.round(this._strokeWidth*this._upscaleRatio),i=this._fillCanv.getContext("2d");this._setSizeFillTextCanvas(t),i.clearRect(0,0,this._fillCanv.width,this._fillCanv.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}},{key:"_setSizeFillTextCanvas",value:function(e){this._fillCanv.width=(this._textWidth+2*e)*J,this._fillCanv.height=(this._fontSize+2*e)*this._upscaleRatio*J,this._fillCanv.width%2==0&&(this._fillCanv.width+=1,this._fillCanv.height+=1)}},{key:"_drawFillTextCropWidth",value:function(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,t*this._upscaleRatio*J,this._fillCanv.height,0,0,t,this._fillCanv.height/this._upscaleRatio/J),e.restore()}},{key:"_drawBgCircle",value:function(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}},{key:"_drawFillRectWithRoundedCorner",value:function(e,t,i,n,o,r,s){e.save(),(0,v.drawRoundRect)(e,t-1,i-1,n+2,o+2,r),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,v.drawRoundRect)(e,t,i,n,o,r),e.fillStyle=s,e.fill(),e.closePath(),e.restore()}},{key:"_drawImageWithColor",value:function(e){e.save(),e.globalAlpha=this._animatedOpacity,e.drawImage(this._imageWhite,0,-.5,this._imageWidth,this._imageHeight),e.restore(),e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),e.restore()}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"minimizedAnimationWidth",value:function(){
return this._brandCircleSize}},{key:"maximizedAnimationWidth",value:function(){return this._fillCanv.width/this._upscaleRatio/J+this._brandCircleSize-3}},{key:"animatedDrawStep",value:function(e,t){var i,n,o,r,s,a,l,h,u,d,p,_,f,m,y,g;this._animatedWidth=t,i=this._animatedWidth<this._brandCircleSize+20?0:this._animatedWidth/this.maximizedAnimationWidth(),n=(0,S.parseRgb)(this._brandCircleColor),o=c(n,3),r=o[0],s=o[1],a=o[2],l=(0,S.parseRgb)(this._fillColor),h=c(l,3),u=h[0],d=h[1],p=h[2],_=(0,S.parseRgb)(this._strokeColor),f=c(_,3),m=f[0],y=f[1],g=f[2],this._animatedColorBg=(0,S.rgbaToString)((0,S.blendRgba)([r,s,a,(0,S.normalizeAlphaComponent)(1)],[u,d,p,(0,S.normalizeAlphaComponent)(i)])),this._animatedColorText=(0,S.rgbaToString)((0,S.blendRgba)([u,d,p,(0,S.normalizeAlphaComponent)(1)],[m,y,g,(0,S.normalizeAlphaComponent)(i)])),this._animatedOpacity=i}},{key:"draw",value:function(e,t){var i,n,o,r,s,c,h,u,d,p;this.showAnimatedBranding?this._needDisplayImage&&this._imageReady&&(e.save(),i=(this._brandCircleSize-this._imageWidth)/2,n=(this._brandCircleSize-this._imageHeight)/2,e.translate(-i,-n),this._drawFillRectWithRoundedCorner(e,0,0,this._animatedWidth,this._brandCircleSize,this._brandCircleSize/2,this._animatedColorBg),e.translate(i,n),this._drawImageWithColor(e),o=12+(G?-.5:0),r=this._imageWidth+o,this._animatedWidth>r&&(e.translate(this._imageWidth/2+o,.5),this._drawFillTextCropWidth(e,this._animatedWidth-r,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):this._layout===R||this._layout===F?(s='12px "Trebuchet MS", Tahoma, Arial, sans-serif',e.font=s,c=e.measureText(this._txt).width,this.width=c+e.measureText("TradingView").width,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",c,12),e.restore()):a(t)&&(this._needDisplayImage&&this._imageReady?(e.save(),h=(this._brandCircleSize-this._imageWidth)/2,e.translate(h,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),u=12+(G?-.5:0),e.translate(this._imageWidth+u,-.5),d=l(t),d&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+h,this.width+=d?u+this._strokeCanv.width/this._upscaleRatio/J:h,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):(e.save(),e.translate(G?-.5:0,-.5),p=l(t),p&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),p&&(this.width=this._strokeCanv.width/this._upscaleRatio/J)))}}]),e}(),ee=function(){function e(t){var i=t.layout,n=void 0===i?V:i,r=t.src,a=t.onReadyCallback;o(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=n,this._src=r,this._onReadyCallback=a,K&&(this._init=s(this._init,this)),this._init()}return h(e,[{key:"_init",value:function(){var e,t,i=this;this._checkLayout(),this.show&&(e=this._src.match(/(\w+)\.svg/),K&&e&&2===e.length?(t=e[1],
this._img.src=X.fallbackImages[t],this._img.addEventListener("load",function(){var e=X.logoSizes;t in e?(i.width=e[t].width,i.height=e[t].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),i.height=Math.round(i._img.height),Y&&(i._img=r(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case R:case B:case F:case W:case j:case z:this.show=!0;break;case V:case D:case O:case N:case H:this.show=!1}}},{key:"draw",value:function(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}]),e}(),t.Branding=function(){function e(t){var i,n=this;o(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._paneHeight=0,this._left=13,this._bottom=24,this._layout=V,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==R&&this._layout!==F||(this._left=8,this._bottom=5),i=function(){n._needToShow?n._layout===V?n._showBranding=window.innerWidth>=768:n._showBranding=!0:n._showBranding=!1},this._resizeHandlerDelayed=b(i,200),i(),window.addEventListener("resize",this._resizeHandlerDelayed),this._model.isSnapshot()?this._init():this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),this._cubicBezier=new m.CubicBezier(.4,.01,.22,1)}return h(e,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy=new Q({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new ee({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return e._model.fullUpdate()}}),this._openAnimation=null,this._closeAnimation=null}},{key:"_checkLayout",value:function(){if(_.enabled("widget"));else if(_.enabled("charting_library")||_.enabled("amp_terminal")||_.enabled("cqg_terminal")||_.enabled("trading_terminal")){var e=JSON.parse(Z.logo)||{};e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=_.enabled("widget_logo"),_.enabled("link_to_tradingview")?this._layout=j:this._layout=z):(this._layout=H,this._needToShow=_.enabled("widget_logo"))}else this._layout=V}},{key:"_startOpenAnimation",value:function(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),this._openAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,g.doAnimate)({from:this._currentStateForAnimation(),
to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_currentStateForAnimation",value:function(){return this._powBy.width}},{key:"_closedStateForAnimation",value:function(){return this._powBy.minimizedAnimationWidth()}},{key:"_openedStateForAnimation",value:function(){return this._powBy.maximizedAnimationWidth()}},{key:"_animatedDrawStep",value:function(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(e){var t=this;return!this._showBranding||_.enabled("logo_without_link")?null:this._powBy&&this._layout!==V&&this._layout!==B&&this._layout!==W&&(0,d.pointInRectangle)(e,new u.Point(this._left,this._paneHeight-this._bottom+this._powBy.bottomShift()/2-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)),new u.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom+this._powBy.bottomShift()/2))?new f.HitTestResult(f.HitTestResult.CUSTOM,{mouseUpHandler:function(){window.open(t.tvUrl(),"_blank").opener=null},mouseEnterHandler:function(){t._startOpenAnimation()},mouseLeaveHandler:function(){t._startCloseAnimation()}}):void 0}},{key:"tvUrl",value:function(){var e,t="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===H||this._layout===j){switch(e=void 0,!0){case _.enabled("charting_library"):e="library";break;case _.enabled("trading_terminal"):case _.enabled("amp_terminal"):case _.enabled("cqg_terminal"):e="trading-terminal"}return t+="/"===t[t.length-1]?"?":"&",t+="utm_source="+window.location.origin+"&utm_medium=library"+(e?"&utm_campaign="+e:"")}return t}},{key:"draw",value:function(e){if(this._showBranding){var t=0;this._powBy&&this._powBy.show&&(t=this._powBy.height-this._powBy.bottomShift(),e.save(),e.translate(this._left,this._paneHeight-this._bottom-t),this._powBy.draw(e,this._canvasWidth),e.restore()),this._custom&&this._custom.show&&(e.save(),e.translate(this._left,this._paneHeight-this._bottom-t-this._custom.height),this._custom.draw(e),e.restore())}}},{key:"renderer",value:function(e,t){return this._paneHeight=this._pane.height(),this._canvasWidth=t,{draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}},{key:"paneViews",value:function(e){var t=_.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?(this._pane=e,[{renderer:this.renderer.bind(this)}]):[]}}]),e}()},function(e,t){
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 13" width="22" height="13"><path fill="#37A6EF" fill-rule="nonzero" d="M19.354 4.932c.379.55.611 1.207.642 1.918A3.007 3.007 0 0 1 22 9.686a3.003 3.003 0 0 1-3 3.006H4a3.983 3.983 0 0 1-2.814-1.16l6.363-5.048a1.657 1.657 0 0 0 1.495.037l3.034 2.66a1.672 1.672 0 0 0 1.589 2.175 1.668 1.668 0 0 0 1.552-2.28l4.135-4.144zm-.942-.945L14.276 8.13a1.66 1.66 0 0 0-1.32.044l-3.034-2.66A1.672 1.672 0 0 0 8.333 3.34a1.668 1.668 0 0 0-1.611 2.097l-6.316 5.01A3.999 3.999 0 0 1 0 8.683a4.004 4.004 0 0 1 4.041-4.008A5.338 5.338 0 0 1 9.333 0a5.337 5.337 0 0 1 5.124 3.857 3.644 3.644 0 0 1 1.876-.517c.772 0 1.488.239 2.079.647z"/></svg>'},function(e,t,i){"use strict";(function(e){function n(e,t,i,n){this._prices=[],this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this.reset({font:e,fontSize:t,backColors:i,colors:n}),this._priceAxisFontSize=11}function o(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function r(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t}function s(e,t,i,n){var o,r,s;for(p.call(this,e,t,i,n),o=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],r=this.properties().levelsStyle.visibility,s=0;s<o.length;s++)r[o[s]].listeners().subscribe(this,TradingView.Study.prototype.processHibernate)}var a=i(6).Point,l=i(24),c=l.parseRgb,h=l.rgbToBlackWhiteString,u=i(119),d=i(117).StudyDataWindowView,p=i(180).NonSeriesStudy,_=i(625).StandardPivotPointsPriceAxisView,f=i(185).TrendLineRenderer,m=i(99),y=i(312),g=i(9).HitTestResult,v=i(69).CompositeRenderer,S=i(17).PlotRowSearchMode,b=i(2).propertyPages,w=i(103).LineEnd;n.prototype.destroy=function(){this._canvas.remove()},n.prototype.reset=function(e){this._prices=[],this._params=e,this._cache.setFont(e.fontSize+"px "+e.font);var t=this;this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce(function(e,i){var n=t._cache.measureText(i).width;return Math.max(n,e)},0)},n.prototype.rowHeight=function(){return this._priceAxisFontSize+4},n.prototype._labelRectByIndex=function(e){return{left:0,top:Math.round(this._topByIndex(e)),width:Math.round(this._labelWidth+4),height:this._params.fontSize+8}},n.prototype.params=function(){return this._params},n.prototype._centerByIndex=function(e){return Math.round((e+.5)*(this._params.fontSize+8))},n.prototype._topByIndex=function(e){return Math.round(e*(this._params.fontSize+8))},n.prototype.setPrices=function(e){var t,i,n,o,r,s,a=8,l=!1,c=function(e,t){return void 0===e&&void 0===t||e.formatted===t.formatted};if(e.length!==this._prices.length)l=!0;else for(t=0;t<this._prices.length;t++)if(!c(this._prices[t],e[t])){l=!0;break}if(l){for(i=this,i._cache.save(),i._cache.font=this._priceAxisFontSize+"px Arial",i._cache.restore(),n=this._labelWidth+6,o=window.hidpiCanvasRatio||1,n*=o,this._canvas.prop("width",n),r=Math.max(e.length,22)*(this._params.fontSize+a),r*=o,this._canvas.prop("height",r),this._canvas.css("width",n).css("height",r),this._prices=e,
this._cache.clearRect(0,0,n,r),this._cache.save(),this._cache.translate(.5,.5),this._cache.font=this._params.fontSize+"px "+this._params.font,this._cache.textBaseline="middle",t=0;t<this._prices.length;t++)this._prices[t]&&(s=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"][t],this._cache.fillStyle=this._params.backColors[t],this._cache.fillText(s,0,this._centerByIndex(t)),this._cache.fillText("/",0,this._centerByIndex(t+11)));this._prices=e,this._cache.restore()}},o.prototype.setCache=function(e){this._cache=e},o.prototype.priceAxisViews=function(e,t){return this._priceAxisViews},o.prototype.mergeLabel=function(e,t,i){var n=""+t;void 0===e[n]?(e[n]={},e[n].text=i,e[n].ids=[this.complete(i)]):(e[n].text+="/"+i,e[n].ids.push(this.complete(i)))},o.prototype.complete=function(e){return"P"===e?e:"S"+e[1]+"/R"+e[1]},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y;if(this._source.pricesView().prices(),this._pivots=[],this._source.customData()&&this._source.customData().pivots&&this._source.properties().visible.value()&&(e=this._source.customData().pivots,t=this._source._indexes,i=this._model.timeScale(),(n=this._source.priceScale())&&!n.isEmpty()&&!i.isEmpty()&&e&&(o=i.visibleBars(),r=o.firstBar(),s=o.lastBar(),this._source.ownerSource())))for(a=this._source.ownerSource().firstValue(),l=0;l<e.length;l++)if(e[l]&&(c=t[e[l].startIndex],!((h=t[e[l].endIndex])<r||c>s))){u={},d=this._source.properties().levelsStyle.visibility,d.P.value()&&this.mergeLabel(u,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(u,e[l].s1,"S1"),this.mergeLabel(u,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(u,e[l].s2,"S2"),this.mergeLabel(u,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(u,e[l].s3,"S3"),this.mergeLabel(u,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(u,e[l].s4,"S4"),this.mergeLabel(u,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(u,e[l].s5,"S5"),this.mergeLabel(u,e[l].r5,"R5")),p=i.indexToCoordinate(c),_=i.indexToCoordinate(h);for(f in u)m=parseFloat(f),y=n.priceToCoordinate(m,a),this._pivots.push({x1:p,x2:_,y:y,label:u[f].text,labelIds:u[f].ids})}},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,h,u,d,p,_,m,S,b;for(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new v,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=0;n<this._pivots.length;n++)if(o=this._pivots[n],r=new a(o.x1,o.y),s=new a(o.x2,o.y),l={points:[r,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t[o.labelIds[0]].value(),linewidth:i[o.labelIds[0]].value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:w.Normal,rightend:w.Normal},c=new f,c.setData(l),c.setHitTest(new g(g.REGULAR)),e.append(c),this._source.properties().levelsStyle.showLabels.value())for(h=o.label.split("/"),u=0,d=0;d<h.length;d++)p=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(h[d]),d>0&&(_=this._cache._labelRectByIndex(p+11),m={left:r.x-_.width+u,
top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width/2,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b)),_=this._cache._labelRectByIndex(p),m={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width,S=this._cache._canvas.get(0),b=new y(S,_,m),e.append(b);return e},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;if(!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()&&null!==(e=this._model.timeScale().visibleBars())&&this._source.customData()&&this._source.customData().pivots&&(t=this._model.mainSeries(),i=this._source.priceScale(),null!==(n=t.bars().search(e.lastBar(),S.NearestLeft)))){for(o=n.index,r=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c<r.length;c++)if(r[c]&&(h=s[r[c].startIndex],u=s[r[c].endIndex],d=a.inputs.showHistoricalPivots.value(),u>=o&&h<=o||!d))for(p=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],this._prices=[],_=0;_<p.length;_++)f=p[_],void 0!==(m=r[c][f])&&(y=i.priceToCoordinate(m,l),g={P:"P",S1:"S1/R1",S2:"S2/R2",S3:"S3/R3",S4:"S4/R4",S5:"S5/R5",R1:"S1/R1",R2:"S2/R2",R3:"S3/R3",R4:"S4/R4",R5:"S5/R5"},v=a.levelsStyle.colors[g[f.toUpperCase()]].value(),this._prices.push({formatted:i.formatPrice(m,l),price:m,coordinate:y,color:v}));this._cache.setPrices(this._prices)}},r.prototype.update=function(){this._invidated=!0},r.prototype.prices=function(){return this._invidated&&(this._updateImpl(),this._invidated=!1),this._prices},inherit(s,p),s.prototype.lastValueData=function(e,t,i){var n=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase()),o={noData:!0},r=this._pricesView.prices()[n];return null!==r&&void 0!==r?r:o},s.prototype.lastPriceLabelFixedCoordinate=function(e){var t=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(e.toUpperCase());return this._priceAxisViews[t]._fixedCoordinate},s.prototype.priceLabelText=function(e){return this._metaInfo.shortDescription+":"+e.toUpperCase()},s.prototype.pricesView=function(){return this._pricesView},s.prototype._getActualCacheParams=function(){var e={};return e.font=this.properties().font.value(),e.fontSize=this.properties().fontsize.value(),e.backColors=[this.properties().levelsStyle.colors.P.value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S5/R5"].value(),this.properties().levelsStyle.colors["S5/R5"].value()],e.colors=e.backColors.map(function(e){return"black"===h(c(e),150)?"white":"black"}),e},s.prototype.updateAllViews=function(){p.prototype.updateAllViews.call(this),this._pricesView.update()},
s.prototype.createViews=function(){var e,t,i,s,a,l=this._getActualCacheParams();for(this._cache&&this._cache.destroy(),this._cache=new n(l.font,l.fontSize,l.backColors,l.colors),this._priceAxisViews=[],e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],this._paneViews.length=0,t=new o(this._model,this),t.setCache(this._cache),this._paneViews.push(t),i=this.properties().levelsStyle.visibility,s=0;s<e.length;s++)this._priceAxisViews.push(new _(this,{name:e[s],cache:this._cache})),a="P"===e[s].toUpperCase()?"P":"S"+e[s][1]+"/R"+e[s][1],i[a]&&i[a].value()&&this._paneViews.push(new m(this._model,this,e[s],"priceLabelText","showStudyPlotLabels"));this._dataWindowView||(this._dataWindowView=new d(this,this._model)),this._statusView||(this._statusView=new u(this,this._model.properties())),this._legendView=null,this._pricesView=new r(this,this._cache)},s.prototype._postProcessGraphics=function(){},s.prototype.isVisible=function(){var e,t,i;if(!this.properties().visible.value())return!1;for(e=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],t=this.properties().levelsStyle.visibility,i=0;i<e.length;i++)if(t[e[i]].value())return!0;return!1},s.prototype.stop=function(){TradingView.Study.prototype.stop.call(this),this._cache&&(this._cache.destroy(),this._cache=null)},s.prototype.priceRange=function(t,i){var n,o,r,s,a,l,c,h;if(!this.customData()||!this.customData().pivots||!this._indexes)return null;if(!this.priceScale())return null;for(n=this.customData().pivots,o=this._indexes,r=null,s=0;s<n.length;s++)if(n[s]&&(a=o[n[s].startIndex],!(o[n[s].endIndex]<t||a>i)))for(l=[],c=this._properties.levelsStyle.visibility,c.P.value()&&l.push(n[s].p),c["S1/R1"].value()&&l.push(n[s].s1,n[s].r1),c["S2/R2"].value()&&l.push(n[s].s2,n[s].r2),c["S3/R3"].value()&&l.push(n[s].s3,n[s].r3),c["S4/R4"].value()&&l.push(n[s].s4,n[s].r4),c["S5/R5"].value()&&l.push(n[s].s5,n[s].r5),h=0;h<l.length;h++)l[h]&&(null===r?r=new e(l[h],l[h]):r.apply(l[h],l[h]));return this.priceScale().isLog()&&r?new e(this.priceScale().priceToLogical(r.minValue()),this.priceScale().priceToLogical(r.maxValue())):r},s.prototype.getStylesPropertyPage=function(){return b.StudyPivotPointsStandardStylesPropertyPage},t.study_PivotPointsStandard=s}).call(t,i(48).PriceRange)},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StandardPivotPointsPriceAxisView",function(){return s}),n=i(1),o=i(58),r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var n,o=e.call(this)||this;return o._source=t,o._data=i,n=i.name,o._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],o}return n.c(t,e),t.prototype._updateRendererData=function(e){var t,i,n,o,s,a,l,c,h,u;e.visible=!1,t=this._source.properties(),t.visible.value()&&(i=this._completeName,n=t.levelsStyle.visibility,n[i]&&n[i].value()&&(o=this._source.model(),s=o.timeScale(),a=this._source.priceScale(),s.isEmpty()||null===s.visibleBars()||null!==a&&a.isEmpty()||(l=this._source.customData())&&l.pivots&&(c=this._source.pricesView().prices(),
h=r.indexOf(this._data.name.toUpperCase()),(u=c[h])&&(e.background=u.color,e.color=this.generateTextColor(u.color),e.coordinate=u.coordinate,e.floatCoordinate=u.floatCoordinate,e.text=u.formatted,e.visible=!0))))},t}(o.a)},function(e,t,i){"use strict";function n(e,t){this._source=e,this._model=t,this._points=[new s(0,0)],this._lineRenderer=new P}function o(e){return null==e[TradingView.OPEN_PLOT]}function r(e,t,i,n){this._waterlineView=null,this._symbolLabelView=new T(e,this,void 0,"symbol","showSymbolLabels"),l.call(this,e,t,i,n),this.m_data=new M(E(),o),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,function(){r._createFormatter(),r.updateAllViews(),r._model.invalidate(new x(x.FULL_UPDATE))}),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var s=i(6).Point,a=i(63).Series,l=i(34).Study,c=i(17).PlotRowSearchMode,h=i(627).OverlayPriceAxisView,u=i(282),d=u.SeriesAreaPaneView,p=u.SeriesLinePaneView,_=u.SeriesHollowCandlesPaneView,f=u.SeriesCandlesPaneView,m=u.SeriesBarsPaneView,y=u.SeriesBaselinePaneView,g=i(283).SeriesWaterlinePaneView,v=i(119),S=i(286).OverlayDataWindowView,b=i(628).OverlayLegendView,w=i(166).SeriesBarColorer,P=i(109).HorizontalLineRenderer,T=i(99),x=i(18),C=i(21).PriceFormatter,L=i(2).propertyPages,I=i(5),A=i(48).PriceRange,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(17).PlotList,V=!I.enabled("hide_study_overlay_legend_item"),D=I.enabled("uppercase_instrument_names"),O=i(4).getLogger("Chart.StudyOverlay");n.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new s(0,e.coordinate)],this._color=e.color)}},n.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(r,l),r.prototype.createPlotLabels=function(e){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,D?e.toUpperCase():e},r.prototype.lastValueData=function(e,t,i){var n,o,r,s,l,h,u,d,p,_,f,m,y,g={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return g;if(null===(n=this._model.timeScale().visibleBars()))return g;if(!this.properties().visible.value())return g
;if(null==(o=this.nearestIndex(n.lastBar(),c.NearestLeft)))return g;if(r=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),s=null!==r&&n.contains(r.index),l=null!==r?r.value:null,h=t||s?l:this.data().valueAt(o),u=this._barFunction(h),!h||!isNumber(u))return g;if(d={noData:!1},i&&(d.price=u),!(p=this.firstValue()))return g;switch(d.text=this.priceScale().formatPrice(u,p),d.floatCoordinate=this.priceScale().priceToCoordinate(u,p,!0),d.coordinate=Math.round(d.floatCoordinate),d.item=h,_=this.properties(),_.style.value()){case a.STYLE_BARS:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:d.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case a.STYLE_LINE:d.color=_.lineStyle.color.value();break;case a.STYLE_AREA:d.color=_.areaStyle.color1.value();break;case a.STYLE_BASELINE:f=_.baselineStyle,m=this.priceScale(),y=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),d.color=d.coordinate<y?_.baselineStyle.topLineColor.value():_.baselineStyle.bottomLineColor.value()}return d},r.prototype.firstValue=function(){var e,t,i=this._model.timeScale().visibleBars();return null===i?null:(e=i.firstBar(),0===this.data().size()?null:(t=this.data().search(e,c.NearestRight,!0),null!==t?this._barFunction(t.value):null))},r.prototype.barFunction=function(){return this._barFunction},r.prototype._updateBarFunction=function(){var e=this.priceSource()||"close";this._barFunction=k(e)},r.prototype.priceSource=function(){switch(this._properties.style.value()){case a.STYLE_LINE:return this._properties.lineStyle.priceSource.value();case a.STYLE_AREA:return this._properties.areaStyle.priceSource.value();case a.STYLE_BASELINE:return this._properties.baselineStyle.priceSource.value()}return null},r.prototype.priceRange=function(e,t){var i,n,o;return TradingView.isInteger(e)?TradingView.isInteger(t)?0===this.m_data.size()?null:(i=this.priceSource(),n=null!==i?this.m_data.minMaxOnRangeCached(e,t,[{name:i,offset:0}]):this.m_data.minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),o=null!==n?new A(n.min,n.max):null,this._postProcessPriceRange(o)):void O.logDebug("priceRange: incorrect endBar"):void O.logDebug("priceRange: incorrect startBar")},r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new h(this)],this._paneViews=[];var e=null;switch(this._properties.style.value()){case a.STYLE_BARS:e=new m(this,this._model);break;case a.STYLE_CANDLES:e=new f(this,this._model);break;case a.STYLE_HOLLOW_CANDLES:e=new _(this,this._model);break;case a.STYLE_LINE:e=new p(this,this._model);break;case a.STYLE_AREA:e=new d(this,this._model);break;case a.STYLE_BASELINE:e=new y(this,this._model),this._waterlineView=new g(this)}e&&this._paneViews.push(e),null!==this._waterlineView&&this._paneViews.push(this._waterlineView),this._paneViews.push(new n(this,this._model)),
this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new S(this,this._model)),this._legendView||(this._legendView=new b(this,this._model)),this._statusView||(this._statusView=new v(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new w(this)},r.prototype.start=function(e){this._formatter=null,l.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var e,t,i,n,o,r,s;"default"===this.properties().minTick.value()?(e=this.properties().inputs.symbol.value(),t=this._resolvedSymbols[e],this._formatter=new C(t?t.pricescale:100,t?t.minmov:1,!!t&&t.fractional)):(i=this.properties().minTick.value(),n=isNumber(i)?["100","1","false"]:i.split(","),o=parseInt(n[0]),r=parseInt(n[1]),s="true"===n[2],this._formatter=new C(o,r,s)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._tryChangeInputs=function(){l.prototype._tryChangeInputs.call(this),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[t];return i?(e=i.name,i.exchange&&0!==i.exchange.length&&(e+=", "+i.exchange)):e=t,D?e.toUpperCase():e},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(e){return this.bars().valueAt(e)[TradingView.OPEN_PLOT]},r.prototype.high=function(e){return this.bars().valueAt(e)[TradingView.HIGH_PLOT]},r.prototype.low=function(e){return this.bars().valueAt(e)[TradingView.LOW_PLOT]},r.prototype.close=function(e){return this.bars().valueAt(e)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},r.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},r.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var e=[],t=this.symbolInfo();return t?e.push(t.name):this._properties.inputs.symbol.value()&&e.push(this._properties.inputs.symbol.value()),e},r.prototype.statusView=function(){return V?l.prototype.statusView.call(this):null},r.prototype.getStylesPropertyPage=function(){return L.StudyOverlayStylesPropertyPage},t.study_Overlay=r},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayPriceAxisView",function(){return r}),n=i(1),o=i(58),r=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return n.c(t,e),t.prototype._updateRendererData=function(e){e.visible=!1;var t=this._source.lastValueData("close",!1)
;t.noData||(e.background=t.color,e.color=this.generateTextColor(t.color),e.coordinate=t.coordinate,e.floatCoordinate=t.floatCoordinate,e.text=t.text,e.visible=!0)},t}(o.a)},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"OverlayLegendView",function(){return a}),n=i(1),o=i(286),r=i(42),s=!0,a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showOnlyPriceSource=i.properties().paneProperties.legendProperties.showOnlyPriceSource,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._seriesStyle=t.properties().style,n._studyOverlay=t,n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return this._additional},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._updateImpl=function(){var t,i,n,o;e.prototype._updateImpl.call(this),t=s&&this._showOnlyPriceSourceValue(),i=this._showSeriesOHLC.value(),n=i&&!t,o=i&&t,this._items[0].setVisible(n),this._items[1].setVisible(n),this._items[2].setVisible(n),this._items[3].setVisible(n),this._items[5].setVisible(this._showBarChange.value()),this._items[4].setVisible(o)},t.prototype._showOnlyPriceSourceValue=function(){return this._showOnlyPriceSource.value()&&Object(r.isPriceSourceStyle)(this._seriesStyle.value())},t}(o.OverlayDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){this._symbolLabelView=new a(e,this,"compare","symbol","showSymbolLabels"),o.call(this,e,t,i,n);var r=this;this._properties.minTick.listeners().subscribe(null,function(){r._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){r._model.invalidate(new l(l.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}var o=i(34).Study,r=i(630).CompareLegendView,s=i(287).CompareDataWindowView,a=i(99),l=i(18),c=i(21).PriceFormatter,h=i(2).propertyPages,u=i(5),d=!u.enabled("hide_study_compare_legend_item"),p=u.enabled("uppercase_instrument_names");inherit(n,o),n.prototype.createPlotLabels=function(e){},n.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},n.prototype.createViews=function(){this._legendView||(this._legendView=new r(this,this._model)),this._dataWindowView||(this._dataWindowView=new s(this,this._model)),o.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},n.prototype._createFormatter=function(){var e,t,i,n,o,r=this.properties().inputs.symbol.value(),s=this._resolvedSymbols?this._resolvedSymbols[r]:null;"default"===this.properties().minTick.value()?this._formatter=new c(s?s.pricescale:100,s?s.minmov:1,!!s&&s.fractional):(e=this.properties().minTick.value(),t=isNumber(e)?["100","1","false"]:e.split(","),
i=parseInt(t[0]),n=parseInt(t[1]),o="true"===t[2],this._formatter=new c(i,n,o)),this.priceScale()&&this.priceScale().updateFormatter()},n.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,p?e.toUpperCase():e},n.prototype.title=function(e){var t,i=this.properties().inputs.symbol.value(),n=this._resolvedSymbols?this._resolvedSymbols[i]:null;return n?(t=n.name,n.exchange&&0!==n.exchange.length&&(t+=", "+n.exchange)):t=i,p?t.toUpperCase():t},n.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var e=this._properties.inputs.symbol.value();return e?this._resolvedSymbols[e]:null},n.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},n.prototype.tags=function(){var e=this.symbol();return e?[e]:[]},n.prototype.statusView=function(){return d?o.prototype.statusView.call(this):null},n.prototype.getInputsPropertyPage=function(){return h.StudyCompareInputsPropertyPage},n.prototype.guiPlotName=function(e){return this.properties().inputs.symbol.value()},t.study_Compare=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompareLegendView",function(){return r}),n=i(1),o=i(287),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._additional=null,n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n._showStudyValues.subscribe(n,n.update),n}return n.c(t,e),t.prototype.isValuesVisible=function(){return this._showStudyValues.value()},t.prototype.destroy=function(){this._showStudyValues.unsubscribeAll(this)},t.prototype.additional=function(){return this._additional},t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this)},t}(o.CompareDataWindowView)},function(e,t,i){"use strict";function n(e,t,i,n){s.call(this,e,t,i,n),this._underlyingData=new a(l(n))}var o=i(7).assert,r=i(12).clone,s=i(34).Study,a=i(17).PlotList,l=i(269).studyPlotFunctionMap;inherit(n,s),n.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData.clear()},n.prototype._mergeData=function(e){var t,i;this._invalidateLastNonEmptyPlotRowCache(),t=this._underlyingData.firstIndex(),this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new a(l(this._metaInfo))),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(e){this._createStrategy(e.strategy,e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)},this)},n.prototype._plotsForStrategyProcessing=function(){var e=["dataoffset"],t=[];return this._metaInfo.plots.forEach(function(i,n){var r,s;e.indexOf(i.type)>-1&&(r=null,this._metaInfo.plots.forEach(function(e,t){e.id===i.target&&(r=t)}),o(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:n,targetIndex:r},t.push(s))},this),t},
n.prototype._createStrategy=function(e,t,i,o){return new n["Strategy_"+e](t,i,o)},n.Strategy_dataoffset=function(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i},n.Strategy_dataoffset.prototype.rebuildData=function(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,n=null,o=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each(function(r,s){var a,l,c,h=s[t],u=s[i]?Math.round(s[i]):null;return s[t]=null,s[i]=null,!(!u||u>0)&&(a=r+u,l={pointIndex:a,value:h},o?o.pointIndex!==l.pointIndex&&(a>=0&&(e.valueAt(a)[t]=h),c=!1,n&&(c=n.value<=o.value&&o.value<=h||n.value>=o.value&&o.value>=h),c?o.pointIndex>=0&&(e.valueAt(o.pointIndex)[t]=null):n=o,o=l):o=l,!1)})},t.study_ScriptWithDataOffset=n},function(e,t,i){"use strict";function n(){return null===c&&(c=new l.Session,c.init("Etc/UTC","24x7")),c}function o(e,t){return e.timezone===t.timezone&&e.session===t.session}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeSynchronizer",function(){return h}),r=i(15),s=i(35),a=i.n(s),l=i(37),i.n(l),c=null,h=function(){function e(e,t){this._sourceTargetBarBuilder=null,this._cache=new Map,this._source=e,this._target=t,this._isResolutionTheSame=r.Interval.isEqual(e.getResolution(),t.getResolution()),this._isSessionTheSame=o(e.getSymbolInfo(),t.getSymbolInfo()),this._shouldCorrectTradingDay=r.Interval.isDWM(e.getResolution())&&!this._isSessionTheSame}return e.prototype.sourceTimeToTargetTime=function(e){var t,i,n,o,r,s;return this._isSessionTheSame&&this._isResolutionTheSame?e:this._source.isValid()&&this._target.isValid()?(t=this._cache.get(e),void 0===t&&(i=1e3*e,this._shouldCorrectTradingDay&&(n=a.a.utc_to_cal(this._source.getSession().timezone,i),n=this._source.getSession().spec.correctTradingDay(n,this._source.getSession().timezone),o=new Date(n),a.a.set_hms(o,0,0,0,0,this._source.getSession().timezone),i=o.valueOf()),r=this._sourceTargetBuilder(),r.moveTo(i),s=r.indexOfBar(i),t=r.startOfBar(Math.max(0,s))/1e3,this._cache.set(e,t)),t):e},e.prototype._sourceTargetBuilder=function(){if(null===this._sourceTargetBarBuilder){var e=this._isSessionTheSame?this._target.getSession():n();this._sourceTargetBarBuilder=Object(l.newBarBuilder)(this._target.getResolution(),this._target.getSession(),e)}return this._sourceTargetBarBuilder},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesScaleRatioProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){this._changed=new o.a,this._model=e}return e.prototype.getStepChangeValue=function(){return.1},e.prototype.getMinValue=function(){return 1e-7},e.prototype.getMaxValue=function(){return 9999},e.prototype.value=function(){return this._model.mainSeriesScaleRatio()},e.prototype.setValue=function(e,t){(e!==this.value()||t)&&(this._model.setMainSeriesScaleRatio(e),this._onChanged())},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},
e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MainSeriesPriceScaleNameProperty",function(){return r}),n=i(8),o=i.n(n),r=function(){function e(e){var t=this;this._changed=new o.a,this._defaultValues=["left","right","none"],this._model=e,this._model.mainSeriesPriceScaleNameChanged().subscribe(null,function(){return t._onChanged()})}return e.prototype.getValues=function(e){var t,i=[],n=this._defaultValues.length-1;for(t=0;t<=n;t++)(t!==n||e)&&i.push(this._defaultValues[t]);return i},e.prototype.value=function(){return this._model.mainSeriesPriceScaleName()},e.prototype.setValue=function(e,t){var i=this.value();(e!==i||t)&&this._model.setMainSeriesPriceScaleName(i,e)},e.prototype.state=function(){return null},e.prototype.clone=function(){return new e(this._model)},e.prototype.listeners=function(){return this._changed},e.prototype.subscribe=function(e,t){this._changed.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._changed.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._changed.unsubscribeAll(e)},e.prototype._onChanged=function(){this._changed.fire(this)},e}()},function(e,t,i){"use strict";function n(e){"LineToolGannComplex"!==e.type||void 0!==e.version&&1!==e.version||(e.type="LineToolGannFixed")}Object.defineProperty(t,"__esModule",{value:!0}),t.migrateState=n},function(e,t){},function(e,t,i){"use strict";function n(e){return null==e._parentMenu?null:o(e._parentMenu)}function o(e){return null==e._parentMenuItem?e:n(e._parentMenuItem)}function r(e,t){this.action=e,this._parentMenu=t}function s(e,t){this.action=e,this._parentMenu=t}var a,l,c;i(208),a=i(289),l=i(290),c=i(38).IS_RTL,r.prototype._createIconTag=function(){var e=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createDeleteButton=function(){var e,t,i;if(!this.action.deleteButton)return null;e=this,t=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),t&&i.click(function(){return t.call(e),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},r.prototype._createTextTag=function(){var e=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqText},r.prototype._createRightTag=function(){var e=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqRight},r.prototype._createSubmenuTag=function(){var e=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqSubmenu},r.prototype._iconTagAttributes=function(){var e={},t=[];return this.action&&(this.action.icon?(t.push("icon"),
t.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(t.push("icon"),this.action.checked?(t.push("checked-icon"),e.html=i(195)):t.push("unchecked-icon")):t.push("spacer")),e.class=t.join(" "),e},r.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},r.prototype.highlight=function(e){e?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(e?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},r.prototype._rightTagAttributes=function(){var e={},t=["right"];return this.action&&this.action.shortcut&&(t.push("shortcut"),e.class=t.join(" "),e.html=this.action.shortcut),e},r.prototype._submenuTagAttributes=function(){var e={};return this.action&&this.action.hasSubActions()?e.class="submenu-arrow":e.class="context-menu spacer",e},r.prototype.render=function(){var e,t;return this._createRow(),e=this._createIconTag(),this.jqRow.append(c?this._createSubmenuTag():e),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(c?e:this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback(),t=this,this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},r.prototype._createRow=function(){var e,t,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),e=this,this.action&&!this.action.hasSubActions()&&(t=function(e){e.destroy(),e._parentMenuItem&&t(e._parentMenuItem._parentMenu)},this.jqRow.click(function(i){t(e._parentMenu)}))},r.prototype.showSubmenu=function(e){var t,n;this._parentMenu.closeOtherSubmenus(this),this.action&&!this.action.hasSubActions()||(this._menu||(t=i(88),n={},this._menu=t.createMenu(this.action.subActions,n,this)),e.pageX=this._parentMenu.jqMenu.width()-2,e.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(e,this._parentMenu.jqMenu))},r.prototype._rowTagAttributes=function(){var e=[];return this.action&&(!1===this.action.enabled&&e.push("disabled"),!1===this.action.visible&&e.push("hidden"),this.action.font&&e.push("font_"+this.action.font),this.action.hasSubActions()&&e.push("has_submenu"),this.action.htmlclass&&e.push(this.action.htmlclass)),{class:e.join(" ")}},r.prototype.appendCallback=function(){var e=this;this.jqRow.click(function(t){e.action.enabled&&e.action.executeCallback(t)})},r.prototype.getTopLevelMenu=function(){return n(this)},s.prototype.render=function(e){this._createRow();var t=this;return this.action.deferred.then(function(n){var o,r,s,a=i(288);for(o in n)r=n[o],s=t._parentMenu.addItem(r),a.renderItem(e,s)}).always(function(){t.jqRow.hide()}),this.jqRow},s.prototype._createIconTag=function(){var e=this._iconTagAttributes()
;return this.jqIcon=l.create(a.ICON_CELL_TAG,e),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createRow=function(){var e=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,e),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},s.prototype._rowTagAttributes=function(){var e=[];return this.action&&e.push("spinner"),{class:e.join(" ")}},s.prototype.highlight=function(e){},s.prototype._iconTagAttributes=function(){var e={},t=[];return t.push("spacer"),e.class=t.join(" "),e.colspan="10",e},t.Item=r,t.ItemPlaceholder=s},function(e,t,i){"use strict";function n(e){var t,i;return e.getClientRects().length?(t=e.getBoundingClientRect(),"fixed"===getComputedStyle(e).position?{top:t.top,left:t.left}:(i=e.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset})):{top:0,left:0}}function o(e,t){var i,o,a,l,c,h,u=getComputedStyle(e),d=u.position;"static"===d&&(e.style.position="relative"),i=n(e),o=u.top,a=u.left,l=0,c=0,"absolute"!==d&&"fixed"!==d||"auto"!==o&&"auto"!==a?(o&&(l=parseFloat(o)),a&&(c=parseFloat(a))):(h=r(e),l=h.top,c=h.left),Object(s.isNumber)(t.top)&&(e.style.top=t.top-i.top+l+"px"),Object(s.isNumber)(t.left)&&(e.style.left=t.left-i.left+c+"px")}function r(e){var t=e.ownerDocument,i=e.offsetParent||t.documentElement,o=n(e),r=n(i);return{top:o.top-r.top,left:o.left-r.left}}var s;Object.defineProperty(t,"__esModule",{value:!0}),t.getOffset=n,t.setOffset=o,t.getPosition=r,s=i(83),i.n(s)},function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this.reset(e,t,i,n)}var o=i(116).makeFont,r=i(115),s=t.enabled("charting_library_debug_mode");n.prototype.maxCount=200,n.prototype.reset=function(e,t,i,n){this._textWidthCache=new r(this.maxCount),this._fontSize=e,this._color=n,this._font=o(e,t,i),this._keys=[],this._hash={}},n.prototype.paintTo=function(e,t,i,n,o){var r=this.getLabelImage(e,t);"left"!==o&&(i-=r.textWidth),n-=Math.floor(r.height/2),e.drawImage(r.canvas,i,n)},n.prototype.getLabelImage=function(e,t){var i,n,o,r,a;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._keys.length>=this.maxCount&&(n=this._keys.shift(),delete this._hash[n]),i={text:t,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},o=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(e,t)),i.textWidth=Math.round(Math.max(1,a)),i.width=Math.round(a+2*o),i.height=this._fontSize+2*o,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,e=i.canvas.getContext("2d"),e.font=this._font,e.fillStyle=this._color,e.fillText(t,0,i.height-o-r)),i},e.exports=n}).call(t,i(5))},function(e,t,i){"use strict";function n(e,t,i){return void 0===i&&(i="promise rejected by time-out"),new Promise(function(n,o){var r=setTimeout(function(){return o(i)},t);e.then(function(e){clearTimeout(r),n(e)}),e.catch(function(e){clearTimeout(r),o(e)})})}
Object.defineProperty(t,"__esModule",{value:!0}),t.makeTimeLimited=n},function(e,t,i){"use strict";function n(e,t,i){this.chart=e,this.paneA=e.paneWidgets()[t],this.paneB=e.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(n.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),this._mouseEventHandler=new r(this.handle,this,!0)}var o,r;i(642),o=i(50).clamp,r=i(110).MouseEventHandler,n.prototype.destroy=function(){this._mouseEventHandler.destroy(),this.jqRow.remove()},n.HEIGHT=1,n.prototype.hide=function(){this.jqRow.addClass("js-hidden")},n.prototype.show=function(){this.jqRow.removeClass("js-hidden")},n.prototype.mouseDownEvent=function(e){(0===e.button||Modernizr.touch)&&(this.startY=e.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n,r;(0===e.button||Modernizr.touch)&&(e.preventDefault(),this.deltaY=e.pageY-this.startY,t=this.paneA.size.h,i=o(t+this.deltaY,this.minPaneHeight,this.maxPaneHeight),n=i*this.pixelStretchFactor,r=this.totalStretch-n,this.paneA.setStretchFactor(n),this.paneB.setStretchFactor(r),this.chart._adjustSize(),this.paneA.size.h!==t&&(this.startY=e.pageY),this.chart.paint())},n.prototype.mouseUpEvent=function(e){(0===e.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},n.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},n.prototype.paint=function(){},n.prototype.image=function(){var e={},t=n.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,o=this.paneA.size.w,r=this.paneA.rhsPriceAxisWidget.size.w,s=$('<canvas width="'+i+'" height="'+t+'">')[0],a=s.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,t),e.leftAxis={content:s.toDataURL(),contentWidth:i,contentHeight:t},s=$('<canvas width="'+o+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,o,t),e.content=s.toDataURL(),e.contentWidth=o,e.contentHeight=t,s=$('<canvas width="'+r+'" height="'+t+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,r,t),e.rightAxis={content:s.toDataURL(),contentWidth:r,
contentHeight:t},e},e.exports=n},function(e,t){},function(e,t,i){"use strict";function n(e,t,n,r,s,a,l,c,h){var u=i(644).ChartUndoModel,d=new u(e,t,n,r,s,a,l,c,h);return d.model().invalidate(new o(o.FULL_UPDATE)),d}var o=i(18),r=i(26);TradingView.MAMetaInfo=function(){return new r({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var e={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new r(e)},TradingView.DMMetaInfo=function(){return new r({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new r({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},e.exports=n},function(e,t,i){"use strict";(function(e){function n(t,i,n,o,r,s,a,l,c){this._chartWidget=s,this.m_model=new z(t,i,n,o,r,this,l,c),this.m_zoomStack=new oe,this.undoHistory=a,this._onRearrangePanes=new e,this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this._currentCustomMoveSource=null,this._currentLineMoveCommand=null,this.beginUndoMacro=a.beginUndoMacro.bind(a),this.endUndoMacro=a.endUndoMacro.bind(a),this.createUndoCheckpoint=a.createUndoCheckpoint.bind(a),this.undoToCheckpoint=a.undoToCheckpoint.bind(a)}function o(e,t,i,n){re.call(this,i),this._targetObj=e,this._newValue=t,this._model=n}function r(e,t,i,n){re.call(this,i),this._priceScale=t,this._newMode=e,this._model=n}function s(e,t,i,n){re.call(this,i),this._property=e,this._newValue=t,this._model=n,this._priceScale=this._model.mainSeries().priceScale()}function a(e,t,i,n){re.call(this,"scale price",!1),this.m_model=e,this.m_pane=t,this.m_priceScale=i,this.m_state=n,this.m_newPriceScaleState=null}function l(e,t,i){re.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=e,this.m_state=t,this.m_newTimeScaleState=null}function c(e,t,i,n){this._model=e,this._series=t,this._oldSymbol=t.symbol(),this._oldInterval=t.interval(),this._symbol=i,this._interval=n}function h(e,t,i,n,o){re.call(this,"Insert "+t.id),this._model=e,this._studyMetaInfo=t,this._props=i,this._isOverlay=n,this._parentSource=o,this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible()}function u(e,t){re.call(this,"Remove Source"),
this._model=e,this._sourceId=t.id()}function d(e,t){re.call(this,"Remove Drawing(s)"),this._model=e,this._linetools=t,this._statesByPaneIndexes={}}function p(e,t,i,n){this._model=e,this._oldPane=this._model.paneForSource(t),re.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=t.id(),this._oldPaneIndex=e.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(t.priceScale()),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),this._pane=i,this._paneIndex=e.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(n):this._paneIndex=e.panes().length}function _(e,t,i){this._model=e,this._sourceId=t.id(),this._oldShowLeftScale=e.isLeftPriceScaleVisible(),this._oldShowRightScale=e.isRightPriceScaleVisible(),re.call(this,i)}function f(e,t){_.call(this,e,t,"Merge Up"),this._mergeRedoFn=this._model.mergeSourceUp,this._mergeUndoFn=this._model.unmergeSourceDown}function m(e,t){_.call(this,e,t,"Merge Down"),this._mergeRedoFn=this._model.mergeSourceDown,this._mergeUndoFn=this._model.unmergeSourceUp}function y(e,t){_.call(this,e,t,"Unmerge Up"),this._mergeRedoFn=this._model.unmergeSourceUp,this._mergeUndoFn=this._model.mergeSourceDown}function g(e,t){_.call(this,e,t,"Unmerge Down"),this._mergeRedoFn=this._model.unmergeSourceDown,this._mergeUndoFn=this._model.mergeSourceUp}function v(e,t,i){re.call(this,"Create line "+i,!1),this._model=e,this._paneIndex=e.panes().indexOf(t),this._lineTool=i}function S(e,t,i,n){re.call(this,"Move Drawing",!1),this._model=e,this._sourceId=t.id(),this._origPoint=i instanceof F?i.clone():TradingView.clone(i),this._pointIndex=n}function b(e,t,i){re.call(this,"Change %1 Z order (%2)".format(t.title(),i>0?"Forward":"Backward")),this._model=e,this._sourceId=t.id(),this._shift=i}function w(e,t){re.call(this,"Send "+t.title()+" to back"),this._model=e,this._sourceId=t.id()}function P(e,t){re.call(this,"Bring "+t.title()+" to front"),this._model=e,this._sourceId=t.id()}function T(e,t,i){re.call(this,"Remove pane"),this._model=e,this._index=t,this._pane=this._model.panes()[t],this._chart=i}function x(e,t,i,n){re.call(this,"Rearrange panes"),this._model=e,this._index=t,this._direction=i,this._chart=n}function C(e,t,i,n,o,r){re.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=o,this._pane=r}function L(e,t,i){re.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function I(e,t,i,n,o){re.call(this,"",!1),this._model=e,this._paneA=t,this._paneB=i,this._prevStretchA=n,this._currStretchA=o}function A(e,t){re.call(this,"Restore Defaults"),this._model=e,this._defaultProperty=t,this._state=t.state(t._exclusions),this._chartWidget=e._undoModel._chartWidget}function k(e,t){re.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(e){
t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor}),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=$.extend(!0,{},this._newSeriesProps,t.mainSourceProperties),this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.properties().state().mainSeriesProperties}function E(e,t,i,n){var o;n=n||"",o=n+" Study template",re.call(this,o),this._model=e,this._oldProps=t,this._newProps=i,this._oldShowLeftScale=e.model().isLeftPriceScaleVisible(),this._oldShowRightScale=e.model().isRightPriceScaleVisible(),this._newSourcesPriceScalesNames=[]}function M(e,t,i,n,o){re.call(this,e),this._property=t,this._value=i,this._forceSetProperty=o,this._prevValue=t.value(),this._cw=n}function V(e,t){var i,n,o,r,s=t.priceScale(),a=[],l=t.firstValue();for(i=0;i<e.length;i++)n={offset:e[i].offset,time_t:e[i].time_t},o=e[i].price,r=s.priceToCoordinate(o,l),r-=40,o=s.coordinateToPrice(r,l),n.price=o,a.push(n);return a}function D(e,t,i){re.call(this,"clone "+t.title()),this._model=e,this._originalSource=t,this._withoutShift=i}function O(e,t){re.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}function R(e,t,i){re.call(this,"Paste Drawing"),this._model=e,this._clipboardData=t,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function B(e,t){re.call(this,"Paste Indicator"),this._model=e,this._clipboardData=t}function N(e,t){re.call(this,"Move",!1),this._origPoint=e.clone(),this._point=null,this._handler=t}
var F=i(6).Point,W=i(73).createLineTool,H=i(0).LineDataSource,j=i(5),z=i(120),U=i(32),q=i(18),Y=i(194).doAnimate,G=i(301),K=i(3),Z=K.saveDefaultProperties,J=i(182),X=i(63).Series,Q=i(34),ee=Q.Study,te=i(124),ie=i(33),ne=i(292).showTooManyStudiesNotice,oe=i(293).UndoStack,re=i(43).UndoCommand,se=i(645).SaveLineToolStateUndoCommand,ae=i(646).ApplyLineToolTemplateUndoCommand,le=i(647).SetChartStyleCommand,ce=i(648).SetResolutionUndoCommand,he=i(42).preparePriceAxisProperties,ue=i(294).RestoreFactoryDefaultsUndoCommand,de=i(294).RestoreUserDefaultsUndoCommand,pe=i(42).getChartStyleByResolution,_e=i(4).getLogger("Chart.ChartUndoModel");inherit(n,G),n.prototype.version=function(){return this.m_model._version},n.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},n.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},n.prototype.createPane=function(e){return this.m_model.createPane(e)},n.prototype.dumpViews=function(){return this.m_model.dumpViews()},n.prototype.readOnly=function(){return this.m_model.readOnly()},n.prototype.restart=function(){this.m_model.restart()},n.prototype.disconnect=function(){this.m_model.disconnect()},n.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},n.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},n.prototype.chartModel=function(){return this.m_model},n.prototype.pushUndoCommand=function(e){this.undoHistory.pushUndoCommand(e)},n.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},n.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},n.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},n.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},n.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new a(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},n.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},n.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},n.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new a(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},n.prototype.startScaleTime=function(e){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(e)},n.prototype.scaleTimeTo=function(e){this.chartModel().scaleTimeTo(e)},
n.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},n.prototype.startScrollTime=function(e){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=e,this.chartModel().startScrollTime(e)},n.prototype.scrollTimeTo=function(e){this._initialTimeScrollPos&&Math.abs(e-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new l(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(e)},n.prototype.gotoTime=function(e,t){var i,n,o=this.timeScale().visibleBars();if(null===o)return $.Deferred().reject().promise();i=o.firstBar(),n=this.m_model.timeScale().state(),this.chartModel().gotoTime(e,t),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new l(this.m_model,n,"scroll time"))},n.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},n.prototype.resetTimeScale=function(){this.pushUndoCommand(new l(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},n.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},n.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},n.prototype.setWidth=function(e){this.m_model.setWidth(e)},n.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},n.prototype.gridSource=function(){return this.m_model.gridSource()},n.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},n.prototype.brandingSource=function(){return this.m_model.brandingSource()},n.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},n.prototype.alertsSources=function(){return this.m_model.alertsSources()},n.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},n.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},n.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},n.prototype.model=function(){return this.m_model},n.prototype.chartWidget=function(){return this._chartWidget},n.prototype.mainSeries=function(){return this.m_model.m_mainSeries},n.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},n.prototype.mainSeriesPriceScaleNameProperty=function(){return this.m_model.mainSeriesPriceScaleNameProperty()},n.prototype.panes=function(){return this.m_model.m_panes},n.prototype.timeScale=function(){return this.m_model.timeScale()},n.prototype.setSelectedSource=function(e,t){this.m_model.setSelectedSource(e,t)},n.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},n.prototype.selectedSource=function(){return this.m_model.selectedSource()},n.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},n.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},n.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},
n.prototype.invalidate=function(e){this.m_model.invalidate(e)},n.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},n.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},n.prototype.modifySeries=function(e,t,i){var n=new c(this.m_model,e,t,i);this.pushUndoCommand(n)},n.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},n.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof ee;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||void(n||ne())},n.prototype._insertStudy=function(e,t,i,n){var o=new h(this.m_model,e,t,i,n);return this.pushUndoCommand(o),o.insertedStudy()},n.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},n.prototype.insertStudy=function(e,t,i,n){if(this.checkIfFeatureAvailable(e,n))return this._insertStudy(e,t,i,n)},n.prototype.setProperty=function(e,t,i){if(e&&e.value()!==t){var n=new o(e,t,i,this.m_model);this.pushUndoCommand(n),this.emitEvent("setProperty")}},n.prototype.setPriceScaleMode=function(e,t,i){var n,o,s=Object.keys(e),a=t.mode(),l=!1;for(n=0;n<s.length;n++)if(a[s[n]]!==e[s[n]]){l=!0;break}l&&(o=new r(e,t,i,this.m_model),this.pushUndoCommand(o))},n.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var n=new le(e,t,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(n),this.emitEvent("setChartStyleProperty")}},n.prototype.setScaleRatioProperty=function(e,t,i){if(e.value()!==t){var n=new s(e,t,i,this.m_model);this.pushUndoCommand(n)}},n.prototype.setScreenChartProperty=function(e,t,i,n,o){if(o||e.value()!==t){var r=new M(n,e,t,i,o);this.pushUndoCommand(r)}},n.prototype.setResolutionProperty=function(e,t,i,n){if(e.value()!==t){var o=new ce(e,t,i,n);this.pushUndoCommand(o)}},n.prototype._getSourcesTree=function(e){var t,i=[],n=this.m_model.children(e);for(t=0;t<n.length;t++)i=i.concat(this._getSourcesTree(n[t]));return i.push(e),i},n.prototype.removeSource=function(e,t){var i,n,o;if(e.isUserDeletable()){if(i=this._getSourcesTree(e),this.lineBeingCreated()===e)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),n=0;n<i.length;++n)o=new u(this.m_model,i[n]),this.pushUndoCommand(o);this.endUndoMacro()}t||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},n.prototype.removeSelectedSource=function(){var e,t=this.m_model.selectedSource();t&&t.isUserDeletable()&&(this.setSelectedSource(null),e=new u(this.m_model,t),this.pushUndoCommand(e),this.emitEvent("removeSource",[t]))},n.prototype.removeLineTools=function(e){var t,i,n=this.lineBeingCreated();n&&-1!==(t=e.indexOf(n))&&(this.cancelCreatingLine(),e.splice(t,1)),i=new d(this.m_model,e),this.pushUndoCommand(i),this.emitEvent("removeSources",[e])},n.prototype.move=function(e,t,i){var n=new p(this.m_model,e,t,i);this.pushUndoCommand(n),this.emitEvent("moveSource",[e])},n.prototype.mergeSourceUp=function(e){
var t=new f(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceUp",[e])},n.prototype.mergeSourceDown=function(e){var t=new m(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("mergeSourceDown",[e])},n.prototype.unmergeSourceUp=function(e){var t=new y(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceUp",[e])},n.prototype.unmergeSourceDown=function(e){var t=new g(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("unmergeSourceDown",[e])},n.prototype.createLineTool=function(e,t,i,n,o){var r,s;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new v(this.m_model,e,i),r=this._createLineCommand.startCreatingLine(t,n,o),s=this._createLineCommand.line(),r&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),s):void ne()},n.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},n.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},n.prototype.coninueCreatingLine=function(e,t,i){var n=this._createLineCommand.continueCreatingLine(e,t,i);return n&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),n},n.prototype.finishLineTool=function(e){this.m_model.finishLineTool(e)},n.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},n.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},n.prototype.startChangingLinetool=function(e,t,i,n){this._currentLineChangeCommand=new se(this.m_model,e,"Change "+i+"point",!1),this.m_model.startChangingLinetool(e,t,i,n)},n.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},n.prototype.changeLinePoint=function(e,t){this.m_model.changeLinePoint(e,t)},n.prototype.endChangingLinetool=function(e){this.m_model.endChangingLinetool(e),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},n.prototype.startMovingSource=function(e,t,i){e.doesMovingAffectsUndo()&&(this._currentLineMoveCommand=new S(this.m_model,e,t,i)),this.m_model.startMovingSource(e,t,i)},n.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},n.prototype.moveSource=function(e){null!==this._currentLineMoveCommand&&this._currentLineMoveCommand.setPoint(e),this.m_model.moveSource(e)},n.prototype.endMovingSource=function(e){this.m_model.endMovingSource(e),null!==this._currentLineMoveCommand&&this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null),this._currentLineMoveCommand=null},n.prototype.dataSources=function(){return this.m_model.dataSources()},n.prototype.orderedDataSources=function(e){return this.m_model.orderedDataSources(e)},n.prototype.dataSourceForId=function(e){return this.m_model.dataSourceForId(e)},n.prototype.state=function(e,t){return this.m_model.state(e,t)},n.prototype.asyncState=function(e){return this.m_model.asyncState(e)},n.prototype.restoreState=function(e,t){return this.m_model.restoreState(e,t)},n.prototype.calculateDefaultTags=function(){
return this.m_model.calculateDefaultTags()},n.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},n.prototype.changeZOrder=function(e,t){var i=new b(this.m_model,e,t);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[e,t])},n.prototype.sendToBack=function(e){var t=new w(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.bringToFront=function(e){var t=new P(this.m_model,e);this.pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},n.prototype.removeAllStudies=function(){var e,t,i;for(this.beginUndoMacro("remove all studies"),e=this.m_model.dataSources(),t=0;t<e.length;t++)i=e[t],(TradingView.isInherited(i.constructor,ee)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,te))&&this.removeSource(i);this.endUndoMacro()},n.prototype.removeAllDrawingTools=function(e){var t,i,n;for(this.beginUndoMacro("remove all drawing tools"),this.lineBeingCreated()&&this.cancelCreatingLine(),t=this.m_model.dataSources(),i=0;i<t.length;i++)n=t[i],TradingView.isInherited(n.constructor,H)&&n.isActualSymbol()&&n.isUserDeletable()&&(e&&e!==n._constructor||this.removeSource(n));this.endUndoMacro()},n.prototype.unlinkLine=function(e){var t=new O(this.m_model,e);this.pushUndoCommand(t)},n.prototype.copyToOtherCharts=function(e){this.m_model.copyToOtherCharts(e)},n.prototype.moveLeft=function(){var e,t;try{this.beginUndoMacro("Move Left")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(e),t.scrollTimeTo(0),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.moveRight=function(){var e,t;try{this.beginUndoMacro("Move Right")}catch(e){return}e=this.m_model.timeScale().width(),t=this,Y({to:e/5,onStep:function(e){t.startScrollTime(0),t.scrollTimeTo(e),t.endScrollTime()},onComplete:function(){t.endUndoMacro()}})},n.prototype.scrollChart=function(e){j.enabled("chart_scroll")&&(this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime())},n.prototype.scrollChartByBar=function(e){if(j.enabled("chart_scroll")){var t=e*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime()}},n.prototype.zoomIn=function(e,t){var i,n,o=this.m_model.timeScale().width(),r=this;if(t=t||1,this.canZoomIn())if(e)i=t*o/10,n=i*((e+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-n),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(e){return}Y({to:o/5,onStep:function(e){r.startScaleTime(e),r.scaleTimeTo(0),r.endScaleTime()},onComplete:function(){r.endUndoMacro(),r._onSimpleZoomIn.fire()}})}},n.prototype.zoomOut=function(e,t){var i=this.m_model.timeScale().width(),n=this;if(t=t||1,this.canZoomOut())if(e)this.startScaleTime(0),this.scaleTimeTo(t*i/10),this.endScaleTime(),this.startScrollTime(t*(i/20-i/20*e)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(e){return}Y({to:i/5,
onStep:function(e){n.startScaleTime(0),n.scaleTimeTo(e),n.endScaleTime()},onComplete:function(){n.endUndoMacro(),n._onSimpleZoomOut.fire()}})}},n.prototype.resetScales=function(){var e,t;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),e=0;e<this.panes().length;e++)t=this.panes()[e],this.resetPriceScale(t,t.leftPriceScale()),this.resetPriceScale(t,t.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},n.prototype.zoomToViewport=function(e,t,i,n,o){var r=new C(this.m_model,e,t,i,n,o),s=new L(r,this.m_zoomStack,!0);this.pushUndoCommand(s)},n.prototype.zoomFromViewport=function(){var e=new L(this.m_zoomStack.head(),this.m_zoomStack,!1);this.pushUndoCommand(e)},n.prototype.zoomStack=function(){return this.m_zoomStack},n.prototype.addPaneStretchFactorUndoCommand=function(e,t,i,n){var o=new I(this.m_model,e,t,i,n);this.pushUndoCommand(o)},n.prototype.restoreFactoryDefaults=function(e){var t=new ue(this.m_model,e);this.pushUndoCommand(t)},n.prototype.restoreDefaults=function(e){var t=new de(this.m_model,e);this.pushUndoCommand(t)},n.prototype.chartLoadTheme=function(e,t){var i=new k(e,t);this.pushUndoCommand(i)},n.prototype.applyLineToolTemplate=function(e,t,i){this.beginUndoMacro(i),this.saveLineToolState(e,i);var n=new ae(e,t,i);this.pushUndoCommand(n),this.saveLineToolState(e,i),this.endUndoMacro(),this.model().updateSource(e)},n.prototype.restoreLineToolFactoryDefaults=function(e,t){this.beginUndoMacro(t),this.saveLineToolState(e,t),e.restoreFactoryDefaults(),this.saveLineToolState(e,t),this.endUndoMacro()},n.prototype.studyLoadTemplate=function(e,t,i,n){var o=new E(e,t,i,n);this.pushUndoCommand(o)},n.prototype.onRearrangePanes=function(){return this._onRearrangePanes},n.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},n.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},n.prototype.loadRange=function(e){e.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(e.val),this.setProperty(this.m_model.mainSeries().properties().interval,e.res,"Change date range")):this.m_model.mainSeries().loadDataTo(e.val)},n.prototype.cloneLineTool=function(e,t){var i=new D(this.m_model,e,t);return this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},n.prototype.alertsList=function(){return this.m_model.alertsList()},n.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},n.prototype.insertStudyStub=function(e){return this.m_model.insertStudyStub(e)},n.prototype.removeStudyStub=function(e){return this.m_model.removeStudyStub(e)},n.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},n.prototype.copySourceToClip=function(e){if(e&&!e.properties().blockCopying){var t={};if(e instanceof H)t.type="drawing",t.geometry=e.geometry();else{if(!(e instanceof ee))return!1;t.type="study"}return t.source=e.state&&e.state(),(delete t.source.alertId,delete t.source.linkKey,t.source)?(t.title=e.title&&e.title(),t.modelId=this.m_model._id,J.set(t),!0):!1}},
n.prototype.cutSourceToClip=function(e){if(!this.copySourceToClip(e))return!1;this.removeSource(e)},n.prototype.pasteLineTool=function(e,t){var i=new R(this.m_model,t,e);this.pushUndoCommand(i)},n.prototype.pasteStudy=function(e){var t=new B(this.m_model,e);this.pushUndoCommand(t)},n.prototype.pasteSourceFromClip=function(e,t){var i=J.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(e,i),"study"===i.type&&this.checkIfFeatureAvailable(i.state)&&this.pasteStudy(i)},n.prototype.trackTime=function(){return this._chartWidget.trackTime()},n.prototype.isInReplay=function(){return this.m_model.isInReplay()},n.prototype.switchToReplay=function(e){},n.prototype.switchToRealtime=function(){},n.prototype.startCustomMoving=function(e,t,i){this._currentCustomMoveCommand=new N(t,i),this._currentCustomMoveSource=e},n.prototype.customMoveBeingProcessed=function(){return null!==this._currentCustomMoveSource},n.prototype.processCustomMove=function(e){this._currentCustomMoveCommand.setPoint(e)},n.prototype.endCustomMoving=function(){null!==this._currentCustomMoveCommand.point()&&(this.pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null,this._currentCustomMoveSource=null)},n.prototype.saveLineToolState=function(e,t){this.pushUndoCommand(new se(this.m_model,e,t))},inherit(o,re),o.prototype.redo=function(){this._oldValue=this._targetObj.value(),Z(!0),this._targetObj.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},o.prototype.undo=function(){Z(!0),this._targetObj.setValue(this._oldValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(r,re),r.prototype.redo=function(){this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode(this._newMode),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},r.prototype.undo=function(){Z(!0),this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(s,re),s.prototype.redo=function(){this._oldValue=this._property.value(),this._oldMode=this._priceScale.mode(),Z(!0),this._priceScale.setMode({autoScale:!1,percentage:!1,log:!1}),this._property.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},s.prototype.undo=function(){Z(!0),this._property.setValue(this._oldValue),this._priceScale.setMode(this._oldMode),Z(!1),this._oldMode=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(a,re),a.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state)},a.prototype.redo=function(){
if(null===this.m_newPriceScaleState)return void _e.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(l,re),l.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state)},l.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void _e.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(c,re),c.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},c.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(h,re),h.prototype.redo=function(){var e,t,i=null;return this._studyState?(i=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==i.id()&&_e.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(i=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=i.id()),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0),i},h.prototype.insertedStudy=function(){return this._model.dataSourceForId(this._studyId)},h.prototype.undo=function(){var e,t=this.insertedStudy();this._studyState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._paneState=e.state(),this._restorePane=this._model.removeSource(t),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(u,re),u.prototype.redo=function(){var e,t=this._model.dataSourceForId(this._sourceId);this._sourceState=t.state(),e=this._model.paneForSource(t),this._paneIndex=this._model.panes().indexOf(e),this._priceScaleName=e.priceScaleName(t.priceScale()),this._paneState=e.state(),this._restorePane=this._model.removeSource(t)},u.prototype.undo=function(){var e=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==e.id()&&_e.logError("Source was restored improperly - source ids does not match")},inherit(d,re),d.prototype.redo=function(){var e,t,i;for(e=0;e<this._linetools.length;e++)t=this._model.paneForSource(this._linetools[e]),i=this._model.panes().indexOf(t),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[e].state(),owner:this._linetools[e].ownerSource().id()}),t.removeDataSource(this._linetools[e]);delete this._linetools},d.prototype.undo=function(){var e,t,i,n,o,r,s;this._linetools=[]
;for(e in this._statesByPaneIndexes)for(t=this._model.panes()[e],i=this._statesByPaneIndexes[e],n=0;n<i.length;n++)o=i[n],r=this._model.dataSourceForId(o.owner),s=t._restoreLineTool(o.state),s.setOwnerSource(r),s.updateAllViews(),this._linetools.push(s);this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(p,re),p.prototype.redo=function(){var e,t;-1===this._model.panes().indexOf(this._pane)&&(this._pane=this._model.createPane(this._paneIndex)),e=this._model.dataSourceForId(this._sourceId),this._model.move(e,this._pane,this._pane.priceScaleByName(this._scaleName)),t=this._pane.priceScaleName(e.priceScale()),this._model.setPriceScaleVisibility(t,!0)},p.prototype.undo=function(){-1===this._model.panes().indexOf(this._oldPane)&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName)),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(_,re),_.prototype.redo=function(){var e,t,i=this._model.dataSourceForId(this._sourceId);this._mergeRedoFn.call(this._model,i),e=this._model.paneForSource(i),t=e.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(t,!0)},_.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._mergeUndoFn.call(this._model,e),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(f,_),inherit(m,_),inherit(y,_),inherit(g,_),inherit(v,re),v.prototype.startCreatingLine=function(e,t,i){var n,o;return this._points=[{point:e}],n=this._model.panes()[this._paneIndex],o=this._model.createLineTool(n,e,this._lineTool,t,i),this._lineId=o.id(),!this._model.lineBeingCreated()},v.prototype.continueCreatingLine=function(e,t,i){return this._points||_e.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:e,envState:t}),this._model.coninueCreatingLine(e,t,i)},v.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},v.prototype.undo=function(){var e=this.line();e&&(this._lineState=e.state(),this._model.removeSource(e),delete this._lineId)},v.prototype.redo=function(){this._lineState||_e.logError("This command was never undone - nothing to redo");var e=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=e.id(),delete this._lineState},inherit(S,re),S.prototype.setPoint=function(e){this._point=e instanceof F?e.clone():TradingView.clone(e)},S.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},S.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(e,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(b,re),b.prototype.undo=function(){
var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,-this._shift)},b.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(e,this._shift)};inherit(w,re),w.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},w.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},inherit(P,re),P.prototype.undo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(e)},P.prototype.redo=function(){var e=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(e)},n.prototype.removePane=function(e,t){var i=new T(this,t,e);this.pushUndoCommand(i)},inherit(T,re),T.prototype.redo=function(){this._model.panes().splice(this._index,1),this._chart._updateGui()},T.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},n.prototype.rearrangePanes=function(e,t,i){var n=new x(this,t,i,e);this.pushUndoCommand(n),this._onRearrangePanes.fire()},inherit(x,re),x.prototype.redo=function(){var e=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,e)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},x.prototype.undo=function(){var e;"up"===this._direction&&(e=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,e)),"down"===this._direction&&(e=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),this._model.panes().splice(this._index,0,e)),this._model.invalidate(new q(q.FULL_UPDATE))},inherit(C,re),C.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},C.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(L,re),L.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},L.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void _e.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(I,re),I.prototype.redo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,
this._paneB._stretchFactor=e-this._currStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},I.prototype.undo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=e-this._prevStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},inherit(A,re),A.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty)},A.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged()},inherit(k,re),k.prototype._merge=function(e,t){var i=this._model;Z(!0),e&&(i.properties().paneProperties.mergeAndFire(e.paneProperties),i.properties().scalesProperties.mergeAndFire(e.scalesProperties),i.properties().symbolWatermarkProperties.mergeAndFire(e.symbolWatermarkProperties)),i.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),i.mainSeries().setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,i.mainSeries().properties().mergeAndFire(t),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=t.version,i.recalculateAllPanes(),i.invalidate(new q(q.FULL_UPDATE)),i.properties().saveDefaults(),Z(!1)},k.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},k.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(E,re),E.prototype._merge=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_=this._model.model(),f=_.mainSeries();for(f.priceScale().properties().lockScale.setValue(!1),e.interval&&(t=pe(e.interval,f.properties().style.value()),f.setChartStyleWithIntervalIfNeeded(t,e.interval)),i=[],n=_.panes(),o=n.length;o--;)for(r=n[o],s=r.containsMainSeries(),a=r.dataSources(),l=a.length;l--;)c=a[l],(!s||c instanceof ee)&&(c.isRemovedByStudyTemplates()||i.push(c),_.removeSource(c));for(h=e.panes,function(e,t){return e.dataSources().some(function(e){return e.alert&&e.alert().id===t.alert.id})},o=0;o<h.length;o++){for(u=!1,d=h[o],l=0;l<d.sources.length;l++)c=d.sources[l],"MainSeries"===c.type&&(delete c.state,u=!0),-1!==d.leftAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("left")&&this._newSourcesPriceScalesNames.push("left"),-1!==d.rightAxisSources.indexOf(c.id)&&-1===this._newSourcesPriceScalesNames.indexOf("right")&&this._newSourcesPriceScalesNames.push("right");if(r=null,r=u?n[o]:_.createPane(o),r.restoreState(h[o],!1,e.version),u)for(p=0;p<i.length;p++)i[p].restore&&i[p].restore()}f.priceScale().setMode({autoScale:!0}),_._version=e.version,_.startNotStartedStudies(),_.recalculateAllPanes(),
_.invalidate(new q(q.FULL_UPDATE))},E.prototype.redo=function(){var e,t,i;for(this._merge(this._newProps),e=this._model.model(),e.mainSeries().onChartStyleChanged(),t=this._model.model().mainSeries().properties(),he(t),e._recalcVisibleRangeStudy(e.dataSources(),!0),i=0;i<this._newSourcesPriceScalesNames.length;i++)e.setPriceScaleVisibility(this._newSourcesPriceScalesNames[i],!0)},E.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged(),this._model.model().setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.model().setRightPriceScaleVisible(this._oldShowRightScale)},inherit(M,re),M.prototype.redo=function(){this._cw.screen.show(),this._property.setValue(this._value,this._forceSetProperty)},M.prototype.undo=function(){this._cw.screen.show(),this._property.setValue(this._prevValue,this._forceSetProperty)},inherit(D,re),D.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h;if(this._lineState)r=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(e=this._originalSource,t=e.priceScale(),i=this._model.paneForSource(e),n=TradingView.className(e.constructor),o=e.properties().clone(),r=W(n,this._model,o,null,e.ownerSource()),r.setOwnerSource(e.ownerSource()),r.properties().visible._value=!0,r._fixedPoints=r._fixedPoints.concat(e._fixedPoints),s=0;s<r._fixedPoints.length;s++)r._fixedPoints[s]=r._fixedPoints[s].add(new F(20,20));a=e._timePoint,l=this._withoutShift?TradingView.clone(a):V(a,e.ownerSource()),c=e._points,h=c,r.restorePoints(l,h),r.cloneData&&r.cloneData(e),i.addDataSource(r,t),this._model.updateSource(r),r.checkAlert&&r.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),U.drawOnAllCharts().value()&&this._model.copyToOtherCharts(r),this._lineState=r.state()}},D.prototype.undo=function(){this._lineState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(e)},D.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(O,re),O.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},O.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(R,re),R.prototype.redo=function(){var e,t,i,n,o,r,s,a,l,c,h=this._model.panes()[this._paneIndex],u=h.dataSourceForId(this._clipboardData.source.ownerSource)||h.mainDataSource();this._sourceState||(e=!0,t=this._clipboardData.source.state.symbol,i=h.mainDataSource(),n=i.symbol?i.symbol():"",o=t===n,o&&(u instanceof X&&(e=!1),u instanceof ee&&(e=!u.metaInfo().is_price_study)),r=TradingView.clone(this._clipboardData.source),delete r.state.symbol,e?(s=this._model,a=function(e){var t=e.x*s.timeScale().width(),i=e.y*u.priceScale().height();return new F(t,i)},l=u.firstValue(),r.points=this._clipboardData.geometry.map(function(e){var t=a(e),i=s.timeScale().coordinateToIndex(t.x),n=s.timeScale().normalizeBarIndex(i);return n.price=u.priceScale().coordinateToPrice(t.y,l),n
})):this._model._id===this._clipboardData.modelId&&u.id()===this._clipboardData.source.ownerSource&&(r.points=V(this._clipboardData.source.points,u)),r.id=ie.guid(),this._sourceState=r),c=h._restoreLineTool(this._sourceState,null,!1),c.calcIsActualSymbol(),c.setOwnerSource(u),c.setPriceScale(u.priceScale()),u.priceScale().addDataSource(c),c.createServerPoints(),this._model.invalidate(new q(q.LIGHT_UPDATE,!0))},R.prototype.undo=function(){var e,t;this._sourceState||_e.logError("This command was never executed - nothing to undo"),e=this._model.panes()[this._paneIndex],t=e.dataSourceForId(this._sourceState.id),this._model.removeSource(t)},inherit(B,re),B.prototype.redo=function(){var e,t,i,n;this._sourceState||(e=TradingView.clone(this._clipboardData.source),e.id=ie.guid(),this._sourceState=e),t=null,i=null,this._sourceState.metaInfo.is_price_study?(t=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(t=this._model.createPane(),i=t.defaultPriceScale()),n=t._restoreStudy(this._sourceState),n.start(),n.setPriceScale(i),t.move(n,i)},B.prototype.undo=function(){this._sourceState||_e.logError("This command was never executed - nothing to undo");var e=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(e)},inherit(N,re),N.prototype.setPoint=function(e){this._point=e.clone(),this._handler(e)},N.prototype.point=function(){return this._point},N.prototype.undo=function(){this._handler(this._origPoint)},N.prototype.redo=function(){this._handler(this._point)},t.ChartUndoModel=n}).call(t,i(8))},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SaveLineToolStateUndoCommand",function(){return s}),n=i(1),o=i(7),i.n(o),r=i(43),s=function(e){function t(t,i,n,o){void 0===o&&(o=!0);var r=e.call(this,n,o)||this;return r._model=t,r._savedState=i.state(!0),r}return n.c(t,e),t.prototype.redo=function(){this._toggleState()},t.prototype.undo=function(){this._toggleState()},t.prototype._getSource=function(){return Object(o.ensureNotNull)(this._model.dataSourceForId(this._savedState.id))},t.prototype._toggleState=function(){var e=this._getSource(),t=this._savedState;this._savedState=e.state(!0),this._model.restoreLineToolState(e,t)},t}(r.UndoCommand)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ApplyLineToolTemplateUndoCommand",function(){return r}),n=i(1),o=i(43),r=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._source=t,o._newState=i,o._oldState=t.properties().state(),o}return n.c(t,e),t.prototype.redo=function(){this._source.applyTemplate(this._newState)},t.prototype.undo=function(){this._source.applyTemplate(this._oldState)},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartStyleCommand",function(){return u}),n=i(1),o=i(43),r=i(3),i.n(r),s=i(42),a=i(62),l=i(18),c=i.n(l),h=i(61),u=function(e){function t(t,i,n,o,r,s){var a=e.call(this,o)||this;return a._prevPriceAxisProps={},
a._property=t,a._mainSeries=n,a._value=i,a._model=r,a._chartWidget=s,a}return n.c(t,e),t.prototype.redo=function(){var e,t,i,n=this._mainSeries,o=n.properties();o.style===this._property&&n.isNeedRestart(this._value)&&this._chartWidget.screen.show(),this._prevResolution=o.interval.value(),this._prevValue=this._property.value(),this._storePriceAxisProps(),Object(r.saveDefaultProperties)(!0),e=o.interval.value(),t=this._model.defaultResolutions(),i=Object(h.getResolutionByChartStyle)(this._value,e,t),a.linking.interval.setValue(i),n.setChartStyleWithIntervalIfNeeded(this._value,i),Object(s.setLastUsedStyle)(this._value),Object(s.preparePriceAxisProperties)(o),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype.undo=function(){var e=this._mainSeries;e.properties().style===this._property&&e.isNeedRestart(this._value)&&this._chartWidget.screen.show(),Object(r.saveDefaultProperties)(!0),e.setChartStyleWithIntervalIfNeeded(this._prevValue,this._prevResolution),this._restorePriceAxisProps(),a.linking.interval.setValue(this._prevResolution),Object(r.saveDefaultProperties)(!1),this._invalidateModel()},t.prototype._storePriceAxisProps=function(){var e=this._mainSeries.priceScale();this._prevPriceAxisProps=e.mode()},t.prototype._restorePriceAxisProps=function(){this._mainSeries.priceScale().setMode(this._prevPriceAxisProps)},t.prototype._invalidateModel=function(){this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new c.a(c.a.LIGHT_UPDATE)))},t}(o.UndoCommand)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetResolutionUndoCommand",function(){return l}),n=i(1),o=i(43),r=i(15),s=i(42),a=i(40),l=function(e){function t(t,i,n,o){var r=e.call(this,o)||this;return r._property=t,r._value=i,r._prevValue=t.value(),r._chartWidget=n,r}return n.c(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._property.setValue(this._value),this._handleResolution(this._value)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._property.setValue(this._prevValue),this._handleResolution(this._prevValue)},t.prototype._handleResolution=function(e){var t=this._chartWidget.model().mainSeries().properties(),i=t.style.value(),n=Object(s.isRangeStyle)(i),o=r.Interval.isRange(e);!n&&o?t.style.setValue(a.STYLE_RANGE):n&&!o&&t.style.setValue(Object(s.getLastUsedStyle)())},t}(o.UndoCommand)},function(e,t,i){"use strict";(function(e){function n(e,t){this._options=Object.assign({},b,t),this.chart=e,this._properties=e.properties().scalesProperties,this.contextMenu=null,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=f(this.jqLhsStub,new m(16,16)),
$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=f(this.jqRhsStub,new m(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=S.MINUTE_SPAN,this._mouseEventHandler=new y(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b;i(650),o=i(125).PriceAxisWidget,r=i(0).LineDataSource,s=i(115),a=i(41),l=a.ActionSeparator,c=i(88),h=i(18),u=i(81),d=u.resizeCanvas,p=u.hardResizeCanvas,_=u.clearRect,f=u.addCanvasTo,m=u.Size,y=i(110).MouseEventHandler,g=i(39).trackEvent,v=i(116).makeFont,S=i(161),b={contextMenuEnabled:!0,timezoneMenuEnabled:!0},n.prototype.destroy=function(){this._mouseEventHandler.destroy()},n.prototype._BORDER_SIZE=1,n.prototype._OFFSET_SIZE=1,n.prototype._TICK_LENGTH=3,n.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},n.prototype.lineColor=function(){return this._properties.lineColor.value()},n.prototype.textColor=function(){return this._properties.textColor.value()},n.prototype.fontSize=function(){return this._properties.fontSize.value()},n.prototype.baseFont=function(){return v(this.fontSize(),"Arial","")},n.prototype.baseBoldFont=function(){return v(this.fontSize(),"Arial","bold")},n.prototype.rendererOptions=function(){var e,t;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s}),e=this._rendererOptions,e.fontSize!==this.fontSize()&&(t=this.fontSize(),e.fontSize=t,
e.font=this.baseFont(),e.font=v(this.fontSize(),"'Trebuchet MS', Tahoma, Arial, sans-serif",""),e.paddingTop=Math.ceil(t/2.5),e.paddingBottom=e.paddingTop,e.paddingHorizontal=Math.ceil(t/2),e.baselineOffset=Math.round(this.fontSize()/5),e.widthCache.reset()),this._rendererOptions},n.prototype.updatePriceScalesVisibility=function(){var e=this.chart.properties().scalesProperties;e.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),e.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},n.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},n.prototype.mouseDownOutsideEvent=function(e){var t=this.chart.model();!t.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.pressedMouseMoveEvent=function(e){var t,i,n=this.chart.model();n.timeScale().isEmpty()||(t=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(t=!0),t||(n.scaleTimeTo(e.localX),this._lastScrollScaleTime=i))},n.prototype.mouseUpEvent=function(e){this._mousedown=!1;var t=this.chart.model();t.timeScale().isEmpty()||(t.endScaleTime(),this.restoreDefaultCursor())},n.prototype.contextMenuEvent=function(e,t){this._options.contextMenuEnabled&&this._createContextMenu().show(e)},n.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},n.prototype.getContextMenuActions=function(){var t,i,n=this.chart;return n.model().mainSeries().createSessStudy(),n.updateActions(),t=n.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],this._options.timezoneMenuEnabled||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},n.prototype.mouseClickEvent=function(e){},n.prototype.mouseDoubleClickEvent=function(e){g("GUI","Double click time scale"),this.chart.model().resetTimeScale()},n.prototype.optimalHeight=function(){var e=this.rendererOptions();return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.fontSize+e.paddingTop+e.paddingBottom)},n.prototype.setSize=function(e,t,i){this.size&&this.size.equals(e)||(this.lhsStubSize=t,d(this.lhsCanvas,t),this.jqLhsTimeAxisStub.width(t.w),this.jqLhsTimeAxisStub.height(t.h),this.rhsStubSize=i,d(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=e,d(this.canvas,e),d(this.top_canvas,e),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(e.w),this.jqCell.height(e.h))},n.prototype._spanIndex=function(e){
for(var t=[S.MINUTE_SPAN,S.HOUR_SPAN,S.DAY_SPAN,S.MONTH_SPAN,S.YEAR_SPAN],i=t.length-1;i>0;){if(t[i]<=e)return i;i--}return i},n.prototype._spanOffset=function(e,t){if(t<e)throw Error("actual span cuold not be less then base");return this._spanIndex(t)-this._spanIndex(e)},n.prototype.update=function(){var e,t;this.chart.model()&&(e=this.chart.model().timeScale().marks())&&(t=this,this._minVisibleSpan=S.YEAR_SPAN,$.each(e,function(){t._minVisibleSpan=Math.min(this.span,t._minVisibleSpan)}))},n.prototype._hightlightBackground=function(e,t){var i,n,o,r,s=this.chart.model(),a=s.timeScale(),l=t[0].index,c=t[0].index;for(i=1;i<t.length;i++)l=Math.min(l,t[i].index),c=Math.max(c,t[i].index);n=a.indexToCoordinate(l),o=a.indexToCoordinate(c),r="rgba(109, 158, 235, 0.3)",_(e,n,1,o-n,this.size.h-1,r)},n.prototype.drawBackground=function(e){var t,i,n,o,s;if(_(e,0,0,this.size.w,this.size.h,this.backgroundColor()),t=this.chart.model()){if(i=t.timeScale(),(n=t.model().selectedSource())&&n instanceof r&&!i.isEmpty()){if(o=n.axisPoints(),0===o.length)return;this._hightlightBackground(e,o)}s=t.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(e,s.measurePoints())}},n.prototype.drawBorder=function(e){e.save(),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),e.restore()},n.prototype.drawStubs=function(){var e,t=this._BORDER_SIZE,i=2*this._BORDER_SIZE,n=this.lhsCtx;_(n,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),n.fillStyle=this.lineColor(),n.fillRect(this.lhsStubSize.w-i-.5,.5,i,t),n.fillRect(this.lhsStubSize.w-i-.5,-.5,t,t),e=this.rhsCtx,_(e,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),e.fillStyle=this.lineColor(),e.fillRect(-.5,.5,i,t),e.fillRect(.5,-.5,t,t)},n.prototype.drawTickMarks=function(e){var t,i,n,o,r,s,a,l,c,h,u,d=this.chart.model().timeScale().marks();if(d&&0!==d.length){for(t=d.reduce(function(e,t){return e.span>t.span?e:t},d[0]).span,t>30&&t<40&&(t=30),e.save(),e.strokeStyle=this.lineColor(),i=this.rendererOptions(),n=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,e.textAlign="center",e.translate(.5,.5),e.fillStyle=this.lineColor(),e.beginPath(),o=d.length;o--;)e.rect(d[o].coord,i.borderSize,1,i.tickLength);for(e.fill(),e.fillStyle=this.textColor(),r={},s=this.baseFont(),a=this.baseBoldFont(),o=0;o<d.length;o++)l=d[o].span>=t?a:s,c=r[l]||[],c.push(d[o]),r[l]=c;for(h in r)for(e.setFont(h),u=r[h],o=0;o<u.length;o++)e.fillText(u[o].label,u[o].coord,n);e.restore()}},n.prototype.drawBackLabels=function(e){var t,i,n,o,r,s,a,l;for(e.save(),t=this.chart.model().dataSources(),i=this.chart.model(),n=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),o=this.rendererOptions(),r=0;r<t.length;r++)if((s=t[r])!==this.chart.model().crossHairSource()&&s!==n&&s.timeAxisViews&&(a=s.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(e,o);e.restore()},n.prototype.drawCrossHairLabel=function(e){var t,i,n,o,r;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),t=this.chart.model(),
i=t.sourceBeingMoved()||t.lineBeingEdited()||t.lineBeingCreated(),n=this.rendererOptions(),i){if(e.save(),i.timeAxisViews&&(o=i.timeAxisViews()))for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);return void e.restore()}if(e.save(),o=this.chart.model().crossHairSource().timeAxisView())for(r=0;r<o.length;r++)o[r].renderer().draw(e,n);e.restore()},o.prototype.hardResetCanvas=function(){this.size&&(p(this.canvas,this.size),p(this.top_canvas,this.size))},n.prototype.paint=function(e){if(0!==e)if(e===h.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var t=this.ctx;this.drawBackground(t),this.drawBorder(t),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(t),this.drawBackLabels(t),this.drawCrossHairLabel(this.top_ctx))}},n.prototype.setStubVisible=function(e,t){var i=o.isLeft(e)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;t?i.css("display","table-cell"):i.css("display","none")},n.prototype.restoreDefaultCursor=function(){this.setCursor("")},n.prototype.setCursor=function(e){var t="";"grabbing"!==e&&"ew-resize"!==e||(t="time-axis--cursor-"+e),this._currentCursorClassName!==t&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),t&&this.jqCell.addClass(t),this._currentCursorClassName=t,this.jqCell.css("cursor"))},n.prototype.image=function(){var e={};return e.content=this.canvas.toDataURL(),e.contentWidth=this.size.w,e.contentHeight=this.size.h,e.lhsStub={},e.lhsStub.content=this.lhsCanvas.toDataURL(),e.lhsStub.contentWidth=this.lhsStubSize.w,e.lhsStub.contentHeight=this.lhsStubSize.h,e.rhsStub={},e.rhsStub.content=this.rhsCanvas.toDataURL(),e.rhsStub.contentWidth=this.rhsStubSize.w,e.rhsStub.contentHeight=this.rhsStubSize.h,e},t.TimeAxisWidget=n}).call(t,i(5))},function(e,t){},function(e,t,i){"use strict";function n(e,t){i.e(13).then(function(n){i(359).showSymbolInfoDialog(e,t)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.showSymbolInfoDialog=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0}),n=i(1),o=i(8),r=i.n(o),s=i(7),a=i(16),l=i.n(a),c=i(33),h=i(4),u=Object(h.getLogger)("ChartApi.AbstractSession"),d="",p=function(){function e(e,t,i){this._isConnected=new l.a(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId=d,this._sessionIdChanged=new r.a,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}return e.prototype.destroy=function(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")},e.prototype.isConnected=function(){return this._isConnected},e.prototype.sessionId=function(){return this._sessionId},e.prototype.onSessionIdChanged=function(){return this._sessionIdChanged},e.prototype.connect=function(){0===this._state&&(Object(s.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(this._sessionPrefix+"_"+Object(c.randomHash)()),
this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))},e.prototype.disconnect=function(){var e=this;0!==this._state&&(Object(s.assert)(this._sessionId!==d,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile(function(){e._chartApi.connected()&&e._sendRemoveSession(),e._processDestroyingOnServer()}))},e.prototype.onMessage=function(e){var t,i;switch(e.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":return t=e.params[0]+"",i=e.params[1]+"",void this._onCriticalError(t,i)}this._onMessage(e)},e.prototype._getChartApi=function(){return this._chartApi},e.prototype._generateLogMessage=function(e){return"["+this._sessionId+"] "+e},e.prototype._onCriticalError=function(e,t){var i=this;this._logError("Critical error. Reason="+e+", info="+t+"."),this._forbidConnectWhile(function(){i._processDestroyingOnServer()}),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")},e.prototype._onChartApiConnected=function(){Object(s.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)},e.prototype._onChartApiDisconnected=function(){var e=this;this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile(function(){e._processDestroyingOnServer()}),this.connect()},e.prototype._setSessionId=function(e){var t=this._sessionId;this._logNormal("Changing sessionId: old="+t+", new="+e),this._sessionId=e,this._sessionIdChanged.fire(e,t)},e.prototype._logNormal=function(e){u.logNormal(this._generateLogMessage(e))},e.prototype._logError=function(e){u.logError(this._generateLogMessage(e))},e.prototype._processDestroyingOnServer=function(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId(d)},e.prototype._forbidConnectWhile=function(e){this._isConnectForbidden=!0,e(),this._isConnectForbidden=!1},e}(),i.d(t,"ChartSession",function(){return _}),Object(h.getLogger)("ChartSession"),_=function(e){function t(t,i){void 0===i&&(i=!1);var n=e.call(this,t,"cs",!1)||this;return n._sessionDisabled=!1,n._handler=null,n._criticalError=new r.a,n._disableStatistics=i,n}return n.c(t,e),t.prototype.destroy=function(){this._criticalError.destroy(),this._handler=null,e.prototype.destroy.call(this)},t.prototype.serverTimeOffset=function(){return this._getChartApi().serverTimeOffset()},t.prototype.switchTimezone=function(e){return this._getChartApi().switchTimezone(this.sessionId(),e)},t.prototype.resolveSymbol=function(e,t,i){return this._getChartApi().resolveSymbol(this.sessionId(),e,t,i)},t.prototype.requestFirstBarTime=function(e,t,i){
return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)},t.prototype.createSeries=function(e,t,i,n,o,r){return this._getChartApi().createSeries(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifySeries=function(e,t,i,n,o){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,n,o)},t.prototype.removeSeries=function(e,t){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e,t)},t.prototype.requestMoreData=function(e,t,i){return this._getChartApi().requestMoreData(this.sessionId(),e,t,i)},t.prototype.requestMoreTickmarks=function(e,t,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)},t.prototype.requestMetadata=function(e,t){var i=this,n=function(){return i._getChartApi().requestMetadata(i.sessionId(),e,t)};n()},t.prototype.isCanCreateStudy=function(e){return this._getChartApi().isCanCreateStudy(e)},t.prototype.createStudy=function(e,t,i,n,o,r,s){return this._getChartApi().createStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.rebindStudy=function(e,t,i,n,o,r,s){return this._getChartApi().rebindStudy(this.sessionId(),e,t,i,n,o,r,s)},t.prototype.modifyStudy=function(e,t,i,n){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,n)},t.prototype.removeStudy=function(e,t,i){return this._getChartApi().removeStudy(this.sessionId(),e,t,i)},t.prototype.createPointset=function(e,t,i,n,o,r){return this._getChartApi().createPointset(this.sessionId(),e,t,i,n,o,r)},t.prototype.modifyPointset=function(e,t,i,n){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,n)},t.prototype.removePointset=function(e){return this._getChartApi().removePointset(this.sessionId(),e)},t.prototype.setVisibleTimeRange=function(e,t,i,n){this._getChartApi().setVisibleTimeRange(e,this.sessionId(),t,i,n)},t.prototype.criticalError=function(){return this._criticalError},t.prototype.connect=function(t){void 0===t&&(t=null),null!==t&&(this._handler=t),e.prototype.connect.call(this)},t.prototype.setHandler=function(e){this._handler=e},t.prototype.connected=function(){return this.isConnected().value()&&!this._sessionDisabled},t.prototype.disable=function(){this._sessionDisabled=!0},t.prototype.chartApi=function(){return this._getChartApi()},t.prototype._sendCreateSession=function(){var e=this;Object.keys(this).forEach(function(t){/^(s|st|symbol_)\d+$/.test(t)&&delete e[t]}),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)},t.prototype._sendRemoveSession=function(){this._getChartApi().chartDeleteSession(this.sessionId())},t.prototype._onMessage=function(e){this._handler&&this._handler(e)},t.prototype._onCriticalError=function(t,i){this._criticalError.fire(t,i),e.prototype._onCriticalError.call(this,t,i)},t}(p)},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MarketStatusIndicator",function(){return c}),n=i(1),i(11),o=i(654),i.n(o),r=i(295),s={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",
post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",holiday:"tv-market-status--holiday",replay:"tv-market-status--replay"},a={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading"),holiday:$.t("Holiday"),replay:""},l={classMap:s,classSuffix:"",data:{},extraTitle:"",labelMap:a,short:!1,showTooltip:!0,tooltipType:"custom"},c=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(t),i}return n.c(t,e),t.prototype.setStatus=function(e,t){var i={values:{current_session:e}};this.update(i,t)},t.prototype.getTooltipText=function(){var t=e.prototype.getTooltipText.call(this);return""===t?t:(""!==this._extraTitle&&(t=t+", "+this._extraTitle),t)},t.prototype.setExtraTitle=function(e){this._extraTitle=e},t.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},t.prototype.enableShortMode=function(t){void 0===t&&(t=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),e.prototype.enableShortMode.call(this)},t.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),e.prototype.disableShortMode.call(this)},t.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},t.prototype._getValueFromData=function(e){return void 0!==e.values&&void 0!==e.values.current_session?e.values.current_session:this.getValue()},t.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),e.prototype._render.call(this)},t.prototype._init=function(t){var i=Object.assign({},l,t);e.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},t.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},t.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DataModeIndicator",function(){return d}),n=i(1),i(11),i(85),o=i(656),i.n(o),r=i(295),s={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"},a={connecting:$.t("Connecting"),
delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("End of Day"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Real-time"),snapshot:$.t("Snapshot"),loading:"",replay:$.t("Replay Mode")},l={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:"",replay:$.t("R",{context:"data_mode_replay_letter"})},c=600,h={streaming:"realtime"},u={classMap:s,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:a,modeInterval:c,short:!1,shortLabelMap:l,showTooltip:!0,tooltipType:"custom"},d=function(e){function t(t){var i=e.call(this,t)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(t),i}return n.c(t,e),t.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":e.prototype.getLabel.call(this)},t.prototype.setMode=function(e,t){this.update({values:{update_mode:e,update_mode_seconds:t}})},t.prototype.hide=function(){this._el.classList.add("i-hidden")},t.prototype.show=function(){this._el.classList.remove("i-hidden")},t.prototype.getTooltipText=function(){var e="",t=this.getValue();if(""===t)return e;switch(t){case"delayed":e=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":e=$.t("Quotes are delayed by {0} min");break;default:e=this._labelMap[t]||e}return["delayed","delayed_streaming"].includes(t)&&(e=e.format(Math.round(this._modeInterval/60))),e},t.prototype._init=function(t){void 0===t&&(t={});var i=Object.assign({},u,t);this._modeInterval=i.modeInterval||c,this._shortLabelMap=i.shortLabelMap||l,e.prototype._init.call(this,i),this._render()},t.prototype._getValueFromData=function(e){var t;return t=void 0!==e.values&&void 0!==e.values.update_mode?e.values.update_mode:this.getValue(),h[t]||t},t.prototype._updateValue=function(t,i){void 0!==t.values&&void 0!==t.values.update_mode_seconds&&(this._modeInterval=t.values.update_mode_seconds),e.prototype._updateValue.call(this,t,i)},t}(r.a)},function(e,t){},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyMetaInfoRepository",function(){return s}),i(11),n=i(26),o=i.n(n),r=i(4),Object(r.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),s=function(){function e(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1,this._onRawMetaReceivedDfd=null,this._tvScriptsRequestDfd=null,this._isReady=!1,this._metaInfoQueryQueue=[],this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._gateway=e}return e.prototype.getStudyScriptingPkgVers=function(){return this._studyScriptingPkgVers},e.prototype.requestMetaInfo=function(){var e=this
;return this._requestStarted(),new Promise(function(t){e._gateway.requestMetadata(e._makeNextRequestId(),function(i){var n=i.params[1].metainfo.slice();e._processLibraryMetaInfo(n),e._requestFinished(),t()})})},e.prototype.requestAlertsMetaInfo=function(){throw Error("not supported")},e.prototype.findById=function(e){if(this._isReady){var t=this._findStudyMetaInfo(e);if(!t)throw new ReferenceError("unexpected study id:"+e);return Promise.resolve(t)}return this._enqueueMetaInfoQuery(e)},e.prototype.isReady=function(){return this._isReady},e.prototype.getInternalMetaInfoArray=function(){return this._studiesMetaInfo},e.prototype.getMigrations=function(){return this._studiesMigrations},e.prototype._processMigrations=function(e){throw Error("not implemented")},e.prototype._addPineMetaInfo=function(e){throw Error("not implemented")},e.prototype._processSiteMetaInfo=function(e,t){throw Error("not implemented")},e.prototype._processLibraryMetaInfo=function(t){for(var i=0;i<t.length;++i)o.a.addOrReplaceStudyMetaInfo(this._studiesMetaInfo,e._applyLocalizationToMetadata(t[i]));this._studiesMetaInfo=this._studiesMetaInfo.sort(function(e,t){var i=e.description_localized||e.description,n=t.description_localized||t.description;return i>n?1:i<n?-1:0}),o.a.overrideDefaults(this._studiesMetaInfo)},e.prototype._requestStarted=function(){this._isReady=!1,this._studiesMetaInfo=[],this._studiesMigrations=[],this._studyScriptingPkgVers=null,this._tvScriptsRequestDfd=null,this._rawStudiesMetaInfo=[],this._metaInfoReceived=!1},e.prototype._requestFinished=function(){this._isReady=!0,this._processPendingMetaInfoQueries()},e.prototype._enqueueMetaInfoQuery=function(e){var t=this;return new Promise(function(i){t._metaInfoQueryQueue.push({studyId:e,resolver:i})})},e.prototype._processPendingMetaInfoQueries=function(){for(var e,t;this._metaInfoQueryQueue.length;){if(e=this._metaInfoQueryQueue.shift(),null===(t=this._findStudyMetaInfo(e.studyId)))throw new ReferenceError("unexpected study id:"+e.studyId);e.resolver(t)}},e.prototype._findStudyMetaInfo=function(e){for(var t=0;t<this._studiesMetaInfo.length;t+=1)if(this._studiesMetaInfo[t].id===e)return this._studiesMetaInfo[t];return null},e.prototype._makeNextRequestId=function(){return"metadata_"+this._nextRequestNumber++},e._applyLocalizationToMetadata=function(e){return e.description_localized=window.t(e.description,{context:"study"}),e},e}()},function(e,t,i){"use strict";function n(){}function o(e){r(e),s(e)}var r,s;Object.defineProperty(t,"__esModule",{value:!0}),t.addPerfMark=o,r=console.timeStamp?console.timeStamp.bind(console):n,s=window.performance&&performance.mark?performance.mark.bind(performance):n},function(e,t,i){"use strict";function n(){function e(){return b}function t(e){return g&&i(),g=new r.UndoMacroCommand(e)}function i(){if(g){var e=g;g=null,e.isEmpty()||a(e)}}function n(){if(v.isEmpty())return!1;var e=v.pop();return!!e&&(e.undo(),S.push(e),d.logNormal("UNDO: "+e.text()),b.fire(y()),!0)}function s(){if(S.isEmpty())return!1;var e=S.pop();return!!e&&(e.redo(),v.push(e),
d.logNormal("REDO: "+e.text()),b.fire(y()),!0)}function a(e){var t,i,n;g?g.addCommand(e):(S.clear(),t=v.head(),i=t&&t.text(),v.push(e),""!==(n=e.text())&&n!==i&&d.logNormal("DO: "+n)),e.executeOnPush()&&e.redo(),g||b.fire(y())}function c(){return{lastActualCommand:v.isEmpty()?null:v.head()}}function h(e){for(;!v.isEmpty()&&e.lastActualCommand!==v.head();)v.pop().undo();S.clear(),b.fire(y())}function p(){return v}function _(){return S}function f(){v.clear(),S.clear(),b.fire(y())}function m(e,t,i){if(e.value()!==t){var n=new l(e,t,i);a(n),n.redo()}}function y(){var e=v.head(),t=S.head();return{enableUndo:!v.isEmpty(),undoText:void 0===e?void 0:e.text(),enableRedo:!S.isEmpty(),redoText:void 0===t?void 0:t.text()}}var g=null,v=new o.UndoStack,S=new o.UndoStack,b=new u.a;return{beginUndoMacro:t,clearStack:f,createUndoCheckpoint:c,endUndoMacro:i,pushUndoCommand:a,redo:s,redoStack:_,setWatchedValue:m,undo:n,undoStack:p,undoToCheckpoint:h,state:y,onChange:e}}var o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),o=i(293),r=i(258),s=i(1),a=i(43),l=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._wv=t,o._newValue=i,o._oldValue=t.value(),o}return s.c(t,e),t.prototype.redo=function(){this._wv.setValue(this._newValue)},t.prototype.undo=function(){this._wv.setValue(this._oldValue)},t}(a.UndoCommand),c=i(4),h=i(8),u=i.n(h),t.createUndoHistory=n,d=Object(c.getLogger)("Common.UndoHistory")},function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChart(e,t,n)}.bind(null,i)).catch(i.oe)}function o(e,t,n){void 0===t&&(t={}),i.e(4).then(function(o){i(137).getImageOfChartSilently(e,t,n)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.getImageOfChart=n,t.getImageOfChartSilently=o},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SetChartLayoutCommand",function(){return s}),n=i(1),o=i(43),r=i(108),s=function(e){function t(t,i){var n=this,o="Change Chart Layout to "+r.layouts[i].title;return n=e.call(this,o)||this,n._chartWidgetCollection=t,n._newLayoutType=i,n._oldLayoutType=t.layout.value(),n}return n.c(t,e),t.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},t.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},t}(o.UndoCommand)},function(e,t,i){"use strict";function n(e){return new Promise(function(t,i){e.subscribe(null,t,!0)})}Object.defineProperty(t,"__esModule",{value:!0}),t.delegateToPromise=n},function(e,t,i){"use strict";function n(e){r.call(this,e);var t=this;a.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!a.hideMarksOnBars().value())})}function o(e){s.call(this)}var r=i(87).BarsMarksContainer,s=i(179).BarMarkTooltip,a=i(32);inherit(n,r),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedBarsMarks",n.prototype._plateViewData=function(e){var t={
text:e.text};return"object"==typeof e.color&&(t.theme="user_defined_theme",t.overridedTheme={},t.overridedTheme.border=e.color.border,t.overridedTheme.background=e.color.background),t},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;this._marks[e].onClicked()},n.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype._createTooltip=function(){return new o},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},inherit(o,s),o.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},o.prototype._updatePlate=function(e){this._currentId=e.id,this._layout.css("border-color",e.theme.border),this._layout.css("margin-top",e.tooltipMargin+"px"),this._layout_text.html(e.text),this._layout.append(this._layout_text)},e.exports=n},function(e,t,i){"use strict";function n(e){a.call(this,e);var t=this;l.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new o(this)}function o(e,t){this.source=e,this._rendererFactory=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i(6).Point,s=i(665).ESDPaneView,a=i(87).BarsMarksContainer,l=i(32),c=i(31),h=i(296).Tooltip;inherit(n,a),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedTimescaleMarks",n.prototype._plateViewData=function(e){return{text:e.text}},n.prototype.onClicked=function(){var e=this._model.lastHittestData().id;c.emit("onTimescaleMarkClick",e)},n.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},n.prototype.paneViews=function(e){return this._properties.visible.value()?[this._paneView]:[]},n.prototype.onClickOutside=function(e){
this._paneView.onClickOutside(e)},inherit(o,s),o.prototype._createLollipops=function(){var e=this.source._model.timeScale(),t=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),n=this;$.each(this.source._marks,function(o,s){var a=s.id;n._lollipops[a]={id:a,basePoint:new r(e.indexToCoordinate(e.timePointToIndex(s.tickmark))+1,t),hovered:i&&i.id===a||a===n.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:n._lollipops.hasOwnProperty(a)?n._lollipops[a].tooltip:new h,visible:!0}})},o.prototype.clearCaches=function(){this._lollipops={}},o.prototype.update=function(){this._createLollipops()},o.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},o.prototype._generateTemplateStyle=function(e,t,i){var n,o,r=e+t+i;return r in this.stylesCache||(n={strokeStyle:t,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:t,font:"normal 12px Verdana, Arial, sans-serif"}}},o={strokeStyle:t,lollipop:{fillStyle:t,fillCircle:!0,text:{strokeStyle:"white"}}},this.stylesCache[r]="default"===e?n:$.extend(!0,{},n,o)),this.stylesCache[r]},o.prototype.getTemplate=function(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]},o.prototype.getStyle=function(e,t){return this._generateTemplateStyle(e,t.color,t.label)},o.prototype.createText=function(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach(function(e){t.addTextLine(e)})},o.prototype.hasTooltip=function(e){return!!e.tooltip&&e.tooltip.length},e.exports=n},function(e,t,i){"use strict";function n(e,t){this._lastClickedId=null,this._model=e,this._study=t,this._metaInfo=t.metaInfo(),this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle),e.properties().paneProperties.background.subscribe(this,this.onPaneBgChange)}function o(e){this.data=e}function r(e){this.data=e,this._hittest=new c(c.CUSTOM,e)}function s(e,t){this._data=e,this._paneView=t,this.textRenderer=new s.TextRenderer(e.style.lollipop.importance)}var a=i(6).Point,l=i(60).pointInCircle,c=i(9).HitTestResult,h=i(69).CompositeRenderer,u=i(296).Tooltip;i(70).PercentageFormatter,i(667).roundToFirstValuable;n.prototype.onPaneBgChange=function(){this.defaultStyle.lollipop.fillStyle=this._model.properties().paneProperties.background.value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach(function(e){0===e.indexOf("default")&&(this.templatesCache[e]=null)},this)},n.prototype.onClickOutside=function(){this._lastClickedId=null},n.prototype.closeTooltips=function(){var e,t;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(t=this._lollipops[e],
t.visible&&(t.tooltip.isOpened()&&t.tooltip.hide(),t.visible=!1))},n.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},n.prototype._setStackStudies=function(){this._stackStudies=[]},n.prototype._getY=function(){var e,t,i=0,n=this._model.panes();for(e=n.length;e--;)t=n[e],t.containsMainSeries()&&(i+=t.height());return i},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,h,u;this._setStackStudies(),e=this,t=this._study.data(),i=this._model.timeScale(),n=i.visibleBars(),o=this._model.mainSeries().bars(),r=this._study.priceScale(),s=this._model.mainSeries(),a=s.firstBar(),r&&!r.isEmpty()&&!i.isEmpty()&&a&&t&&(this.closeTooltips(),l=this._getY(),c=n.firstBar(),h=n.lastBar(),u=t.range(c,h),u.each(function(t,n){var s,a=0;for(s=0;s<e._stackStudies.length;++s)e._stackStudies[s].data().contains(t)&&++a;t>c&&t<h&&e.addLollipop(l,o,i,r,t,n,a)}),this.afterUpdate(l,o,i,r))},n.prototype.addLollipop=function(e,t,i,n,o,r,s){var l,c,h,d,p,_,f,m,y=r[0],g=this._model.mainSeries().symbolInfo();g&&(l=g.name,c=null,h=this._study.metaInfo().id+"_"+y+"_"+l,d=this._model.lastHittestData(),p=d&&d.id===h,p&&null!==(_=t.valueAt(o))&&(f=_[TradingView.LOW_PLOT],m=this._model.mainSeries().firstValue(),c=n.priceToCoordinate(f,m)),this._lollipops[h]=$.extend({id:h,visible:!0,basePoint:new a(i.indexToCoordinate(o)+1,e),hovered:p||h===this.getLastClickedLollipopId(),barY:c,stack:s,tooltip:this._lollipops.hasOwnProperty(h)?this._lollipops[h].tooltip:new u},this.extraData(r)))},n.prototype.afterUpdate=function(e,t,i){},n.prototype.extraData=function(e){throw Error("Not Implemented")},n.prototype.createText=function(e,t){throw Error("Not Implemented")},n.prototype.showBarLine=function(){return!0},n.prototype.getStyle=function(e,t){var i,n=e;return t.stack&&(n+="_stack:"+t.stack),"hovered"===n?this.hoveredStyle:"default"===n?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),this._stylesCache[n]||(i=TradingView.clone("hovered"===e?this.hoveredStyle:this.defaultStyle),t.stack&&(i.lollipop.incHeight=24*t.stack),this._stylesCache[n]=i),this._stylesCache[n])},n.prototype.hasTooltip=function(e){return!0},n.prototype.renderer=function(){var e,t,i,n,l,c,u,d,p;this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h;for(t in this._lollipops)this._lollipops.hasOwnProperty(t)&&(i=this._lollipops[t],n=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-n-(l.lollipop.incHeight||0)),style:l,createText:this.createText.bind(this)},i),u=this.getTemplate(i.hovered?"hovered":"default",i),d={circlePoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:u,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},e.append(new r(d)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(p={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},
startPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a(i.basePoint.x,i.barY)},e.append(new o(p))),e.append(new s(c,this))));return e},n.prototype.getTemplate=function(e,t){var i=e;return t.stack&&(i+="_stack:"+t.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(e,t))),this.templatesCache[i]},n.prototype.createTemplate=function(e){var t=document.createElement("canvas"),i=t.getContext("2d"),n=new a(e.lollipop.width/2,e.lollipop.height-e.lollipop.circleHeight-(e.lollipop.incHeight||0));return this.drawCircle(i,e,n),this.drawLabel(i,e,n),t},n.prototype.drawCircle=function(e,t,i){e.strokeStyle=t.strokeStyle,e.fillStyle=t.lollipop.fillStyle,e.lineWidth=t.lollipop.lineWidth,CanvasEx.setLineStyle(e,CanvasEx.LINESTYLE_SOLID),e.beginPath(),e.arc(i.x,i.y,t.lollipop.radius,0,2*Math.PI,!1),e.closePath(),e.stroke(),t.lollipop.fillCircle&&e.fill()},n.prototype.drawLabel=function(e,t,i){e.textAlign="center",e.textBaseline="middle",e.fillStyle=t.lollipop.text.strokeStyle,e.font=t.lollipop.text.font,e.fillText(t.lollipop.text.label,i.x,i.y)},n.prototype._lollipopMouseClickHandler=function(e){this._lastClickedId=this._lastClickedId===e?null:e},o.prototype.draw=function(e){e.strokeStyle=this.data.style.strokeStyle,e.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(e,this.data.style.lineStyle),CanvasEx.drawLine(e,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},o.prototype.hitTest=function(e){return null},r.prototype.hitTest=function(e){return l(e,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null},r.prototype.draw=function(e){var t=this.data.template;e.drawImage(t,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},s.prototype.draw=function(e){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:e.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},s.prototype.hitTest=function(e){return null},s.TextRenderer=function(e){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",e&&(this.importance=e)},s.TextRenderer.prototype.draw=function(e,t){var i,n,o=t.y;for(i=0;i<this.lines.length;i++)n=this.lines[i],e.font=this.font,n.options.fontWeight&&(e.font=n.options.fontWeight+" "+this.font),e.fillStyle=this.fillStyle,n.renderer(e,n.line,{x:t.x,y:o}),o+=this.lineSpacing+this.fontHeight},s.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},s.TextRenderer.prototype.basicRenderer=function(e,t,i){e.fillText(t,i.x,i.y)},s.TextRenderer.prototype.addMulticolorTextLine=function(e,t){
this.addTextLine(e,t,this.multicolorRenderer)},s.TextRenderer.prototype.addTextLine=function(e,t,i){i||(i=this.basicRenderer),t||(t={}),this.lines.push({line:e,renderer:i,options:t})},s.TextRenderer.prototype.multicolorRenderer=function(e,t,i){var n,o,r=i.x;for(n=0;n<t.length;++n)o=t[n],e.fillStyle=o.color,e.fillText(o.text,r,i.y),r+=e.measureText(o.text).width},t.ESDPaneView=n},function(e,t){},function(e,t,i){"use strict";function n(e){var t,i=""+e,n=i.split(".")[1],o=2;return n&&(t=n.match(/^([0]+)/))&&(o=t[1].length+1),parseFloat(i).toFixed(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.roundToFirstValuable=n},function(e,t,i){"use strict";var n=i(72).TimePointIndexSearchMode,o=i(37),r=i(25),s=i(670),a=i(297),l=i(268),c=l.ChartApiInterface,h=l.HandlerInfo,u=i(12).requireFullInterfaceImplementation,d=i(4).getLogger("Chart.ChartApiLocal");TradingView.STUDY_COUNT_LIMIT=210,JSServer.ChartApi=function(e){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new s(e),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0;var t=this;this._studyEngine.on("configuration_received",function(){t._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(e){var i={time:e.value[0]/1e3,open:e.value[1],high:e.value[2],low:e.value[3],close:e.value[4],volume:e.value[5]};t._fireEvent("realtime_tick",i,!0)}),this._setVisibleRangeTimeout=null},JSServer.ChartApi.prototype._makeSymbolKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype._makeSeriesKey=function(e,t){if(!e||!t)throw Error("incorrect identifiers");return e+"_"+t},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(e){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(e){this._enabledMoreBarsRequest=e},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||["1","3","5","15","30","45","60","120","180","240","D","W","M"]},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(e){this._enableLogging&&console.log(e)},JSServer.ChartApi.prototype.unsubscribe=function(e,t){var i=this._callbacks[e]
;i&&i.splice(i.indexOf(t),1)},JSServer.ChartApi.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},JSServer.ChartApi.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e))for(n=this._callbacks[e].slice(0),i||(this._callbacks[e]=[]),o=0;o<n.length;++o)n[o](t)},JSServer.ChartApi.prototype.chartCreateSession=function(e,t){},JSServer.ChartApi.prototype.chartDeleteSession=function(e){},JSServer.ChartApi.prototype.createSession=function(e,t){TradingView.ChartapiMessagerInstances[e]=new a(this,e),this._sessions[e]=t,this._notificationHandlers[e]={},this.connected()&&t.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(e){delete this._sessions[e],delete this._notificationHandlers[e],this._studyEngine.stopSources(e)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var e=this;return void this.on("start_enabled",function(){e.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){this._connected=!1,this._notifySessions({method:"disconnected",params:[]})},JSServer.ChartApi.prototype.switchTimezone=function(e,t){if(TradingView.ChartapiMessagerInstances[e].timezone()!==t&&(TradingView.ChartapiMessagerInstances[e].setTimezone(t),this._recentSeriesId[e])){var i=this;this._doWhenSeriesSymbolIdIsReady(e,this._recentSeriesId[e],function(t){var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution;i._studyEngine.recreateSources(t.name,n,e,!0),i._doWhenSeriesDataReceived(e,function(){var n=i._seriesIdCache[i._makeSeriesKey(e,i._recentSeriesId[e])].resolution,o=TradingView.ChartapiMessagerInstances[e].lastBarTime(i._recentSeriesId[e]);o&&i._studyEngine.rebuildExtrapolatedData(e,t.name,n,t.info,1e3*o)})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(e){this._logMessage("< "+e.method),this._dispathNotification(e),this._fireEvent("message_"+e.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(e,t,i,n,o){this._studyEngine.getMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.getTimescaleMarks=function(e,t,i,n,o){this._studyEngine.getTimescaleMarks(e,t,i,n,o)},JSServer.ChartApi.prototype.resolveSymbol=function(e,t,i,n,o){function r(t,n){Object.keys(s._seriesIdCache).some(function(e){return s._seriesIdCache[e].symbolId===t})&&TradingView.ChartapiMessagerInstances[e].onSeriesClearData(0,""),TradingView.ChartapiMessagerInstances[e].onSymbolError(t,n),s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,status:"invalid_symbol"},s._fireEvent("resolve_fail",{session:e,symbolId:t},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolve_fail")}this._notificationHandlers[e][t]=new h(n,t),this._symbolIdCache[this._makeSymbolKey(e,t)]=null;var s=this;this._studyEngine.resolveSymbol(i,function(n){if(n.errmsg)return void r(t,n.errmsg)
;s._symbolIdCache[s._makeSymbolKey(e,t)]={name:i,info:n,status:"ok"},s._fireEvent("symbol_resolved",{symbolInfo:n,symbolId:t,session:e},!0),s._fireEvent(s._makeSymbolKey(e,t)+"_resolved",n),TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,n)},function(e){r(t,e)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(e,t,i){function n(){return{name:r._symbolIdCache[r._makeSymbolKey(e,t)].name,info:r._symbolIdCache[r._makeSymbolKey(e,t)].info}}function o(){s&&(i(n()),s=!1,r.unsubscribe(r._makeSymbolKey(e,t)+"_resolved",o),r.unsubscribe(r._makeSymbolKey(e,t)+"_resolve_fail",o))}var r=this,s=!0;this._symbolIdCache[this._makeSymbolKey(e,t)]?o():(this.on(this._makeSymbolKey(e,t)+"_resolved",o),this.on(this._makeSymbolKey(e,t)+"_resolve_fail",o))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(e,t){TradingView.ChartapiMessagerInstances[e].seriesCompleted.subscribe(null,t,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(e,t,i,n){function o(){var t=c._symbolIdCache[c._makeSymbolKey(e,h)];return{name:t.name,info:t.info}}function r(){i(o())}function s(){c.unsubscribe("symbol_resolved",l),c.unsubscribe("resolve_fail",a)}function a(t){t.symbolId===h&&t.session===e&&(s(),n&&n())}function l(t){t.symbolId===h&&t.session===e&&(s(),r())}var c=this,h=this._seriesIdCache[e+"_"+t].symbolId;this._symbolIdCache[this._makeSymbolKey(e,h)]?r():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(e,t,i,n,o,s,a){i=i||"";var l=this;this._notificationHandlers[e][t]=new h(function(s){if("series_completed"===s.method){var c=r.Symbol.parsePeriod(o);c.range&&l._applyRange(e,n,t,i,c.range)}a(s)},t),this._recentSeriesId[e]=t,TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),this._seriesIdCache[e+"_"+t]={symbolId:n,resolution:o,turnaround:i},this._studyEngine.updateSeriesTurnaround(e,t,i),this._doWhenSeriesSymbolIdIsReady(e,t,function(n){l._studyEngine.seriesTurnaround(e,t)===i&&l._studyEngine.createSeries(n.name,o,e,t,i)})},JSServer.ChartApi.prototype.removeSeries=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t),this._studyEngine.removeSeries(e,t)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(e,t,i,o,r){function s(){var s,a;u=e.data(),s=[u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),u.plotValueToTimePointIndex(o,TradingView.TIME_PLOT,n.FromRight)],s[1]<s[0]||(u.valueAt(s[1])[0]<o&&e.syncModel()&&(a=e.syncModel().distance(u.valueAt(s[1])[0],o),a.success&&(s[1]+=a.result)),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(p,_,s[0],s[1],!0),e.requestMoreData(),r&&r())}function a(e,t){e===p&&t===_&&(c.unsubscribe(null,a),h.unsubscribe(null,l),s())}function l(e,t){e===p&&t===_&&c.unsubscribe(null,a)}var c,h,u=e.data(),d=!!u.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,n.FromLeft),p=this._recentSeriesId[t],_=this._seriesIdCache[t+"_"+p].turnaround;if(d)return void s();c=TradingView.ChartapiMessagerInstances[t].seriesCompleted,
h=TradingView.ChartapiMessagerInstances[t].seriesError,null!==this._setVisibleRangeTimeout&&clearTimeout(this._setVisibleRangeTimeout),this._setVisibleRangeTimeout=setTimeout(function(){this._setVisibleRangeTimeout=null,c.subscribe(null,a,!0),h.subscribe(null,l,!0),this._studyEngine.ensureExtendedTo(p,t,i)}.bind(this),0)},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(e,t){var i,n=chartWidget.model().mainSeries().bars(),r=chartWidget.model().mainSeries().symbolInfo().session,s=n._valueAt(n.size()-1)[0],a=o.alignPeriodsBack(r,e.resolution,e.interval,1,1e3*s),l=n.size();for(a/=1e3,i=0,i=0;i<l&&!(n._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(e,t,i,n,o){var r,s,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(r=this._exactBarsCountOfTimeFrame(o,this._symbolIdCache[this._makeSymbolKey(e,t)].info),s=Math.max(0,l-1-r),a=Math.max(s,l-1),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(i,n,s,a))},JSServer.ChartApi.prototype.modifySeries=function(e,t,i,n,o,s,a){var l,c;i=i||"",l=this._seriesIdCache[e+"_"+t]?this._seriesIdCache[e+"_"+t].resolution:void 0,TradingView.ChartapiMessagerInstances[e].setResolution(r.Symbol.parsePeriod(o).pureResolution),c=this,this._notificationHandlers[e][t]=new h(function(a){var h,u;"series_completed"===a.method&&(h=r.Symbol.parsePeriod(l),u=r.Symbol.parsePeriod(o),u.range&&h.range!==u.range&&c._applyRange(e,n,t,i,u.range)),s(a)},t),this._recentSeriesId[e]=t,this._studyEngine.updateSeriesTurnaround(e,t,i),a&&(this._seriesIdCache[this._makeSeriesKey(e,a)]=null),this._seriesIdCache[this._makeSymbolKey(e,t)]={symbolId:n,resolution:o,turnaround:i},this._doWhenSeriesSymbolIdIsReady(e,t,function(t){c._studyEngine.purgeRangeExtensionData(e),c._studyEngine.recreateSources(t.name,o,e,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(e,t,i,n){if(this._enabledMoreBarsRequest){var o=this;setTimeout(function(){o._notificationHandlers[e][t]=new h(n,t),o._studyEngine.extendSeriesRange(t,e,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.setWatchlistSettings=function(e){this._watchlistSettings=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(e,t,i){this._notificationHandlers[e][t]=new h(i,t);var n=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[e].onRequestMetadata(t,n)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(e,t,i,n,o,r,s){var a,l,c;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[e][t]=new h(s,t),l=this._seriesIdCache[this._makeSeriesKey(e,n)].symbolId,c=this._seriesIdCache[this._makeSeriesKey(e,n)].resolution,this._doWhenSymbolIdIsReady(e,l,function(n){a._studyEngine.createStudy(n.name,c,e,t,i,o,r),
a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(e,t,i,n,o,r,s,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(e,t){this._notificationHandlers[e][t]=null,this._studyEngine.removeStudy(e,t),this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(e,t,i,n,o){var r=this;setTimeout(function(){i=i||"",r._notificationHandlers[e][t]=new h(o,t),r._studyEngine.recomputeStudy(t,n,e,i)},0)},JSServer.ChartApi.prototype.createPointset=function(e,t,i,n,o,r,s){i=i||"",this._notificationHandlers[e][t]=new h(s,t);var a=this;this._doWhenSymbolIdIsReady(e,n,function(i){a._studyEngine.createPointset(e,t,i.info.full_name,i.info,o,r)})},JSServer.ChartApi.prototype.modifyPointset=function(e,t,i,n,o){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(e,t,i){this._notificationHandlers[e][t]=null,this._studyEngine.removePointset(t)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t);var o=this;this._doWhenSeriesSymbolIdIsReady(e,t,function(n){var r=o._seriesIdCache[o._makeSeriesKey(e,t)].resolution;o._studyEngine.onMoreTickmarksRequested(e,n.name,n.info,r,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(e,t,i,n){this._notificationHandlers[e][t]=new h(n,t)},JSServer.ChartApi.prototype._invokeHandler=function(e,t){e&&e(t)},JSServer.ChartApi.prototype._sendRequest=function(e,t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(e){var t,i=e.marks;for(t=0;t<i.length;++t)i[t]={span:i[t][0],time:i[t][1],index:i[t][2]};return e},JSServer.ChartApi.prototype._dispathNotification=function(e){var t,i,n,o,r,s,a,l,c,h,u=e.params.shift();if(this._notificationHandlers[u])switch(e.method){case"timescale_update":t=e.params[0],i=e.params[1],n=this._convertTimescaleResponse(i),n.clear=0===i.changes.length&&0===i.marks.length,this._sessions[u].onMessage({method:"timescale_update",params:n});for(o in t)r={},r.customId=o,r.plots=t[o].series,t[o].ns&&(r.nonseries=t[o].ns),r.turnaround=t[o].turnaround,s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s);break;case"tickmark_update":n=this._convertTimescaleResponse(e.params[0]),n.changes=[],this._sessions[u].onMessage({method:"timescale_update",params:n});break;case"data_update":for(o in e.params[0]){a=e.params[0][o],r={},r.customId=o,r.plots=a.series?a.series:a.plots,r.turnaround=a.turnaround,"s"in a&&"ns"in a&&(r.plots=a.s,r.nonseries=a.ns);for(l=0;l<r.plots.length;l++)for(c in r.plots[l].value)1e100===r.plots[l].value[c]&&(r.plots[l].value[c]=void 0);s={method:"data_update",params:r},this._invokeNotificationHandler(u,o,s)}break;case"index_update":for(o in e.params[0])s={method:"index_update",params:e.params[0][o]},this._invokeNotificationHandler(u,o,s);break;case"critical_error":
d.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+e.params[0]),this._sessions[u].onMessage({method:"critical_error",params:e.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[u].onMessage({method:e.method,params:e.params});break;default:h=e.params[0],this._invokeNotificationHandler(u,h,e)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(e,t,i){if(void 0!==t){var n=this._notificationHandlers[e][t];void 0!==n&&n&&this._invokeHandler(n.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[e][t]}},JSServer.ChartApi.prototype.searchSymbols=function(e,t,i,n,o,r,s,a,l,c){0===e.length&&0===t.length&&0===i.length&&c([]),this._studyEngine.searchSymbols(e,t,i,c)},JSServer.ChartApi.prototype._notifySessions=function(e){var t,i;for(t in this._sessions){if(!this._sessions.hasOwnProperty(t))return;i=this._sessions[t],"function"==typeof i.onMessage&&i.onMessage(e)}},JSServer.ChartApi.prototype.unpack=function(e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(e){return this._studyEngine.quoteCreateSession(e)},JSServer.ChartApi.prototype.quoteDeleteSession=function(e){return this._studyEngine.quoteDeleteSession(e)},JSServer.ChartApi.prototype.quoteSetFields=function(e,t){return this._studyEngine.quoteSetFields(e,t)},JSServer.ChartApi.prototype.quoteAddSymbols=function(e,t){return-1!==t.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),t=t.filter(function(e){return!!e})),this._studyEngine.quoteAddSymbols(e,t)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(e,t){return this._studyEngine.quoteRemoveSymbols(e,t)},JSServer.ChartApi.prototype.quoteFastSymbols=function(e,t){return this._studyEngine.quoteFastSymbols(e,t)},JSServer.ChartApi.prototype.quoteHibernateAll=function(e){return this._studyEngine.quoteHibernateAll(e)},JSServer.ChartApi.prototype.depthCreateSession=function(e){return this._studyEngine.depthCreateSession(e)},JSServer.ChartApi.prototype.depthDeleteSession=function(e){return this._studyEngine.depthDeleteSession(e)},JSServer.ChartApi.prototype.depthSetSymbol=function(e,t){return this._studyEngine.depthSetSymbol(e,t)},JSServer.ChartApi.prototype.depthClearSymbol=function(e){},JSServer.ChartApi.prototype.depthSetScale=function(e,t){},JSServer.ChartApi.prototype.createStudiesAccessController=function(e,t,i){return new this.StudiesAccessController(this._studyEngine,e&&JSON.parse(e)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(e,t){this._studyEngine=e,this._studiesAccess=t},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(e){var t,i,n=null;for(t=0;t<this._studiesAccess.tools.length;++t)if(i=this._studiesAccess.tools[t],i.name===e||i===e){n=i;break}return n},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){
return this._studyEngine.studiesMetadata().filter(function(e){var t=this._findTool(e.description);return"black"===this._studiesAccess.type?!t||t.grayed:!!t},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(e){var t=this._findTool(e);return t&&t.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(e,t,i){return this._studyEngine.alignTimePoint(e,t,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},u(JSServer.ChartApi,"JSServer.ChartApi",c,"ChartApiInterface"),e.exports=JSServer.ChartApi},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyError",function(){return o}),n=i(1),o=function(e){function t(t){var i=e.call(this,t)||this;return i.studyError=!0,i}return n.c(t,e),t}(Error)},function(e,t,i){"use strict";(function(t,n){function o(e){var t=e.findIndex(function(e){return e.index!==_});return 0===t?e:e.slice(t)}function r(e,i){var n=t.get_timezone(i.timezone),o=new b.Session;return o.init(n,i.session),y.Symbol.newBarBuilder(e,o,o)}function s(e){function t(e){console.warn("SymbolInfo validation: "+e)}var i,o;if(e.has_empty_bars&&n.enabled("disable_resolution_rebuild")&&t('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&t("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&t("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||t("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||t("session must be non-empty string"),void 0===e.timezone||0===e.timezone.length?t("timezone must be non-empty string"):"exchange"!==e.timezone&&p(e.timezone)||"UTC"!==e.timezone&&t('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers)if(i=e.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&t('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else t("intraday_multipliers must be array");(e.supported_resolutions||[]).filter(function(e){return!w.isValid(e)}).forEach(function(e){t("supported_resolutions field contains invalid value: "+e)})}function a(e){var t,i;if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.supported_resolutions)for(t=0;t<e.supported_resolutions.length;t++)i=w.parse(e.supported_resolutions[t]),i.isValid()&&(e.supported_resolutions[t]=i.value())}function l(e,t){
null!=e.graphicsCmds&&null!=e.graphicsCmds.create&&null!=e.graphicsCmds.create.vertlines&&e.graphicsCmds.create.vertlines.forEach(function(e){e.data.forEach(t)})}function c(e,t){var i,n,o=e.length,r=t.length,s=0;for(i=0;i<o;++i){for(n=e[i];s<r&&t[s].value[0]<n;)++s;s>=r?e[i]=t[r-1].index:e[i]=t[s].index}}function h(e,t){var i,n;null!==t&&0!==t.length&&(i={},T(e,function(e){x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(i[e[t]]=!0)})},{visitInstances:!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),Object.assign(e,T(e,function(e){return x(e)&&Object.keys(e).forEach(function(t){t.endsWith("__t")&&(e[t.slice(0,-3)]=i[e[t]])}),e},{visitInstances:!0})),c(n,t),e.indexes=n)}function u(e,t){var i,n;null!==t&&0!==t.length&&(i={},l(e.data,function(e){i[e.time]=!0}),n=Object.keys(i).map(Number).sort(function(e,t){return e-t}),n.forEach(function(e,t){i[e]=t}),l(e.data,function(e){e.index=i[e.time]}),c(n,t),e.indexes=n)}var d,p,_,f,m=i(671),y=i(25),g=i(672),v=i(674),S=i(675),b=i(37),w=i(15).Interval,P=i(31),T=i(676).visitObject,x=i(12).isObject;i(183),i(297),d=i(677).DatafeedRequestsCachedProcessor,p=i(200).timezoneIsAvailable,_=-5e6,f=function(e){function t(e,t,i){return function(n){var o,a;n&&n.count()&&(o=r(t,e),a=1e3*s.getCurrentUTCTime(),o.moveTo(a),o.indexOfBar(a)>=0&&n.setLastBarClosed(!1)),i(n)}}function i(e,i,n,o,r){return s._cachedDatafeed.subscribe(e,i,n,t(e,i,o),r)}function n(e){return s._cachedDatafeed.unsubscribe(e)}function o(e,t,i){s.resolveSymbol(e,t,i)}var s=this;this._studiesCache={},this._sessionsLastDataCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=v,this._externalDatafeed=e,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,s._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),s._datafeedConfiguration=s._adoptConfigurationData(window.configurationData),s._fireEvent("configuration_received"),s._externalDatafeed.getServerTime&&s._externalDatafeed.getServerTime(function(e){s._serverTimeOffset=e-(new Date).valueOf()/1e3}),this._pointsetsManager=S,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._cachedDatafeed=new d(e,f.createDWMAligner),this._extendedRange=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].summary},this._extendedTime=function(e){return s._rangeExtensionData[e]&&s._rangeExtensionData[e].time},g.setupFeed({resolve:o,subscribe:i,unsubscribe:n,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},f.createDWMAligner=function(e,i,n){var o=t.get_timezone(i),r=new b.Session;return r.init(o,n),b.createDWMAligner(e,r)},f.prototype._barsCoefficients=function(e,t){if(0!==e.indexOf("="))return{};var i=e+t
;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},f.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null},f.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},f.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},f.prototype._logMessage=function(e){n.enabled("charting_library_debug_mode")&&console.log(e)},f.prototype._extendRange=function(e,t){this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),void 0===this._rangeExtensionData[e].summary&&(this._rangeExtensionData[e].summary=0),this._rangeExtensionData[e].summary+=t},f.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},f.prototype._fireEvent=function(e,t,i){var n,o;if(this._callbacks.hasOwnProperty(e)){for(n=this._callbacks[e],o=0;o<n.length;++o)n[o](t);i||(this._callbacks[e]=[])}},f.prototype._adoptConfigurationData=function(e){var t,i,n,o=TradingView.merge({},e),r=o.supported_resolutions;if(!r||0===r.length)return o.supported_resolutions=void 0,o;for(t=[],i=0;i<r.length;i++){if(n=r[i],-1!==t.indexOf(n))throw Error("Duplicating resolution `"+n+"`");t.push(n)}return o.supported_resolutions=t,o},f.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},f.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},f.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},f.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},f.prototype._findStudyObject=function(e){var t=e.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===e||i.metainfo.shortDescription===t});if(0===i.length)throw Error("Study `"+e+"` not found");return i[0]},f.prototype.getMarks=function(e,t,i,n,o){var r,s={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(e,t,i,function(t){var i,a,l=t.map(function(e){return e.time=parseInt(e.time),e});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(l))),i=f.createDWMAligner(o,e.timezone,e.session),a=l.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e.direction=s[e.color],e.onClicked=function(){P.emit("onMarkClick",e.id)},e.label=!!e.label&&e.label[0],e}),n(a)},o))},f.prototype.getTimescaleMarks=function(e,t,i,n,o){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,o,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()))
;var r=this;this._externalDatafeed.getTimescaleMarks(e,t,i,function(t){var i,s;r._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,o,JSON.stringify(t))),i=f.createDWMAligner(o,e.timezone,e.session),s=t.map(function(e){return e.tickmark=null!==i?i.tradingDayToSessionStart(1e3*e.time)/1e3:e.time,e}),n(s)},o)}},f.prototype._computeStudy=function(e,t,i,n,o,r,s,a,l,c,h){function u(e){var t,i;return e<s()?_:0===(t=m.length)?0:(i=m[t-1].index,i===_?0:i+1)}function d(e,t,i){var n,o,r,s,a=e.time,c="number"==typeof t?[t]:t;for(n=0;n<c.length;++n)o=c[n],o&&"object"==typeof o&&(g["plot_"+n]=o.offset,o=o.value,v++),"number"==typeof o&&isNaN(o)&&(o=void 0),c[n]=o;r=m.length-1,s=r<0||a>m[r].value[0],s?m.push({index:u(a),value:[a].concat(c)}):m[r].value=[a].concat(c),p||l([m[m.length-1]],s,m.length,g,i)}var p=!0,f=this._computeStudyCounter++,m=[],g={},v=0,S=!1,b=!1,w=this,P=function(s){var l;if(y.Symbol.parsePeriod(n).isIntraday&&!s.has_intraday)return void c("Unsupported resolution. Did you forget to set has_intraday to true?");try{if(l=new y.StudyEngine({tickerid:i,symbolInfo:s,period:n,body:t,sessionId:e,onErrorCallback:c,rangeExtension:{getRangeExtensionCount:w._extendedRange.bind(this,e),getRangeExtensionTime:w._extendedTime.bind(this,e)},input:function(e){return r[e]},out:function(e,t){d(e,t,s)},nonseriesOut:function(e,t){b=!0,h(t,s)},setNoMoreData:function(){S=!0},recalc:function(e,i){p=!1,m.endOfData=S,b&&!(m.length>0)||t.error&&null!==t.error()||a(m,v>0?g:void 0,s,i)}}),!w._studiesCache[e]||!w._studiesCache[e][o])throw Error("This should never happen");w._studiesCache[e][o].engine=l}catch(e){if(!e.studyError)throw e;c(e.message)}},T=function(e){c(e)},x=function(){return w._studiesCache[e]&&w._studiesCache[e][o]&&w._studiesCache[e][o].activeResolve===f};w._studiesCache[e][o].activeResolve=f,this.resolveSymbol(i,function(){x()&&P.apply(w,arguments)},function(){x()&&T.apply(w,arguments)})},f.prototype._createStudy=function(e,t,i,n,r,s,a){function l(e){var t,i,o;if(Array.isArray(e))return e;for(t=[],i=p._studiesCache[n][r].metainfo.inputs,o=0;o<i.length;o++)t[o]=e[i[o].id];return t}function c(i,a,l){i=o(i),TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),a,l,p._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[n].onStudyCompleted(r,s)}var d,p=this;a=l(a),TradingView.ChartapiMessagerInstances[n].onStudyLoading(r,s),d=null,p._computeStudy(n,i,e,t,r,a,function(){if(null===d){var e=p._sessionsLastDataCache[n][0];if(void 0===e)return 1/0;d=e.value[0]}return d},function(e,t,i){c(e,t?{data:{offsets:t}}:null,i)},function(i,a,l,c,h){i=o(i);var u=c?{data:{offsets:c}}:null;TradingView.ChartapiMessagerInstances[n].onDataUpdate(r,s,p._convertBarsTimeToUnix(i),u,h,p._extendedRange(e,t))},function(e){TradingView.ChartapiMessagerInstances[n].onStudyError(r,s,e)},function(e,t){var i;switch(e.type){case"projection":this._updateProjectionData(n,r,s,e);break;case"study_graphics":i={data:e.data,indexes:[]},u(i,p._sessionsLastDataCache[n]),c([],i,t);break
;case"non_series_data":i={data:e.data,indexes:[]},h(i,p._sessionsLastDataCache[n]),c([],i,t);break;default:console.warn("unsupported non-series data type for study "+e.type)}}.bind(this))},f.prototype.stopSources=function(e){var t,i;for(t in this._studiesCache[e])(i=this._studiesCache[e][t])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);g.unsubscribeUnused()},f.prototype.recreateSources=function(e,t,i,n){var o,r;this.stopSources(i);for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&(r.symbol=e,r.resolution=t,"series"===r.type&&this.createSeries(e,t,i,o,r.turnaround,n));for(o in this._studiesCache[i])(r=this._studiesCache[i][o])&&"study"===r.type&&this._createStudy(e,t,r.studyObject,i,o,r.turnaround,r.inputs)},f.prototype.removeStudy=function(e,t){this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),g.unsubscribeUnused()),this._studiesCache[e][t]=null},f.prototype.removeSeries=function(e,t){this.removeStudy(e,t)},f.prototype.recomputeStudy=function(e,t,i,n){var o=this._studiesCache[i][e];if(!o)throw Error("This should never happen");o.inputs=t,o.turnaround=n,o.engine&&o.engine.stop(),this._createStudy(o.symbol,o.resolution,o.studyObject,i,e,n,t)},f.prototype._convertBarsTimeToUnix=function(e){var t,i,n=[];for(t=0;t<e.length;++t)i={index:e[t].index,value:[].concat(e[t].value)},i.value[0]/=1e3,n.push(i);return n.endOfData=e.endOfData,n},f.prototype.createStudy=function(e,t,i,n,o,r,s){var a=this._findStudyObject(r),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][n]={studyObject:l,symbol:e,resolution:t,guid:n,type:"study",inputs:s,metainfo:a.metainfo,turnaround:o},this._createStudy(e,t,l,i,n,o,s)},f.prototype.purgeRangeExtensionData=function(e){e?this._rangeExtensionData[e]={summary:0}:this._rangeExtensionData={}},f.prototype.ensureExtendedTo=function(e,t,i){var n,o=this._studiesCache[t][e];if(!o)throw Error("This should never happen");this.purgeRangeExtensionData(t),this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),this._rangeExtensionData[t].time=i,n=this,setTimeout(function(){n.recreateSources(o.symbol,o.resolution,t,!0)},0)},f.prototype.extendSeriesRange=function(e,t,i){var n,o,r,s,a=this._studiesCache[t][e];if(!a)throw Error("This should never happen");if(this._isEndOfData(t,e,a.turnaround))return n=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[t].onSeriesCompleted(e,a.turnaround,n)},0);i+=10,o=this._barsCoefficients(a.symbol,a.resolution),r=o.barsCoefficient||1,this._extendRange(t,i*r),o.barsCoefficient||(o.expectedBarsCount=this._extendedRange(t)),s=this,setTimeout(function(){s.recreateSources(a.symbol,a.resolution,t,!0)},0)},f.prototype._updateProjectionData=function(e,t,i,n){var o=n.barsetSize?this._convertBarsTimeToUnix([{index:n.barsetSize-1,exTime:n.lastBar?n.lastBar[0]/1e3:0,value:n.lastBar}]):null;TradingView.ChartapiMessagerInstances[e].onProjectionUpdate(t,i,n,o)},
f.prototype.updateSeriesTurnaround=function(e,t,i){this._studiesCache[e]||(this._studiesCache[e]={}),this._studiesCache[e][t]||(this._studiesCache[e][t]={}),this._studiesCache[e][t].type="series",this._studiesCache[e][t].turnaround=i},f.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},f.prototype.createSeries=function(e,t,i,o,r,s){function a(e,n,o){l._extrapolationManager.storage(i,e.full_name,t).setLastBarTime(n,o)}var l,c=e,h=new y.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{},this._sessionsLastDataCache[i]=null,this._studiesCache[i][o]={symbol:e,resolution:t,studyObject:h,guid:o,type:"series",turnaround:r},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(o,r),l=this,this._computeStudy(i,h,c,t,o,[],function(){return-1/0},function(n,c,h,u){var d,p,_,f,m,y;if(!l._studiesCache[i][o])throw Error("This should never happen");if(l._sessionsLastDataCache[i]=n,d=l._convertBarsTimeToUnix(n),p=d.length>0?1e3*d[0].value[0]:void 0,u.nextTime&&(!p||u.nextTime<p/1e3))return void l.ensureExtendedTo(o,i,u.nextTime);0!==d.length&&(_=l._barsCoefficients(e,t),_.expectedBarsCount&&_.barsCount&&(_.barsCoefficient=Math.min(Math.max(_.barsCoefficient||1,parseInt(_.expectedBarsCount/(d.length-_.barsCount)+.5)),100)),_.barsCount=d.length,f=d[d.length-1],a(h,d.length-1,1e3*f.value[0]),l.rebuildExtrapolatedData(i,e.name,t,h,1e3*f.value[0]),s&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,d,h,0),m=l._extrapolationManager.storage(i,h.full_name,t),Promise.resolve().then(function(){l._pointsetsManager.broadcastPointsetsUpdates(h.full_name,t,n,m,h,function(e,t){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(e,r,t,h)})})),y=0===d.length||u&&u.endOfData,y&&(l._logMessage("Series has no more data on server: {0}".format(h.full_name)),l._setEndOfData(i,o,r),0===d.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(o,r,h.data_status)},function(e,n,s,c,h){var u,d=l._convertBarsTimeToUnix(e),p=d[d.length-1];if(n){if(!l._studiesCache[i][o])throw Error("This should never happen");u=s-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[p],h,u),a(h,u,1e3*p.value[0]),l.rebuildExtrapolatedData(i,h.full_name,t,h,1e3*p.value[0])}else l._logMessage("Last bar update: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(o,r,d,null,h);l._fireEvent("realtime_tick",e[e.length-1],!0)},function(e){l._logMessage("Series error: {0}".format(e)),TradingView.ChartapiMessagerInstances[i].onSeriesError(o,e),n.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(o,r)},function(e,n){var s,c,h,u,d,p,_,f;if("projection"!==e.type)throw Error("unexpected non-series data type for series "+e.type)
;if(s=e.projectionTime/1e3,c=-1,(e.data||[]).forEach(function(e){c=Math.max(c,e[0]||0)}),c=Math.min(c,100),h=e.barsetSize,s&&c>=0&&h&&e.lastBar){for(u=[],d=0;d<=c;d++)u.push(s+.001*d);p=e.lastBar.slice(0),p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(o,r,[{index:h-1,value:p}],n,h-1,u),_=h+c,f=1e3*Math.trunc(u[c]),a(n,_,f),l.rebuildExtrapolatedData(i,n.full_name,t,n,f)}l._updateProjectionData(i,o,r,e)})},f.prototype.onMoreTickmarksRequested=function(e,t,i,n,o){this._extrapolationManager.storage(e,i.full_name,n).onTickmarksNeeded(i,o)},f.prototype.removePointset=function(e){this._pointsetsManager.removePointset(e)},f.prototype.rebuildExtrapolatedData=function(e,t,i,n,o){this._extrapolationManager.storage(e,n.full_name,i).rebuild(o,n)},f.prototype.createPointset=function(e,t,i,n,o,r){var s=this._extrapolationManager.storage(e,n.full_name,o);this._pointsetsManager.createPointset(t,i,o,r,s,n)},f.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(e){return e.metainfo})),this._metainfoCache},f.prototype.searchSymbols=function(e,t,i,n){function o(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),n(e)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,o)},f.prototype.resolveSymbol=function(e,t,i){var n,o=g.parseSymbol(e).symbol;this._resolveRequests[o]?n=this._resolveRequests[o]:(n=this.resolveSymbolInternal(o),this._resolveRequests[o]=n),n.done(t).fail(i)},f.prototype.resolveSymbolInternal=function(e){var t,i=this,n=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(e)),t=!0,this._externalDatafeed.resolveSymbol(e,function(o){t&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(o))),a(o),s(o),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(o))),i._fullNameSymbolInfoMap[o.full_name]=o,n.resolve(o)},function(t){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,t)),n.reject(t)}),t=!1,n.promise()},f.prototype._createMarketStatusWatchers=function(e,t){void 0===this._marketStatusWatchers[e]&&(this._marketStatusWatchers[e]={});var i=this;t.forEach(function(t){void 0===i._marketStatusWatchers[e][t]&&(i._marketStatusWatchers[e][t]=new m(i,e,t))})},f.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach(function(i){t._marketStatusWatchers[e][i].stop()}),this._marketStatusWatchers[e]={}},f.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},
f.prototype._startQuotesSubscription=function(e){function t(t,i){var n=r._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||n&&n.marketStatus(),t.values.pricescale=i.pricescale,t.values.minmov=i.minmov,t.values.minmove2=i.minmove2||0,t.values.fractional=i.fractional||!1,n&&t.v.cs&&n.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}function i(e){e.forEach(function(e){void 0!==o[e.n]?null!==o[e.n]&&t(e,o[e.n]):r.resolveSymbol(e.n,function(i){o[e.n]=i,t(e,i)},function(){o[e.n]=null})})}var o={},r=this,s=this._quotesInfo[e].symbols;0!==s.length&&(this._externalDatafeed.getQuotes&&!n.enabled("charting_library")?this._externalDatafeed.getQuotes(s,function(t){r._quotesInfo[e]&&(i(t),r._quotesInfo[e].listenerGUID=e,r._externalDatafeed.subscribeQuotes(s,r._quotesInfo[e].fastSymbols,i,r._quotesInfo[e].listenerGUID))},function(e){}):!this._externalDatafeed.getQuotes&&n.enabled("trading_terminal")&&setTimeout(function(){i(s.map(function(e){return{n:e,s:"ok",v:{}}}))}),this._createMarketStatusWatchers(e,s))},f.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},f.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},f.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},f.prototype.quoteSetFields=function(e,t){},f.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},f.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter(function(e){return t.indexOf(e)<0}),this._restartQuotesSubscription(e)},f.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},f.prototype.quoteHibernateAll=function(e){},f.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},f.prototype._startDepthSubscription=function(e){function t(e){return e.map(function(e){return{p:e.price,v:e.volume}})}function i(e){var i={};return i.s=r,i.bids=t(e.bids),i.asks=t(e.asks),i}function n(t){t.snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([i(t)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([i(t)]))}var o=this,r=this._depthInfo[e].symbol;r&&this._fullNameSymbolInfoMap[r]&&this._externalDatafeed.subscribeDepth&&(o._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(r,function(t){o._depthInfo[e]&&n(t)}))},f.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},f.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},
f.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},f.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},f.prototype._filteredSymbols=function(e){var t=[];return e.forEach(function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)}),t},f.prototype._isEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;return!!this._endOfData[n]},f.prototype._setEndOfData=function(e,t,i){var n=e+"!"+t+"@"+i;this._endOfData[n]=!0},f.prototype.alignTimePoint=function(e,t,i){return n.enabled("disable_resolution_rebuild")?e:r(t,i).alignTimeIfPossible(1e3*e)/1e3},f.prototype.serverTimeOffset=function(){return this._serverTimeOffset},f.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},e.exports=f}).call(t,i(35),i(5))},function(e,t,i){"use strict";(function(t){var n=i(37),o={},r=function(e,i,r){function s(){var e={};e.symbolname=_,e.status="ok",e.values={},e.values.current_session=d,o[_]=d,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([e]))}function a(e,i,o){var r=t.get_timezone(i);c=(new n.Session).init(r,e),h=o,m=setInterval(l,6e4),l(),s()}function l(){var e,t;if(c){if(h)return void(d="out_of_session");e=n.isTradingNow(new Date,c),t=e?"market":"out_of_session",t!==d&&(d=t,s())}}var c,h,u={},d=o[r]||"out_of_session",p=!1,_=r,f=i,m=null;return e.resolveSymbol(r,function(e){p||a(e.session,e.timezone,e.expired)},function(){}),u.stop=function(){p=!0,m&&clearInterval(m)},u.marketStatus=function(){return d},u};e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";(function(t){var n=i(673).HeikenAshi,o=i(15).Interval,r=function(){function e(e){this.host=e,this.cache={}}function r(e){var t=e.indexOf(",");return-1===t?e:e.slice(0,t)}function s(e,t,i,n,o,r,s){return o+e+t+i+(a(n)?"_":"")+r+"_"+s}function a(e){return e.has_empty_bars||e.force_session_rebuild}function l(e){if(0!==e.indexOf("="))return{symbol:e};var t;try{t=JSON.parse(e.slice(1))}catch(t){return{symbol:e}}return t.type&&(0===t.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?t.builder=new n:console.error("unknown builder type: "+t.type)),"string"!=typeof t.symbol&&(t.session=t.symbol.session||t.session,t.symbol=t.symbol.symbol),t}function c(t){e.instance=new e(t),p.setupFeed(e.instance)}var h,u,d,p=i(25),_=i(37),f=p.Symbol,m=p.StudyEngine,y=p.BarBuilder,g=p.BarSet;return e.prototype.getCache=function(e){return this.cache[e]},e.prototype.putCache=function(e,t){this.cache[e]=t},e.prototype.subscribe=function(e,t,i,n,o,r,a,l,c,h){var u=s(e,t,i,a,l,n,h),d=this.getCache(u);return d||(d=this.createItem(e,t,i,a,c,l,n,h),this.putCache(u,d)),d.listeners.addListener(o,r),{key:u,listener:o}},e.prototype.unsubscribe=function(e){var t=this.getCache(e.key);t&&t.listeners.removeListener(e.listener)},e.prototype.removeUnused=function(){var e,t,i,n,o,r=[];for(e in this.cache)this.cache[e]&&(t=this.cache[e],0===t.listeners.listenersCount()&&r.push(e));if(0!==r.length){for(i=0;i<r.length;i++)n=r[i],o=this.cache[n],
this.cache[n]=null,o.stop();this.removeUnused()}},e.prototype.rebuildFrom=function(e,t,i){var n,o,r,s,a=f.parsePeriod(e),l=f.parsePeriod(t);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(n=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(o=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===o.indexOf(n)){for(r=o.length-1;r>=0;r--)if(s=+o[r],n%s==0)return s+(a.isSeconds?"S":"");return""}return n+(a.isSeconds?"S":"")},e.prototype.createItem=function(e,t,i,n,s,c,p,_){var f,m,g,v,S,b,w,P=new d,T=l(e);return T.builder?new u(P,T.symbol,t,i,T.builder,n,s,c):(f=r(t),m=this.rebuildFrom(f,r(i),n),g=a(n),!o.isEqual(f,m)||g?(v=n.has_empty_bars,S=$.extend({},n),g&&(S.has_empty_bars=!1,S.force_session_rebuild=!1),void 0!==_&&(b=o.parse(f).inMilliseconds()/o.parse(m).inMilliseconds(),_*=Math.ceil(b)),new u(P,T.symbol,t,m,new y(t,v),S,s,c,p,_)):(w=T.session&&"extended"!==T.session,new h(P,T.symbol,t,i,w,this.host,n,s,p,_)))},h=function(e,t,i,n,o,s,a,l,c,h){this.listeners=e,this.host=s;var u=this;this.host.resolve(t,function(e){o&&e.regular_session&&(e.session=e.regular_session);var s=u.calculateFromTo(e,c||n||i,t,l,h);u.subs=u.host.subscribe(e,r(i),s,function(e){u.listeners.fire(e)},function(e){u.listeners.onError(e)})},function(e){u.listeners.onError(e)})},h.prototype._createDWMAligner=function(e,i){var n=t.get_timezone(i.timezone),o=new _.Session;return o.init(n,i.session),f.newBarBuilder(e,o,o)},h.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(e,i,n,o,r){var s,a,l,c,h,u,d,p,m=f.parsePeriod(i),y=(new Date).valueOf(),g=e.expired?t.cal_to_utc(t.get_timezone(e.timezone),new Date(1e3*e.expiration_date))||y:y;return""===m.resolution?(a=m.interval,l="D"):"S"===m.resolution?(a=10*m.interval,l=""):(c="D"===m.resolution?1:"W"===m.resolution?5:30,a=12*c*m.interval,l="M"),m.range?(a=m.range.interval,l=m.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,l,a))&&(a=h.intervalBack||a,l=void 0===h.resolutionBack?l:h.resolutionBack),u=e.sessionString||e.session,s=_.alignPeriodsBack(u,l,a,1,g),o&&o.getRangeExtensionTime&&(d=o.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),p=Math.ceil(1.5*r),o&&o.getRangeExtensionCount&&(p+=o.getRangeExtensionCount()),p>0&&(s=_.alignPeriodsBack(u,m.resolution,m.interval,p,s)),{from:s,to:g+6e4}},u=function(e,t,i,n,o,r,s,a,l,c){if(this.listeners=e,this.isRecalculated=!1,""===n)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=r;var h=this;this.engine=new m({tickerid:t,period:n,periodBase:i,body:o,sessionId:a,symbolInfo:r,rangeExtension:s,periodForInitialRange:l,
additionalBarsCount:c,recalc:function(e,t){h._recalc(t)},out:function(e,t){h._out(e,t)},nonseriesOut:function(e,t){h._nonseriesOut(e,t)},setNoMoreData:function(){h.barset&&(h.barset.endOfData=!0)},onErrorCallback:function(e){h.listeners.onError(e)}})},u.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},u.prototype._recalc=function(e){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new g(this.symbolInfo)),e&&(this.barset.nextTime=e.nextTime,this.barset.endOfData=e.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},u.prototype._nonseriesOut=function(e,t){var i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},u.prototype._out=function(e,t){var i,n,o,r,s,a,l,c=t[0];if(!isNaN(c)){if(i={time:c,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},n=t[7],this.barset||(this.barset=new g(e.info)),(o=t[8])instanceof Array)for(r=0;r<o.length;r++)s=t[9],a=o[r],l={time:a,open:s,high:s,low:s,close:s,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,n),this.barset.isBarClosed=n,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){return this.listeners.reduce(function(e,t){return e+(t?1:0)},0)},d.prototype.addListener=function(e,t){this.listeners.push({dataListener:e,onErrorCallback:t}),this.barset&&e(this.barset),this.errorMsg&&t(this.errorMsg)},d.prototype.removeListener=function(e){var t,i=this.listeners.filter(function(t){return t.dataListener===e});0!==i.length&&(t=this.listeners.indexOf(i[0]),delete this.listeners[t])},d.prototype.onError=function(e){var t,i,n,o;for(this.errorMsg=e||"unspecified error",t=this.listeners,i=t.length,n=0;n<i;n++)(o=t[n])&&o.onErrorCallback&&o.onErrorCallback(e)},d.prototype.fire=function(e,t){var i,n,o,r;for(t||(this.barset=e),i=this.listeners,n=i.length,o=0;o<n;o++)(r=i[o])&&r.dataListener(e)},{setupFeed:c,parseSymbol:l,unsubscribeUnused:function(){e.instance.removeUnused()}}}();e.exports=r}).call(t,i(35))},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HeikenAshi",function(){return o}),n=i(25),i.n(n),o=function(){function e(){}return e.prototype.main=function(e){var t,i,o,r,s=e.new_var(n.Std.open(e)),a=e.new_var(n.Std.close(e)),l=s.get(1),c=a.get(1),h=n.Std.ohlc4(e),u=n.Std.na(s.get(1))?(n.Std.open(e)+n.Std.close(e))/2:(l+c)/2;return s.set(u),a.set(h),t=n.Std.max(n.Std.high(e),n.Std.max(u,h)),i=n.Std.min(n.Std.low(e),n.Std.min(u,h)),o=n.Std.volume(e),r=e.symbol,[r.time,u,t,i,h,o,r.updatetime,r.isBarClosed]},e}()},function(e,t,i){"use strict";var n=function(){function e(e,t,i){return e+","+t+","+i}function t(t,i,n){delete o[e(t,i,n)]}function n(t,i,n){function s(e){
return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?o[e]=new a(TradingView.ChartapiMessagerInstances[t],l.pureResolution):o[e]=new a(null,l.pureResolution),o[e]}var l=r.Symbol.parsePeriod(n),c=e(t,i,l.pureResolution);return o[c]?o[c]:s(c)}var o={},r=i(25),s=i(37),a=function(e,t,i){this._chartApiMessager=e,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=t,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(e,t){this._lastRealBarTime=e;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars);this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(t,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1500))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(e,t,i){var n,o;return 0===t?e:!this.ready()||e<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*e),this.historyExtrapolator().getPointTimeUTC(e,t,i)):(n=0===this._extrapolatedBarsCache.length||e===this._lastRealBarTime/1e3,o=n?-1:this.indexOfBar(e,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,o+t+1),this._extrapolatedBarsCache[o+t])},a.prototype.findDistanceInBars=function(e,t,i){return e===t?0:(this.historyExtrapolator().setLastBarTime(0,1e3*e),this.historyExtrapolator().indexOfBar(t,i))},a.prototype.indexOfBar=function(e,t){this._ensureExtrapolatedToTime(t,1e3*e);var i=s.lower_bound(this._extrapolatedBarsCache,e,function(e,t){return e>t?1:e<t?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(e,t){var i,n,o;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=t(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,e,this._resolution));for(n=0;n<i.length;++n)i[n]=i[n]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,o=i.slice(0),o.sort(),n=0;n<o.length-1;++n)o[n]===o[n+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*o[n]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,e,this._resolution)},a.prototype.onTickmarksNeeded=function(e,t){if(this.ready())this.ensureExtrapolatedToBar(e,t);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(e,t)})}},a.prototype.ensureExtrapolatedToBar=function(e,t){var i=this;return this._requestedAmountOfBars=t,this._extrapolateData(e,function(n){return i._extrapolatedBarsCache.length>=t||!i._shouldExtrapolateMore()?null:s.extrapolateBarsFrontByCount(i.newBarBuilder(e),n,t)})},a.prototype._ensureExtrapolatedToTime=function(e,t){
var i=this;return this._extrapolateData(e,function(n){var o,r;return n>=t||!i._shouldExtrapolateMore()?null:(o=2e3,r=s.extrapolateBarsFrontToTime(i.newBarBuilder(e),n,t,o),r[r.length-1]<t&&console.warn("Extrapolation error: not enough data created"),r)})},a.prototype.newBarBuilder=function(e){var t=r.Symbol.newSession(e.timezone,e.session);return r.Symbol.newBarBuilder(this._resolution,t)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(e,t){(null===this._lastRealBarIndex||this._lastRealBarIndex===e&&this._lastRealBarTime!==t)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==e&&(this._lastRealBarIndex>e?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==t&&this._extrapolatedBarsCache.shift(e-this._lastRealBarIndex)),this._lastRealBarIndex=e,this._lastRealBarTime=t;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:t,storage:n}}();e.exports=n},function(e,t,i){"use strict";(function(t){var n=i(37),o=i(15).Interval,r=function(){function e(e,t){return e}function r(e,t){var i=m.get_timezone(e.timezone),o=new n.Session;return o.init(i,e.session),f.Symbol.newBarBuilder(t,o,o)}function s(t,i,n,o,r,s){var a,l,c,h,u=e(i,n);for(p.hasOwnProperty(u)||(p[u]=[]),a=[],l=0;l<o.length;++l)o[l][1]<0&&(o[l][1]=0),0!==o[l][1]?(c=r.getPointTimeUTC(o[l][0],o[l][1],s),a.push(c)):o[l][0]&&a.push(o[l][0]);h={guid:t,points:a},p[u].push(h)}function a(e){var t,i,n;for(t in p)for(i=p[t],n=0;n<i.length;++n)if(i[n].guid===e)return void i.splice(n,1)}function l(e,t,i,n,o){var r,s,a,l=[];for(r=0;r<e.points.length;++r){if(null==(s=e.points[r]))return null;if(null===(a=h(t,s,i,n,o)))return null;l.push({index:r,value:[a,s]})}return l}function c(t,i,n,o,r,s){var a,c,h,u,d=e(t,i);if(p.hasOwnProperty(d))for(a=p[d].length,c=0;c<a;++c)h=p[d][c],null!==(u=l(h,n,o,r,i))&&s(h.guid,u)}function h(e,t,i,o,s){var a,l;return 1e3*(t=r(o,s).alignTimeIfPossible(1e3*t)/1e3)<e[0].value[0]?-d(o,s,t,e[0].value[0]/1e3,i):(a=n.lower_bound(e,1e3*t,function(e,t){return e.value[0]>t?1:e.value[0]<t?-1:0}))>=0&&t<e[e.length-1].value[0]?(e[a].value[0]/1e3!==t&&0!==a&&a--,e[a].index):(l=i.indexOfBar(t,o),-1===l?null:l)}function u(e,t,i,n,o){function r(e,t){var i=new Date(1e3*e),n=new Date(1e3*t),o=12*(n.getFullYear()-i.getFullYear());return o-=i.getMonth()+1,o+=n.getMonth(),o<=0?0:o}var s,a,l,c,h,u,d,p,_,f,y,g,v,S,b;if(t.isMonths())s=r(n,o)/t.multiplier();else if(t.isWeeks())a=Math.ceil((o-n)/604800),s=Math.ceil(a/t.multiplier());else{if(l=m.utc_to_cal(i.timezone,+new Date(1e3*n)),c=m.utc_to_cal(i.timezone,+new Date(1e3*o)),(h=(o-n)/86400)>4*(7-i.spec.weekEndsCount()))d=h/7,u=d*(7-i.spec.weekEndsCount());else{for(p=0,_={},f=l;f.valueOf()<=c.valueOf();f=m.add_days_considering_dst(i.timezone,f,1))y=m.get_day_of_week(f),void 0===_[y]&&(_[y]=i.spec.isWeekEnd(y)),_[y]&&p++;u=h-p}if(t.isDays())s=Math.ceil(u/t.multiplier());else{
if(g=t.isHours()?60*t.multiplier()*60:t.isSeconds()?t.multiplier():60*t.multiplier(),h<1&&(v=i.spec.findSessionEntry(m.get_day_of_week(l),m.get_minutes_from_midnight(l)),S=i.spec.findSessionEntry(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),v===S))return Math.ceil((o-n)/g);y=i.spec.entries()[0].dayOfWeek(),b=60*i.spec.entries().reduce(function(e,t){return e+(t.dayOfWeek()===y?t.length():0)},0),s=Math.ceil(u*b/g)}}return s}function d(e,t,i,s,a){var l,c,h=new o(t),d=m.get_timezone(e.timezone),p=new n.Session;return p.init(d,e.session),l=r(e,t),i=l.alignTimeIfPossible(1e3*i)/1e3,s=l.alignTimeIfPossible(1e3*s)/1e3,i>=s?0:(c=u(e,h,p,i,s),c>=1e3?c:a.findDistanceInBars(i,s,e))}var p={},_="undefined"!=typeof window?window:t,f=i(25),m=_.PineJsCalendar?_.PineJsCalendar:i(35);return{createPointset:s,removePointset:a,broadcastPointsetsUpdates:c,tests:{approxBarsInterval:u,indexOfTime:h}}}();e.exports=r}).call(t,i(98))},function(e,t,i){"use strict";function n(e,t,i){return Object(a.isArray)(e)?o(e,t,i):Object(a.isObject)(e)&&(Object(a.isHashObject)(e)||i&&i.visitInstances)?r(e,t,i):e}function o(e,t,i){return e.map(function(e){var o=n(e,t,i),r=t(o);return void 0!==r?r:o})}function r(e,t,i){var o={};return Object.keys(e).forEach(function(r){var s=n(e[r],t,i),a=t(s);o[r]=void 0!==a?a:s}),o}function s(e,t,i){var o=n(e,t,i),r=t(o);return void 0!==r?r:o}var a;Object.defineProperty(t,"__esModule",{value:!0}),t.visitObject=s,a=i(12),i.n(a)},function(e,t,i){"use strict";function n(e,t){return e.ticker+"_"+t}function o(e){return new Date(e).toISOString()}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DatafeedRequestsCachedProcessor",function(){return h}),r=i(15),s=i(78),a=i(25),i.n(a),l=i(5),i.n(l),i(85),c=function(){function e(e,t,i,n){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=e,this._symbolInfo=t,this._resolution=i,this._dwmAligner=n}return e.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed},e.prototype.addSubscription=function(e,t,i){var n=this,o=this._getNextSubscriptionId(),r=Math.floor(e.from/1e3),s=Math.floor(e.to/1e3);return this._pendingSubscribers.push({key:o,range:{from:r,to:s},onHistoryCallback:t,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return n._processPendingSubscribers()},0),o},e.prototype.removeSubscription=function(e){var t,i=this,n=this._pendingSubscribers.find(function(t){return t.key===e});return n?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(n),1):(t=this._subscribers.find(function(t){return t.key===e}))?(this._subscribers.splice(this._subscribers.indexOf(t),1),
void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i._purgeCacheDelayed(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._purgeCacheDelayed=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},e.prototype._logMessage=function(e,t){(l.enabled("charting_library_debug_mode")||t)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,e))},e.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},e.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},e.prototype._processPendingSubscribers=function(){var e,t,i,n,s,a,l=this,c=this._pendingSubscribers;if(c.length){if(this._requesting)return void this._logMessage("Processing is skipped due active request");if(this._logMessage("Processing pending subscribers, count="+c.length),this._needPurgeCache&&this._purgeCache(),this._errorMessage)return e=this._errorMessage,this._logMessage("Return error: "+e),this._pendingSubscribers=[],void c.forEach(function(t){t.onErrorCallback(e)});if(t=c.reduce(function(e,t){return Math.min(t.range.from,e)},1/0),this._logMessage('Leftmost requested "from" is '+o(1e3*t)),(!this._leftDate||t<this._leftDate)&&(i=new r.Interval(this._resolution),n=(i.inMilliseconds(Date.now())||0)/1e3,s=!this._leftDate,a=!s&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t<n,(s||!a)&&!this._endOfData))return void this._ensureRequestedTo(t);this._pendingSubscribers=[],c.forEach(function(e){var t=l._moveSubscriberToRealtime(e);l._returnHistoryDataToSubscriber(e,t)}),this._subscribeRealtimeIfNeeded()}},e.prototype._moveSubscriberToRealtime=function(e){var t={key:e.key,onHistoryCallback:e.onHistoryCallback,barset:null};return this._subscribers.push(t),t},e.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},e.prototype._subscribeRealtime=function(){var e,t,i=this;this._symbolInfo.expired||this._realtimeOn||(e=function(e){i._dwmAligner&&(e.time=i._dwmAligner.tradingDayToSessionStart(e.time)),i._putToCacheNewBar(e),i._subscribers.forEach(function(t){var i=t.barset;if(null===i)throw Error("subscirber.barset is null");i.add(e),t.onHistoryCallback(i)})},t=function(){i._unsubscribeRealtime();var e=i._leftDate;i._purgeCache(),e&&i._ensureRequestedTo(e)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,e,n(this._symbolInfo,this._resolution),t),this._logMessage("Subscribed to realtime"))},e.prototype._unsubscribeRealtime=function(){
!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(n(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},e.prototype._returnHistoryDataToSubscriber=function(e,t){var i,n,r=e.range,s=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||r.from):this._createBarset(r.from);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),o(s.bars[0].time),o(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,i=this._inGapNextTime(r.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*i))),s.nextTime=i):0===s.count()&&(n=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>n&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*n))),s.nextTime=n||void 0),this._endOfData&&null!==this._leftDate&&e.range.from<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)},e.prototype._createBarset=function(e){var t=Object(s.lowerbound)(this._cache.bars,1e3*e,function(e,t){return e.time<t});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(t))},e.prototype._ensureRequestedTo=function(t){var i,n,r,s=this;if(this._leftDate&&this._leftDate<t)return void this._processPendingSubscribers();i=!this._leftDate,this._requesting=!0,n=t,r=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(e._now()/1e3),this._leftDate=t,this._logMessage("Requesting data: [{0} ... {1}] ".format(o(1e3*n),o(1e3*r))),this._datafeed.getBars(this._symbolInfo,this._resolution,n,r,function(e,t){s._requesting=!1,s._processBars(e,t)},function(e){s._requesting=!1,s._errorMessage=e||null,s._processPendingSubscribers()},i)},e.prototype._processBars=function(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?this._processFullBarset(e,t):this._processEmptyBarset(t),this._processPendingSubscribers()},e.prototype._processEmptyBarset=function(t){this._logMessage("Receiving bars: barset is empty"),t&&t.nextTime?(this._logMessage("Next time received: `{0}`".format(o(1e3*t.nextTime))),this._addGap(t.nextTime),this._leftDate=Math.min(this._leftDate||e._now()/1e3,t.nextTime+1)):t&&t.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},e.prototype._processFullBarset=function(e,t){var i=e[0].time,n=e[e.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(e.length,o(i),o(n))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),
this._putToCache(e)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},e.prototype._addGap=function(t){var i;this._gaps.find(function(e){return e.from===t})||(i=(this._cache.bars.length?this._cache.bars[0].time:e._now())/1e3,this._gaps.push({from:t,to:i}))},e.prototype._inGapNextTime=function(e){var t=this._gaps.find(function(t){return t.from<e&&t.to>e});return t?t.from:null},e.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},e.prototype._checkBars=function(e,t){var i,n;if(void 0===t&&(t=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<e.length;i++)e[i].time<=e[i-1].time&&(n="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(e[i].time,i,e[i-1].time,i-1),t&&this._dwmAligner&&(n+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(n))},e.prototype._putToCache=function(e){if(0===e.length)return!0;if(this._cache.bars.length===e.length&&this._cache.bars[0].time===e[0].time&&this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&e[e.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&e[e.length-1].time>=this._cache.bars[0].time){var t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=e.concat(this._cache.bars),this._checkBars(this._cache.bars,!0),!0},e.prototype._putToCacheNewBar=function(e){var t=this._cache.bars.length,i=e.time,n=0===t?NaN:this._cache.bars[t-1].time;0===t||n<i?this._cache.bars.push(e):n===i?this._cache.bars[t-1]=e:console.error("putToCacheNewBar: time violation, previous bar time: "+o(n)+" should be less or equal to new time: "+o(i))},e.prototype._alignBarsTime=function(e){if(this._dwmAligner)for(var t=0;t<e.length;t++)e[t].time=this._dwmAligner.tradingDayToSessionStart(e[t].time)},e._now=function(){return Date.now()+6e4},e}(),h=function(){function e(e,t){this._threads={},this._datafeed=e,this._dwmAlignerCreator=t}return e.prototype.destroy=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={},delete this._datafeed},e.prototype.purgeCache=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={}},e.prototype.subscribe=function(e,t,i,o,r){var s,a=n(e,t);return this._threads[a]||(this._threads[a]=this._createThread(e,t)),
s=this._threads[a].addSubscription(i,o,r),a+'"'+s},e.prototype.unsubscribe=function(e){var t,i,n=e.split('"');if(2!==n.length)return void console.warn("Wrong guid format");t=n[0],i=parseInt(n[1]),this._threads.hasOwnProperty(t)?this._threads[t].removeSubscription(i):console.warn("Data thread doesnt exist: "+e)},e.prototype._createThread=function(e,t){return new c(this._datafeed,e,t,this._dwmAlignerCreator(t,e.timezone,e.session))},e.prototype._forEachThread=function(e){var t=this;Object.keys(this._threads).forEach(function(i){return e(i,t._threads[i])})},e}()},function(e,t,i){"use strict";(function(t,n){function o(e,i,n,o){this._chartWidgetCollection=e,this._chartApiInstance=i,this._saveChartService=n,this._loadChartService=o,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(62).linking,s=i(679),a=i(108).layouts,l=i(31),c=i(88),h=i(32),u=i(61),d=i(67),p=i(4),_=i(209).createNoticeDialog,f=i(82).createConfirmDialog,m=i(298),y=i(685).ThemesApi;o.prototype.subscribe=function(e,t){l.subscribe(e,t)},o.prototype.unsubscribe=function(e,t){l.unsubscribe(e,t)},o.prototype.onContextMenu=function(e){l.subscribe("onContextMenu",function(t){t.callback(e(t.unixtime,t.price))})},o.prototype.onGrayedObjectClicked=function(e){l.subscribe("onGrayedObjectClicked",e)},o.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},o.prototype._getChartWidgetApi=function(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new s(e),this._chartWidgets.set(e,t)),t},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(e,t,i){r.interval.setValue(t),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(e){this._chartWidgetCollection.layout.setValue(e)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.layoutName=function(){return this._chartWidgetCollection.metaInfo.name.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},o.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},o.prototype.saveChart=function(e){var t=this;this._saveChartService.whenReadyToSave(function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))})},o.prototype.loadChart=function(e){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),
e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(e){return!e.is_hidden_study}).map(function(e){return e.name||e.description})},o.prototype.getSavedCharts=function(e){d.getCharts(e)},o.prototype.loadChartFromServer=function(e){d.loadChart(e)},o.prototype.saveChartToServer=function(e,t,i,n){this._saveChartService.saveChartSilently(e,i,t,n)},o.prototype.removeChartFromServer=function(e,t){d.removeChart(e,t)},o.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},o.prototype.closePopupsAndDialogs=function(){var e,t,n=document.querySelectorAll("._tv-dialog-title-close");for(e=0;e<n.length;e++)n[e].click();t=i.c[690],t&&t.exports.closeAllDialogs(),c.hideAll()},o.prototype.selectLineTool=function(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,h.tool.value()!==e&&h.tool.setValue(e))},o.prototype.selectedLineTool=function(){var e,t=Object.keys(m.supportedLineTools),i=h.tool.value();for(e=0;e<t.length;++e)if(m.supportedLineTools[t[e]].name===i)return t[e];return""},o.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new n(h.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(e){h.lockDrawings().setValue(e)}),h.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(h.lockDrawings().value())})),this._lockDrawingsWatchedValue},o.prototype.hideAllDrawingTools=function(){return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new n(h.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe(function(e){h.hideAllDrawings().setValue(e)}),h.hideAllDrawings().subscribe(this,function(){this._hideDrawingsWatchedValue.setValue(h.hideAllDrawings().value())})),this._hideDrawingsWatchedValue},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(e){function t(){i&&(i(),i=null)}e=e||{};var i=e.callback;_({title:e.title,content:e.body||""}).then(function(e){e.on("action:ok",t),e.on("afterClose",t),e.open()})},o.prototype.showConfirmDialog=function(e){function t(e){i&&(i(e),i=null)}if(e=e||{},!e.callback)throw Error("callback must be exist");var i=e.callback;f({title:e.title,content:e.body||""}).then(function(e){e.on("action:yes",t.bind(null,!0)),e.on("action:no",t.bind(null,!1)),e.on("afterClose",t.bind(null,!1)),e.open()})},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){
var e=this._loadChartService;e&&e.showLoadDialog()},o.prototype.showSaveAsChartDialog=function(){var e=this._saveChartService;e&&window.runOrSignIn(function(){e.saveChartAs()})},o.prototype.themes=function(){return new y({chartWidgetCollection:this._chartWidgetCollection})},o.prototype.undoRedoState=function(){return this._chartWidgetCollection.undoHistory.state()},o.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},e.exports=o}).call(t,i(8),i(16))},function(e,t,i){"use strict";(function(t){function n(e){var t,i,n=Object.keys(y),o=n.length;for(t=0;t<o;++t)if(i=n[t],y[i].name===e)return i;return null}function o(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}var r=i(7).ensureNotNull,s=i(680),a=i(162).applyOverridesToStudy,l=i(26),c=i(681).LineDataSourceApi,h=i(682).StudyApi,u=i(683).PaneApi,d=i(3).DefaultProperty,p=i(335).availableIcons,_=i(37),f=i(15).Interval,m=i(35),y=i(298).supportedLineTools,g=i(292).showTooManyStudiesNotice,v=i(12).isNumber,S=i(684).onSeriesCompletedOrErrorReceived,b=function(e){this._chartWidget=e,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};b.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new u(e),this._panes.set(e,t)),t},b.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model().model()),this._studies.set(e,t)),t},b.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},b.prototype._makeSubscriptionFromDelegate=function(e){var t=$.extend({},e);return delete t.fire,t},b.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},b.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},b.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},b.prototype.clearMarks=function(){this._chartWidget.clearMarks()},b.prototype.symbol=function(){return this._chartWidget.getSymbol()},b.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null},b.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},b.prototype.setSymbol=function(e,i){function n(e){e||i()}if(e!==this.symbol()||t.enabled("same_data_requery")){var o=this._chartWidget.model().mainSeries().dataEvents();return i&&S(o,n),this._chartWidget.setSymbol(e)}},b.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()
},b.prototype.setResolution=function(e,t){function i(e){e||t()}if((e=e.toUpperCase())!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();return t&&S(n,i),this._chartWidget.setResolution(e)}},b.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},b.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(e){return{id:e.id(),name:e._metaInfo.description}})},b.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(e){return{id:e.id(),name:n(e.toolname)}}).filter(function(e){return null!==e.name})},b.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},b.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},b.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);if(!t)return void console.warn("Can't find a source with id: "+e);this._chartWidget.model().chartModel().removeSource(t,!0)},b.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},b.prototype.applyStudyTemplate=function(e){this._chartWidget.model().model().restoreStudyTemplate(e,""+1e3*Math.random())},b.prototype.setVisibleRange=function(e,i){var n,o,r,s;if(void 0===e||!e.from||!e.to||isNaN(e.from)||isNaN(e.to))return void console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.');n=this._chartWidget.model().model(),o=n.mainSeries(),r=[parseInt(e.from),parseInt(e.to)],s=f.isDWM(o.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,e.from=s[0],e.to=s[1],this._chartWidget.setVisibleTimeRange(e.from,e.to,i)},b.prototype.getVisibleRange=function(){var e,t,i,n,o={from:0,to:0},s=this._chartWidget.model().timeScale(),a=s.visibleBars(),l=this._chartWidget.model().mainSeries(),c=l.syncModel();return null===a?o:(e=r(l.data().last()),t=a.lastBar()-e.index,i=t<=0,n=i?s.indexToTimePoint(a.lastBar()):c.projectTime(e.value[TradingView.TIME_PLOT],t),o.from=+s.indexToTimePoint(Math.max(0,a.firstBar()))||0,o.to=+n||0,o)},b.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},b.prototype._createTradingPrimitive=function(e,t){function i(){var e=TradingView.CLOSE_PLOT,t=r(n._chartWidget.model().mainSeries().bars().last());return{index:t.index,price:t.value[e]}}var n=this,o=this._chartWidget.model().model(),s=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(s,i(),e)._adapter},b.prototype.createOrderLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},b.prototype.createPositionLine=function(e){var e=e||{}
;return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},b.prototype.createExecutionShape=function(e){var e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},b.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},b.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries(),r=o.symbolInfo(),s=m.get_timezone(r.timezone);return n.timeScale().isEmpty()?e:(t=(new _.Session).init(s,r.session),i=_.createDWMAligner(o.interval(),t),null===i?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},b.prototype._convertUserPointsToDataSource=function(e){function i(e,t,i){var n,o,r,s=h.closestIndexLeft(e)||0,a={index:s},l=h.valueAt(s);return e>l&&(n=c.syncModel().distance(l,e),n.success&&(a.index=a.index+n.result)),v(t)?a.price=t:(o=["open","high","low","close"],r=i?o.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var n,o,r,s,a,l=this._chartWidget.model().model(),c=l.mainSeries(),h=l.timeScale().points(),u=c.data();if(l.timeScale().isEmpty())return null;for(n=e.map(function(e){return e.time}),o=f.isDWM(c.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(n):n,r=[],s=0;s<e.length;s++)a=e[s],r.push(i(o[s],a.price,a.channel));return r},b.prototype.createMultipointShape=function(e,t,i){var n,r,s,a,l,c,h,u=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(n=_.paneForSource(f),r=this._convertUserPointsToDataSource(e),s=y[t.shape]||y.flag,s.onlySelectable)throw Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(t.icon))throw Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=new d(s.name.toLowerCase()),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):o(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(s.supportsText&&t.text&&a.text.setValue(t.text),c=u.createLineTool(n,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+t.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return t.lock&&c.setUserEditEnabled(!1),t.disableSelection&&(c.customization.disableSelection=!0),t.disableSave&&(c.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder&&("top"===t.zOrder?u.bringToFront(c):"bottom"===t.zOrder&&u.sendToBack(c)),c.id()}},b.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw Error("There is no such shape")
;return this._getLineDataSourceApi(t)},b.prototype.createStudy=function(e,t,i,n,o,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g(),null):(e=e.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),e),d=$.extend({},d),delete d.state,d?(p={},n&&(p.inputs=s.getStudyRecordFromArray([e].concat(n),this._chartWidget).inputs),_=u.insertStudy(d,p,t,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),o&&o(_.id()),_.id()):(console.warn("Study `"+e+"` not found."),null))},b.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw Error("There is no such study");return this._getStudyApi(t)},b.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},b.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},b.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},b.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},b.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},b.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},b.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},b.prototype.dataReady=function(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t},b.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},b.prototype.setTimezone=function(e){this._chartWidget.setTimezone(e)},b.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(e){return this._getPaneApi(e)},this)},b.prototype.exportData=function(e){var t=this._chartWidget;return new Promise(function(n){i.e(26).then(function(o){var r=i(821).exportData;n(r(t.model().chartModel(),e))}.bind(null,i)).catch(i.oe)})},b.prototype.canZoomOut=function(){return!this._chartWidget.model().zoomStack().isEmpty()},b.prototype.zoomOut=function(){this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()},e.exports=b}).call(t,i(5))},function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;i<e.length;++i)if(e[i].description.toLowerCase()===n||e[i].shortDescription.toLowerCase()===n)return e[i];throw Error("Can't find metainfo for `"+t+"`")}
throw Error("There is no studies metainfo at all")}function i(e){return e.inputs.map(function(e){return{id:e.id,type:e.type,name:e.name}})}function n(n,o){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(n))return r=t(o.model().studiesMetaData(),n),{id:r.id,overlay:e(r)};for(a=n.slice(0),l=a[0],r=t(o.model().studiesMetaData(),l),c=e(r),h=i(r),d=a.splice(1),p=0;p<d.length;++p)u||(u={}),_=s[h[p].type]||s.string,u[h[p].id]=_(d[p]);return{id:r.id,name:l,overlay:c,inputs:u}}function o(e,n,o){function r(e){return e.name.toLowerCase()===a}var s,a,l,c=t(o.model().studiesMetaData(),e),h=i(c),u={};for(s in n)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=n[s]):console.warn("Uknown input `"+s+"` of `"+e+"`");return{id:c.id,name:e,inputs:u}}var r={},s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return r.getStudyRecordFromArray=function(e,t){return t=t||chartWidget,n(e,t)},r.getStudyRecordFromObject=function(e,t,i){return i=i||chartWidget,o(e,t,i)},r}();e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineDataSourceApi",function(){return r}),n=i(12),i.n(n),o=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function e(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}return e.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},e.prototype.setSelectionEnabled=function(e){this._source.setSelectionEnabled(e)},e.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},e.prototype.setSavingEnabled=function(e){this._source.setSavingInChartEnabled(e)},e.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},e.prototype.setShowInObjectsTreeEnabled=function(e){this._source.setShowInObjectsTreeEnabled(e)},e.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._source.setUserEditEnabled(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._source)},e.prototype.sendToBack=function(){this._model.sendToBack(this._source)},e.prototype.getProperties=function(){return this._source.properties().state(o,!0)},e.prototype.setProperties=function(e){this._setProps(this._source.properties(),e,"")},e.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},e.prototype.setPoints=function(e){var t,i,n=this._source.pointsCount(),o=-1===n?this._source.points().length:n;if(o!==e.length)throw Error("Wrong points count. Required="+o);for(t=this._pointsConverter.apiPointsToDataSource(e),i=0;i<t.length;++i)this._source.setPoint(i,t[i])},e.prototype._setProps=function(e,t,i){var o,r,s;for(o in t)t.hasOwnProperty(o)&&(r=0===i.length?o:i+"."+o,e.hasOwnProperty(o)?(s=t[o],
Object(n.isHashObject)(s)?this._setProps(e[o],s,r):e[o].setValue(s)):console.warn('Unknown property "'+r+'"'))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyApi",function(){return s}),n=i(1),i(11),o=i(7),i.n(o),r=i(162),s=function(){function e(e,t){this._study=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return n.a({},e,{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n,o=this.getInputValues(),r=function(e){void 0!==o.find(function(t){return t.id===e.id})?s._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],r(n)},e.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.changePriceScale=function(e){var t,i,n,r=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),s=null;switch(e){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":s=r.priceScaleByName("");break;case"as-series":if(t=this._model.mainSeries(),(i=Object(o.ensureNotNull)(this._model.paneForSource(t)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');n=i.priceScaleName(i.priceScaleForSource(t)),s=r.priceScaleByName(n);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+e+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},e.prototype.isVisible=function(){return this._study.properties().visible.value()},e.prototype.setVisible=function(e){this._study.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._study)},e.prototype.sendToBack=function(){this._model.sendToBack(this._study)},e.prototype.applyOverrides=function(e){Object(r.applyOverridesToStudy)(this._study,e)},e.prototype._showStudyPriceScale=function(){var e=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),t=e.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(t,!0)},e}()},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e){this._priceScale=e}return e.prototype.getMode=function(){var e=this._priceScale.properties()
;return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0},e.prototype.setMode=function(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})},e}(),i.d(t,"PaneApi",function(){return o}),o=function(){function e(e){this._priceScales=new WeakMap,this._pane=e}return e.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},e.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},e.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},e.prototype.getMainSourcePriceScale=function(){var e,t=this._pane.mainDataSource();return null===t?null:(e=this._pane.priceScaleForSource(t),null===e?null:this._getPriceScaleApi(e))},e.prototype._getPriceScaleApi=function(e){var t=this._priceScales.get(e);return void 0===t&&(t=new n(e),this._priceScales.set(e,t)),t},e}()},function(e,t,i){"use strict";function n(e,t){var i=function(){e.completed().unsubscribe(null,n),t(!1)},n=function(){e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.onSeriesCompletedOrErrorReceived=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ThemesApi",function(){return o}),n=i(251),o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(this._getActiveChartModel()))},e.prototype.setStdTheme=function(e){var t=this;return Object(n.getStdTheme)(e).then(function(i){t._opts.chartWidgetCollection.applyTheme(i.content),Object(n.setTheme)(e),Object(n.syncTheme)()})},e.prototype.setStdThemeForLayout=function(e){Object(n.setTheme)(e),Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},e.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},e}()},function(e,t,i){"use strict";var n,o,r,s=i(25);i(183),n=i(687).pivotPointsStandardStudyItem,o=i(688).spreadStudyItem,r=i(689).ratioStudyItem,JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),s.Std.period(this._context),s.Std.period(this._context))},
this.main=function(e,t){var i,n,o,r,a;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=s.Std[t(0)](this._context),r=this._context.new_unlimited_var(o),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{symbol:""}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"Open"},high:{title:"High"},low:{title:"Low"},close:{title:"Close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a,l;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(s.Std.open(this._context)),r=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context)),this._context.select_sym(0),[o.adopt(n,i,1),r.adopt(n,i,1),a.adopt(n,i,1),l.adopt(n,i,1)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#eb4d5c",width:1,style:0},1:{color:"#53b987",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(e,t){return s.Std.gt(e,t)?0:1},this.f_1=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){var i,n,o,r,a,l,c;return this._context=e,this._input=t,i=this._input(0),n=s.Std.volume(this._context),o=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,o,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,
is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(e,t){var i,n,o,r,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),n=this._input(1),o=i/100,r=n/2,a=s.Std.zigzag(o,r,this._context),l=s.Std.zigzagbars(o,r,this._context),c=a,h=l,[c,h]}}},{name:"Sessions",metainfo:{_metainfoVersion:44,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0,precision:4},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions"},constructor:function(){function e(e,t){return{id:e,time:e,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){var i,n,o;return s.Std.isdwm(e)?null:(i=s.Std.time(e),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),e.symbol.isLastBar&&e.symbol.isNewBar?(o=this._getVerticalLineData(e),0===o.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:o}]},erase:[{action:"all"}]}}}):null))}}},{name:"SuperTrend",metainfo:{_metainfoVersion:39,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,
type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var e,t,i,n,o,r=this._input(0),a=this._input(1),l=s.Std.atr(r,this._context);return r=s.Std.hl2(this._context)+l*a,l=s.Std.hl2(this._context)-l*a,e=this._context.new_var(s.Std.close(this._context)),a=this._context.new_var(),t=s.Std.max(l,a.get(1)),a.set(s.Std.gt(e.get(1),a.get(1))?t:l),l=this._context.new_var(),t=s.Std.min(r,l.get(1)),l.set(s.Std.lt(e.get(1),l.get(1))?t:r),r=this._context.new_var(),e=s.Std.nz(r.get(1),1),e=s.Std.lt(s.Std.close(this._context),a.get(1))?-1:e,r.set(s.Std.gt(s.Std.close(this._context),l.get(1))?1:e),a=s.Std.eq(r.get(0),1)?a.get(0):l.get(0),i=s.Std.eq(r.get(0),1)?0:1,n=1===r.get(0)&&-1===r.get(1),o=-1===r.get(0)&&1===r.get(1),[a,i,n,o]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}},n,o,r])},function(e,t,i){"use strict";function n(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw Error("Unknown kind "+e)}}function o(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function r(e,t){return new Date(t,e,0).getDate()}function s(e,t){var i,n,s;return u.Std.ismonthly(e)?(i=new Date(t),n=i.getUTCDay(),s=r(i.getUTCMonth(),i.getUTCFullYear()),n<s?(o(i,u.Std.interval(e)),i=u.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=u.Std.add_days_considering_dst("Etc/UTC",i,1),o(i,u.Std.interval(e))),i.valueOf()):t+d.Interval.parse(e.symbol.resolution).inMilliseconds(t)}function a(e,t,i,n,o,r,s,a){var l,c=new p,h=NaN,d=i-n;switch(a){case 0:h=(i+n+o)/3,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+(i-n),c.s2=h-(i-n),c.r3=2*h+(i-2*n),c.s3=2*h-(2*i-n),c.r4=3*h+(i-3*n),c.s4=3*h-(3*i-n),c.r5=4*h+(i-4*n),c.s5=4*h-(4*i-n);break;case 1:h=(i+n+o)/3,c.p=h,c.r1=h+.382*d,c.s1=h-.382*d,c.r2=h+.618*d,c.s2=h-.618*d,c.r3=h+d,c.s3=h-d;break;case 2:h=(i+n+2*e)/4,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=i+2*(h-n),c.s3=n-2*(i-h),c.r4=c.r3+d,c.s4=c.s3-d;break;case 3:h=(i+n+o)/3,c.p=h,c.r1=2*h-n,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=h+2*d,c.s3=h-2*d,c.r4=h+3*d,c.s4=h-3*d;break;case 4:l=NaN,l=u.Std.equal(t,o)?i+n+2*o:u.Std.greater(o,t)?2*i+n+o:2*n+i+o,h=l/4,c.p=h,c.r1=l/2-n,c.s1=l/2-i;break;case 5:h=(i+n+o)/3,c.p=h,c.r1=o+1.1*d/12,c.s1=o-1.1*d/12,c.r2=o+1.1*d/6,c.s2=o-1.1*d/6,c.r3=o+1.1*d/4,c.s3=o-1.1*d/4,c.r4=o+1.1*d/2,c.s4=o-1.1*d/2;break;default:throw Error("Unknown kind")}return c.startIndex__t=r,c.endIndex__t=s,c}function l(e,t){return(!u.Std.isdaily(e)||"Daily"!==t)&&((!u.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!u.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}function c(e){if(u.Std.isweekly(e)||u.Std.ismonthly(e))return"12M";if(u.Std.isdaily(e))return"1M";if(u.Std.isintraday(e)){var t=u.Std.interval(e);return t>=1&&t<=15?"1D":"1W"}throw Error("Unexpected resolution type: "+e.symbol.resolution)}function h(e,t){
switch(t){case"Auto":return c(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw Error("No such pivTimeFrame: "+t)}}var u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"pivotPointsStandardStudyItem",function(){return m}),u=i(25),i.n(u),d=i(15),p=function(){function e(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}return e}(),_=function(){function e(){this.pivots=[]}return e}(),f=function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i,o=t(0),r=t(1),s=t(2),a=t(3);this._data=new _,this._firstMainSeriesBarTime=NaN,this._kindPP=n(o),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=s,this._isValidResolution=l(e,this._pivTimeFrame),this._isValidResolution||u.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=h(e,this._pivTimeFrame)),i=""===e.symbol.resolution?Math.max(30,2*parseInt(e.symbol.interval))+"":e.symbol.period,e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},e.prototype.main=function(e){var t,i,n,o,r,l,c,h,d,p,_,f,m,y,g;return this._isValidResolution?e.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null):(e.select_sym(1),t=e.new_var(u.Std.open(e)),i=e.new_var(u.Std.high(e)),n=e.new_var(u.Std.low(e)),o=e.new_var(u.Std.close(e)),r=e.new_var(u.Std.time(e)),l=this._data,c=t.get(0),h=r.get(0),d=t.get(1),p=i.get(1),_=n.get(1),f=o.get(1),m=e.symbol.isLastBar,0!==l.pivots.length&&e.symbol.isNewBar&&(y=l.pivots[l.pivots.length-1],y.endIndex__t!==h&&(y.endIndex__t=h)),0!==e.symbol.index&&e.symbol.isNewBar?(g=a(c,d,p,_,f,h,s(e,h),this._kindPP),e.select_sym(0),this._showHistoricalPivots||(l.pivots=[]),l.pivots.push(g),l.pivots.length>this._historicalPivotsToKeep&&l.pivots.shift(),m?this._createResponse():null):(e.select_sym(0),null)):null},e.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex(function(t){return t.startIndex__t>e._firstMainSeriesBarTime})-1,0);t>0&&this._data.pivots.splice(0,t)},e}(),m={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",
options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:f}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"spreadStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t-i*n},t}(o.a),s={name:"Spread",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:o.c,id:"Spread@tv-basicstudies-1"},constructor:r}},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ratioStudyItem",function(){return s}),n=i(1),o=i(299),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._doCalculation=function(e,t,i,n){return e*t/(i*n)},t}(o.a),s={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:o.b,plots:o.d,styles:o.e,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:o.c,id:"Ratio@tv-basicstudies-1"},constructor:r}}],[462]);