Release v17.019 (from 07f6d1aa)

Fixes tradingview/charting_library#4742
This commit is contained in:
jenkins@nwork.local
2020-10-23 12:16:49 +00:00
parent 9587cfe078
commit ab6f38b69f
32 changed files with 48 additions and 48 deletions

View File

@@ -296,22 +296,22 @@ t.prototype._makeLine=function(e,t,i,r){if(null!==this._data){var n=t.findIndex(
}(a.LineDataSource)},MROS:function(e,t,i){"use strict";i.r(t),i.d(t,"ModelSelection",(function(){return o}));var r=i("Y7w9"),n=i("CW80"),o=function(){function e(){this._items=[],this._set=new Set}return e.prototype.isEmpty=function(){return 0===this._items.length},e.prototype.add=function(e){this._items.length>0&&!Object(n.isLineTool)(this._items[0])&&this.clear(),Object(n.isLineTool)(e)||this.clear();var t=Object(r.lowerbound)(this._items,e,(function(e,t){return e.zorder()<t.zorder()}));this._items.splice(t,0,e),this._set.add(e)},e.prototype.canBeAddedToSelection=function(e){return 0===this._items.length||Object(n.isLineTool)(this._items[0])&&Object(n.isLineTool)(e)},e.prototype.isSelected=function(e){return this._set.has(e)},e.prototype.sources=function(){return this._items.slice(0)},e.prototype.checkLineToolSelection=function(){this._items.forEach((function(e){return Object(n.isLineTool)(e)&&e.calcIsActualSymbol()})),this._items=this._items.filter((function(e){return!Object(n.isLineTool)(e)||e.isActualSymbol()}))},e.prototype.remove=function(e){this._items=this._items.filter((function(t){return t!==e})),this._set.delete(e)},e.prototype.clear=function(){this._items=[],this._set.clear()},e.prototype.notFixedSources=function(){return this._items.filter((function(e){return!Object(n.isLineTool)(e)||!e.isFixed()}))},e}()},MWAT:function(e,t,i){"use strict";i.r(t),i.d(t,"PriceScaleSelectionStrategyEvenly",(function(){return a})),i.d(t,"PriceScaleSelectionStrategyAllRight",(function(){return l})),i.d(t,"PriceScaleSelectionStrategyAllLeft",(function(){return c})),i.d(t,"createPriceScaleSelectionStrategy",(function(){return h})),i.d(t,"allPriceScaleSelectionStrategyInfo",(function(){return d}));var r=i("mrSG"),n=i("Eyy1"),o=i("3ClC"),s=function(){function e(e){this._priceScalesLimit=8,this._metaInfo=e}return e.prototype.metaInfo=function(){return this._metaInfo},e.prototype.findSuitableScale=function(e,t,i,r){if(void 0!==r)return this._tryToGetDesiredPriceScale(e,t,r,i);if(Object(o.isStudy)(t)){var n=t.metaInfo();if("Volume@tv-basicstudies"===n.id)return(l=e.createPriceScaleAtPosition("overlay")).setTopMargin(.75),l.setBottomMargin(0),l;var s=t.desiredPriceScalePosition();if(null!==s)return this._tryToGetDesiredPriceScale(e,t,s,i);if(void 0!==i&&(Object(o.isStudy)(i)||e.isMainPane())&&n.is_price_study)return this._getPriceScaleTheSameAsForSource(i,e)}var a=!1;if(Object(o.isStudy)(t)){var l,c=t.metaInfo().groupingKey;if(void 0!==c)if(null!==(l=e.model().findNonOverlayStudyWithGroupingKey(c,e)))return this._getPriceScaleTheSameAsForSource(l.study,l.pane);a=Boolean(t.metaInfo().is_price_study)}else t===e.model().mainSeries()&&(a=!0);if(a&&null!==(l=this._findFirstScaleForPriceStudy(e)))return l;return this.createNewPriceScaleIfPossible(e)},e.prototype.canCreateNewPriceScale=function(e){return e.leftPriceScales().length+e.rightPriceScales().length<this._priceScalesLimit},e.prototype._getPriceScaleTheSameAsForSource=function(e,t){return t.isOverlay(e)?t.createPriceScaleAtPosition("overlay"):Object(n.ensureNotNull)(e.priceScale())
},e.prototype._priceScaleIsPrice=function(e,t){var i=e.mainSource();return!!i&&(i===t.mainSeries()||!!Object(o.isStudy)(i)&&Boolean(i.metaInfo().is_price_study))},e.prototype._findFirstScaleForPriceStudy=function(e){for(var t=e.model(),i=0;i<this._priceScalesLimit;i++){if(e.rightPriceScales().length>i&&this._priceScaleIsPrice(e.rightPriceScales()[i],t))return e.rightPriceScales()[i];if(e.leftPriceScales().length>i&&this._priceScaleIsPrice(e.leftPriceScales()[i],t))return e.leftPriceScales()[i]}return null},e.prototype._targetPriceScaleIndex=function(e,t){if(e.mainSource()===t.mainSeries())return 0},e.prototype._tryToGetDesiredPriceScale=function(e,t,i,r){switch(i){case"left":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay");case"right":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay");case"as-series":return void 0!==r?Object(n.ensureNotNull)(r.priceScale()):e.isMainPane()?Object(n.ensureNotNull)(Object(n.ensureNotNull)(e.mainDataSource()).priceScale()):this.createNewPriceScaleIfPossible(e);case"overlay":return e.createPriceScaleAtPosition("overlay")}},e}(),a=function(e){function t(t){return e.call(this,t)||this}return Object(r.__extends)(t,e),t.prototype.apply=function(e){if(e.containsMainSeries()){var t=Object(n.ensureNotNull)(Object(n.ensureNotNull)(e.mainDataSource()).priceScale());e.movePriceScale(t,"right",0)}for(var i=e.model();e.leftPriceScales().length>e.rightPriceScales().length;){t=e.leftPriceScales()[e.leftPriceScales().length-1];e.movePriceScale(t,"right",this._targetPriceScaleIndex(t,i))}for(;e.rightPriceScales().length-e.leftPriceScales().length>1;){t=e.rightPriceScales()[e.rightPriceScales().length-1];e.movePriceScale(t,"left",this._targetPriceScaleIndex(t,i))}},t.prototype.createNewPriceScaleIfPossible=function(e){if(!this.canCreateNewPriceScale(e))return e.createPriceScaleAtPosition("overlay");var t=e.leftPriceScales().length<e.rightPriceScales().length?"left":"right";return e.createPriceScaleAtPosition(t)},t}(s),l=function(e){function t(t){return e.call(this,t)||this}return Object(r.__extends)(t,e),t.prototype.apply=function(e){var t=this,i=e.model();e.leftPriceScales().slice(0).forEach((function(r){return e.movePriceScale(r,"right",t._targetPriceScaleIndex(r,i))}))},t.prototype.createNewPriceScaleIfPossible=function(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay")},t}(s),c=function(e){function t(t){return e.call(this,t)||this}return Object(r.__extends)(t,e),t.prototype.apply=function(e){var t=this,i=e.model();e.rightPriceScales().slice(0).forEach((function(r){return e.movePriceScale(r,"left",t._targetPriceScaleIndex(r,i))}))},t.prototype.createNewPriceScaleIfPossible=function(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay")},t}(s),u=[{name:"left",title:window.t("Stack On The Left"),ctor:c},{name:"right",
title:window.t("Stack On The Right"),ctor:l},{name:"auto",title:window.t("Auto"),ctor:a}];function h(e){var t=Object(n.ensureDefined)(u.find((function(t){return t.name===e})));return new t.ctor(t)}function d(){return u}},MXV9:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd" stroke="currentColor" transform="translate(4 4)"><path d="M.5 10.992c0 .287.226.508.505.508H2.65c.19.93.55 1.82 1.09 2.63L2.577 15.3a.5.5 0 0 0-.007.71l1.42 1.42a.5.5 0 0 0 .71-.007l1.17-1.163c.81.54 1.71.9 2.63 1.09v1.645c0 .284.227.505.508.505h1.984c.28 0 .508-.221.508-.505V17.35a7.46 7.46 0 0 0 2.63-1.09l1.17 1.163a.5.5 0 0 0 .71.007l1.42-1.42a.5.5 0 0 0-.007-.71l-1.163-1.17c.54-.81.9-1.7 1.09-2.63h1.645a.502.502 0 0 0 .505-.508V9.008a.503.503 0 0 0-.505-.508H17.35c-.19-.93-.55-1.82-1.09-2.63l1.163-1.17a.5.5 0 0 0 .007-.71l-1.42-1.42a.5.5 0 0 0-.71.007L14.13 3.74a7.46 7.46 0 0 0-2.63-1.09V1.005A.504.504 0 0 0 10.992.5H9.008a.504.504 0 0 0-.508.505V2.65c-.92.19-1.82.55-2.63 1.09L4.7 2.577a.5.5 0 0 0-.71-.007L2.57 3.99a.5.5 0 0 0 .007.71L3.74 5.87c-.54.81-.9 1.7-1.09 2.63H1.005a.503.503 0 0 0-.505.508v1.984z"/><circle cx="10" cy="10" r="2.5"/></g></svg>'},MY2c:function(e,t,i){"use strict";i.r(t),i.d(t,"UndoStack",(function(){return l}));var r=i("RDU5"),n=i("aIyQ"),o=i.n(n),s=i("uOxu"),a=Object(s.getLogger)("Common.UndoStack"),l=function(){function e(){this._commands=[],this._onChange=new o.a}return e.prototype.onChange=function(){return this._onChange},e.prototype.isEmpty=function(){return 0===this._commands.length},e.prototype.clear=function(){this.isEmpty()||(this._commands.length=0,this._onChange.fire())},e.prototype.push=function(e){if(!(e instanceof r.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(e),this._onChange.fire(e)},e.prototype.pop=function(){if(!this.isEmpty()){var e=this._commands.pop();return this._onChange.fire(e),e}a.logDebug("pop: undo stack is empty")},e.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},e}()},MbIA:function(e,t,i){"use strict";i.r(t),i.d(t,"DateTimeFormatter",(function(){return s}));var r=i("4kQX"),n=i("gQ5K"),o={dateFormat:"yyyy-MM-dd",timeFormat:"%h:%m:%s",dateTimeSeparator:" "},s=function(){function e(e){void 0===e&&(e={});var t=Object.assign({},o,e);this._dateFormatter=new n.DateFormatter(t.dateFormat),this._timeFormatter=new r.TimeFormatter(t.timeFormat),this._separator=t.dateTimeSeparator}return e.prototype.format=function(e){return""+this._dateFormatter.format(e)+this._separator+this._timeFormatter.format(e)},e.prototype.formatLocal=function(e){return""+this._dateFormatter.formatLocal(e)+this._separator+this._timeFormatter.formatLocal(e)},e}()},MrEN:function(e,t,i){"use strict";(function(t){var r=i("IiTo"),n=i("LxhU").Interval,o=i("aIyQ"),s=i("Kxc7"),a=i("/bs+").barTimeToEndOfPeriod,l=function(e,t){this._server=e,this._session=t,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new o,
this.seriesError=new o,this._lastBarTimes={}};l.prototype.lastBarTime=function(e){return this._lastBarTimes[e]},l.prototype._userTimezone=function(){return this._timezone},l.prototype.setTimezone=function(e){this._timezone="exchange"===e?"exchange":t.get_timezone(e),this._timezoneId=e},l.prototype.timezone=function(){return this._timezoneId},l.prototype.setResolution=function(e){this._isDWM=n.isDWM(e),this._resolution=e},l.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},l.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},l.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},l.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},l.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},l.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},l.prototype.onSeriesError=function(e,t){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t]}),this.seriesError.fire(e,t)},l.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:[]}]})},l.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},l.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},l.prototype._calcMarksTime=function(e,i,o,l){for(var c=t.get_timezone(i.timezone),u=new r.SessionInfo(i.timezone,i.session,i.holidays,i.corrections),h=r.newBarBuilder(this._resolution,u,u),d=this._isDWM&&!s.enabled("disable_resolution_rebuild"),p=s.enabled("end_of_period_timescale_marks"),f=!this._isDWM,_=n.parse(this._resolution),m=0;m<e.length;m++){var y=o(e[m]);if(p&&(y=a(h,u.spec,y,_)),d){var g=t.utc_to_cal(c,1e3*y);g=u.spec.correctTradingDay(g),t.set_hms(g,0,0,0,0,c),y=parseInt(g.valueOf()/1e3)}f&&(y=this.timeInTimezone(y,c)),e[m]=l(e[m],y)}},l.prototype.onTickmarksUpdated=function(e,t,i,r){if(n.isEqual(r,this._resolution)){var o=t.slice(0);this._calcMarksTime(o,i,(function(e){return e}),(function(e,t){return t}));for(var s,a=[],l=[],c=0;c<o.length;++c){var u=o[c];a.push([this._spanByTime(u,s),u,e+c]),l.push(u),s=u}var h={method:"tickmark_update",params:[this._session,{index:e,zoffset:0,changes:l,marks:a,index_diff:[]}]};this._server.receiveLocalResponse(h)}},l.prototype.onTimescaleUpdate=function(e,t,i,r,n,o){var s=o&&o.slice(0);this._lastBarTimes[e]=s?s&&s[s.length-1]:i&&i[i.length-1].value[0],
this._calcMarksTime(i,r,(function(e){return e.value[0]}),(function(e,t){return e.exTime=t,e})),s&&this._calcMarksTime(s,r,(function(e){return e}),(function(e,t){return{markTime:t,time:e}}));var a={};a[e]={series:i,turnaround:t};var l,c=[],u=[],h=i.map((function(e){return{markTime:e.exTime,time:e.value[0]}}));s&&(h=h.concat(s));for(var d=0;d<h.length;++d){var p=h[d].markTime;c.push([this._spanByTime(p,l),p,n+d]),u.push(h[d].time),l=p}var f={method:"timescale_update",params:[this._session,a,{index:n,zoffset:0,changes:u,marks:c,index_diff:[]}]};this._server.receiveLocalResponse(f)},l.prototype.onSeriesTimeframeUpdate=function(e,t,i,r,n){var o={method:"series_timeframe",params:[this._session,e,t,i,r,n]};this._server.receiveLocalResponse(o)},l.prototype.onPointsetDataUpdate=function(e,t,i,r){this._onDataUpdate(e,t,i,null,r,1)},l.prototype.onDataUpdate=function(e,t,i,r,n){this._onDataUpdate(e,t,i,r,n,0)},l.prototype._onDataUpdate=function(e,t,i,r,n,o){var s={},a="",l=[];null!==r&&(a=JSON.stringify(r.data),l=r.indexes||[]),s[e]={s:i,ns:{d:a,indexes:l},turnaround:t};var c={method:"data_update",params:[this._session,s]};this._server.receiveLocalResponse(c)},l.prototype.onQuotesData=function(e){this._server.receiveLocalResponse({method:"quote_symbol_data",params:e})},l.prototype.onDepthData=function(e){this._server.receiveLocalResponse({method:"dd",params:e})},l.prototype.onDepthUpdate=function(e){this._server.receiveLocalResponse({method:"dpu",params:e})},l.prototype.onProjectionUpdate=function(e,t,i,r){var n=i.data,o=n[n.length-1],s={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:o?o[4]:i.price,bars:n.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]}}))}},a={};a[e]={s:r||[],ns:{d:JSON.stringify(s),indexes:n.map((function(e,t){return i.barsetSize+(e[0]||0)}))},turnaround:t};var l={method:"data_update",params:[this._session,a]};this._server.receiveLocalResponse(l)},l.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)},l.prototype._spanByTime=function(e,t){function i(e){return 60*e*60*1e3}function r(e){return 60*e*1e3}var n,o=[{divisor:1,span:20},{divisor:(n=1,1e3*n),span:19},{divisor:r(5),span:21},{divisor:r(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;var s=new Date(1e3*t),a=new Date(1e3*e);if(a.getUTCFullYear()!==s.getUTCFullYear())return 70;if(a.getUTCMonth()!==s.getUTCMonth())return 60;if(a.getUTCDate()!==s.getUTCDate())return 50;for(var l=o.length-1;l>=0;--l)if(Math.floor(s/o[l].divisor)!==Math.floor(a/o[l].divisor))return o[l].span},TradingView.ChartapiMessagerInstances=[],e.exports=l}).call(this,i("jCNj"))},"N+BX":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Double Curve");function a(e,t){this._constructor="LineToolBezierCubic"
;var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("a6on").BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Double Curve"},a.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5).transposed().scaled(.3),r=e.add(t).scaled(.33),n=e.add(t).scaled(.67),o=r.add(i),s=n.subtract(i);return[this.screenPointToPoint(o),this.screenPointToPoint(s)]},a.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},a.prototype.addPoint=function(e,t,i){var n=r.prototype.addPoint.call(this,e,t,!0);if(n){var o=this.controlPoints();delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return n},a.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},a.prototype.getStylesPropertyPage=function(){return o.LineToolBezierStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("b4fl").GeneralBezierDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolbeziercubic",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolBezierCubic=a},N1UO:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyApi",(function(){return h}));var r=i("mrSG"),n=(i("YFKU"),i("Eyy1")),o=i("9iCb"),s=i("xo8u"),a=i("gaBL"),l=i("HGup"),c=i("jRfx"),u=i("/ToI"),h=function(){function e(e,t){this._study=e,this._undoModel=t,this._model=t.model()}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 Object(r.__assign)(Object(r.__assign)({},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){for(var t=this.getInputValues(),i=function(e){void 0!==t.find((function(t){return t.id===e.id}))?r._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},r=this,n=0,o=e;n<o.length;n++){i(o[n])}},e.prototype.mergeUp=function(){this._model.isMergeUpAvailableForSource(this._study)&&new c.c(this._model,this._study,"").redo()},e.prototype.mergeDown=function(){
this._model.isMergeDownAvailableForSource(this._study)&&new c.a(this._model,this._study,"").redo()},e.prototype.unmergeUp=function(){this._model.isUnmergeAvailableForSource(this._study)&&new l.c(this._model,this._study,"").redo()},e.prototype.unmergeDown=function(){this._model.isUnmergeAvailableForSource(this._study)&&new l.a(this._model,this._study,"").redo()},e.prototype.mergeUpWithUndo=function(){this._model.isMergeUpAvailableForSource(this._study)&&this._undoModel.mergeSourceUp(this._study)},e.prototype.mergeDownWithUndo=function(){this._model.isMergeDownAvailableForSource(this._study)&&this._undoModel.mergeSourceDown(this._study)},e.prototype.unmergeUpWithUndo=function(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceUp(this._study)},e.prototype.unmergeDownWithUndo=function(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceDown(this._study)},e.prototype.changePriceScale=function(e){var t=Object(n.ensureNotNull)(this._model.paneForSource(this._model.mainSeries())),i=Object(n.ensureNotNull)(this._model.paneForSource(this._study));switch(e){case"no-scale":Object(n.assert)(i.actionNoScaleIsEnabled(this._study),"Unable to leave a pane without any non-overlay price scale"),new u.b(this._model,this._study,i,"overlay","").redo();break;case"as-series":Object(n.assert)(i===t,"Study should be on the main pane"),new u.a(this._model,this._study,i,this._model.mainSeries().priceScale(),"").redo();break;case"new-left":new u.b(this._model,this._study,i,"left","").redo();break;case"new-right":new u.b(this._model,this._study,i,"right","").redo();break;default:var r=this._model.dataSourceForId(e);if(null===r)throw new Error("There is no study with entityId='"+e+"'");var o=i===this._model.paneForSource(r);Object(n.assert)(o,"Both studies should be on the same pane");var l=Object(n.ensureNotNull)(r.priceScale()),c=Object(a.sourceNewCurrencyOnPinningToPriceScale)(this._study,l,this._model);new u.a(this._model,this._study,i,l,"").redo(),null!==c&&new s.a(l,c,this._undoModel.chartWidget(),"").redo()}},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(o.applyOverridesToStudy)(this._study,e)},e.prototype.dataLength=function(){return this._study.data().size()},e}()},N22A:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var r=i("ObRt"),n={id:"TradingService"};function o(){return Object(r.a)(n)?Object(r.c)(n):null}},NJRZ:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("XABCD Pattern");function a(e,t){this._constructor="LineTool5PointsPattern";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("6MfG").Pattern5PaneView
;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 5},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"XABCD Pattern"},a.prototype.getStylesPropertyPage=function(){return o.LineToolLineTool5PointsPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetool5pointspattern",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineTool5PointsPattern=a},NSoL:function(e,t,i){"use strict";i.r(t),i.d(t,"clientSnapshot",(function(){return y}));var r=i("mrSG"),n=i("ikwP"),o=i("zDbI"),s=i("XlJ7"),a=i("EsvI"),l=i("Dq3s"),c=i("Kxc7"),u=i("tzRX"),h=!c.enabled("widget_logo");function d(e,t,i){var n;void 0===t&&(t=null),void 0===i&&(i=null);var o={};if("number"==typeof e)return{relativePositions:(n={},n[e]={l:t,t:i},n),nextElementLeft:e,nextElementTop:e};var s=e[0],a=e.slice(1);if("v"===s){for(var l=null,c=0,u=a;c<u.length;c++){var h=d(u[c],t,i);o=Object(r.__assign)(Object(r.__assign)({},o),h.relativePositions),i=h.nextElementTop,l=h.nextElementLeft}t=l}if("h"===s){for(var p=null,f=0,_=a;f<_.length;f++){h=d(_[f],t,i);o=Object(r.__assign)(Object(r.__assign)({},o),h.relativePositions),t=h.nextElementLeft,p=h.nextElementTop}i=p}return{relativePositions:o,nextElementTop:i,nextElementLeft:t}}var p=function(e){for(var t={},i=0,r=Object.keys(e);i<r.length;i++){var n=r[i],o=d(e[n]).relativePositions;t[n]=o}return t}(l);function f(e,t,i,r,o){Object(n.drawScaled)(e,o,(function(){e.fillText(r,t/o,i/o)}))}var _=URL.createObjectURL(new Blob([u],{type:"image/svg+xml"}));function m(e,t,i,r){i.save(),i.translate(t.x,t.y);for(var n=0,o=0,s=e.panes;o<s.length;o++){var a=s[o],l=0,c=a.leftAxis.canvas.width+Math.round(8*r),u=n,h=n+Math.round(10*r);if(a.leftAxis.contentWidth>0&&(i.drawImage(a.leftAxis.canvas,l,n),l+=a.leftAxis.canvas.width),i.drawImage(a.canvas,l,n),l+=a.canvas.width,a.rightAxis.contentWidth>0&&i.drawImage(a.rightAxis.canvas,l,n),"pane"===a.type){var d=17*r;i.fillStyle=e.colors.text,a.mainSeriesText&&h+d<u+a.canvas.height&&(f(i,c,h,a.mainSeriesText,r),h+=d);for(var p=0,_=a.studies;p<_.length;p++){var m=_[p];h+d<u+a.canvas.height&&(f(i,c,h,m,r),h+=d)}}n+=a.canvas.height}if(void 0!==e.timeAxis){l=0;e.timeAxis.lhsStub.contentWidth>0&&(i.drawImage(e.timeAxis.lhsStub.canvas,l,n),l+=e.timeAxis.lhsStub.canvas.width),i.drawImage(e.timeAxis.canvas,l,n),l+=e.timeAxis.canvas.width,e.timeAxis.rhsStub.contentWidth>0&&i.drawImage(e.timeAxis.rhsStub.canvas,l,n)}i.restore()}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,i,l,c,u,d,f,y,g,v,S,b,w,P,C,x,T;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:for(t=p[e.layout],i=e.charts.map((function(e){return function(e){
for(var t=e.panes[0],i=t.canvas.width+t.leftAxis.canvas.width+t.rightAxis.canvas.width,r=0,o=0,s=e.panes;o<s.length;o++){r+=s[o].canvas.height}return void 0!==e.timeAxis&&(r+=e.timeAxis.canvas.height),new n.Size(i,r)}(e)})),l=e.hidpiRatio,c=e.charts.map((function(e,r){return function e(t,i,r,n){var o=Math.round(10*n),s=Math.round(10*n),a=r[t];if(null!==a.l){var l=e(a.l,i,r,n);o=l.x+l.width+Math.round(5*n)}if(null!==a.t){var c=e(a.t,i,r,n);s=c.y+c.height+Math.round(5*n)}var u=i[t];return{x:o,y:s,width:u.w,height:u.h}}(r,i,t,l)})),u=0,d=0,f=0,y=c;f<y.length;f++)C=y[f],u=Math.max(u,C.x+C.width),d=Math.max(d,C.y+C.height);for(u+=Math.round(10*l),g=h?Math.round(10*l):Math.round(35*l),v=d,d+=g,S=Object(n.createDisconnectedCanvas)(document,new n.Size(u,d),1),(b=Object(n.getContext2D)(S)).font=Object(s.makeFont)(12,o.CHART_FONT_FAMILY),b.textBaseline="top",b.fillStyle=a.themes[e.theme].getThemedColor("color-bg-primary"),b.fillRect(0,0,u,d),w=0;w<e.charts.length;++w)P=e.charts[w],C=c[w],m(P,C,b,l);return h?[3,2]:[4,(L=Math.round(26*l),I=Math.round(15*l),new Promise((function(e){var t=new Image;t.width=L,t.height=I,t.onload=function(){e({image:t,width:L,height:I})},t.src=_})))];case 1:x=r.sent(),b.fillStyle=a.themes[e.theme].getThemedColor("color-text-primary"),b.font=Object(s.makeFont)(13,o.CHART_FONT_FAMILY),T=v+Math.round(g/2-x.height/2),function(e,t,i,r,o){e.save(),e.drawImage(r.image,t,i,r.width,r.height),e.textBaseline="bottom";var s=(t+r.width)/o+3,a=(i+r.height)/o;Object(n.drawScaled)(e,o,(function(){e.fillText("TradingView",s,a)})),e.restore()}(b,Math.round(10*l),T,x,l),r.label=2;case 2:return[2,S]}var L,I}))}))}},Ndyb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererColumns",(function(){return n}));var r=i("VdBB"),n=function(){function e(e){this._data=null,this._precalculatedCache=[],this.setData(e)}return e.prototype.setData=function(e){this._data=e,this._precalculatedCache=[]},e.prototype.draw=function(e,t){if(null!==this._data&&0!==this._data.items.length){var i=t.pixelRatio;this._precalculatedCache.length||this._fillPrecalculatedCache(i);for(var r=Math.max(1,Math.floor(i)),n=Math.round(this._data.histogramBase*i)-Math.floor(r/2),o=n+r,s=this._data.lineColor,a=0;a<this._data.items.length;a++){var l=this._data.items[a],c=this._precalculatedCache[a],u=Math.round(l.y*i),h=l.style?l.style.color:s;e.fillStyle=h;var d=void 0,p=void 0;u<=n?(d=u,p=o):(d=n,p=u-Math.floor(r/2)+r),e.fillRect(c.left,d,c.right-c.left+1,p-d)}}},e.prototype.hitTest=function(e){if(null===this._data)return null;for(var t=.5*this._data.barSpacing,i=e.x-t,n=e.x+t,o=0,s=this._data.items;o<s.length;o++){var a=s[o],l=a.x;if(l>=i&&l<=n){var c=a.y;if(e.y>=Math.min(c,this._data.histogramBase)&&e.y<=Math.max(c,this._data.histogramBase))return new r.HitTestResult(r.HitTestResult.REGULAR)}}return null},e.prototype._fillPrecalculatedCache=function(e){if(null!==this._data&&0!==this._data.items.length){var t=Math.ceil(this._data.barSpacing*e)<=1?0:Math.max(1,Math.floor(e)),i=Math.round(this._data.barSpacing*e)-t
;this._precalculatedCache=new Array(this._data.items.length);for(var r=0;r<this._data.items.length;r++){var n,o=this._data.items[r],s=Math.round(o.x*e),a=void 0,l=void 0;if(i%2)a=s-(n=(i-1)/2),l=s+n;else a=s-(n=i/2),l=s+n-1;this._precalculatedCache[r]={left:a,right:l,roundedCenter:s,center:o.x*e,time:o.timePointIndex}}for(r=1;r<this._data.items.length;r++){var c=this._precalculatedCache[r],u=this._precalculatedCache[r-1];c.time===u.time+1&&(c.left-u.right!==t+1&&(u.roundedCenter>u.center?u.right=c.left-t-1:c.left=u.right+t+1))}var h=Math.ceil(this._data.barSpacing*e);for(r=0;r<this._data.items.length;r++){(c=this._precalculatedCache[r]).right<c.left&&(c.right=c.left);var d=c.right-c.left+1;h=Math.min(d,h)}if(t>0&&h<4)for(r=0;r<this._data.items.length;r++){(d=(c=this._precalculatedCache[r]).right-c.left+1)>h&&(c.roundedCenter>c.center?c.right-=1:c.left+=1)}}else this._precalculatedCache=[]},e}()},NhkU:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=i("ytGH").LineToolWidthsProperty,a=window.t("Pitchfan");function l(e,t){this._constructor="LineToolPitchfan";var n=t||l.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("l5Au").PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe);for(var o=[this._properties.child("median").child("linewidth")],a=0;a<=l.LevelsCount;a++)o.push(this._properties.child("level"+a).child("linewidth"));this._widthsProperty=new s(o)}inherit(l,r),l.LevelsCount=8,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 3},l.prototype.translatedType=function(){return a},l.prototype.name=function(){return"Pitchfan"},l.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},l.prototype.getStylesPropertyPage=function(){return o.LineToolPitchfanStylesPropertyPage},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("D+Nk").PitchBaseDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new n("linetoolpitchfan",e,!1,{range:[0,8]});return l._configureProperties(t),t},l._configureProperties=function(e){r._configureProperties(e)},t.LineToolPitchfan=l},NsVT:function(e,t,i){"use strict";i.r(t);var r=i("hY0g"),n=i.n(r),o=i("HySD");function s(e,t){for(var i=0,r=0,n=t;r<n.length;r++){var o=n[r],s=o.min,a=o.max;if(!(e<s||a<s)){var l=Math.min(e,a);if(e===(i=Math.max(i,l)))break}}return i}function a(e){var t=[];if(void 0===e)return[];Array.isArray(e)||(e=[e]);for(var i=0,r=e;i<r.length;i++){var n=r[i],o=void 0,s=void 0;isFinite(n)?o=s=Number(n):(o=+n.min,s=+n.max),(o<0||isNaN(o))&&(o=0),isNaN(s)&&(s=1/0),o<=s&&s>0&&t.push({min:o,max:s})}return t.sort((function(e,t){return e.min-t.min||e.max-t.max})),t}function l(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}var c=i("+GxX"),u=i("Kxc7");i.d(t,"ChartPage",(function(){return d}));var h=u.enabled("no_min_chart_width"),d=function(){function e(e){var t=this;this._processVisibility=function(e){var i=e.container.value();return t._affectsLayout(e.name)?(i&&i.classList.toggle("js-hidden",!1),!0):(i&&i.classList.toggle("js-hidden",!0),!1)},this._setWidth=function(e,i){var r=i;t._fullscreenArea!==e.name&&(e.availWidth.setValue(i),e.canNegotiate.width&&(r=s(i,e.negotiations.width)));var n=e.container.value();return n&&(n.style.width=r+"px"),e.width.setValue(r),r},this._setHeight=function(e,i){var r=i;t._fullscreenArea!==e.name&&(e.availHeight.setValue(i),e.canNegotiate.height&&(r=s(i,e.negotiations.height)));var n=e.container.value();return n&&(n.style.height=r+"px"),e.height.setValue(r),r};var i=e.container.value();if(!i)throw new Error("bridge.container.value() must be an element");this._container=i,this._availableAreas=["left","tradingpanel","right","top","bottom","center","topleft","extratop"],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=this,i=e&&e.areaName;if(-1===this._availableAreas.indexOf(i))throw new Error("unknown options.areaName");this.free(i);var r=this._createDOM(i),s={name:i,canNegotiate:{width:"left"===i||"right"===i||"tradingpanel"===i||"topleft"===i,height:"top"===i||"bottom"===i||"topleft"===i||"extratop"===i},negotiations:{width:[],height:[]},remove:function(){for(var e in t._areas)t._areas[e]===s&&t.free(e)},negotiateWidth:function(e){if(s.canNegotiate.width){var i=a(e);l(s.negotiations.width,i)||(s.negotiations.width=i,t.recalculate())}},negotiateHeight:function(e){if(s.canNegotiate.height){var i=a(e);l(s.negotiations.height,i)||(s.negotiations.height=i,t.recalculate())}},requestFullscreen:function(){t._fullscreenArea||("right"!==i&&"center"!==i||(t._fullscreenArea=i),"center"===i&&t._bridge.requestFullscreen(),t._updateFullscreen())},exitFullscreen:function(){i===t._fullscreenArea&&(t._fullscreenArea=void 0,"center"===i&&t._bridge.exitFullscreen(),t._updateFullscreen())},width:new n.a,height:new n.a,availWidth:new n.a,availHeight:new n.a,alive:new n.a(!0),container:new n.a(r),visible:new n.a(!0),fullscreen:new n.a(!0),rdState:new o.ResizerDetacherState};return s.rdState.pushOwner(s),this._areas[i]=s,s.rdState.owner.subscribe((function(e){var r=s.container.value();if(e!==s)r&&(r.innerHTML="",r.parentElement&&r.parentElement.removeChild(r));else{for(var n=null,o=t._availableAreas.indexOf(i);o--;){var a=t._availableAreas[o];if(t._affectsLayout(a)){n=t._areas[a].container.value();break}}r&&(n&&r.parentElement?r.insertAdjacentElement("afterend",n):t._container.appendChild(r))}t.recalculate()}),{callWithLast:!0}),s.rdState.bridge()},
e.prototype.free=function(e){var t=this._areas[e];if(t){this._areas[e]=void 0;var i=t.container.value();i&&i.parentElement&&i.parentElement.removeChild(i),t.alive.setValue(!1)}},e.prototype.recalculate=function(){var e={};this._recalcSingleRunToken=e;var t=this._areas.topleft,i=this._areas.left,r=this._areas.tradingpanel,n=this._areas.right,o=this._areas.top,s=this._areas.bottom,a=this._areas.center,l=this._areas.extratop,c=this._width.value(),u=this._height.value(),d=0,p=0,f=0,_=0,m=0,y=0,g=0,v=0;(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(v=this._setHeight(l,u),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t))&&(g=this._setHeight(t,u),(y=this._setWidth(t,c))&&(y+=4),(L=t.container.value())&&(L.style.top=v+"px"));e===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&((L=i.container.value())&&(L.style.top=g+v+"px"),this._setHeight(i,u-g-v),(f=this._setWidth(i,c))&&(f+=4));if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,u);var S=c-f;h||(S-=300),m=this._setWidth(r,S)}if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){this._setHeight(n,u-v);S=c-f-m;h||(S-=300),_=this._setWidth(n,S),(L=n.container.value())&&(L.style.top=v+"px")}var b=m+_,w=b?4:0;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){var P=Math.max(y,f);(L=o.container.value())&&(L.style.left=P+"px",L.style.top=v+"px");S=c-P-m-_-w;this._setWidth(o,S),d=this._setHeight(o,u)}var C=0,x=c-f-m-_-w;if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){(L=s.container.value())&&(L.style.left=f+"px",L.classList.toggle("no-border-top-left-radius",!f),L.classList.toggle("no-border-top-right-radius",!b)),this._setWidth(s,x);var T=u-d-v;C=Math.min(300,T-0),p=this._setHeight(s,T)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){var L;(L=a.container.value())&&(L.style.left=f+"px",L.style.top=d+v+"px",L.classList.toggle("no-border-bottom-left-radius",!p||!f),L.classList.toggle("no-border-bottom-right-radius",!b||!p)),this._setWidth(a,x);T=u-d-p-v;this._setHeight(a,Math.max(T,C))}e===this._recalcSingleRunToken&&r&&this._affectsLayout("tradingpanel")&&((L=r.container.value())&&(L.style.right=_+"px",L.style.top=v+"px"));e===this._recalcSingleRunToken&&this._updateVisibility()},e.prototype._affectsLayout=function(e){var t=this._areas[e];if(!t)return!1;if(t.rdState.owner.value()!==t)return!1;if(this._fullscreenArea&&this._fullscreenArea!==e)return p(e);if(this._width.value()<=567||this._height.value()<=445){var i=["center","top","left","topleft","extratop"];if(Object(c.isFeatureEnabled)("mobile_show_bottom_panel")&&i.push("bottom"),!i.includes(e))return!1}return!0},e.prototype._updateVisibility=function(){for(var e=this._bridge.visible.value(),t=0;t<this._availableAreas.length;t++){var i=this._availableAreas[t],r=this._areas[i];r&&(e&&this._affectsLayout(i)?r.visible.setValue(!0):r.visible.setValue(!1))}},e.prototype._onParentFullscreenChange=function(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,
this._updateFullscreen())},e.prototype._updateFullscreen=function(){for(var e=void 0!==this._fullscreenArea,t=0;t<this._availableAreas.length;t++){var i=this._availableAreas[t],r=this._areas[i];if(r)if(i!==this._fullscreenArea){var n=r.container.value();n&&n.classList.toggle("js-hidden",e&&!p(i))}else r.fullscreen.setValue(!0)}this._updateVisibility(),this.recalculate()},e.prototype._createDOM=function(e){var t=document.createElement("div");return t.classList.add("layout__area--"+e),t.style.position="absolute","bottom"===e?t.style.bottom="0":t.style.top="0","right"===e||"tradingpanel"===e?t.style.right="0":t.style.left="0",t},e}();function p(e){var t=u.enabled("side_toolbar_in_fullscreen_mode"),i=u.enabled("header_in_fullscreen_mode");return"center"===e||"left"===e&&t||"top"===e&&i}},Nu4p:function(e,t,i){"use strict";i.r(t),i.d(t,"plotShapesData",(function(){return r}));i("YFKU");var r={shape_arrow_down:{guiName:window.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown",icon:"arrow_down"},shape_arrow_up:{guiName:window.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup",icon:"arrow_up"},shape_circle:{guiName:window.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle",icon:"circle"},shape_cross:{guiName:window.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross",icon:"cross"},shape_diamond:{guiName:window.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond",icon:"diamond"},shape_flag:{guiName:window.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag",icon:"flag"},shape_label_down:{guiName:window.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown",icon:"label_down"},shape_label_up:{guiName:window.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup",icon:"label_up"},shape_square:{guiName:window.t("Square"),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square",icon:"square"},shape_triangle_down:{guiName:window.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown",icon:"triangle_down"},shape_triangle_up:{guiName:window.t("Triangle Up"),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup",icon:"triangle_up"},shape_xcross:{guiName:window.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross",icon:"x_cross"}}},OBgQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i("jCNj"),n=function(){function e(e,t,i){this.year=e,this.month=t,this.day=i}return e.prototype.toString=function(){return this.year+"-"+this.month+"-"+this.day},e.prototype.compareTo=function(e){
return this.year>e.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1},e.prototype.before=function(e){return-1===this.compareTo(e)},e.prototype.toCalendar=function(e){return r.get_cal(r.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)},e.prototype.addDays=function(t){var i=this.toCalendar(r.get_timezone("Etc/UTC"));return r.add_date(i,t),e.fromCalendar(i)},e.fromCalendar=function(t){return new e(r.get_year(t),r.get_month(t)+1,r.get_day_of_month(t))},e}()},OH2X:function(e,t,i){"use strict";t.LineToolFibRetracement=i("t2ex").LineToolFibRetracement,t.LineToolFibChannel=i("xnA2").LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i("Yjuu").LineToolFibSpeedResistanceArcs,t.LineToolProjection=i("68at").LineToolProjection,t.LineToolTrendBasedFibExtension=i("ZtA1").LineToolTrendBasedFibExtension,t.LineToolElliott=i("xz+e").LineToolElliott,t.LineToolFibCircles=i("4bfY").LineToolFibCircles,t.LineToolVertLine=i("n40Z").LineToolVertLine,t.LineToolCrossLine=i("MA5A").LineToolCrossLine,t.LineToolBarsPattern=i("2bPF").LineToolBarsPattern,t.LineToolTrendBasedFibTime=i("yUly").LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i("FsE7").LineToolFibTimeZone,t.LineToolCircleLines=i("tG6Q").LineToolCircleLines,t.LineToolDateRange=i("WkYF").LineToolDateRange,t.LineToolPriceRange=i("RDDl").LineToolPriceRange,t.LineToolDateAndPriceRange=i("UCMi").LineToolDateAndPriceRange,t.LineToolParallelChannel=i("qcGP").LineToolParallelChannel,t.LineToolTrendAngle=i("nW7S").LineToolTrendAngle,t.LineToolTrendLine=i("WPQD").LineToolTrendLine,t.LineToolInfoLine=i("yi8X").LineToolInfoLine,t.LineToolArrowMark=i("TohL").LineToolArrowMark,t.LineToolExecution=i("704P").LineToolExecution,t.LineToolPitchfan=i("NhkU").LineToolPitchfan,t.LineToolGannSquare=i("Z0Sh").LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i("zZ5f").LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i("nd9+").LineToolGannComplex,t.LineToolGannFixed=i("TBaH").LineToolGannFixed,t.LineToolGannFan=i("4u8j").LineToolGannFan,t.LineToolFibWedge=i("9QkW").LineToolFibWedge,t.LineToolPitchfork=i("aDyP").LineToolPitchfork,t.LineToolDisjointAngle=i("oIoN").LineToolDisjointChannel,t.LineToolFlatBottom=i("InMJ").LineToolFlatBottom,t.LineToolIcon=i("icPo").LineToolIcon,t.LineToolRotatedRectangle=i("Az04").LineToolRotatedRectangle,t.LineToolFibSpiral=i("i80N").LineToolFibSpiral,t.LineToolHeadAndShoulders=i("aILO").LineToolHeadAndShoulders,t.LineToolTriangle=i("isVH").LineToolTriangle,t.LineToolTrianglePattern=i("lNN+").LineToolTrianglePattern,t.LineTool5PointsPattern=i("NJRZ").LineTool5PointsPattern,t.LineToolThreeDrivers=i("PYn8").LineToolThreeDrivers,t.LineToolABCD=i("pKDv").LineToolABCD,t.LineToolPolyline=i("hP9j").LineToolPolyline,t.LineToolPrediction=i("Wh6B").LineToolPrediction,t.LineToolPriceLabel=i("zqZp").LineToolPriceLabel,t.LineToolArrowMarker=i("wiuq").LineToolArrowMarker,t.LineToolNote=i("gLxC").LineToolNote,t.LineToolNoteAbsolute=i("gLxC").LineToolNoteAbsolute,
t.LineToolBrush=i("+hLl").LineToolBrush,t.LineToolArc=i("0Pxc").LineToolArc,t.LineToolCallout=i("odCa").LineToolCallout,t.LineToolBalloon=i("me8f").LineToolBalloon,t.LineToolText=i("V3Oj").LineToolText,t.LineToolHorzLine=i("/DxK").LineToolHorzLine,t.LineToolHorzRay=i("CJIV").LineToolHorzRay,t.LineToolRectangle=i("7qI1").LineToolRectangle,t.LineToolEllipse=i("V086").LineToolEllipse,t.LineToolTimeCycles=i("kIXa").LineToolTimeCycles,t.LineToolSineLine=i("bv/X").LineToolSineLine,t.LineToolGhostFeed=i("XUCF").LineToolGhostFeed,t.LineToolBezierQuadro=i("Xyly").LineToolBezierQuadro,t.LineToolBezierCubic=i("N+BX").LineToolBezierCubic,t.LineToolArrow=i("QQu0").LineToolArrow,t.LineToolRay=i("5ZUI").LineToolRay,t.LineToolExtended=i("CHw2").LineToolExtended,t.LineToolSchiffPitchfork=i("v5F8").LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i("XFad").LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i("EqoR").LineToolInsidePitchfork,t.LineToolTextAbsolute=i("V3Oj").LineToolTextAbsolute,t.LineToolArrowMarkLeft=i("TohL").LineToolArrowMarkLeft,t.LineToolArrowMarkRight=i("TohL").LineToolArrowMarkRight,t.LineToolArrowMarkUp=i("TohL").LineToolArrowMarkUp,t.LineToolArrowMarkDown=i("TohL").LineToolArrowMarkDown,t.LineToolFlagMark=i("aIha").LineToolFlagMark,t.LineToolCypherPattern=i("bTqm").LineToolCypherPattern,t.LineToolElliottImpulse=i("xz+e").LineToolElliottImpulse,t.LineToolElliottTriangle=i("xz+e").LineToolElliottTriangle,t.LineToolElliottTripleCombo=i("xz+e").LineToolElliottTripleCombo,t.LineToolElliottCorrection=i("xz+e").LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i("xz+e").LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i("tDUI").LineToolRiskRewardLong,t.LineToolRiskRewardShort=i("tDUI").LineToolRiskRewardShort,t.LineToolPosition=i("ziJ5").LineToolPosition,t.LineToolOrder=i("B4/o").LineToolOrder},"OK+B":function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("eJTA"),o=n.rgba,s=n.rgbaToString,a=n.parseRgb,l=i("+GxX").isFeatureEnabled,c=i("cWHH"),u=i("1Wlv").PriceScale,h=i("8sOK").StudyStub,d=i("CW80"),p=d.createLineTool,f=d.createLineToolProperties,_=d.createStudyLineToolProperties,m=d.isLineToolName,y=d.isStudyLineToolName,g=i("Ss5c").LineDataSource,v=i("OH2X").LineToolBarsPattern,S=i("OH2X").LineToolCallout,b=i("HLXm"),w=i("GVHu"),P=w.Study,C=w.prepareStudyPropertiesForLoadChart,x=i("3ClC").createStudy,T=i("qJq3").Series,L=i("dfhE"),I=i("n5al"),M=i("0YCj"),O=i("Kxc7"),A=i("uOxu").getLogger("Chart.Serialization"),k=i("OH2X").LineToolParallelChannel,E=i("OH2X").LineToolTrendAngle,D=i("OH2X").LineToolGhostFeed,V=i("OH2X").LineToolElliott,B=i("7ktv").PriceDataSource,R=i("iDOr").Pane,N=i("Tmoa"),F=i("jofe").createDeferredPromise,j=i("ApcL").preferencesByWhiteList,W=(A=i("uOxu").getLogger("Chart.Serialization"),i("mPvX").LineToolsGroupModel);c.version=2,c.prototype.state=function(e,t,i){for(var r={panes:[]},n=0;n<this.panes().length;n++)r.panes.push(this.panes()[n].state(!0,e,!1,t,i));r.timeScale=this._timeScale.state(e);var o=this.properties();return r.chartProperties={paneProperties:o.paneProperties.state(),
scalesProperties:o.scalesProperties.state(),publishedChartsTimelineProperties:void 0,chartEventsSourceProperties:o.chartEventsSourceProperties.state(),priceScaleSelectionStrategyName:o.priceScaleSelectionStrategyName.value()},o.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=o.chartEventsSourceProperties.state()),r.lineToolsGroups=this.lineToolsGroupModel().state(t),r.version=c.version,r.timezone=this.timezone(),r.sessions=this.sessions().state(e),r.shouldBeSavedEvenIfHidden=this._shouldBeSavedEvenIfHidden,r},c.prototype.chartPropertiesTransparencyMigrate=function(e){var t,i,r;e.chartProperties.paneProperties.crossHairProperties&&(r=e.chartProperties.paneProperties.crossHairProperties,N.isHexColor(r.color)&&(i=r.transparency/100,t=a(r.color),r.color=s(o(t,i)))),e.chartProperties.paneProperties.dataWindowProperties&&(r=e.chartProperties.paneProperties.dataWindowProperties,N.isHexColor(r.color)&&(i=r.transparency/100,t=a(r.color),r.color=s(o(t,i))))},c.prototype.resetDeferredStudies=function(){new z(this).reset()},c.prototype._getExceedingChildStudies=function(e){for(var t=[],i=0;i<e.length;++i)t=t.concat(e[i].sources||[]);for(var r=0,n=[],o={},s=0,a=1e6;t.length&&--a;){var l=t[s];(l.ownerSource&&o[l.ownerSource]||!l.ownerSource)&&(o[l.id]=l,t.splice(t.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++r>1&&n.push(l)),s=(s+1)%t.length}return n},c.prototype.restoreState=function(e,t,i){new z(this).reset();var r={};if(e.panes)if(Array.isArray(e.panes)){if(!(e.panes.length<1)){if(this._shouldBeSavedEvenIfHidden=void 0===e.shouldBeSavedEvenIfHidden||e.shouldBeSavedEvenIfHidden,e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties){var n=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(n,e.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(r.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(r.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.mergeAndFire(e.chartProperties.paneProperties),this._properties.scalesProperties.mergeAndFire(n),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.mergeAndFire(e.chartProperties.chartEventsSourceProperties),this._timeScale.restoreState(e.timeScale,t),this._updateDateTimeFormatter()}
if(e.timeScale&&this._timeScale.restoreState(e.timeScale,t),!this.readOnly()){var o=this._getExceedingChildStudies(e.panes);if(o.length)for(var s=e.panes.length-1;s>=0;--s){for(var a=(h=e.panes[s]).sources.length-1;a>=0;--a){var l=h.sources[a];~o.indexOf(l)&&h.sources.splice(a,1)}h.sources.length||e.panes.splice(s,1)}}var c=e.panes;this.panes()[0].restoreState(c[0],t,e.version,r,i,!0);var u=1;for(s=1;s<e.panes.length;s++){var h,d=e.panes[s];if(0!==d.sources.length)(h=this.panes()[u]||this.createPane()).restoreState(d,t,e.version,r,i,!0),u+=1;else A.logWarn("Empty pane detected - restoring is skipped. idx="+s+", state="+JSON.stringify(d))}this._invalidateBarColorerCaches();var p=this.dataSources(),f=0;for(s=0;s<p.length;s++){var _=p[s];TradingView.isInherited(_.constructor,g)&&(f++,_.calcIsActualSymbol())}this._version=e.version,this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.fullUpdate(),this.syncESD();var m=TVLocalStorage.getItem("linetools_limit")||1e3;return window.is_authenticated&&window.user&&window.user.settings&&(m=window.user.settings.linetools_limit||m),e.sessions&&this.sessions().restoreState(e.sessions,t),e.lineToolsGroups&&(this._lineToolsGroupModel=W.fromState(this,e.lineToolsGroups)),f>m&&f%100==0?{lines_limit_exceeded:!0,line_tools_count:f}:(this._dataSourceCollectionChanged.fire(),{})}A.logDebug("ChartModel.restoreState: invalid state")}else A.logDebug("ChartModel.restoreState: invalid state");else A.logDebug("ChartModel.restoreState: invalid state")},R.prototype.state=function(e,t,i,r,n){var o={},s=new Map;function a(e){if(s.has(e))return s.get(e);var o=null,a=i&&!e.isSavedInStudyTemplates()||!e.state||!(o=e.state(t,n))||!e.isSavedInChart(t)||r&&e.isActualSymbol&&!e.isActualSymbol()?null:o;return s.set(e,a),a}if(e){o.sources=[];for(var l=0;l<this.m_dataSources.length;l++){var c=a(this.m_dataSources[l]);null!==c&&o.sources.push(c)}}function u(e){return null!==s.get(e)}o.leftAxisesState=this._leftPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).map((function(e){return e.id()})),t})),o.rightAxisesState=this._rightPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).map((function(e){return e.id()})),t})),o.overlayPriceScales={};for(l=0;l<this.m_dataSources.length;l++){var h=this.m_dataSources[l];this.isOverlay(h)&&h.isSavedInChart(t)&&(o.overlayPriceScales[h.id()]=h.priceScale().state())}return o.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(o.mainSourceId=this.m_mainDataSource.id()),o.priceScaleRatio=this._currentPriceScaleRatio,o},R.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},R.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},
R.prototype.isStudyToSkip=function(e){return!!this.isESDStudy(e)},R.prototype.restoreState=function(e,t,i,r,n,o){r=r||{},e.stretchFactor&&(this._stretchFactor=e.stretchFactor);var s={};if(e.sources){var a=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)}))||(A.logNormal("Dropped invalid "+e.type+". Reason: non-numeric point time"),!1)))})),l=-1!==this.m_dataSources.indexOf(this._model.mainSeries());this.clearSeries(o),this.m_mainDataSource=null,l&&this._addSourceToCollections(this._model.mainSeries(),o);var c=this.getZOrderMinMax(),h=c.minZOrder,d=c.maxZOrder;!function(){var t=a.find((function(t){return t.id===e.mainSourceId}));if(void 0!==t)if(TradingView[t.type]&&TradingView.isInherited(TradingView[t.type],g)){for(var i=null,r=0;r<a.length;r++){var n=a[r];if(!TradingView[t.type]||!TradingView.isInherited(TradingView[n.type],g)){if(null!==i)return void A.logWarn("Pane contains more than 1 possibly main sources - auto fix cannot be applied");i=n}}if(null!==i){var o=e.mainSourceId,s=0;e.mainSourceId=i.id,a.forEach((function(e){e.ownerSource===o&&(e.ownerSource=i.id,s+=1)})),A.logNormal("Auto fix broken pane is applied, changed line tools="+s+", changed from="+o+" to="+i.id)}else A.logWarn("Pane contains only line tools - possible we need to remove this pane?")}else A.logNormal("The type of main source is not line tool - fix is unnecessary");else A.logWarn("There is no main source with id "+e.mainSourceId+", total sources="+a.length)}();for(var p=0;p<a.length;p++){if("study_Sessions"===(_=(f=a[p]).type)){this.model().sessions().restoreOldState(f,t);break}}for(p=0;p<e.sources.length;p++){var f,_;if("study_Sessions"!==(_=(f=e.sources[p]).type)){if(Math.abs(f.zorder)>1e200){var m=h-1;A.logWarn("Datasource zorder has bad value: "+f.zorder+" Resetting it to "+m),f.zorder=m}else if(!this.isZOrderAvailable(f.zorder)){l&&"MainSeries"===_&&this._model.mainSeries().zorder()===f.zorder||(f.zorder=d+1)}s[O=f.id]=f.ownerSource,_&&("MainSeries"===_?this._restoreMainSeries(f,t,l,r,n,o):_.toLowerCase().startsWith("study")?this._restoreStudy(f,t,r,o):TradingView.isInherited(TradingView[_],g)?this.restoreLineTool(f,t,void 0,o):TradingView[_]&&TradingView[_].createFromState&&this._restoreSpecialSource(f,t,o)),h=Math.min(h,f.zorder),d=Math.max(d,f.zorder)}}}var y,v,S=new Set,b=this;function w(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new u(b.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var r=b.dataSourceForId(e);r&&function(e,t,i){S.add(e),void 0!==i.m_showSymbolLabels&&e instanceof T&&b.model().properties().scalesProperties.showSymbolLabels.setValue(i.m_showSymbolLabels),e.setPriceScale(t),t.addDataSource(e)}(r,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)y=e.leftAxisesState.map(w).filter((function(e){return null!==e}));else{var C=w({state:e.leftAxisState,sources:e.leftAxisSources});y=null!==C?[C]:[]}
if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],y.forEach((function(e){b._placePriceScale(e,"left")})),e.rightAxisesState)v=e.rightAxisesState.map(w).filter((function(e){return null!==e}));else{var x=w({state:e.rightAxisState,sources:e.rightAxisSources});v=null!==x?[x]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],v.forEach((function(e){b._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;for(p=0;p<this.m_dataSources.length;p++){var L=this.m_dataSources[p];if(!S.has(L)){var I=new u(this._model.properties().scalesProperties);if(I.setHeight(this.m_height),I.addDataSource(L),e.overlayPriceScales&&e.overlayPriceScales[L.id()]){var M=e.overlayPriceScales[L.id()];M.m_isAutoScale=!0,M.m_isLog=!1,M.m_isPercentage=!1,M.m_isLockScale=!1,I.restoreState(M)}L.setPriceScale(I)}}for(var O in s){var k=s[O];if(k)(L=this.dataSourceForId(O))&&this.dataSourceForId(O).setOwnerSource(this.dataSourceForId(k))}if(e.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(e.mainSourceId)),!this.m_mainDataSource)for(p=0;p<this.m_dataSources.length;p++){L=this.m_dataSources[p];if(TradingView.isInherited(L.constructor,B)){this.m_mainDataSource=L;break}}for(p=0;p<this.m_dataSources.length;p++){L=this.m_dataSources[p];if(TradingView.isInherited(L.constructor,g))L.ownerSource()||L.setOwnerSource(this.mainDataSource()),L.isFixed()&&L.restoreFixedPoints(),L.fixAfterRestorePriceAxis&&L.fixAfterRestorePriceAxis();else if(TradingView.isInherited(L.constructor,P)){var E=L.properties();E.linkedToSeries&&E.linkedToSeries.value()&&(L.ownerSource()||L.setOwnerSource(this.model().mainSeries()))}}this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},R.prototype._restoreMainSeries=function(e,t,i,r,n,o){var s=e.id,a=e.state,c=e.zorder;if(a&&n&&(a.style=n.style||a.style,a.interval=n.interval||a.interval,a.symbol=n.symbol||a.symbol),a&&a.style===L.STYLE_HILO&&!l("chart_style_hilo")&&(a.style=L.STYLE_CANDLES),a&&["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){a[e]&&(a[e].wickUpColor=a[e].wickUpColor||a[e].wickColor,a[e].wickDownColor=a[e].wickDownColor||a[e].wickColor)})),a&&(a.statusViewStyle=a.statusViewStyle||{},!a.statusViewStyle.symbolTextSource)){var u=!!a.statusViewStyle.showSymbolAsDescription;a.statusViewStyle.symbolTextSource=u?"ticker":"description"}if(!i){var h=this._model.mainSeries();this._model.paneForSource(h).removeDataSource(h,!1,o),this._addSourceToCollections(h,o)}if(this.m_mainDataSource=this._model.mainSeries(),
this.seriesError=new o,this._lastBarTimes={}};function c(e){return 12*e*30*24*60*60*1e3}function u(e){return 30*e*24*60*60*1e3}function h(e){return 7*e*24*60*60*1e3}function d(e){return 24*e*60*60*1e3}function p(e){return 60*e*60*1e3}function f(e){return 60*e*1e3}l.prototype.lastBarTime=function(e){return this._lastBarTimes[e]},l.prototype._userTimezone=function(){return this._timezone},l.prototype.setTimezone=function(e){this._timezone="exchange"===e?"exchange":t.get_timezone(e),this._timezoneId=e},l.prototype.timezone=function(){return this._timezoneId},l.prototype.setResolution=function(e){this._isDWM=n.isDWM(e),this._resolution=e},l.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},l.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},l.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},l.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},l.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},l.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},l.prototype.onSeriesError=function(e,t){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t]}),this.seriesError.fire(e,t)},l.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:[]}]})},l.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},l.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},l.prototype._calcMarksTime=function(e,i,o,l){for(var c=t.get_timezone(i.timezone),u=new r.SessionInfo(i.timezone,i.session,i.holidays,i.corrections),h=r.newBarBuilder(this._resolution,u,u),d=this._isDWM&&!s.enabled("disable_resolution_rebuild"),p=s.enabled("end_of_period_timescale_marks"),f=!this._isDWM,_=n.parse(this._resolution),m=0;m<e.length;m++){var y=o(e[m]);if(p&&(y=a(h,u.spec,y,_)),d){var g=t.utc_to_cal(c,1e3*y);g=u.spec.correctTradingDay(g),t.set_hms(g,0,0,0,0,c),y=parseInt(g.valueOf()/1e3)}f&&(y=this.timeInTimezone(y,c)),e[m]=l(e[m],y)}},l.prototype.onTickmarksUpdated=function(e,t,i,r){if(n.isEqual(r,this._resolution)){var o=t.slice(0);this._calcMarksTime(o,i,(function(e){return e}),(function(e,t){return t}));for(var s,a=[],l=[],c=0;c<o.length;++c){var u=o[c];a.push([this._spanByTime(u,s),u,e+c]),l.push(u),s=u}var h={method:"tickmark_update",params:[this._session,{index:e,zoffset:0,changes:l,
marks:a,index_diff:[]}]};this._server.receiveLocalResponse(h)}},l.prototype.onTimescaleUpdate=function(e,t,i,r,n,o){var s=o&&o.slice(0);this._lastBarTimes[e]=s?s&&s[s.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,r,(function(e){return e.value[0]}),(function(e,t){return e.exTime=t,e})),s&&this._calcMarksTime(s,r,(function(e){return e}),(function(e,t){return{markTime:t,time:e}}));var a={};a[e]={series:i,turnaround:t};var l,c=[],u=[],h=i.map((function(e){return{markTime:e.exTime,time:e.value[0]}}));s&&(h=h.concat(s));for(var d=0;d<h.length;++d){var p=h[d].markTime;c.push([this._spanByTime(p,l),p,n+d]),u.push(h[d].time),l=p}var f={method:"timescale_update",params:[this._session,a,{index:n,zoffset:0,changes:u,marks:c,index_diff:[]}]};this._server.receiveLocalResponse(f)},l.prototype.onSeriesTimeframeUpdate=function(e,t,i,r,n){var o={method:"series_timeframe",params:[this._session,e,t,i,r,n]};this._server.receiveLocalResponse(o)},l.prototype.onPointsetDataUpdate=function(e,t,i,r){this._onDataUpdate(e,t,i,null,r,1)},l.prototype.onDataUpdate=function(e,t,i,r,n){this._onDataUpdate(e,t,i,r,n,0)},l.prototype._onDataUpdate=function(e,t,i,r,n,o){var s={},a="",l=[];null!==r&&(a=JSON.stringify(r.data),l=r.indexes||[]),s[e]={s:i,ns:{d:a,indexes:l},turnaround:t};var c={method:"data_update",params:[this._session,s]};this._server.receiveLocalResponse(c)},l.prototype.onQuotesData=function(e){this._server.receiveLocalResponse({method:"quote_symbol_data",params:e})},l.prototype.onDepthData=function(e){this._server.receiveLocalResponse({method:"dd",params:e})},l.prototype.onDepthUpdate=function(e){this._server.receiveLocalResponse({method:"dpu",params:e})},l.prototype.onProjectionUpdate=function(e,t,i,r){var n=i.data,o=n[n.length-1],s={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:o?o[4]:i.price,bars:n.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]}}))}},a={};a[e]={s:r||[],ns:{d:JSON.stringify(s),indexes:n.map((function(e,t){return i.barsetSize+(e[0]||0)}))},turnaround:t};var l={method:"data_update",params:[this._session,a]};this._server.receiveLocalResponse(l)},l.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)},l.prototype._spanByTime=function(e,i){var r,n=[{divisor:(r=1,1e3*r),span:10},{divisor:f(1),span:20},{divisor:f(5),span:21},{divisor:f(30),span:22},{divisor:p(1),span:30},{divisor:p(3),span:31},{divisor:p(6),span:32},{divisor:p(12),span:33},{divisor:d(1),span:40},{divisor:h(1),span:50},{divisor:u(1),span:60},{divisor:c(1),span:70}];if(!i)return 20;var o=new Date(1e3*i),s=new Date(1e3*e);if(s.getUTCFullYear()!==o.getUTCFullYear())return 70;if(s.getUTCMonth()!==o.getUTCMonth())return 60;if(t.get_week_of_year(s)!==t.get_week_of_year(o))return 50;if(s.getUTCDate()!==o.getUTCDate())return 40;for(var a=n.length-1;a>=0;--a)if(Math.floor(o/n[a].divisor)!==Math.floor(s/n[a].divisor))return n[a].span},
TradingView.ChartapiMessagerInstances=[],e.exports=l}).call(this,i("jCNj"))},"N+BX":function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Double Curve");function a(e,t){this._constructor="LineToolBezierCubic";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("a6on").BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 2},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Double Curve"},a.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5).transposed().scaled(.3),r=e.add(t).scaled(.33),n=e.add(t).scaled(.67),o=r.add(i),s=n.subtract(i);return[this.screenPointToPoint(o),this.screenPointToPoint(s)]},a.prototype.setLastPoint=function(e,t){r.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},a.prototype.addPoint=function(e,t,i){var n=r.prototype.addPoint.call(this,e,t,!0);if(n){var o=this.controlPoints();delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return n},a.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},a.prototype.getStylesPropertyPage=function(){return o.LineToolBezierStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("b4fl").GeneralBezierDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolbeziercubic",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolBezierCubic=a},N1UO:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyApi",(function(){return h}));var r=i("mrSG"),n=(i("YFKU"),i("Eyy1")),o=i("9iCb"),s=i("xo8u"),a=i("gaBL"),l=i("HGup"),c=i("jRfx"),u=i("/ToI"),h=function(){function e(e,t){this._study=e,this._undoModel=t,this._model=t.model()}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 Object(r.__assign)(Object(r.__assign)({},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){for(var t=this.getInputValues(),i=function(e){void 0!==t.find((function(t){return t.id===e.id
}))?r._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},r=this,n=0,o=e;n<o.length;n++){i(o[n])}},e.prototype.mergeUp=function(){this._model.isMergeUpAvailableForSource(this._study)&&new c.c(this._model,this._study,"").redo()},e.prototype.mergeDown=function(){this._model.isMergeDownAvailableForSource(this._study)&&new c.a(this._model,this._study,"").redo()},e.prototype.unmergeUp=function(){this._model.isUnmergeAvailableForSource(this._study)&&new l.c(this._model,this._study,"").redo()},e.prototype.unmergeDown=function(){this._model.isUnmergeAvailableForSource(this._study)&&new l.a(this._model,this._study,"").redo()},e.prototype.mergeUpWithUndo=function(){this._model.isMergeUpAvailableForSource(this._study)&&this._undoModel.mergeSourceUp(this._study)},e.prototype.mergeDownWithUndo=function(){this._model.isMergeDownAvailableForSource(this._study)&&this._undoModel.mergeSourceDown(this._study)},e.prototype.unmergeUpWithUndo=function(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceUp(this._study)},e.prototype.unmergeDownWithUndo=function(){this._model.isUnmergeAvailableForSource(this._study)&&this._undoModel.unmergeSourceDown(this._study)},e.prototype.changePriceScale=function(e){var t=Object(n.ensureNotNull)(this._model.paneForSource(this._model.mainSeries())),i=Object(n.ensureNotNull)(this._model.paneForSource(this._study));switch(e){case"no-scale":Object(n.assert)(i.actionNoScaleIsEnabled(this._study),"Unable to leave a pane without any non-overlay price scale"),new u.b(this._model,this._study,i,"overlay","").redo();break;case"as-series":Object(n.assert)(i===t,"Study should be on the main pane"),new u.a(this._model,this._study,i,this._model.mainSeries().priceScale(),"").redo();break;case"new-left":new u.b(this._model,this._study,i,"left","").redo();break;case"new-right":new u.b(this._model,this._study,i,"right","").redo();break;default:var r=this._model.dataSourceForId(e);if(null===r)throw new Error("There is no study with entityId='"+e+"'");var o=i===this._model.paneForSource(r);Object(n.assert)(o,"Both studies should be on the same pane");var l=Object(n.ensureNotNull)(r.priceScale()),c=Object(a.sourceNewCurrencyOnPinningToPriceScale)(this._study,l,this._model);new u.a(this._model,this._study,i,l,"").redo(),null!==c&&new s.a(l,c,this._undoModel.chartWidget(),"").redo()}},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(o.applyOverridesToStudy)(this._study,e)},e.prototype.dataLength=function(){return this._study.data().size()},e}()},N22A:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var r=i("ObRt"),n={id:"TradingService"};function o(){return Object(r.a)(n)?Object(r.c)(n):null}},NJRZ:function(e,t,i){"use strict"
;var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("XABCD Pattern");function a(e,t){this._constructor="LineTool5PointsPattern";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("6MfG").Pattern5PaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 5},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"XABCD Pattern"},a.prototype.getStylesPropertyPage=function(){return o.LineToolLineTool5PointsPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetool5pointspattern",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineTool5PointsPattern=a},NSoL:function(e,t,i){"use strict";i.r(t),i.d(t,"clientSnapshot",(function(){return y}));var r=i("mrSG"),n=i("ikwP"),o=i("zDbI"),s=i("XlJ7"),a=i("EsvI"),l=i("Dq3s"),c=i("Kxc7"),u=i("tzRX"),h=!c.enabled("widget_logo");function d(e,t,i){var n;void 0===t&&(t=null),void 0===i&&(i=null);var o={};if("number"==typeof e)return{relativePositions:(n={},n[e]={l:t,t:i},n),nextElementLeft:e,nextElementTop:e};var s=e[0],a=e.slice(1);if("v"===s){for(var l=null,c=0,u=a;c<u.length;c++){var h=d(u[c],t,i);o=Object(r.__assign)(Object(r.__assign)({},o),h.relativePositions),i=h.nextElementTop,l=h.nextElementLeft}t=l}if("h"===s){for(var p=null,f=0,_=a;f<_.length;f++){h=d(_[f],t,i);o=Object(r.__assign)(Object(r.__assign)({},o),h.relativePositions),t=h.nextElementLeft,p=h.nextElementTop}i=p}return{relativePositions:o,nextElementTop:i,nextElementLeft:t}}var p=function(e){for(var t={},i=0,r=Object.keys(e);i<r.length;i++){var n=r[i],o=d(e[n]).relativePositions;t[n]=o}return t}(l);function f(e,t,i,r,o){Object(n.drawScaled)(e,o,(function(){e.fillText(r,t/o,i/o)}))}var _=URL.createObjectURL(new Blob([u],{type:"image/svg+xml"}));function m(e,t,i,r){i.save(),i.translate(t.x,t.y);for(var n=0,o=0,s=e.panes;o<s.length;o++){var a=s[o],l=0,c=a.leftAxis.canvas.width+Math.round(8*r),u=n,h=n+Math.round(10*r);if(a.leftAxis.contentWidth>0&&(i.drawImage(a.leftAxis.canvas,l,n),l+=a.leftAxis.canvas.width),i.drawImage(a.canvas,l,n),l+=a.canvas.width,a.rightAxis.contentWidth>0&&i.drawImage(a.rightAxis.canvas,l,n),"pane"===a.type){var d=17*r;i.fillStyle=e.colors.text,a.mainSeriesText&&h+d<u+a.canvas.height&&(f(i,c,h,a.mainSeriesText,r),h+=d);for(var p=0,_=a.studies;p<_.length;p++){var m=_[p];h+d<u+a.canvas.height&&(f(i,c,h,m,r),h+=d)}}n+=a.canvas.height}if(void 0!==e.timeAxis){l=0;e.timeAxis.lhsStub.contentWidth>0&&(i.drawImage(e.timeAxis.lhsStub.canvas,l,n),l+=e.timeAxis.lhsStub.canvas.width),i.drawImage(e.timeAxis.canvas,l,n),l+=e.timeAxis.canvas.width,
e.timeAxis.rhsStub.contentWidth>0&&i.drawImage(e.timeAxis.rhsStub.canvas,l,n)}i.restore()}function y(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,i,l,c,u,d,f,y,g,v,S,b,w,P,C,x,T;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:for(t=p[e.layout],i=e.charts.map((function(e){return function(e){for(var t=e.panes[0],i=t.canvas.width+t.leftAxis.canvas.width+t.rightAxis.canvas.width,r=0,o=0,s=e.panes;o<s.length;o++){r+=s[o].canvas.height}return void 0!==e.timeAxis&&(r+=e.timeAxis.canvas.height),new n.Size(i,r)}(e)})),l=e.hidpiRatio,c=e.charts.map((function(e,r){return function e(t,i,r,n){var o=Math.round(10*n),s=Math.round(10*n),a=r[t];if(null!==a.l){var l=e(a.l,i,r,n);o=l.x+l.width+Math.round(5*n)}if(null!==a.t){var c=e(a.t,i,r,n);s=c.y+c.height+Math.round(5*n)}var u=i[t];return{x:o,y:s,width:u.w,height:u.h}}(r,i,t,l)})),u=0,d=0,f=0,y=c;f<y.length;f++)C=y[f],u=Math.max(u,C.x+C.width),d=Math.max(d,C.y+C.height);for(u+=Math.round(10*l),g=h?Math.round(10*l):Math.round(35*l),v=d,d+=g,S=Object(n.createDisconnectedCanvas)(document,new n.Size(u,d),1),(b=Object(n.getContext2D)(S)).font=Object(s.makeFont)(12,o.CHART_FONT_FAMILY),b.textBaseline="top",b.fillStyle=a.themes[e.theme].getThemedColor("color-bg-primary"),b.fillRect(0,0,u,d),w=0;w<e.charts.length;++w)P=e.charts[w],C=c[w],m(P,C,b,l);return h?[3,2]:[4,(L=Math.round(26*l),I=Math.round(15*l),new Promise((function(e){var t=new Image;t.width=L,t.height=I,t.onload=function(){e({image:t,width:L,height:I})},t.src=_})))];case 1:x=r.sent(),b.fillStyle=a.themes[e.theme].getThemedColor("color-text-primary"),b.font=Object(s.makeFont)(13,o.CHART_FONT_FAMILY),T=v+Math.round(g/2-x.height/2),function(e,t,i,r,o){e.save(),e.drawImage(r.image,t,i,r.width,r.height),e.textBaseline="bottom";var s=(t+r.width)/o+3,a=(i+r.height)/o;Object(n.drawScaled)(e,o,(function(){e.fillText("TradingView",s,a)})),e.restore()}(b,Math.round(10*l),T,x,l),r.label=2;case 2:return[2,S]}var L,I}))}))}},Ndyb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererColumns",(function(){return n}));var r=i("VdBB"),n=function(){function e(e){this._data=null,this._precalculatedCache=[],this.setData(e)}return e.prototype.setData=function(e){this._data=e,this._precalculatedCache=[]},e.prototype.draw=function(e,t){if(null!==this._data&&0!==this._data.items.length){var i=t.pixelRatio;this._precalculatedCache.length||this._fillPrecalculatedCache(i);for(var r=Math.max(1,Math.floor(i)),n=Math.round(this._data.histogramBase*i)-Math.floor(r/2),o=n+r,s=this._data.lineColor,a=0;a<this._data.items.length;a++){var l=this._data.items[a],c=this._precalculatedCache[a],u=Math.round(l.y*i),h=l.style?l.style.color:s;e.fillStyle=h;var d=void 0,p=void 0;u<=n?(d=u,p=o):(d=n,p=u-Math.floor(r/2)+r),e.fillRect(c.left,d,c.right-c.left+1,p-d)}}},e.prototype.hitTest=function(e){if(null===this._data)return null;for(var t=.5*this._data.barSpacing,i=e.x-t,n=e.x+t,o=0,s=this._data.items;o<s.length;o++){var a=s[o],l=a.x;if(l>=i&&l<=n){var c=a.y
;if(e.y>=Math.min(c,this._data.histogramBase)&&e.y<=Math.max(c,this._data.histogramBase))return new r.HitTestResult(r.HitTestResult.REGULAR)}}return null},e.prototype._fillPrecalculatedCache=function(e){if(null!==this._data&&0!==this._data.items.length){var t=Math.ceil(this._data.barSpacing*e)<=1?0:Math.max(1,Math.floor(e)),i=Math.round(this._data.barSpacing*e)-t;this._precalculatedCache=new Array(this._data.items.length);for(var r=0;r<this._data.items.length;r++){var n,o=this._data.items[r],s=Math.round(o.x*e),a=void 0,l=void 0;if(i%2)a=s-(n=(i-1)/2),l=s+n;else a=s-(n=i/2),l=s+n-1;this._precalculatedCache[r]={left:a,right:l,roundedCenter:s,center:o.x*e,time:o.timePointIndex}}for(r=1;r<this._data.items.length;r++){var c=this._precalculatedCache[r],u=this._precalculatedCache[r-1];c.time===u.time+1&&(c.left-u.right!==t+1&&(u.roundedCenter>u.center?u.right=c.left-t-1:c.left=u.right+t+1))}var h=Math.ceil(this._data.barSpacing*e);for(r=0;r<this._data.items.length;r++){(c=this._precalculatedCache[r]).right<c.left&&(c.right=c.left);var d=c.right-c.left+1;h=Math.min(d,h)}if(t>0&&h<4)for(r=0;r<this._data.items.length;r++){(d=(c=this._precalculatedCache[r]).right-c.left+1)>h&&(c.roundedCenter>c.center?c.right-=1:c.left+=1)}}else this._precalculatedCache=[]},e}()},NhkU:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("5rJj"),o=i("hayr").propertyPages,s=i("ytGH").LineToolWidthsProperty,a=window.t("Pitchfan");function l(e,t){this._constructor="LineToolPitchfan";var n=t||l.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("l5Au").PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe);for(var o=[this._properties.child("median").child("linewidth")],a=0;a<=l.LevelsCount;a++)o.push(this._properties.child("level"+a).child("linewidth"));this._widthsProperty=new s(o)}inherit(l,r),l.LevelsCount=8,l.prototype.levelsCount=function(){return l.LevelsCount},l.prototype.pointsCount=function(){return 3},l.prototype.translatedType=function(){return a},l.prototype.name=function(){return"Pitchfan"},l.prototype.processErase=function(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,"Erase level line")},l.prototype.getStylesPropertyPage=function(){return o.LineToolPitchfanStylesPropertyPage},l.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("D+Nk").PitchBaseDefinitionsViewModel}.bind(null,i)).catch(i.oe)},l.createProperties=function(e){var t=new n("linetoolpitchfan",e,!1,{range:[0,8]});return l._configureProperties(t),t},l._configureProperties=function(e){r._configureProperties(e)},t.LineToolPitchfan=l},NsVT:function(e,t,i){"use strict";i.r(t);var r=i("hY0g"),n=i.n(r),o=i("HySD");function s(e,t){for(var i=0,r=0,n=t;r<n.length;r++){var o=n[r],s=o.min,a=o.max;if(!(e<s||a<s)){var l=Math.min(e,a);if(e===(i=Math.max(i,l)))break}}return i}function a(e){var t=[];if(void 0===e)return[];Array.isArray(e)||(e=[e])
;for(var i=0,r=e;i<r.length;i++){var n=r[i],o=void 0,s=void 0;isFinite(n)?o=s=Number(n):(o=+n.min,s=+n.max),(o<0||isNaN(o))&&(o=0),isNaN(s)&&(s=1/0),o<=s&&s>0&&t.push({min:o,max:s})}return t.sort((function(e,t){return e.min-t.min||e.max-t.max})),t}function l(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}var c=i("+GxX"),u=i("Kxc7");i.d(t,"ChartPage",(function(){return d}));var h=u.enabled("no_min_chart_width"),d=function(){function e(e){var t=this;this._processVisibility=function(e){var i=e.container.value();return t._affectsLayout(e.name)?(i&&i.classList.toggle("js-hidden",!1),!0):(i&&i.classList.toggle("js-hidden",!0),!1)},this._setWidth=function(e,i){var r=i;t._fullscreenArea!==e.name&&(e.availWidth.setValue(i),e.canNegotiate.width&&(r=s(i,e.negotiations.width)));var n=e.container.value();return n&&(n.style.width=r+"px"),e.width.setValue(r),r},this._setHeight=function(e,i){var r=i;t._fullscreenArea!==e.name&&(e.availHeight.setValue(i),e.canNegotiate.height&&(r=s(i,e.negotiations.height)));var n=e.container.value();return n&&(n.style.height=r+"px"),e.height.setValue(r),r};var i=e.container.value();if(!i)throw new Error("bridge.container.value() must be an element");this._container=i,this._availableAreas=["left","tradingpanel","right","top","bottom","center","topleft","extratop"],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=this,i=e&&e.areaName;if(-1===this._availableAreas.indexOf(i))throw new Error("unknown options.areaName");this.free(i);var r=this._createDOM(i),s={name:i,canNegotiate:{width:"left"===i||"right"===i||"tradingpanel"===i||"topleft"===i,height:"top"===i||"bottom"===i||"topleft"===i||"extratop"===i},negotiations:{width:[],height:[]},remove:function(){for(var e in t._areas)t._areas[e]===s&&t.free(e)},negotiateWidth:function(e){if(s.canNegotiate.width){var i=a(e);l(s.negotiations.width,i)||(s.negotiations.width=i,t.recalculate())}},negotiateHeight:function(e){if(s.canNegotiate.height){var i=a(e);l(s.negotiations.height,i)||(s.negotiations.height=i,t.recalculate())}},requestFullscreen:function(){t._fullscreenArea||("right"!==i&&"center"!==i||(t._fullscreenArea=i),"center"===i&&t._bridge.requestFullscreen(),t._updateFullscreen())},exitFullscreen:function(){i===t._fullscreenArea&&(t._fullscreenArea=void 0,"center"===i&&t._bridge.exitFullscreen(),t._updateFullscreen())},width:new n.a,height:new n.a,availWidth:new n.a,availHeight:new n.a,alive:new n.a(!0),container:new n.a(r),visible:new n.a(!0),fullscreen:new n.a(!0),rdState:new o.ResizerDetacherState};return s.rdState.pushOwner(s),this._areas[i]=s,s.rdState.owner.subscribe((function(e){
var r=s.container.value();if(e!==s)r&&(r.innerHTML="",r.parentElement&&r.parentElement.removeChild(r));else{for(var n=null,o=t._availableAreas.indexOf(i);o--;){var a=t._availableAreas[o];if(t._affectsLayout(a)){n=t._areas[a].container.value();break}}r&&(n&&r.parentElement?r.insertAdjacentElement("afterend",n):t._container.appendChild(r))}t.recalculate()}),{callWithLast:!0}),s.rdState.bridge()},e.prototype.free=function(e){var t=this._areas[e];if(t){this._areas[e]=void 0;var i=t.container.value();i&&i.parentElement&&i.parentElement.removeChild(i),t.alive.setValue(!1)}},e.prototype.recalculate=function(){var e={};this._recalcSingleRunToken=e;var t=this._areas.topleft,i=this._areas.left,r=this._areas.tradingpanel,n=this._areas.right,o=this._areas.top,s=this._areas.bottom,a=this._areas.center,l=this._areas.extratop,c=this._width.value(),u=this._height.value(),d=0,p=0,f=0,_=0,m=0,y=0,g=0,v=0;(e===this._recalcSingleRunToken&&l&&this._processVisibility(l)&&(v=this._setHeight(l,u),this._setWidth(l,c)),e===this._recalcSingleRunToken&&t&&this._processVisibility(t))&&(g=this._setHeight(t,u),(y=this._setWidth(t,c))&&(y+=4),(L=t.container.value())&&(L.style.top=v+"px"));e===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&((L=i.container.value())&&(L.style.top=g+v+"px"),this._setHeight(i,u-g-v),(f=this._setWidth(i,c))&&(f+=4));if(e===this._recalcSingleRunToken&&r&&this._processVisibility(r)){this._setHeight(r,u);var S=c-f;h||(S-=300),m=this._setWidth(r,S)}if(e===this._recalcSingleRunToken&&n&&this._processVisibility(n)){this._setHeight(n,u-v);S=c-f-m;h||(S-=300),_=this._setWidth(n,S),(L=n.container.value())&&(L.style.top=v+"px")}var b=m+_,w=b?4:0;if(e===this._recalcSingleRunToken&&o&&this._processVisibility(o)){var P=Math.max(y,f);(L=o.container.value())&&(L.style.left=P+"px",L.style.top=v+"px");S=c-P-m-_-w;this._setWidth(o,S),d=this._setHeight(o,u)}var C=0,x=c-f-m-_-w;if(e===this._recalcSingleRunToken&&s&&this._processVisibility(s)){(L=s.container.value())&&(L.style.left=f+"px",L.classList.toggle("no-border-top-left-radius",!f),L.classList.toggle("no-border-top-right-radius",!b)),this._setWidth(s,x);var T=u-d-v;C=Math.min(300,T-0),p=this._setHeight(s,T)+4}if(e===this._recalcSingleRunToken&&a&&this._processVisibility(a)){var L;(L=a.container.value())&&(L.style.left=f+"px",L.style.top=d+v+"px",L.classList.toggle("no-border-bottom-left-radius",!p||!f),L.classList.toggle("no-border-bottom-right-radius",!b||!p)),this._setWidth(a,x);T=u-d-p-v;this._setHeight(a,Math.max(T,C))}e===this._recalcSingleRunToken&&r&&this._affectsLayout("tradingpanel")&&((L=r.container.value())&&(L.style.right=_+"px",L.style.top=v+"px"));e===this._recalcSingleRunToken&&this._updateVisibility()},e.prototype._affectsLayout=function(e){var t=this._areas[e];if(!t)return!1;if(t.rdState.owner.value()!==t)return!1;if(this._fullscreenArea&&this._fullscreenArea!==e)return p(e);if(this._width.value()<=567||this._height.value()<=445){var i=["center","top","left","topleft","extratop"];if(Object(c.isFeatureEnabled)("mobile_show_bottom_panel")&&i.push("bottom"),
!i.includes(e))return!1}return!0},e.prototype._updateVisibility=function(){for(var e=this._bridge.visible.value(),t=0;t<this._availableAreas.length;t++){var i=this._availableAreas[t],r=this._areas[i];r&&(e&&this._affectsLayout(i)?r.visible.setValue(!0):r.visible.setValue(!1))}},e.prototype._onParentFullscreenChange=function(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,this._updateFullscreen())},e.prototype._updateFullscreen=function(){for(var e=void 0!==this._fullscreenArea,t=0;t<this._availableAreas.length;t++){var i=this._availableAreas[t],r=this._areas[i];if(r)if(i!==this._fullscreenArea){var n=r.container.value();n&&n.classList.toggle("js-hidden",e&&!p(i))}else r.fullscreen.setValue(!0)}this._updateVisibility(),this.recalculate()},e.prototype._createDOM=function(e){var t=document.createElement("div");return t.classList.add("layout__area--"+e),t.style.position="absolute","bottom"===e?t.style.bottom="0":t.style.top="0","right"===e||"tradingpanel"===e?t.style.right="0":t.style.left="0",t},e}();function p(e){var t=u.enabled("side_toolbar_in_fullscreen_mode"),i=u.enabled("header_in_fullscreen_mode");return"center"===e||"left"===e&&t||"top"===e&&i}},Nu4p:function(e,t,i){"use strict";i.r(t),i.d(t,"plotShapesData",(function(){return r}));i("YFKU");var r={shape_arrow_down:{guiName:window.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown",icon:"arrow_down"},shape_arrow_up:{guiName:window.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup",icon:"arrow_up"},shape_circle:{guiName:window.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle",icon:"circle"},shape_cross:{guiName:window.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross",icon:"cross"},shape_diamond:{guiName:window.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond",icon:"diamond"},shape_flag:{guiName:window.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag",icon:"flag"},shape_label_down:{guiName:window.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown",icon:"label_down"},shape_label_up:{guiName:window.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup",icon:"label_up"},shape_square:{guiName:window.t("Square"),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square",icon:"square"},shape_triangle_down:{guiName:window.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown",icon:"triangle_down"},shape_triangle_up:{guiName:window.t("Triangle Up"),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup",icon:"triangle_up"},shape_xcross:{guiName:window.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross",
icon:"x_cross"}}},OBgQ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i("jCNj"),n=function(){function e(e,t,i){this.year=e,this.month=t,this.day=i}return e.prototype.toString=function(){return this.year+"-"+this.month+"-"+this.day},e.prototype.compareTo=function(e){return this.year>e.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1},e.prototype.before=function(e){return-1===this.compareTo(e)},e.prototype.toCalendar=function(e){return r.get_cal(r.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)},e.prototype.addDays=function(t){var i=this.toCalendar(r.get_timezone("Etc/UTC"));return r.add_date(i,t),e.fromCalendar(i)},e.fromCalendar=function(t){return new e(r.get_year(t),r.get_month(t)+1,r.get_day_of_month(t))},e}()},OH2X:function(e,t,i){"use strict";t.LineToolFibRetracement=i("t2ex").LineToolFibRetracement,t.LineToolFibChannel=i("xnA2").LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i("Yjuu").LineToolFibSpeedResistanceArcs,t.LineToolProjection=i("68at").LineToolProjection,t.LineToolTrendBasedFibExtension=i("ZtA1").LineToolTrendBasedFibExtension,t.LineToolElliott=i("xz+e").LineToolElliott,t.LineToolFibCircles=i("4bfY").LineToolFibCircles,t.LineToolVertLine=i("n40Z").LineToolVertLine,t.LineToolCrossLine=i("MA5A").LineToolCrossLine,t.LineToolBarsPattern=i("2bPF").LineToolBarsPattern,t.LineToolTrendBasedFibTime=i("yUly").LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i("FsE7").LineToolFibTimeZone,t.LineToolCircleLines=i("tG6Q").LineToolCircleLines,t.LineToolDateRange=i("WkYF").LineToolDateRange,t.LineToolPriceRange=i("RDDl").LineToolPriceRange,t.LineToolDateAndPriceRange=i("UCMi").LineToolDateAndPriceRange,t.LineToolParallelChannel=i("qcGP").LineToolParallelChannel,t.LineToolTrendAngle=i("nW7S").LineToolTrendAngle,t.LineToolTrendLine=i("WPQD").LineToolTrendLine,t.LineToolInfoLine=i("yi8X").LineToolInfoLine,t.LineToolArrowMark=i("TohL").LineToolArrowMark,t.LineToolExecution=i("704P").LineToolExecution,t.LineToolPitchfan=i("NhkU").LineToolPitchfan,t.LineToolGannSquare=i("Z0Sh").LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i("zZ5f").LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i("nd9+").LineToolGannComplex,t.LineToolGannFixed=i("TBaH").LineToolGannFixed,t.LineToolGannFan=i("4u8j").LineToolGannFan,t.LineToolFibWedge=i("9QkW").LineToolFibWedge,t.LineToolPitchfork=i("aDyP").LineToolPitchfork,t.LineToolDisjointAngle=i("oIoN").LineToolDisjointChannel,t.LineToolFlatBottom=i("InMJ").LineToolFlatBottom,t.LineToolIcon=i("icPo").LineToolIcon,t.LineToolRotatedRectangle=i("Az04").LineToolRotatedRectangle,t.LineToolFibSpiral=i("i80N").LineToolFibSpiral,t.LineToolHeadAndShoulders=i("aILO").LineToolHeadAndShoulders,t.LineToolTriangle=i("isVH").LineToolTriangle,t.LineToolTrianglePattern=i("lNN+").LineToolTrianglePattern,t.LineTool5PointsPattern=i("NJRZ").LineTool5PointsPattern,t.LineToolThreeDrivers=i("PYn8").LineToolThreeDrivers,t.LineToolABCD=i("pKDv").LineToolABCD,
t.LineToolPolyline=i("hP9j").LineToolPolyline,t.LineToolPrediction=i("Wh6B").LineToolPrediction,t.LineToolPriceLabel=i("zqZp").LineToolPriceLabel,t.LineToolArrowMarker=i("wiuq").LineToolArrowMarker,t.LineToolNote=i("gLxC").LineToolNote,t.LineToolNoteAbsolute=i("gLxC").LineToolNoteAbsolute,t.LineToolBrush=i("+hLl").LineToolBrush,t.LineToolArc=i("0Pxc").LineToolArc,t.LineToolCallout=i("odCa").LineToolCallout,t.LineToolBalloon=i("me8f").LineToolBalloon,t.LineToolText=i("V3Oj").LineToolText,t.LineToolHorzLine=i("/DxK").LineToolHorzLine,t.LineToolHorzRay=i("CJIV").LineToolHorzRay,t.LineToolRectangle=i("7qI1").LineToolRectangle,t.LineToolEllipse=i("V086").LineToolEllipse,t.LineToolTimeCycles=i("kIXa").LineToolTimeCycles,t.LineToolSineLine=i("bv/X").LineToolSineLine,t.LineToolGhostFeed=i("XUCF").LineToolGhostFeed,t.LineToolBezierQuadro=i("Xyly").LineToolBezierQuadro,t.LineToolBezierCubic=i("N+BX").LineToolBezierCubic,t.LineToolArrow=i("QQu0").LineToolArrow,t.LineToolRay=i("5ZUI").LineToolRay,t.LineToolExtended=i("CHw2").LineToolExtended,t.LineToolSchiffPitchfork=i("v5F8").LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i("XFad").LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i("EqoR").LineToolInsidePitchfork,t.LineToolTextAbsolute=i("V3Oj").LineToolTextAbsolute,t.LineToolArrowMarkLeft=i("TohL").LineToolArrowMarkLeft,t.LineToolArrowMarkRight=i("TohL").LineToolArrowMarkRight,t.LineToolArrowMarkUp=i("TohL").LineToolArrowMarkUp,t.LineToolArrowMarkDown=i("TohL").LineToolArrowMarkDown,t.LineToolFlagMark=i("aIha").LineToolFlagMark,t.LineToolCypherPattern=i("bTqm").LineToolCypherPattern,t.LineToolElliottImpulse=i("xz+e").LineToolElliottImpulse,t.LineToolElliottTriangle=i("xz+e").LineToolElliottTriangle,t.LineToolElliottTripleCombo=i("xz+e").LineToolElliottTripleCombo,t.LineToolElliottCorrection=i("xz+e").LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i("xz+e").LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i("tDUI").LineToolRiskRewardLong,t.LineToolRiskRewardShort=i("tDUI").LineToolRiskRewardShort,t.LineToolPosition=i("ziJ5").LineToolPosition,t.LineToolOrder=i("B4/o").LineToolOrder},"OK+B":function(e,t,i){"use strict";var r=i("Eyy1").assert,n=i("eJTA"),o=n.rgba,s=n.rgbaToString,a=n.parseRgb,l=i("+GxX").isFeatureEnabled,c=i("cWHH"),u=i("1Wlv").PriceScale,h=i("8sOK").StudyStub,d=i("CW80"),p=d.createLineTool,f=d.createLineToolProperties,_=d.createStudyLineToolProperties,m=d.isLineToolName,y=d.isStudyLineToolName,g=i("Ss5c").LineDataSource,v=i("OH2X").LineToolBarsPattern,S=i("OH2X").LineToolCallout,b=i("HLXm"),w=i("GVHu"),P=w.Study,C=w.prepareStudyPropertiesForLoadChart,x=i("3ClC").createStudy,T=i("qJq3").Series,L=i("dfhE"),I=i("n5al"),M=i("0YCj"),O=i("Kxc7"),A=i("uOxu").getLogger("Chart.Serialization"),k=i("OH2X").LineToolParallelChannel,E=i("OH2X").LineToolTrendAngle,D=i("OH2X").LineToolGhostFeed,V=i("OH2X").LineToolElliott,B=i("7ktv").PriceDataSource,R=i("iDOr").Pane,N=i("Tmoa"),F=i("jofe").createDeferredPromise,j=i("ApcL").preferencesByWhiteList,W=(A=i("uOxu").getLogger("Chart.Serialization"),
i("mPvX").LineToolsGroupModel);c.version=2,c.prototype.state=function(e,t,i){for(var r={panes:[]},n=0;n<this.panes().length;n++)r.panes.push(this.panes()[n].state(!0,e,!1,t,i));r.timeScale=this._timeScale.state(e);var o=this.properties();return r.chartProperties={paneProperties:o.paneProperties.state(),scalesProperties:o.scalesProperties.state(),publishedChartsTimelineProperties:void 0,chartEventsSourceProperties:o.chartEventsSourceProperties.state(),priceScaleSelectionStrategyName:o.priceScaleSelectionStrategyName.value()},o.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=o.chartEventsSourceProperties.state()),r.lineToolsGroups=this.lineToolsGroupModel().state(t),r.version=c.version,r.timezone=this.timezone(),r.sessions=this.sessions().state(e),r.shouldBeSavedEvenIfHidden=this._shouldBeSavedEvenIfHidden,r},c.prototype.chartPropertiesTransparencyMigrate=function(e){var t,i,r;e.chartProperties.paneProperties.crossHairProperties&&(r=e.chartProperties.paneProperties.crossHairProperties,N.isHexColor(r.color)&&(i=r.transparency/100,t=a(r.color),r.color=s(o(t,i)))),e.chartProperties.paneProperties.dataWindowProperties&&(r=e.chartProperties.paneProperties.dataWindowProperties,N.isHexColor(r.color)&&(i=r.transparency/100,t=a(r.color),r.color=s(o(t,i))))},c.prototype.resetDeferredStudies=function(){new z(this).reset()},c.prototype._getExceedingChildStudies=function(e){for(var t=[],i=0;i<e.length;++i)t=t.concat(e[i].sources||[]);for(var r=0,n=[],o={},s=0,a=1e6;t.length&&--a;){var l=t[s];(l.ownerSource&&o[l.ownerSource]||!l.ownerSource)&&(o[l.id]=l,t.splice(t.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++r>1&&n.push(l)),s=(s+1)%t.length}return n},c.prototype.restoreState=function(e,t,i){new z(this).reset();var r={};if(e.panes)if(Array.isArray(e.panes)){if(!(e.panes.length<1)){if(this._shouldBeSavedEvenIfHidden=void 0===e.shouldBeSavedEvenIfHidden||e.shouldBeSavedEvenIfHidden,e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties){var n=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(n,e.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(r.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(r.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.mergeAndFire(e.chartProperties.paneProperties),this._properties.scalesProperties.mergeAndFire(n),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),
e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.mergeAndFire(e.chartProperties.chartEventsSourceProperties),this._timeScale.restoreState(e.timeScale,t),this._updateDateTimeFormatter()}if(e.timeScale&&this._timeScale.restoreState(e.timeScale,t),!this.readOnly()){var o=this._getExceedingChildStudies(e.panes);if(o.length)for(var s=e.panes.length-1;s>=0;--s){for(var a=(h=e.panes[s]).sources.length-1;a>=0;--a){var l=h.sources[a];~o.indexOf(l)&&h.sources.splice(a,1)}h.sources.length||e.panes.splice(s,1)}}var c=e.panes;this.panes()[0].restoreState(c[0],t,e.version,r,i,!0);var u=1;for(s=1;s<e.panes.length;s++){var h,d=e.panes[s];if(0!==d.sources.length)(h=this.panes()[u]||this.createPane()).restoreState(d,t,e.version,r,i,!0),u+=1;else A.logWarn("Empty pane detected - restoring is skipped. idx="+s+", state="+JSON.stringify(d))}this._invalidateBarColorerCaches();var p=this.dataSources(),f=0;for(s=0;s<p.length;s++){var _=p[s];TradingView.isInherited(_.constructor,g)&&(f++,_.calcIsActualSymbol())}this._version=e.version,this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.fullUpdate(),this.syncESD();var m=TVLocalStorage.getItem("linetools_limit")||1e3;return window.is_authenticated&&window.user&&window.user.settings&&(m=window.user.settings.linetools_limit||m),e.sessions&&this.sessions().restoreState(e.sessions,t),e.lineToolsGroups&&(this._lineToolsGroupModel=W.fromState(this,e.lineToolsGroups)),f>m&&f%100==0?{lines_limit_exceeded:!0,line_tools_count:f}:(this._dataSourceCollectionChanged.fire(),{})}A.logDebug("ChartModel.restoreState: invalid state")}else A.logDebug("ChartModel.restoreState: invalid state");else A.logDebug("ChartModel.restoreState: invalid state")},R.prototype.state=function(e,t,i,r,n){var o={},s=new Map;function a(e){if(s.has(e))return s.get(e);var o=null,a=i&&!e.isSavedInStudyTemplates()||!e.state||!(o=e.state(t,n))||!e.isSavedInChart(t)||r&&e.isActualSymbol&&!e.isActualSymbol()?null:o;return s.set(e,a),a}if(e){o.sources=[];for(var l=0;l<this.m_dataSources.length;l++){var c=a(this.m_dataSources[l]);null!==c&&o.sources.push(c)}}function u(e){return null!==s.get(e)}o.leftAxisesState=this._leftPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).map((function(e){return e.id()})),t})),o.rightAxisesState=this._rightPriceScales.map((function(e){var t={};return t.state=e.state(),t.sources=e.dataSources().filter(u).map((function(e){return e.id()})),t})),o.overlayPriceScales={};for(l=0;l<this.m_dataSources.length;l++){var h=this.m_dataSources[l];this.isOverlay(h)&&h.isSavedInChart(t)&&(o.overlayPriceScales[h.id()]=h.priceScale().state())}return o.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(o.mainSourceId=this.m_mainDataSource.id()),o.priceScaleRatio=this._currentPriceScaleRatio,o},R.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},
R.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},R.prototype.isStudyToSkip=function(e){return!!this.isESDStudy(e)},R.prototype.restoreState=function(e,t,i,r,n,o){r=r||{},e.stretchFactor&&(this._stretchFactor=e.stretchFactor);var s={};if(e.sources){var a=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)}))||(A.logNormal("Dropped invalid "+e.type+". Reason: non-numeric point time"),!1)))})),l=-1!==this.m_dataSources.indexOf(this._model.mainSeries());this.clearSeries(o),this.m_mainDataSource=null,l&&this._addSourceToCollections(this._model.mainSeries(),o);var c=this.getZOrderMinMax(),h=c.minZOrder,d=c.maxZOrder;!function(){var t=a.find((function(t){return t.id===e.mainSourceId}));if(void 0!==t)if(TradingView[t.type]&&TradingView.isInherited(TradingView[t.type],g)){for(var i=null,r=0;r<a.length;r++){var n=a[r];if(!TradingView[t.type]||!TradingView.isInherited(TradingView[n.type],g)){if(null!==i)return void A.logWarn("Pane contains more than 1 possibly main sources - auto fix cannot be applied");i=n}}if(null!==i){var o=e.mainSourceId,s=0;e.mainSourceId=i.id,a.forEach((function(e){e.ownerSource===o&&(e.ownerSource=i.id,s+=1)})),A.logNormal("Auto fix broken pane is applied, changed line tools="+s+", changed from="+o+" to="+i.id)}else A.logWarn("Pane contains only line tools - possible we need to remove this pane?")}else A.logNormal("The type of main source is not line tool - fix is unnecessary");else A.logWarn("There is no main source with id "+e.mainSourceId+", total sources="+a.length)}();for(var p=0;p<a.length;p++){if("study_Sessions"===(_=(f=a[p]).type)){this.model().sessions().restoreOldState(f,t);break}}for(p=0;p<e.sources.length;p++){var f,_;if("study_Sessions"!==(_=(f=e.sources[p]).type)){if(Math.abs(f.zorder)>1e200){var m=h-1;A.logWarn("Datasource zorder has bad value: "+f.zorder+" Resetting it to "+m),f.zorder=m}else if(!this.isZOrderAvailable(f.zorder)){l&&"MainSeries"===_&&this._model.mainSeries().zorder()===f.zorder||(f.zorder=d+1)}s[O=f.id]=f.ownerSource,_&&("MainSeries"===_?this._restoreMainSeries(f,t,l,r,n,o):_.toLowerCase().startsWith("study")?this._restoreStudy(f,t,r,o):TradingView.isInherited(TradingView[_],g)?this.restoreLineTool(f,t,void 0,o):TradingView[_]&&TradingView[_].createFromState&&this._restoreSpecialSource(f,t,o)),h=Math.min(h,f.zorder),d=Math.max(d,f.zorder)}}}var y,v,S=new Set,b=this;function w(e){var t=defaults("chartproperties").paneProperties.axisProperties,i=new u(b.model().properties().scalesProperties,t);return i.restoreState(e.state),e.sources.forEach((function(e){var r=b.dataSourceForId(e);r&&function(e,t,i){S.add(e),void 0!==i.m_showSymbolLabels&&e instanceof T&&b.model().properties().scalesProperties.showSymbolLabels.setValue(i.m_showSymbolLabels),
e.setPriceScale(t),t.addDataSource(e)}(r,i,t)})),0===i.dataSources().length?null:i}if(e.leftAxisesState)y=e.leftAxisesState.map(w).filter((function(e){return null!==e}));else{var C=w({state:e.leftAxisState,sources:e.leftAxisSources});y=null!==C?[C]:[]}if(this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],y.forEach((function(e){b._placePriceScale(e,"left")})),e.rightAxisesState)v=e.rightAxisesState.map(w).filter((function(e){return null!==e}));else{var x=w({state:e.rightAxisState,sources:e.rightAxisSources});v=null!==x?[x]:[]}this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],v.forEach((function(e){b._placePriceScale(e,"right")})),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null;for(p=0;p<this.m_dataSources.length;p++){var L=this.m_dataSources[p];if(!S.has(L)){var I=new u(this._model.properties().scalesProperties);if(I.setHeight(this.m_height),I.addDataSource(L),e.overlayPriceScales&&e.overlayPriceScales[L.id()]){var M=e.overlayPriceScales[L.id()];M.m_isAutoScale=!0,M.m_isLog=!1,M.m_isPercentage=!1,M.m_isLockScale=!1,I.restoreState(M)}L.setPriceScale(I)}}for(var O in s){var k=s[O];if(k)(L=this.dataSourceForId(O))&&this.dataSourceForId(O).setOwnerSource(this.dataSourceForId(k))}if(e.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(e.mainSourceId)),!this.m_mainDataSource)for(p=0;p<this.m_dataSources.length;p++){L=this.m_dataSources[p];if(TradingView.isInherited(L.constructor,B)){this.m_mainDataSource=L;break}}for(p=0;p<this.m_dataSources.length;p++){L=this.m_dataSources[p];if(TradingView.isInherited(L.constructor,g))L.ownerSource()||L.setOwnerSource(this.mainDataSource()),L.isFixed()&&L.restoreFixedPoints(),L.fixAfterRestorePriceAxis&&L.fixAfterRestorePriceAxis();else if(TradingView.isInherited(L.constructor,P)){var E=L.properties();E.linkedToSeries&&E.linkedToSeries.value()&&(L.ownerSource()||L.setOwnerSource(this.model().mainSeries()))}}this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},R.prototype._restoreMainSeries=function(e,t,i,r,n,o){var s=e.id,a=e.state,c=e.zorder;if(a&&n&&(a.style=n.style||a.style,a.interval=n.interval||a.interval,a.symbol=n.symbol||a.symbol),a&&a.style===L.STYLE_HILO&&!l("chart_style_hilo")&&(a.style=L.STYLE_CANDLES),a&&["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){a[e]&&(a[e].wickUpColor=a[e].wickUpColor||a[e].wickColor,a[e].wickDownColor=a[e].wickDownColor||a[e].wickColor)})),a&&(a.statusViewStyle=a.statusViewStyle||{},!a.statusViewStyle.symbolTextSource)){var u=!!a.statusViewStyle.showSymbolAsDescription;a.statusViewStyle.symbolTextSource=u?"ticker":"description"}if(!i){var h=this._model.mainSeries();this._model.paneForSource(h).removeDataSource(h,!1,o),this._addSourceToCollections(h,o)}if(this.m_mainDataSource=this._model.mainSeries(),
(y=a&&a.style?a.style:void 0)===T.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":y===T.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),a&&!a.hasOwnProperty("showSessions")&&(a.showSessions=!1),a&&!a.extendedHours&&(a.extendedHours=!1),a&&t&&(a.showCountdown=!1),a&&(t&&!("showSeriesLastValueProperty"in r)&&"showLastValue"in a&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(a.showLastValue),delete a.showLastValue),a)for(var d={haStyle:I.chartStyleStudyId(T.STYLE_HEIKEN_ASHI,!0),renkoStyle:I.chartStyleStudyId(T.STYLE_RENKO,!0),pbStyle:I.chartStyleStudyId(T.STYLE_PB,!0),kagiStyle:I.chartStyleStudyId(T.STYLE_KAGI,!0),pnfStyle:I.chartStyleStudyId(T.STYLE_PNF,!0),rangeStyle:I.chartStyleStudyId(T.STYLE_RANGE,!0)},p=this._model.studyVersioning(),f=this._model.mainSeries().styleStudyInfos(),_=Object.keys(L.SYMBOL_STRING_DATA),m=0;m<_.length;m++){var y=_[m],g=L.STYLE_SHORT_NAMES[y]+"Style",v=g in e?e[g].studyId:d[g];if(null!=(y=a[g])){var S=y.inputs,b=M.parseIdString(v),w=f[g].studyId,P=M.parseIdString(w),C=p.updateStudyInputs(b.id,b.version,P.version,S,null);y.inputs=C}}this._model.mainSeries().restoreState(e,t),this._sourcesById.delete(this._model.mainSeries().id()),this._model.mainSeries().setId(s),this._sourcesById.set(s,this._model.mainSeries()),void 0!==c&&this._model.mainSeries().setZorder(c),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours),this._model.mainSeries().symbolInfo()&&this._model.mainSeries().dataEvents().fireSymbolResolved(this._model.mainSeries().symbolInfo())},R.prototype._restoreStudy=function(e,t,i,r){if(t&&void 0===e.data&&void 0===e.nonSeriesData&&void 0===e.indexes)A.logError("Cannot restore (skipping) study without data "+e.id+", "+e.metaInfo.id);else{var n=e.id,o=e.state,s=e.zorder,a=e.ownerSource,l=TradingView.clone(e.metaInfo);if(Object.assign(l,M.parseIdString(l.id)),!this.isStudyToSkip(l)||t){var c=o,u=this._model.studyVersioning(),d=u.patchPropsStateAndMetaInfo(c,l,{oldShowStudyLastValueProperty:t&&!i.showStudyLastValueProperty});c=d.propsState,l=d.metaInfo;var p=new h(this._model,e,l.shortDescription);p.setId(n);var f=this;if(t)m(null);else{var _=u.updateMetaInfoAsync(l);_.sync?m(_.result):_.result.then((function(e){m(e)})).catch((function(e){p.setStatus("error: "+e),p.setFailed(!0)}))}return p&&this._addSourceToCollections(p,r),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,p&&void 0!==s&&p.setZorder(s),p}A.logNormal("Skipping study "+l.id)}function m(i){p.setStatus("");var r=i||new M(l),o=new z(f._model);function s(s){var a=C(l,i,c,null,u,s),h=x(f._model,a,s||f._model.mainSeries(),r);if(h.setId(n),t){var d=u.patchStudyData(l,e.data,e.nonSeriesData,e.indexes);h.restoreData(d.data,d.nsData,d.indexes)}
f._model.replaceStudyStub(p,h)||(p=h),o.add(n,h)}a&&e.state.isChildStudy?o.get(a).then(s):s()}},R.prototype.restoreLineTool=function(e,t,i,n){i=void 0===i||i,V.migrateState(e),b.migrateState(e);var o=e.type,s=e.id,a=e.state,l=i?e.zorder:this._newZOrderForLineTool();r(m(o),"invalid data source type:"+o+" (expected to be a Line Tool)");var c,u,d=null;if(y(o)){var g=(e=(d=this._model.studyVersioning()).patchPointsBasedStudyState(e)).metaInfo;if(Object.assign(g,M.parseIdString(g.fullId)),!t){var w=g.productId;if(!pro.hasPackage(w)){var P=new h(this._model,e,g.shortDescription);return P.setId(s),this._addSourceToCollections(P,n),void 0!==l&&P.setZorder(l),P.setStatus(window.t("not authorized")),void P.setFailed(!0)}}var C=d.updateMetaInfo(g)||g;u=_(o,g,C,a,d),t?u.merge({fixedSize:!1}):u.merge({fixedSize:!0}),c=p(o,this._model,u,C)}else u=f(o,a),t?u.merge({fixedSize:!1}):u.merge({fixedSize:!0}),c=new TradingView[o](this._model,u,!0);c.setId(s),c.linkKey=e.linkKey;var x=e.alertId;x&&c.canHasAlert()&&"function"==typeof c.setAlert&&O.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&c.setAlert(x,{noChartSave:!0});var T=e.indexes?e.indexes:[];if(T=T.slice(0,e.points.length),c.isFixed()?c.restorePositionPercents(e.positionPercents):c.restorePoints(e.points,T,t),c instanceof v||c instanceof S||c instanceof E||c instanceof D||c instanceof k)c.restoreData(e);else if(t&&c.restoreData){var L=e;d&&(L.graphics=d.patchPointsBasedStudyData(L.metaInfo,L.graphics)),c.restoreData(L)}var I=null==e.version?1:e.version,A=null==c.version?1:c.version;return I!==A&&"function"==typeof c.migrateVersion&&c.migrateVersion(I,A,{pane:this,model:this._model,properties:u}),this._addSourceToCollections(c,n),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==l&&c.setZorder(l),c},R.prototype._restoreSpecialSource=function(e,t,i){var r=TradingView[e.type];if(r&&r.createFromState){var n=r.createFromState(e,t,this._model);n&&(n.setId(e.id),this._addSourceToCollections(n,i),n.zorder&&n.setZorder(n.zorder))}},c.prototype.studyTemplate=function(e,t){for(var i={panes:[]},r=0;r<this.panes().length;r++){i.panes.push(this.panes()[r].state(!0,!1,!0))}return e&&(i.symbol=this.mainSeries().symbol()),t&&(i.interval=this.mainSeries().interval()),i.version=c.version,i},c.prototype.theme=function(){var e={};return e.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.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,t,i){var r={hollowCandle:{related:"candle"}};for(var n in r)if(!e.mainSourceProperties[n+"Style"]){var o=e.mainSourceProperties[r[n].related+"Style"];e.mainSourceProperties[n+"Style"]=TradingView.clone(o)}this._undoModel.chartLoadTheme(this,e,t,i)},c.prototype.preferences=function(){
return j(this,this.mainSeries())};var z=function(){var e=[],t=[];function i(r){var n=e.indexOf(r);return~n?t[n]:this instanceof i?(this._source=r,this._studies={},this._deferreds={},e.push(r),void t.push(this)):new i(r)}return i.prototype.add=function(e,t){this._deferreds[e]&&(this._deferreds[e].resolve(t),delete this._deferreds[e]),this._studies[e]=t},i.prototype.get=function(e){return this._studies[e]?Promise.resolve(this._studies[e]):(this._deferreds[e]||(this._deferreds[e]=F()),this._deferreds[e].promise)},i.prototype.reset=function(){var i=e.indexOf(this._source);~i&&(e.splice(i,1),t.splice(i,1))},i}();e.exports=c},OYox:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCircles",(function(){return a}));var r=i("aO4+"),n=i("ogJP"),o=i("Zp/P"),s=i("VdBB"),a=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){for(var i=this._data,r=t.pixelRatio,o=Math.max(1,Math.floor(r))%2?.5:0,s=i.vertOffset||0,a=i.lineColor||i.color,l=i.lineWidth||i.height/2,c="",u=!1,h=0,d=i.items;h<d.length;h++){var p=d[h],f=p.x,_=p.y+s;if(!Object(n.isNaN)(f)&&!Object(n.isNaN)(_)){var m=void 0,y=void 0;null!=p.style?(m=p.style.color,y=p.style.width):(m=a,y=l),m!==c&&(c=m,u&&e.fill(),e.beginPath(),e.fillStyle=m);var g=Math.round(f*r)+o,v=Math.round(_*r)+o,S=Math.round(y*r)+o;e.moveTo(g+S,v),e.arc(g,v,S,0,2*Math.PI,!1),u=!0}}u&&e.fill()},e.prototype.hitTest=function(e){for(var t=this._data,i=t.lineWidth||t.height/2,n=2*i,a=t.vertOffset||0,l=Object(o.selectionTolerance)(n),c=0,u=t.items;c<u.length;c++){var h=u[c];if(h)if(new r.Point(h.x,h.y+a).subtract(e).length()+i<=l)return new s.HitTestResult(s.HitTestResult.REGULAR)}return null},e}()},ObRt:function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"d",(function(){return c}));var r=i("jofe"),n={},o=new Map;function s(e,t){if(a(e))throw new Error("Service already registered");n[e.id]=t;var i=o.get(e.id);void 0!==i&&(o.delete(e.id),i.resolve(t))}function a(e){return void 0!==n[e.id]}function l(e){var t=n[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}function c(e){if(a(e))return Promise.resolve(l(e));var t=o.get(e.id);return void 0===t&&(t=Object(r.createDeferredPromise)(),o.set(e.id,t)),t.promise}},Ocx9:function(e,t,i){"use strict";(function(e){var r=i("wZIs"),n=i("tc+8");function o(e,t,i,n){var o=e?r.defaults:r.factoryDefaults,a=t.startsWith("study_")?TradingView.clone(o("study")):{},l=TradingView.clone(o(t,n));return t.startsWith("study_")&&l.inputs&&delete l.inputs.symbol,"linetoolicon"===t&&e&&(l.icon=r.defaults(t).icon),l=s(l,i),TradingView.merge(a,l),a}function s(e,t){var i={};for(var r in e)t.indexOf(r)<0&&(i[r]=e[r]);return i}function a(t,i,r,s){var l;void 0===s&&(s=!0),this._defaultName=t,r?l=i:(l=o(s,t,[],null),i&&TradingView.merge(l,i)),n.call(this,l),this._defaultName=t,this._useUserPreferences=s,this.listeners().subscribe(this,a.prototype.onPropertyChanged),this._exclusions=[],this._restoreFactoryDefaultsEvent=new e}inherit(a,n),
@@ -566,7 +566,7 @@ for(var n=Math.floor(i*(t-1)),o=t/r*(t/r),s=[],a=0,l=0;l<t;++l){var c=Math.exp(-
;if(this._lastType.get()!==i)Math.abs(r-t)/t>this._deviation&&this.addPivot(e,t,i);else(i===d.HIGH?t>r:t<r)&&this.updatePivot(e,t)}},p.prototype.processPivot=function(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())},u.zigzag=function(e,t,i){return new p(e,t,i).lastPrice()},u.zigzagbars=function(e,t,i){var r=new p(e,t,i);return-1===r.lastIndex()?NaN:r.lastIndex()-u.n(i)},f.prototype.new_sym=function(e,t,i,r,n){return this.symbol.script.add_sym(e,n,t,i,void 0,r)},f.prototype.select_sym=function(e){this.symbol=this.symbol.script.get_sym(e)},f.prototype.new_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new _(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},f.prototype.new_unlimited_var=function(e){var t=this.vars;t.length<=this.vars_index&&t.push(new m(this.symbol));var i=t[this.vars_index++];return arguments.length>0&&i.set(e),i},f.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new f(this.symbol)),this.ctx[this.ctx_index++]},f.prototype.prepare=function(e){this.ctx_index=0,this.vars_index=0;for(var t=0;t<this.vars.length;t++)this.vars[t].prepare(e);for(var i=0;i<this.ctx.length;i++)this.ctx[i].prepare(e)},f.prototype.maxAdditionalDepth=function(){for(var e=0,t=0;t<this.vars.length;t++){var i=this.vars[t].mindepth;!isNaN(i)&&i>e&&(e=i)}return e},f.prototype.stop=function(){this.symbol=null,this.vars=null},_.prototype.valueOf=function(){return this.get(0)},_.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=u.max(this.mindepth,e),NaN)},_.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},_.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},_.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)},_.prototype.add_hist=function(){if(!this.hist){var e=u.na(this.mindepth)?u.max_series_default_size:u.max(this.mindepth+1,1);e=Math.round(e);for(var t=new 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},_.prototype.adopt=function(e,t,i){this.hist||(this.mindepth=NaN);var r=t.get(),n=e.indexOf(r);if(0!==i){var o=t.get(1);if(!u.na(o))n=n===e.indexOf(o)?-1:n}return n<0?NaN:this._get(n)},_.prototype.indexOf=function(e){if(!this.hist)return this.mindepth=NaN,-1;if(u.na(e))return-1;var t=this.hist.length,i=this.symbol.index+1,r=Math.min(t,i),o=n.upperbound_int(this.hist,e,0,r);return 0===o?-1:r-o},o(m,_),m.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},y.parseTicker=function(e){var t=e.indexOf(":");return-1===t?e:e.substr(t+1)},y.parsePeriod=function(e){var t,i=(e+="").slice(0);if(i.indexOf(",")>=0){var r=i.split(",");t=y.parsePeriod(r[1]),i=r[0]}var n=!1,o=!1,s=i[i.length-1];-1==="DWM".indexOf(s)&&("S"===s?o=!0:(n=!0,s=""));var a=parseInt(n?i:i.length>1?i.slice(0,i.length-1):1);return{resolution:s,interval:a,pureResolution:[a,s].join(""),isIntraday:n,isSeconds:o,range:t}},y.newBarBuilder=function(e,t,i){var r=y.parsePeriod(e);return l.newBarBuilder(r.interval+r.resolution,t,i)},y.newSession=function(e){return new l.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)},y.prototype.set_symbolinfo=function(e){for(var t in e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.timezone=a.get_timezone(e.timezone),this.session.init(e.timezone,e.session,e.holidays,e.corrections),this.other_sessions)this.other_sessions.hasOwnProperty(t)&&this.other_sessions[t].init(e.timezone,e.session,e.holidays,e.corrections)},y.prototype.get_session=function(e){if(!e)return this.session;var t=this.other_sessions[e];return t||(t=new l.SessionInfo("Etc/UTC","24x7"),this.other_sessions[e]=t),t},y.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},y.prototype.enable_dwm_aligning=function(e,t){this.dwm_aligner=y.newBarBuilder(this.period,e,t)},y.prototype.bartime=function(e,t){var i=this.time;if(e){var r=e;t&&(r+=t);var n=this.bb_cache[r];if(!n){var o=this.get_session(t);n=y.newBarBuilder(e,o),this.bb_cache[r]=n}i=n.alignTime(i)}if(!this.isdwm()||isNaN(i))return i;var s=a.utc_to_cal(this.timezone,i);return this.session.spec.correctTradingDay(s),a.cal_to_utc(this.timezone,s)},y.prototype.lastbar=function(e){if(!isNaN(e.time)){var t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0));var 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)}},g.prototype.calc=function(e){var t=this.ctx,i=this.body;t.prepare(e);var r=i.main(t,this.inputCallback),n=this;this.out&&r&&(!isNaN(t.symbol.time)||r.nonseries)&&(r.nonseries?("projection"===r.type&&(r.projectionTime=t.symbol.time),this.nonseriesOut(t.symbol,r)):r.bars?r.bars.forEach((function(e){n.out(t.symbol,e)})):this.out(t.symbol,r))},g.prototype.init=function(){var e=this.ctx,t=this.body;t.init&&t.init(e,this.inputCallback),t.main(e,this.inputCallback)},g.prototype.add_sym=function(e,t,i,r,n,o){var s=this.runner.add_sym(e,t,i,r,this,n,o);return this.symbols.push(s),s.isdwm()&&this.symbols.length>1&&s.enable_dwm_aligning(this.symbols[0].session,s.session),s},g.prototype.maxAdditionalDepth=function(){return this.ctx.maxAdditionalDepth()},g.prototype.stop=function(){this.symbols=null,this.ctx.stop(),
this.ctx=null},g.prototype.get_sym=function(e){return this.symbols[e]},v.prototype.add_sym=function(e,t,i,r,n,o,s){var a=new y(e,t,i,r,n,o,s);return this.symbols.push(a),a},v.prototype.get_sym=function(e){return this.symbols[e]},v.prototype.out=function(e,t){if(this.nonseriesUpdate){var i=Object.assign({},this.nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)},v.prototype.start=function(){var e=this.host;this._script=new g(e.tickerid,e.currencyCode,e.period,e.periodBase||e.period,e.periodForInitialRange,this,e.body,this.out.bind(this),e.input,e.symbolInfo.minmov/e.symbolInfo.pricescale,e.nonseriesOut);var t=this,i=[],r=this.symbols,n=(e.additionalBarsCount||0)+t._script.maxAdditionalDepth();function o(r,o){var s=v.feed.subscribe(r.tickerid,r.currencyCode,r.period,r.periodBase,r.periodForInitialRange,(function(i){"series"===(i.nonseries?"nonseries":"series")?t.update(o,i):i.lastBar?(t.nonseriesUpdate=i,i.lastBar.isLastBar=!0,t.symbols[0].lastbar(i.lastBar),t.nonseriesUpdate=null):e.nonseriesOut(r,i)}),e.onErrorCallback,e.symbolInfo,e.sessionId,e.rangeExtension,n);i.push(s)}for(var s=0;s<r.length;s++)o(r[s],s);this.subscription=i},v.prototype.stop=function(){var e=this.subscription;if(e||this._script){for(var t=0;t<e.length;t++)v.feed.unsubscribe(e[t]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null}else console.warn("Recurring script engine stop happened.")},v.prototype.update=function(e,t){if(t){var i=this.symbols[e];if(this.isRecalculated){var r=t.bar(t.count()-1);r.isBarClosed=t.isLastBarClosed(),r.isLastBar=!0,i.lastbar(r)}else this.barsets[e]||(this.barsets[e]=t,i.set_symbolinfo(t.symbolinfo()),this.recalc())}else console.error("Unexpected barset = null")},v.prototype.recalc=function(){for(var e=this.symbols,t=0;t<e.length;t++)if(!this.barsets[t])return;for(var i=e.length-1;i>=0;i--)for(var r=e[i],n=this.barsets[i],o=n.count(),s=0;s<o;s++){var a=n.bar(s);a.isLastBar=s===o-1,a.isBarClosed=!a.isLastBar||n.isLastBarClosed(),r.lastbar(a)}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})},v.feed={subscribe:function(e,t,i,r){console.error("must be initialized with setupFeed")},unsubscribe:function(e){console.error("must be initialized with setupFeed")}},S.prototype.stop=function(){this.runner.stop()},b.prototype.symbolinfo=function(){return this.info},b.prototype.isLastBarClosed=function(){return this.isBarClosed},b.prototype.setLastBarClosed=function(e){this.isBarClosed=e},b.prototype.bar=function(e){return this.bars[e]},b.prototype.count=function(){return this.bars.length},b.prototype.add=function(e,t){var i=e,r=this.bars,n=r.length,o=i.time,s=0===n?NaN:r[n-1].time;0===n||s<o?r.push(i):s===o?r[n-1]=i:console.error("time order violation, prev: "+new Date(s).toUTCString()+", cur: "+new Date(o).toUTCString()),this.isBarClosed=!!t},w.prototype.init=function(e){
this.bb=y.newBarBuilder(this.period,e.symbol.session),this.bbEmptyBars=this.generateEmptyBars?y.newBarBuilder(this.period,e.symbol.session):void 0},w.prototype.extrapolate=function(e,t){return isNaN(e)||isNaN(t)?void 0:c(this.bbEmptyBars,e,t,Number.MAX_SAFE_INTEGER,!0).times},w.prototype.main=function(e){var t=e.symbol.time,i=this.bb.alignTime(t),r=e.new_var(i),n=u.na(i),o=r.get(1),s=u.na(o)?1:u.neq(i,o),a=e.new_var(),l=e.new_var(),c=e.new_var(),h=e.new_var(),d=a.get(1),p=l.get(1),f=c.get(1),_=h.get(1),m=n?NaN:s?u.open(e):d,y=n?NaN:s?u.high(e):u.max(u.high(e),p),g=n?NaN:s?u.low(e):u.min(u.low(e),f),v=n?NaN:u.close(e),S=n?NaN:s?u.volume(e):u.volume(e)+_,b=n?NaN:t,w=e.symbol.isBarClosed&&this.bb.isLastBar(0,t),P=this.generateEmptyBars&&s?this.extrapolate(o,i):void 0,C=e.new_var(u.close(e)).get(1),x=P instanceof Array?C:NaN;return a.set(m),l.set(y),c.set(g),h.set(S),[i,m,y,g,v,S,b,w,P,x]},P.prototype.main=function(e){return[u.open(e),u.high(e),u.low(e),u.close(e),u.volume(e),u.updatetime(e)]},{Std:u,Series:_,Symbol:y,SymbolInfo:function(e,t){this.timezone=e||"America/New_York",this.session=t||"0000-0000"},StudyEngine:S,BarSet:b,OHLCV:P,BarBuilder:w,setupFeed:function(e){v.feed=e}}}();e.exports=a}).call(this,i("yLpj"))},ocrj:function(e,t,i){"use strict";i.r(t),i.d(t,"RemoveSourcesCommand",(function(){return h}));var r=i("mrSG"),n=i("Eyy1"),o=i("RDU5"),s=i("CW80"),a=i("uOxu"),l=i("pQ+n"),c=(i("GVHu"),i("jpZi")),u=Object(a.getLogger)("Chart.RemoveSourcesCommand"),h=function(e){function t(t,i,r){var n=e.call(this,r)||this;return n._excludeLineToolsUndoCommands=[],n._chartModel=t,n._sourceIds=Object(l.a)(t,i).map((function(e){return e.id()})),n._sourceStates=[],n._paneIndexes=[],n._priceScalePositionIds=[],n._paneStates=[],n._restorePanes=[],n}return Object(r.__extends)(t,e),t.prototype.removedIds=function(){return this._sourceIds},t.prototype.redo=function(){var e=this,t=(this._chartModel.panes().length,this._sourceIds.map((function(t){return Object(n.ensureNotNull)(e._chartModel.dataSourceForId(t))})));this._sourceStates=t.map((function(e){return Object(n.ensureNotNull)(e.state(!1))}));var i=t.map((function(t){return Object(n.ensureNotNull)(e._chartModel.paneForSource(t))}));this._paneIndexes=i.map((function(t){return e._chartModel.panes().indexOf(t)}));var r=this._chartModel.lineToolsGroupModel(),o=new Map;t.forEach((function(e){if(Object(s.isLineTool)(e)){var t=r.groupForLineTool(e);if(null!==t){var i=o.get(t)||[];i.push(e),o.set(t,i)}}})),o.forEach((function(t,i){var r=new c.a(e._chartModel,i,t);r.redo(),e._excludeLineToolsUndoCommands.push(r)})),this._priceScalePositionIds=t.map((function(e,t){if(Object(s.isLineTool)(e))return null;var r=Object(n.ensureNotNull)(e.priceScale()),o=i[t].priceScalePosition(r);return{id:r.id(),position:o,priceScaleIndex:i[t].priceScaleIndex(r,o)}}));var a=new Set;t.forEach((function(t,i){Object(s.isLineTool)(t)||a.add(e._paneIndexes[i])})),this._paneStates=t.map((function(t,r){var n=e._paneIndexes[r];return a.has(n)?i[r].state():null})),this._restorePanes=t.map((function(t){
this.bb=y.newBarBuilder(this.period,e.symbol.session),this.bbEmptyBars=this.generateEmptyBars?y.newBarBuilder(this.period,e.symbol.session):void 0},w.prototype.extrapolate=function(e,t){return isNaN(e)||isNaN(t)?void 0:c(this.bbEmptyBars,e,t,Number.MAX_SAFE_INTEGER,!0).times},w.prototype.main=function(e){var t=e.symbol.time,i=this.bb.alignTime(t),r=e.new_var(i),n=u.na(i),o=r.get(1),s=e.symbol.isNewBar,a=e.new_var(),l=e.new_var(),c=e.new_var(),h=e.new_var(),d=a.get(1),p=l.get(1),f=c.get(1),_=h.get(1),m=n?NaN:s?u.open(e):d,y=n?NaN:s?u.high(e):u.max(u.high(e),p),g=n?NaN:s?u.low(e):u.min(u.low(e),f),v=n?NaN:u.close(e),S=n?NaN:s?u.volume(e):u.volume(e)+_,b=n?NaN:t,w=e.symbol.isBarClosed&&this.bb.isLastBar(0,t),P=this.generateEmptyBars&&s?this.extrapolate(o,i):void 0,C=e.new_var(u.close(e)).get(1),x=P instanceof Array?C:NaN;return a.set(m),l.set(y),c.set(g),h.set(S),[i,m,y,g,v,S,b,w,P,x]},P.prototype.main=function(e){return[u.open(e),u.high(e),u.low(e),u.close(e),u.volume(e),u.updatetime(e)]},{Std:u,Series:_,Symbol:y,SymbolInfo:function(e,t){this.timezone=e||"America/New_York",this.session=t||"0000-0000"},StudyEngine:S,BarSet:b,OHLCV:P,BarBuilder:w,setupFeed:function(e){v.feed=e}}}();e.exports=a}).call(this,i("yLpj"))},ocrj:function(e,t,i){"use strict";i.r(t),i.d(t,"RemoveSourcesCommand",(function(){return h}));var r=i("mrSG"),n=i("Eyy1"),o=i("RDU5"),s=i("CW80"),a=i("uOxu"),l=i("pQ+n"),c=(i("GVHu"),i("jpZi")),u=Object(a.getLogger)("Chart.RemoveSourcesCommand"),h=function(e){function t(t,i,r){var n=e.call(this,r)||this;return n._excludeLineToolsUndoCommands=[],n._chartModel=t,n._sourceIds=Object(l.a)(t,i).map((function(e){return e.id()})),n._sourceStates=[],n._paneIndexes=[],n._priceScalePositionIds=[],n._paneStates=[],n._restorePanes=[],n}return Object(r.__extends)(t,e),t.prototype.removedIds=function(){return this._sourceIds},t.prototype.redo=function(){var e=this,t=(this._chartModel.panes().length,this._sourceIds.map((function(t){return Object(n.ensureNotNull)(e._chartModel.dataSourceForId(t))})));this._sourceStates=t.map((function(e){return Object(n.ensureNotNull)(e.state(!1))}));var i=t.map((function(t){return Object(n.ensureNotNull)(e._chartModel.paneForSource(t))}));this._paneIndexes=i.map((function(t){return e._chartModel.panes().indexOf(t)}));var r=this._chartModel.lineToolsGroupModel(),o=new Map;t.forEach((function(e){if(Object(s.isLineTool)(e)){var t=r.groupForLineTool(e);if(null!==t){var i=o.get(t)||[];i.push(e),o.set(t,i)}}})),o.forEach((function(t,i){var r=new c.a(e._chartModel,i,t);r.redo(),e._excludeLineToolsUndoCommands.push(r)})),this._priceScalePositionIds=t.map((function(e,t){if(Object(s.isLineTool)(e))return null;var r=Object(n.ensureNotNull)(e.priceScale()),o=i[t].priceScalePosition(r);return{id:r.id(),position:o,priceScaleIndex:i[t].priceScaleIndex(r,o)}}));var a=new Set;t.forEach((function(t,i){Object(s.isLineTool)(t)||a.add(e._paneIndexes[i])})),this._paneStates=t.map((function(t,r){var n=e._paneIndexes[r];return a.has(n)?i[r].state():null})),this._restorePanes=t.map((function(t){
return e._chartModel.removeSource(t)}))},t.prototype.undo=function(){for(var e=this,t=[],i=this._sourceStates.length-1;i>=0;i--){var r=this._chartModel.restoreSource(this._restorePanes[i],this._paneIndexes[i],this._paneStates[i],this._sourceStates[i],this._priceScalePositionIds[i]);t.push(r)}t.some((function(i,r){return i.id()!==e._sourceIds[t.length-r-1]}))&&u.logError("Source was restored improperly - source ids does not match"),this._excludeLineToolsUndoCommands.forEach((function(e){return e.undo()}))},t}(o.UndoCommand)},odCa:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("fgLi").DataSource,o=i("tc+8"),s=i("Ocx9").DefaultProperty,a=i("hayr").propertyPages,l=i("jTis").CalloutConsts,c=window.t("Callout");function u(e,t){this._constructor="LineToolCallout";var n=t||u.createProperties();r.call(this,e,n),this._barOffset=0,this._timeScale=e.timeScale(),i.e("lt-pane-views").then(function(e){var t=i("B4Hi").CalloutPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(u,r),u.prototype.pointsCount=function(){return 2},u.prototype.translatedType=function(){return c},u.prototype.name=function(){return"Callout"},u.prototype.correctPoints=function(e){var t=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,r=e[1];r.index+=t,r.price+=i,e[1]=r},u.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this._calculateBarOffset(),t},u.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},u.prototype.setLastPoint=function(e){r.prototype.setLastPoint.call(this,e),2===this.points().length&&this._calculateBarOffset()},u.prototype.setPoint=function(e,t){switch(e){case 0:r.prototype.setPoint.call(this,e,t),this._calculateBarOffset();break;case 1:var i=this.properties();if(!i.wordWrapWidth)return;var n=this._points,o=this._dragStartLeftEdgeIndex,s=Math.round((t.index-o)/2);if(isFinite(o)&&isFinite(s)){n[1]={index:o+s,price:n[1].price},this._calculateBarOffset(),this.normalizePoints();var a=this._timeScale.indexToCoordinate(o+2*s)-this._timeScale.indexToCoordinate(o)-l.RoundRadius-l.TextMargins;if(!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(l.MinWidth,a));break}n[1]=t,this._calculateBarOffset(),this.normalizePoints()}},u.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)},u.prototype.move=function(e,t,i){r.prototype.move.call(this,e,t,i),this._calculateBarOffset()},u.prototype.state=function(e){var t=r.prototype.state.call(this,e);return t.barOffset=this._barOffset,t},u.prototype.restoreData=function(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this._calculatePoint2()},u.prototype.setPriceScale=function(e){n.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&this._calculatePoint2()},u.prototype.template=function(){var e=r.prototype.template.call(this)
;return e.text=this.properties().childs().text.value(),e},u.prototype._applyTemplateImpl=function(e){r.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},u.prototype._calculatePoint2=function(){if(!(this._model.lineBeingEdited()===this||this._model.sourcesBeingMoved().includes(this)||this._points.length<2)){var e=this.points()[0],t=this.points()[1];this._points[1]={price:t.price,index:e.index+this._barOffset}}},u.prototype.getStylesPropertyPage=function(){return a.LineToolCalloutStylesPropertyPage},u.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("xhf0").CalloutDefinitionsViewModel}.bind(null,i)).catch(i.oe)},u.createProperties=function(e){var t=new s("linetoolcallout",e);return u._configureProperties(t),t},u._configureProperties=function(e){r._configureProperties(e),e.hasChild("text")||e.addChild("text",new o(window.t("Text"))),e.addExclusion("text")},t.LineToolCallout=u},oiZD:function(e,t,i){"use strict";i.r(t);var r=i("hY0g"),n=i.n(r);i.d(t,"watchedTheme",(function(){return o})),i.d(t,"setTheme",(function(){return s}));var o=new n.a;function s(e){o.setValue(e)}o.subscribe((function(e){!function(e,t){void 0===t&&(t=window);for(var i="theme-"+e,r=t.document.documentElement.classList,n=0,o=Array.from(r);n<o.length;n++){var s=o[n];s.startsWith("theme-")&&s!==i&&r.remove(s)}r.add(i)}(e,window)}))},okVO:function(e,t,i){"use strict";i.r(t),i.d(t,"SyncModel",(function(){return s}));var r=i("IiTo"),n=i("IDnv"),o=0,s=function(){function e(e,t){this._extrapolatedData=[],this._modelId=o++,this._builderCache=null,this._resolution=t,this._symbolInfo=e,this._valid=Boolean(e.timezone)&&Boolean(e.session),this._session=new r.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)}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){if(!this.isValid())return{success:!1};var i=this._extrapolatedData.length,r=0!==i?this._extrapolatedData[0]:null,o=null!==r?this._extrapolatedData[i-1]:null;if(1e3*e!==r&&(this._extrapolatedData=[1e3*e],r=null,o=null),null===r||null!==o&&1e3*t>o){var s=Object(n.extrapolateBarsFrontToTime)(this._barBuilder(),o||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length}if((o=this._extrapolatedData[i-1])<1e3*t)return{success:!1};var a=this._extrapolatedData.indexOf(1e3*t);return-1===a?{success:!1}:{success:!0,result:a}},e.prototype.projectTime=function(e,t){if(!this.isValid())return e;var i=this._extrapolatedData.length,r=i>0?this._extrapolatedData[0]:null,o=null!==r?this._extrapolatedData[i-1]:null;if(1e3*e!==r&&(this._extrapolatedData=[1e3*e],r=null,o=null),null===r||t>=i){var s=Object(n.extrapolateBarsFrontByCount)(this._barBuilder(),o||1e3*e,t-i+1,!0)
;this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length}return i<t?e:this._extrapolatedData[t]/1e3},e.prototype.isValid=function(){return this._valid},e.prototype._barBuilder=function(){return null===this._builderCache&&(this._builderCache=Object(r.newBarBuilder)(this._resolution,this._session,this._session)),this._builderCache},e}()},onDC:function(e,t,i){"use strict";i.r(t);var r=i("mrSG"),n=i("Eyy1"),o=i("7MZv"),s=i("4O8T"),a=i.n(s),l=i("uOxu"),c=window.t("Move All Scales To Left"),u=window.t("Move All Scales To Right"),h=Object(l.getLogger)("Chart.MergeAllScales");var d=i("RDU5"),p=function(e){function t(t,i,r,n,o,s){var a=e.call(this,s)||this;return a._model=t,a._paneIndex=t.panes().indexOf(i),a._targetPosition=n,a._targetIndex=o,a._scaleId=r.id(),a._sourcePosition=i.priceScalePosition(r),"overlay"!==a._sourcePosition&&(a._sourceIndex=i.priceScaleIndex(r,a._sourcePosition)),a}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._model.panes()[this._paneIndex],t=Object(n.ensureNotNull)(e.getPriceScaleById(this._scaleId));e.movePriceScale(t,this._targetPosition,this._targetIndex),this._model.fullUpdate()},t.prototype.undo=function(){var e=this._model.panes()[this._paneIndex],t=Object(n.ensureNotNull)(e.getPriceScaleById(this._scaleId));e.movePriceScale(t,this._sourcePosition,this._sourceIndex),this._model.fullUpdate()},t}(d.UndoCommand),f=i("CW80"),_=function(e){function t(t,i,r,n){var o=e.call(this,n)||this;return o._createdIds=[],o._model=t,o._withoutShift=r,o._origStates=i.map((function(e){return e.state(!0)})),o}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this,t=this._origStates.map((function(t,i){var r=Object(n.ensureNotNull)(e._model.dataSourceForId(t.id)),o=0===e._createdIds.length?void 0:Object(n.ensureDefined)(e._createdIds[i]),s=Object(f.cloneLineTool)(e._model,r,!e._withoutShift,o),a=Object(n.ensureNotNull)(r.priceScale());return Object(n.ensureNotNull)(e._model.paneForSource(r)).addDataSource(s,a,!1),e._model.updateSource(s),s}));0===this._createdIds.length&&(this._createdIds=t.map((function(e){return e.id()}))),this._model.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e=this;this._createdIds.forEach((function(t){var i=Object(n.ensureNotNull)(e._model.dataSourceForId(t));e._model.removeSource(i)}))},t.prototype.newIds=function(){return this._createdIds},t}(d.UndoCommand),m=i("ocrj"),y=i("jpZi"),g=i("Ltzl"),v=i("HGup"),S=i("jRfx"),b=i("s1Gx"),w=function(e){function t(t,i,r,n,o){void 0===o&&(o=!0);var s=e.call(this,"Create line "+r,!1)||this;return s._lineId=null,s._lineState=null,s._model=t,s._paneIndex=t.panes().indexOf(i),s._lineTool=r,s._ownerSourceId=n.id(),s._needCopyToOtherCharts=o,s}return Object(r.__extends)(t,e),t.prototype.startCreatingLine=function(e,t,i){var r=this._model.panes()[this._paneIndex],n=this._model.dataSourceForId(this._ownerSourceId),o=this._model.createLineTool(r,e,this._lineTool,t,i,n);return this._lineId=o.id(),!this._model.lineBeingCreated()},