commit 2017-11-14 09:45:12.775894

Unexpected resolution values in getBars #2179
Widget logo showing momentarily on paid account #2132
This commit is contained in:
Jenkins
2017-11-14 03:49:07 -06:00
parent d40e70c387
commit f8a4698995
5 changed files with 110 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
(function(){function m(a){var b;if("object"!==typeof a||a.constructor&&!a.hasOwnProperty("constructor")&&!(a.constructor.prototype||{}).hasOwnProperty("isPrototypeOf"))return!1;for(b in a);return void 0===b||a.hasOwnProperty(b)}function k(){var a,b,c,e,d,f=arguments[0]||{},h=1,g=arguments.length,l=!1;"boolean"===typeof f&&(l=f,f=arguments[h]||{},h++);"object"!==typeof f&&"function"!==typeof f&&(f={});h===g&&(f=this,h--);for(;h<g;h++)if(null!=(a=arguments[h]))for(b in a)c=f[b],e=a[b],f!==e&&(l&&e&&
(m(e)||(d=Array.isArray(e)))?(d?(d=!1,c=c&&Array.isArray(c)?c:[]):c=c&&m(c)?c:{},f[b]=k(l,c,e)):void 0!==e&&(f[b]=e));return f}function g(a){d.widget.prototype[a]=function(b){console.warn("Method `"+a+"` is obsolete. Please use `chart."+a+"()` subscription method instead.")}}if(!window.TradingView){var n={mobile:{disabledFeatures:"left_toolbar header_widget timeframes_toolbar edit_buttons_in_legend context_menus control_bar border_around_the_chart".split(" "),enabledFeatures:[]}},d={BARS:0,CANDLES:1,
LINE:2,AREA:3,HEIKEN_ASHI:8,HOLLOW_CANDLES:9,version:function(){return"1.11 (internal id 18168320 @ 2017-10-20 04:31:58.628107)"},gEl:function(a){return document.getElementById(a)},gId:function(){return"tradingview_"+(1048576*(1+Math.random())|0).toString(16).substring(1)},onready:function(a){window.addEventListener?window.addEventListener("DOMContentLoaded",a,!1):window.attachEvent("onload",a)},css:function(a){var b=document.getElementsByTagName("head")[0],c=document.createElement("style");c.type=
LINE:2,AREA:3,HEIKEN_ASHI:8,HOLLOW_CANDLES:9,version:function(){return"1.11 (internal id fe319232 @ 2017-11-14 03:44:26.632703)"},gEl:function(a){return document.getElementById(a)},gId:function(){return"tradingview_"+(1048576*(1+Math.random())|0).toString(16).substring(1)},onready:function(a){window.addEventListener?window.addEventListener("DOMContentLoaded",a,!1):window.attachEvent("onload",a)},css:function(a){var b=document.getElementsByTagName("head")[0],c=document.createElement("style");c.type=
"text/css";c.styleSheet?c.styleSheet.cssText=a:(a=document.createTextNode(a),c.appendChild(a));b.appendChild(c)},bindEvent:function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},unbindEvent:function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)},widget:function(a){this.id=d.gId();if(!a.datafeed)throw Error("Datafeed is not defined");var b={width:800,height:500,symbol:"AA",interval:"D",timeframe:null,
timezone:"",container:"",path:"",locale:"en",toolbar_bg:void 0,drawingsAccess:void 0,studiesAccess:void 0,widgetbar:{datawindow:!1,details:!1,watchlist:!1,watchlist_settings:{default_symbols:[]}},overrides:{"mainSeriesProperties.showCountdown":!1},studiesOverrides:{},brokerConfig:{},fullscreen:!1,autosize:!1,disabledFeatures:[],enabledFeatures:[],indicators_file_name:null,custom_css_url:null,auto_save_delay:null,debug:!1,time_frames:[{text:"5y",resolution:"W"},{text:"1y",resolution:"W"},{text:"6m",
resolution:"120"},{text:"3m",resolution:"60"},{text:"1m",resolution:"30"},{text:"5d",resolution:"5"},{text:"1d",resolution:"1"}],client_id:"0",user_id:"0",charts_storage_url:void 0,charts_storage_api_version:"1.0",logo:{},favorites:{intervals:[],chartTypes:[]},rss_news_feed:null,settingsAdapter:null};this.options=k(!0,b,{width:a.width,height:a.height,symbol:a.symbol,interval:a.interval,timeframe:a.timeframe,timezone:a.timezone,container:a.container_id,path:a.library_path,locale:a.locale,toolbar_bg:a.toolbar_bg,
@@ -10,7 +10,7 @@ settingsAdapter:a.settings_adapter});this.options.time_frames=a.time_frames||b.t
{_innerWindow:function(){return d.gEl(this.id).contentWindow},_autoResizeChart:function(){this.options.fullscreen&&(d.gEl(this.id).style.height=window.innerHeight+"px")},create:function(){var a=this.render(),b=this,c;if(this.options.container){var e=d.gEl(this.options.container);e.innerHTML=a}else document.write(a);if(this.options.autosize||this.options.fullscreen)e=d.gEl(this.id),e.style.width="100%",this.options.fullscreen||(e.style.height="100%");this._autoResizeChart();this._onWindowResize=function(a){b._autoResizeChart()};
window.addEventListener("resize",this._onWindowResize);c=d.gEl(this.id);var g=null,g=function(){d.unbindEvent(c,"load",g);c.contentWindow.widgetReady(function(){var a;b._ready=!0;for(a=b._ready_handlers.length;a--;)b._ready_handlers[a].call(b);c.contentWindow._initializationFinished()})};d.bindEvent(c,"load",g)},render:function(){window[this.options.uid]={datafeed:this.options.datafeed,customFormatters:this.options.customFormatters,tradingController:this.options.tradingController,brokerFactory:this.options.brokerFactory,
overrides:this.options.overrides,studiesOverrides:this.options.studiesOverrides,disabledFeatures:this.options.disabledFeatures,enabledFeatures:this.options.enabledFeatures,brokerConfig:this.options.brokerConfig,favorites:this.options.favorites,logo:this.options.logo,numeric_formatting:this.options.numeric_formatting,rss_news_feed:this.options.rss_news_feed,newsProvider:this.options.newsProvider,loadLastChart:this.options.loadLastChart,settingsAdapter:this.options.settingsAdapter};this.options.savedData&&
(window[this.options.uid].chartContent={json:this.options.savedData});var a=(this.options.path||"")+"static/tv-chart.18168320bd5edaac1e75.html#localserver=1&symbol="+encodeURIComponent(this.options.symbol)+"&interval="+encodeURIComponent(this.options.interval)+(this.options.timeframe?"&timeframe="+encodeURIComponent(this.options.timeframe):"")+(this.options.toolbar_bg?"&toolbarbg="+this.options.toolbar_bg.replace("#",""):"")+(this.options.studiesAccess?"&studiesAccess="+encodeURIComponent(JSON.stringify(this.options.studiesAccess)):
(window[this.options.uid].chartContent={json:this.options.savedData});var a=(this.options.path||"")+"static/tv-chart.fe3192321931572c06b8.html#localserver=1&symbol="+encodeURIComponent(this.options.symbol)+"&interval="+encodeURIComponent(this.options.interval)+(this.options.timeframe?"&timeframe="+encodeURIComponent(this.options.timeframe):"")+(this.options.toolbar_bg?"&toolbarbg="+this.options.toolbar_bg.replace("#",""):"")+(this.options.studiesAccess?"&studiesAccess="+encodeURIComponent(JSON.stringify(this.options.studiesAccess)):
"")+"&widgetbar="+encodeURIComponent(JSON.stringify(this.options.widgetbar))+(this.options.drawingsAccess?"&drawingsAccess="+encodeURIComponent(JSON.stringify(this.options.drawingsAccess)):"")+"&timeFrames="+encodeURIComponent(JSON.stringify(this.options.time_frames))+"&locale="+encodeURIComponent(this.options.locale)+"&uid="+encodeURIComponent(this.options.uid)+"&clientId="+encodeURIComponent(this.options.client_id)+"&userId="+encodeURIComponent(this.options.user_id)+(this.options.charts_storage_url?
"&chartsStorageUrl="+encodeURIComponent(this.options.charts_storage_url):"")+(this.options.charts_storage_api_version?"&chartsStorageVer="+encodeURIComponent(this.options.charts_storage_api_version):"")+(this.options.indicators_file_name?"&indicatorsFile="+encodeURIComponent(this.options.indicators_file_name):"")+(this.options.custom_css_url?"&customCSS="+encodeURIComponent(this.options.custom_css_url):"")+(this.options.auto_save_delay?"&autoSaveDelay="+encodeURIComponent(this.options.auto_save_delay):
"")+"&debug="+this.options.debug+(this.options.snapshotUrl?"&snapshotUrl="+encodeURIComponent(this.options.snapshotUrl):"")+(this.options.timezone?"&timezone="+encodeURIComponent(this.options.timezone):"")+(this.options.studyCountLimit?"&studyCountLimit="+encodeURIComponent(this.options.studyCountLimit):"")+(this.options.symbolSearchRequestDelay?"&ssreqdelay="+encodeURIComponent(this.options.symbolSearchRequestDelay):"");return'<iframe id="'+this.id+'" name="'+this.id+'" src="'+a+'"'+(this.options.autosize||

View File

@@ -2,7 +2,7 @@ webpackJsonp([4],[function(t,e,i){(function(t){"use strict";function e(){JSON.pa
urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(u.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new x(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(_.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(_.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),urlParams.autoSaveDelay&&ChartApiInstance.setAutoSaveDelay(urlParams.autoSaveDelay),ChartApiInstance.setTimeFramesList(JSON.parse(urlParams.timeFrames)),ChartApiInstance.setStudiesAccessController(ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)),o=window.parent[window.urlParams.uid].settingsAdapter,null!=o?(TVSettings.setSettingsAdapter(o),TVSettings.sync()):t.enabled("use_localstorage_for_settings")&&TVSettings.sync(),n=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,s=urlParams.interval||"D",r={resizerBridge:b.allocate({areaName:"center"}),padding:t.enabled("border_around_the_chart")?5:0,edge:t.enabled("border_around_the_chart")?5:0,content:n,widgetOptions:{hideIdeas:!0,addVolume:!0,handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:s,defTimeframe:urlParams.timeframe&&urlParams.timeframe.toLowerCase()},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl},n&&void 0!==n.extendedData&&(a=n.extendedData,r.metaInfo={id:a.uid,name:a.name,description:a.description,uid:a.uid,username:"",tags:""}),p=window.chartWidgetCollection=new w(r),"undefined"!=typeof serviceLocator&&serviceLocator.registerService(CHART_WIDGET_COLLECTION_SERVICE,p),p.activeChartWidget.subscribe(function(t){d.emit("activeChartChanged",p.getAll().indexOf(t))}),window.saver=new l(p),window.chartWidget=p.activeChartWidget.value(),window.pro=new TradingView.Pro,g=JSON.parse(urlParams.favorites),g.intervals=g.intervals.map(function(t){var e=""+t;return e.match(/1[DWMYdwmy]/)&&(e=e.slice(1)),e}),t.enabled("study_templates")&&(window.studyTemplates=new h({chartWidgetCollection:p,notShowQuicks:!t.enabled("items_favoriting")})),v=null,window.headerWidget=new S({resizerBridge:b.allocate({areaName:"top"}),chartWidgetCollection:p,headerChartPanel:e,domePanel:v,hideStudyTemplates:!0,favoriteIntervals:g.intervals,interval_options:{interval:s},favoriteChartTypes:g.chartTypes}),window.tradingViewApi=new k(p,window.saver,ChartApiInstance,window.headerWidget.saveLoadWidget()),c.bindToChartWidgetCollection(p),urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)&&$("<style>").text("body,.tv-side-toolbar,.chart-controls-bar,#footer-chart-panel{background-color:#"+urlParams.toolbarbg+" !important}").appendTo($("head")),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),
TradingView.isNaN(urlParams.ssreqdelay)||I.setSearchRequestDelay(Math.max(0,+urlParams.ssreqdelay)),t.enabled("left_toolbar")&&(window.sideToolbar=new T({resizerBridge:b.allocate({areaName:"left"}),chartWidgetCollection:p,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,forceVisible:!0})),window.quoteSessionMultiplexerInstance={},window.quoteSessionMultiplexerInstance.simple=new m("simple"),window.quoteSessionMultiplexerInstance.full=new m,window.lineToolPropertiesToolbar=new C(p),chartWidget.onDisconnected().subscribe(null,function(t){t&&f.showCriticalErrorMessage()}),$(".tv-content").bind("contextmenu",function(t){var e=$(t.originalEvent.target);if(!e.is("input")&&!e.is("textarea"))return!1}),M.resolve(),chartWidget.withModel(null,function(){chartWidget.model().mainSeries().onSymbolResolved().subscribe(null,function(t){var e,i,o=chartWidget.model().mainSeries().symbolInfo()||t;o&&(e=chartWidget.model().mainSeries().properties().interval.value(),i={name:o.name,exchange:o.exchange,description:o.description,type:o.type,interval:e},d.emit("onSymbolChange",i))}),c.interval.subscribe(function(t){d.emit("onIntervalChange",t)}),ChartApiInstance.on("realtime_tick",function(t){d.emit("onTick",t)}),ChartApiInstance.on("onAutoSaveNeeded",function(){d.emit("onAutoSaveNeeded")}),t.enabled("charting_library_debug_mode")&&d.subscribeToAll(function(){var t=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(t[0],JSON.stringify(t.slice(1))))})}),d.subscribe("chart_load_requested",function(t){window.tradingViewApi.loadChart({json:JSON.parse(t.content),extendedData:t})})},window.destroyChart=function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.quoteSessionMultiplexerInstance&&(window.quoteSessionMultiplexerInstance.simple&&window.quoteSessionMultiplexerInstance.simple.destroy(),window.quoteSessionMultiplexerInstance.full&&window.quoteSessionMultiplexerInstance.full.destroy(),window.quoteSessionMultiplexerInstance=null),ChartApiInstance&&(ChartApiInstance.destroy(),ChartApiInstance=null)},e(),o(),O=$.Deferred(),window.parent[urlParams.uid].loadLastChart&&t.enabled("saveload_storage_customization")?r.getCharts(function(t){if(0===t.length)return void n();var e=t.sort(function(t,e){return e.modified_iso-t.modified_iso})[0];r.getChartContent(e,function(t){var e=JSON.parse(t.content);e.extendedData=t,urlParams.chartContent=JSON.stringify({json:e}),n()},n)},n):n(),V=$.Deferred(),$.when(s,V,O).done(function(){if($(window).resize(),$(".loading-indicator").hide(),setTimeout(D,0),t.enabled("14851")){!function(t,e,i,o,n,s,r){t.GoogleAnalyticsObject=n,t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},t[n].l=1*new Date,s=e.createElement(i),r=e.getElementsByTagName(i)[0],s.async=1,s.src=o,r.parentNode.insertBefore(s,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga");var e=document.URL.match(RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-53174009-1","auto"),
ga("set","anonymizeIp",!0),ga("set",{hostname:e,page:e,referrer:e}),ga("send","pageview")}}),function(){var t=!0;window.parent[urlParams.uid].datafeed.onReady(function(e){t&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,V.resolve()}),t=!1}(),window.getFunctionFromArguments=function(t){return window.parent[urlParams.uid][t]},window.createShortcutAction=function(){var t={};return function(e,i){void 0===t[e]&&(t[e]=new a({shortcut:e})),t[e].callbacks().subscribe(null,i)}}(),window.addCustomCSSFile=function(t){var e=document.createElement("link");document.getElementsByTagName("head")[0].appendChild(e),e.setAttribute("type","text/css"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",t)},urlParams.customCSS&&window.addCustomCSSFile(urlParams.customCSS),window._initializationFinished=function(){P.clearStack()},window.resizeWindow=function(){$(window).resize()},window.createButton=function(){var t=null;return function(e){var i,o,n,s;return e=e||{},i=e.align||"left",o=window.headerWidget,n=o.createGroup("",{single:!0}),s=$('<div class="button"></div>').appendTo(n),t&&clearTimeout(t),t=setTimeout(function(){window.resizeWindow(),clearTimeout(t)},5),setTimeout(function(){o.addButton(n,"left"===i)}),s}}()}).call(e,i(3))},function(t,e,i){(function(t){"use strict";function o(t,e){r.call(this,t,e),this._linetool=t,this._pointIndex=e,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._invalidated=!0,this._model=t._model}function n(t,e){l.call(this),this._linetool=t,this._pointindex=e,this._model=t._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0}function s(t,e,i){var o,r,a;if(c.call(this),this._model=t,this._properties=i,this._pointAdded=new w,this._pointChanged=new w,i.visible&&i.frozen||this._properties.merge(defaults("linetool")),o=defaults("linetoolvisibilities"),i.intervalsVisibilities)for(r in o.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,o.intervalsVisibilities[r]);else this._properties.merge(o);if($.isArray(e)?this._paneViews=e:this._paneViews=[e],this._points=[],this._fixedPoints=[],this._timePoint=[],this._properties.symbol||this._properties.merge({symbol:t.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:t.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,s.prototype.calcIsActualSymbol),
this._properties.listeners().subscribe(this,s.prototype.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.push(this.createPriceAxisView(a)),this.m_timeAxisViews.push(new n(this,a));this._properties.visible.listeners().subscribe(this,function(t){t.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this)),this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0)}var r=i(66),a=i(67),l=i(212),h=i(213),c=i(48).DataSource,d=i(41),p=i(43).Interval,u=i(121).DateTimeFormatter,_=i(2),f=i(587),m=i(21),g=i(47),v=g.Action,y=i(53).UndoHistory,b=i(12).getLogger("Chart.LineDataSource"),w=i(15);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.setActive=function(t){this._active=t},o.prototype._updateImpl=function(){var t,e,i,o,n;if(this._visible=!1,this._text="",this._model.timeScale()&&!this._model.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&(this._model.selectedSource()===this._linetool||this._linetool.customization.forcePriceAxisLabel)&&(t=this._model.timeScale().visibleBars(),!t.isEmpty()&&(e=this._linetool.axisPoints(),!(e.length<=this._pointIndex)&&(i=e[this._pointIndex],isFinite(i.price))))){if(o=this._linetool.priceScale(),o.isPercent()){if(n=this._linetool.ownerSource().firstValue(),!isNumber(n))return;i.price=o.priceRange().convertToPercent(i.price,n)}this._text=o.formatter().format(i.price),this._coordinate=o.priceToCoordinate(i.price),this._visible=!0}},o.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this._color,borderColor:this._borderColor,background:this._active?this._activeBackground:this._background,visible:this._visible};return new a(t)},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),r.prototype.text.call(this)},inherit(n,l),n.prototype.setActive=function(t){this._active=t},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i;this._visible=!1,this._model.timeScale().isEmpty()||(t=this._linetool.axisPoints(),t.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",e=t[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),i=this._model.timeScale().indexToUserTime(e),i&&(this._text=new u(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},n.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1)
this._properties.listeners().subscribe(this,s.prototype.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.push(this.createPriceAxisView(a)),this.m_timeAxisViews.push(new n(this,a));this._properties.visible.listeners().subscribe(this,function(t){t.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this)),this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0)}var r=i(66),a=i(67),l=i(212),h=i(213),c=i(48).DataSource,d=i(42),p=i(36).Interval,u=i(121).DateTimeFormatter,_=i(2),f=i(587),m=i(21),g=i(47),v=g.Action,y=i(53).UndoHistory,b=i(12).getLogger("Chart.LineDataSource"),w=i(15);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.setActive=function(t){this._active=t},o.prototype._updateImpl=function(){var t,e,i,o,n;if(this._visible=!1,this._text="",this._model.timeScale()&&!this._model.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&(this._model.selectedSource()===this._linetool||this._linetool.customization.forcePriceAxisLabel)&&(t=this._model.timeScale().visibleBars(),!t.isEmpty()&&(e=this._linetool.axisPoints(),!(e.length<=this._pointIndex)&&(i=e[this._pointIndex],isFinite(i.price))))){if(o=this._linetool.priceScale(),o.isPercent()){if(n=this._linetool.ownerSource().firstValue(),!isNumber(n))return;i.price=o.priceRange().convertToPercent(i.price,n)}this._text=o.formatter().format(i.price),this._coordinate=o.priceToCoordinate(i.price),this._visible=!0}},o.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this._color,borderColor:this._borderColor,background:this._active?this._activeBackground:this._background,visible:this._visible};return new a(t)},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),r.prototype.text.call(this)},inherit(n,l),n.prototype.setActive=function(t){this._active=t},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i;this._visible=!1,this._model.timeScale().isEmpty()||(t=this._linetool.axisPoints(),t.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",e=t[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),i=this._model.timeScale().indexToUserTime(e),i&&(this._text=new u(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},n.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1)
;var t={text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,visible:this._visible};return new h(t)},inherit(s,c),s.LINEEND_NORMAL=0,s.LINEEND_ARROW=1,s.LINEEND_CIRCLE=2,s.prototype.pointAdded=function(){return this._pointAdded},s.prototype.pointChanged=function(){return this._pointChanged},s.PointPriceProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i,e.pointAdded().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)}),e.pointChanged().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)})},inherit(s.PointPriceProperty,t),s.prototype.enableCurrentIntervalVisibility=function(){var t,e,i,o,n,s,r,a=p.parse(this._model.mainSeries().interval());a.kind()===p.SECONDS&&(a.multiplier()<60?(this.properties().intervalsVisibilities.seconds.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsTo.setValue(e)):a=new p(p.MINUTES,a.multiplier()/60)),a.kind()===p.MINUTES&&(a.multiplier()<60?(this.properties().intervalsVisibilities.minutes.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesTo.setValue(e)):(i=Math.floor(a.multiplier()/60),this.properties().intervalsVisibilities.hours.setValue(!0),o=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),i),this.properties().intervalsVisibilities.hoursFrom.setValue(o),n=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),i),this.properties().intervalsVisibilities.hoursTo.setValue(n))),a.kind()===p.DAYS&&(this.properties().intervalsVisibilities.days.setValue(!0),s=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.daysFrom.setValue(s),r=Math.max(this.properties().intervalsVisibilities.daysTo.value(),a.multiplier()),this.properties().intervalsVisibilities.daysTo.setValue(r)),a.kind()===p.WEEKS&&this.properties().intervalsVisibilities.weeks.setValue(!0),a.kind()===p.MONTHS&&this.properties().intervalsVisibilities.months.setValue(!0)},s.prototype.getType=function(){return TradingView.className(this.constructor)},s.prototype.getConstructor=function(){return this._constructor||null},s.prototype.isActualSymbol=function(){return this._isActualSymbol},s.prototype.isActualInterval=function(){return this._isActualInterval},s.prototype.isSavedInChart=function(t){return!this.customization.disableSave},s.prototype.showInObjectTree=function(){return this.customization.showInObjectsTree},s.prototype.visibilityKeyByInterval=function(t){var e,i=p.parse(t)
;return s.IntervalsVisibilities.forEach(function(t){t.kind===i.kind()&&t.from<=i.multiplier()&&t.to>=i.multiplier()&&(e=t.key)}),e},s.prototype.calcIsActualSymbol=function(){var t=this._properties.symbol,e=this._model.mainSeries();this._isActualSymbol=e.symbolSameAsCurrent(t.value()),this._isActualSymbol&&t.setValue(e.symbol()),this.calcIsActualInterval()},s.prototype.calcIsActualInterval=function(){var t,e,i,o,n=this._properties,s=this._model.mainSeries(),r=p.parse(s.interval()),a=n.intervalsVisibilities;this._isActualInterval=!1,r.kind()===p.SECONDS&&(t=a.seconds.value(),e=a.secondsFrom.value(),i=a.secondsTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.MINUTES&&r.multiplier()<60&&(t=a.minutes.value(),e=a.minutesFrom.value(),i=a.minutesTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.MINUTES&&r.multiplier()>=60&&(o=Math.floor(r.multiplier()/60),t=a.hours.value(),e=a.hoursFrom.value(),i=a.hoursTo.value(),this._isActualInterval=t&&o>=e&&o<=i),r.kind()===p.DAYS&&(t=a.days.value(),e=a.daysFrom.value(),i=a.daysTo.value(),this._isActualInterval=t&&r.multiplier()>=e&&r.multiplier()<=i),r.kind()===p.WEEKS&&(this._isActualInterval=a.weeks.value()),r.kind()===p.MONTHS&&(this._isActualInterval=a.months.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},s.PointPriceProperty.prototype.value=function(){var t=this._lineSource.points()[this._pointIndex].price,e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.PointPriceProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.price=parseFloat(t),e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},s.PointIndexProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(s.PointIndexProperty,t),s.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},s.PointIndexProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.index=t,e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},s.prototype._syncMultichartState=function(){var t={points:this._timePoint,interval:this._model.mainSeries().interval()}
;this.linkKey&&!this.properties().singleChartOnly&&d.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:t})},s.prototype._createPointProperty=function(t){var e,i=this._properties.points;i.addProperty(t),e=i[t],e.addChild("price",new s.PointPriceProperty(this,t)),e.addChild("bar",new s.PointIndexProperty(this,t))},s.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var t=0;t<this.pointsCount();t++)this._createPointProperty(t)},s.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},s.prototype.symbol=function(){return this._properties.symbol.value()},s.prototype.properties=function(){return this._properties},s.prototype.isSavedInStudyTemplates=function(){return!1},s.prototype.state=function(t){var e=TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),points:this._timePoint,zorder:this.zorder(),linkKey:this.linkKey};return i.state._isActualInterval=this.isActualInterval(),delete i.state.points,t&&(i.indexes=this._points),this.ownerSource()&&(i.ownerSource=this.ownerSource().id()),this.isFixed()&&(i.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(i.version=this.version),this.hasAlert.value()&&(i.alertId=this._alertId),i},s.prototype.template=function(){var t=this.properties().state();return delete t.points,delete t.symbol,delete t.symbolInfo,t},s.prototype.restoreTemplate=function(t){delete t.symbolInfo,this._model._undoModel.drawingLoadTemplate(this,t)},s.prototype.clearData=function(){this._points=[]},s.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId},s.prototype.stop=function(){this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null),this.hasAlert.value()&&TradingView.alertsDispatcher&&TradingView.alertsDispatcher.deleteAlert(this._alertId)},s.prototype.isStarted=function(){return!!this._currentPointsetId},s.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=0,this.createServerPoints())},s.prototype.tryCreateServerPoints=function(){this.isFixed()||this._currentPointsetId||this.createServerPoints()},s.prototype.normalizePoint=function(t){var e=this._model.timeScale().normalizeBarIndex(t.index);return e.price=t.price,e},s.prototype.normalizePoints=function(){var t,e;for(this._timePoint=[],t=0;t<this._points.length;t++){if(e=this._model.timeScale().normalizeBarIndex(this._points[t].index),!e.time_t){this._timePoint=[];break}e.price=this._points[t].price,this._timePoint.push(e)}},s.prototype.denormalizeTimePoints=function(){var t,e,i=[];for(t=0;t<this._timePoint.length;t++){if(void 0===(e=this._model.timeScale().denormalizeTimePoint(this._timePoint[t]))){i=[];break}i.push({index:e,price:this._timePoint[t].price})}i.length>0&&(this._points=i)},s.prototype.restorePoints=function(t,e,i){this._timePoint=t,this._points=e,i||this.denormalizeTimePoints()},
@@ -15,7 +15,7 @@ return t<=e}function n(t,e){return t>=e}function s(t,e,i){return Math.min(Math.m
return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.scaled=function(e){return new t(this.x*e,this.y*e)},t.prototype.normalized=function(){return this.scaled(1/this.length())},t.prototype.transponed=function(){return new t(-this.y,this.x)},t.prototype.clone=function(){return new t(this.x,this.y)},t}(),e.Point=P,L=function(){function t(){this._rows=[[1,0,0],[0,1,0],[0,0,1]]}return t.prototype.mult=function(e){var i,o,n,s,r;if(e instanceof t){for(i=new t,o=0;o<3;o++)for(n=0;n<3;n++)for(i._rows[o][n]=0,s=0;s<3;s++)i._rows[o][n]+=this._rows[o][s]*e._rows[s][n];return i}for(r=[e.x,e.y,1],i=[0,0,0],o=0;o<3;o++)for(n=0;n<3;n++)i[o]+=r[n]*this._rows[o][n];return new P(i[0],i[1])},t.rotate=function(e){var i=new t;return i._rows[0][0]=Math.cos(e),i._rows[1][1]=Math.cos(e),i._rows[0][1]=-Math.sin(e),i._rows[1][0]=Math.sin(e),i},t.scale=function(e,i){var o=new t;return o._rows[0][0]=e,o._rows[1][1]=i,o},t.translate=function(e,i){var o=new t;return o._rows[0][2]=e,o._rows[1][2]=i,o},t}(),e.Matrix=L,e.distanceToLine=_,e.distanceToSegment=f,e.intersectLines=m,e.intersectSegments=g,e.pointInRect=v,e.pointInTriangle=y,e.intersectRayWithRect=b,e.isInPolygon=w,e.isInCircle=S,e.optionalCorner=T},function(t,e,i){var o=i(568),n={},s={},r={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets,Array.isArray(e)?e.forEach(function(t){n[t]=1}):e&&Object.keys(e).forEach(function(t){n[t]=1}),n[i]=1}),i=Object.keys(n),i.forEach(function(t){i.forEach(function(i){if(void 0!==(l=o[i])){if(!(e=l.subsets))return;s.hasOwnProperty(t)||(s[t]=[]),Array.isArray(e)&&~e.indexOf(t)?s[t].push(i):t in e&&s[t].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(t){a.disable(t)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(t){a.enable(t)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:n,_setsReverseDependencies:s,_setsStates:r}},enabled:function(t){var e=function(t){var i,o,n=s.hasOwnProperty(t)?s[t]:[];if(!1===r[t])return!1;for(i=r[t],o=0;o<n.length;++o)i|=e(n[o]);return i};return!!e(t)},enable:function(t){r[t]=!0},disable:function(t){r[t]=!1},setEnabled:function(t,e){r[t]=!!e},_uniqueSets:function(){return Object.keys(n)}};a.init(),t.exports=a},,function(t,e,i){(function(t){"use strict";function o(t,e){this._model=e,this._bindings=[],this._property=t}function n(t,e,i,o,n,s){if(!t)return void N.logDebug("Binding: missing control");this._control=t,this._property=e,this._applyOnFly=i,this._undoModel=o,this._undoText=n,e&&(this._formatters=[],this._changed=!1,this.setValue(e.value()),e.listeners().subscribe(this,this.propertyChanged))}function s(t){return t.toUpperCase()}function r(t){return function(e){return e<t?t:e}}function a(t){return function(e){return e>t?t:e}}function l(t){return function(e){var i=parseInt(e,10);return TradingView.isNaN(i)?t:i}}function h(t){var e=new V;return function(i){var o=e.parse(i)
;return TradingView.isNaN(o)?t:o}}function c(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function d(t){return function(e){return 0===e.length?t:e}}function p(t,e,i,o,s,r){n.call(this,t,e,o,s,r),this._transformFunction=i,this._attachToControl(t,o)}function u(t,e,i,o,n){p.call(this,t,e,h(e.value()),i,o,n),this.addFormatter(function(t){return(new V).format(t)})}function _(t,e,i,o,s,r){this._subControlIds=e,n.call(this,t,i,o,s,r),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function f(t,e,i,o,s,r,a){this._model=o,this._mainSeries=r,this._toIntTransformer=l(a),this._disabled=!1,n.call(this,t,e,i,o,s);var h=this;i&&t.change(function(){h.setValueToProperty(h.value())}),this._mainSeries.onBarReceived().subscribe(this,function(t){h.setValue(this.property().value())})}function m(t,e,i,o,s){n.call(this,t,e,i,o,s),i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e)}.bind(this))}function g(t,e,i,o,s,r,a,l){n.call(this,t,e,o,s,r),this._transformFunction=i,this._propertyChangedHook=l,this._setter=a;var h=this;o&&t.change(function(){h._setter?h._setter.call(h,h.value()):h.setValueToProperty(h.value())})}function v(t,e){n.call(this,t,e)}function y(t,e,i,o,s,r){if(!t.is(":checkbox, :radio"))return new w(t,e,i,o,s);n.call(this,t,e,i,o,s),this._setter=r;var a=this;i&&t.change(function(){a._setter?a._setter.call(a,a.value()):a.setValueToProperty(a.value())})}function b(t,e,i,o,s,r){n.call(this,t,e,i,o,s),this._inverted=!0===r}function w(t,e,i,o,s){n.call(this,t,e,i,o,s);var r=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");r.setValueToProperty(t)})}function S(t,e,i,o,s){if(!i)return void N.logDebug("ActionBinder: Missed undo model");n.call(this,t,e,!0,i,o),s?t.callbacks().subscribe(this,s):t.callbacks().subscribe(this,S.prototype.onActionCallback)}function T(t,e,i,o,s,r){var a,l;a=t.is("input")?t:t.find("input"),n.call(this,a,e,i,o,s),this._transparencyProperty=r,this.applyOldTransparency(),l=this,i&&a.change(function(){l.setValueToProperty(l.value())})}function C(e,i,o,s,r,a){function l(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||i<e.value&&e.value<o)&&c.setValueToProperty(e.value)}function h(t,e){c.setValueToProperty(e.value)}isNumber(i.value())||(N.logWarn("Property cannot be binded to control, bad value (expect number): "+i.value()),i=new t),n.call(this,e,i,o,s,r);var c=this;o&&(a?(e.bind("slidechange",l),e.bind("slide",l)):(e.bind("slidechange",h),e.bind("slide",h))),e.bind("slidestart",function(t,e){s.beginUndoMacro(r)}),e.bind("slidestop",function(t,e){s.endUndoMacro()})}function x(t,e,i,o,n,s){y.call(this,t,e,o,n,s),this._intervalProperty=i,this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged),this.onIntervalChanged()}function P(t,e,i,o){this._control=t,this._wv=e,this._transformFunction=i,this._undoText=o,this._attachToControl(this._control),
this._setValueBinded=this.setValue.bind(this)}function L(t,e,i,o,n){this._not=!!n,P.apply(this,arguments)}function k(t,e,i,o,n,s,r,a){this._propFrom=e[0],this._propTo=e[1],this._control=t,this._applyOnFly=o,this._undoModel=n,this._undoText=r,this._properties=e,this._inputsText=s,this._transformers=i;var l=this;t.slider({range:!0,min:i[0],max:i[1],values:[l._propFrom.value(),l._propTo.value()]}),this.$rangeHandleFrom=$(t.find(".ui-slider-handle")[0]).addClass("from"),this.$rangeHandleTo=$(t.find(".ui-slider-handle")[1]).addClass("to"),this.setValue(this._propFrom,0),this.setValue(this._propTo,1),a&&($(a).on("change",function(t){$(this).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))}),$(a).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))),s&&($(s[0]).val(this._control.slider("values",0)),$(s[1]).val(this._control.slider("values",1)),t.slider({slide:function(t,e){$(s[0]).val(e.values[0]),$(s[1]).val(e.values[1])}}),$(s).each(function(){$(this).on("keydown",function(t){parseInt($(s[0]).val())<l._transformers[0]?$(s[0]).val(l._transformers[0]):parseInt($(s[1]).val())>l._transformers[1]&&$(s[1]).val(l._transformers[1]),-1!==$.inArray(t.keyCode,[46,8,9,27,13,110,190])||65===t.keyCode&&!0===t.ctrlKey||67===t.keyCode&&!0===t.ctrlKey||88===t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(s[0]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(s[1]).val())&&$(this).val(s[1].val()),l._control.slider("values",0,$(this).val()),k.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(s[1]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())<$(s[0]).val()&&$(this).val(s[0].val()),l._control.slider("values",1,$(this).val()),k.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,k.prototype.propertyChanged),this._propTo.listeners().subscribe(this,k.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){s&&($(s[0]).val(l._control.slider("values",0)),$(s[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){s&&($(s[0]).val(l._control.slider("values",0)),$(s[1]).val(l._control.slider("values",1))),
l.setValueToProperty(l._control.slider("values"),e.handle)}})}function I(t,e,i,o,s,r){n.call(this,t,e,i,o,s),this._separator=r||" ";var a=this;i&&t.change(function(){a.setValueToProperty(a.value())})}var A=i(36),E=A.rgba,M=A.rgbaToString,D=A.parseRgb,O=i(53).UndoHistory,V=i(26).NumericFormatter,B=i(14),R=i(32).addColorPicker,N=i(12).getLogger("Chart.PropertyPage");o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},o.prototype.loadData=function(){var t,e,i;for(t=0;t<this._bindings.length;t++)e=this._bindings[t],e.properties?(i=e.properties(),e.setValue(i[0],0),e.setValue(i[1],1)):e.property&&(e.transparencyProperty&&e.transparencyProperty()?e.applyOldTransparency():e.setValue(e.property().value()))},o.prototype.saveData=function(){var t,e;for(this._model.beginUndoMacro(),t=0;t<this._bindings.length;t++)e=this._bindings[t],e.changed()&&this._model.setProperty(e.property(),e.value());this._model.endUndoMacro()},o.prototype.createColorPicker=function(t){return R(null,t)},o.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i)},o.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},o.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},o.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},o.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},o.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="<select><option value='default'>"+$.t("Default")+"</option>",s=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];for(t in s)e=s[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="<option value='"+i+"'>"+o+"</option>";return n+="</select>",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="<select><option value='default'>"+$.t("Default")+"</option>";for(t=0;t<=6;t++)e+="<option value='"+t+"'>"+t+"</option>";return e+="</select>",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,s,r,a=null
l.setValueToProperty(l._control.slider("values"),e.handle)}})}function I(t,e,i,o,s,r){n.call(this,t,e,i,o,s),this._separator=r||" ";var a=this;i&&t.change(function(){a.setValueToProperty(a.value())})}var A=i(37),E=A.rgba,M=A.rgbaToString,D=A.parseRgb,O=i(53).UndoHistory,V=i(26).NumericFormatter,B=i(14),R=i(32).addColorPicker,N=i(12).getLogger("Chart.PropertyPage");o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},o.prototype.loadData=function(){var t,e,i;for(t=0;t<this._bindings.length;t++)e=this._bindings[t],e.properties?(i=e.properties(),e.setValue(i[0],0),e.setValue(i[1],1)):e.property&&(e.transparencyProperty&&e.transparencyProperty()?e.applyOldTransparency():e.setValue(e.property().value()))},o.prototype.saveData=function(){var t,e;for(this._model.beginUndoMacro(),t=0;t<this._bindings.length;t++)e=this._bindings[t],e.changed()&&this._model.setProperty(e.property(),e.value());this._model.endUndoMacro()},o.prototype.createColorPicker=function(t){return R(null,t)},o.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i)},o.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},o.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},o.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},o.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},o.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="<select><option value='default'>"+$.t("Default")+"</option>",s=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];for(t in s)e=s[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="<option value='"+i+"'>"+o+"</option>";return n+="</select>",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="<select><option value='default'>"+$.t("Default")+"</option>";for(t=0;t<=6;t++)e+="<option value='"+t+"'>"+t+"</option>";return e+="</select>",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,s,r,a=null
;return"number"==typeof t.valueOf()?(a=t,o=e,n=i):(o=t,n=e),o+="",s=this._labelToId(o),r=$("<td>"),$("<label>").html(o.length>0?$.t(o):"").attr("for",s).appendTo(r),a&&r.attr("colspan",a),n&&n.attr("id",s),r},o.prototype.createTableInTable=function(t){var e=$("<tr>").appendTo(t),i=$("<td>").appendTo(e);return $('<table cellpadding="0" cellspacing="0">').appendTo(i)},o.prototype._labelToId=function(t){return"control"+t.replace(/(^| )\w/g,function(t){return"-"+t.trim().toLowerCase()})+Math.floor(1e3*Math.random())},o.prototype.addRow=function(t){return $(document.createElement("tr")).appendTo(t)},o.prototype.addLabeledRow=function(t,e,i,o){var n,s=e&&e.length>0?$.t(e):"",r=$(document.createElement("tr")),a=$(document.createElement("td")).html(s);return o&&a.attr("colspan",2),i&&(n=this._labelToId(e),i.attr("id",n),a.html('<label for="'+n+'">'+s+"</label>")),r.append(a).appendTo(t)},o.prototype.addEditorRow=function(t,e,i,o){var n=$(document.createElement("td"));return i.row=this.addLabeledRow(t,e,i,o),i.appendTo(n.appendTo(i.row)),i},o.prototype.addColorPickerRow=function(t,e){return this.addEditorRow(t,e,this.createColorPicker())},o.prototype.addOffsetEditorRow=function(t,e){var i=$("<input/>");return i.attr("type","text"),i.css("width","100px"),i.addClass("ticker"),this.addEditorRow(t,e,i)},o.prototype.addFontEditorRow=function(t,e){return this.addEditorRow(t,e,this.createFontEditor())},o.prototype.refreshStateControls=function(t,e,i){var o,n,s;for(o=0;o<e.length;o++)n=e[o],s=t[n.id],s.toggle(this.parseRule(n.visible,e,i)),s.attr("disabled",!this.parseRule(n.visible,e,i))},o.prototype.parseRule=function(t,e,i){if(!t)return!0;var o=t.split("==");return!(o.length<2)&&i[o[0]].value()===o[1]},o.prototype.destroy=function(){for(var t=this._bindings.length;t--;)this._bindings[t].destroy();this._bindings.length=0},o.prototype.bindInteger=function(t,e,i,o,n){var s=[l(e.value())];void 0!==o&&s.push(r(1)),void 0!==n&&s.push(a(1e3)),this.bindControl(new p(t,e,s,!1,this.model(),i))},o.prototype.bindColor=function(t,e,i){this.bindControl(new T(t,e,!0,this.model(),i))},o.prototype.bindBoolean=function(t,e,i){this.bindControl(new y(t,e,!0,this.model(),i))},n.prototype.addFormatter=function(t){this._formatters.push(t),this.setValue(this._property.value())},n.prototype._formatValue=function(t){return this._formatters.reduce(function(t,e){return e(t)},t)},n.prototype._attachToControl=function(t,e){var i=this;e?t.on("keyup change input",function(t){var e=i.value();i.setValueToProperty(e),i.setValue(e)}):(t.keypress(function(t){if(this._changed=!0,13===t.which){var e=i.value();i.setValueToProperty(e),i.setValue(e)}}),t.focusout(function(t){var e=i.value();i.changed()&&(i.setValueToProperty(e),i.setValue(e))}),t.change(function(t){var e=i.value();$(t.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i.setValueToProperty(e)},250)):i.setValueToProperty(e),i.setValue(e)}))},n.prototype.control=function(){return this._control},n.prototype.changed=function(){
return this._changed},n.prototype.setValueToProperty=function(t){this._undoModel.setProperty(this._property,t,this._undoText),this._changed=!1},n.prototype.property=function(){return this._property},n.prototype.propertyChanged=function(t){this.setValue(t.value())},n.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},inherit(p,n),p.prototype.value=function(){var t,e=this._control.val();if(this._transformFunction)if(Array.isArray(this._transformFunction))for(t=0;t<this._transformFunction.length;t++)e=this._transformFunction[t](e);else e=this._transformFunction(e);return e},p.prototype.setValue=function(t){var e=this._control.val(),i=this._formatValue(t);e!==i&&this._control.val(i)},inherit(u,p),inherit(_,n),_.prototype._forEachSubControl=function(t){this._subControlIds.forEach(function(e){var i="#"+e,o=this.control().find(i);t.call(this,o)},this)},_.prototype._parseSessions=function(t){var e,i,o=t.split("-",2);return 2!==o.length&&(o=["0","0"]),e=parseInt(o[0]),i=parseInt(o[1]),[Math.floor(e/100),e%100,Math.floor(i/100),i%100]},_.prototype.value=function(){var t,e,i,o=[];return this._forEachSubControl(function(t){o.push(t.val())}),t=function(t,e){return e.forEach(function(e){t=e(t)}),("0"+t).slice(-2)},e=[l(0),r(0),a(23)],i=[l(0),r(0),a(59)],t(o[0],e)+t(o[1],i)+"-"+t(o[2],e)+t(o[3],i)},_.prototype.setValue=function(t){var e=this._parseSessions(t);this._forEachSubControl(function(t){var i=t.val(),o=("0"+e[0]).slice(-2);e.shift(),i!==o&&t.val(o)})},inherit(f,n),f.prototype.value=function(){var t,e,i;return this._disabled?(this._control.attr("disabled",!0),null):(t=this._control.val(),e=this._toIntTransformer(t),e<0&&(e=0),i=this._mainSeries.bars().size(),i<=e&&(e=i-1),1e3*this._mainSeries.bars()._valueAt(this._mainSeries.bars().lastIndex()-e)[TradingView.TIME_PLOT])},f.prototype.setValue=function(t){var e,i,o;return this._disabled||null==t?void this._control.attr("disabled",!0):t<0?(this._control.val(-t),void this._property.setValue(this.value())):null===(e=this._mainSeries.data().timeToBarIndex(t/1e3,TradingView.SEARCH_FROM_RIGHT))?void(this._disabled=!0):(i=this._mainSeries.bars().lastIndex(),o=i-e,void(this._control.val()!==""+o&&this._control.val(o)))},inherit(m,n),m.prototype.value=function(){return this._control.val()},m.prototype.setValue=function(t){var e=this.value();t&&e!==t&&this._control.val(t)},inherit(g,n),g.prototype.value=function(){var t=this._control.val();return this._transformFunction&&(t=this._transformFunction(t)),t},g.prototype.setValue=function(t){var e,i;if(this._control.val(t),this._control.selectbox)try{e=this._control.find("[value='"+t+"']"),e.length>0&&(i=e[0],this._control.selectbox("change",i.value,i.text))}catch(t){}},g.prototype.propertyChanged=function(t){var e=t.value();"function"==typeof this._propertyChangedHook&&(e=this._propertyChangedHook(e)),this.setValue(e)},inherit(v,n),v.prototype.value=function(){return this._property.value()},v.prototype.setValue=function(t){return this._control.html(t)},inherit(y,n),
y.prototype.value=function(){return this.control().is(":checked")},y.prototype.setValue=function(t){var e,i,o,n;return this.control().is(".visibility-checker")&&(t?(this.control().closest("tr").find(".slider-range").slider("enable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!1)})):(this.control().closest("tr").find(".slider-range").slider("disable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!0)}))),this.control().is(".visibility-switch")&&(e={opacity:t?1:.5},i=t?"enable":"disable",o=this.control().data("hides"),o?o.closest("td").css(e):(n=this.control(),n.parent().parent().data("visible",t).find("td").filter(function(){var t=$(this);return!t.find("label").length&&t.find(":checkbox").attr("id")!==n.attr("id")}).each(function(){var o=$(this);o.children().each(function(){var n=$(this);n.is(".ui-slider")?n.slider(i):n.is("select")?(n.selectbox(i),o.css(e)):n.is(".custom-select")?(n.data(i)(),o.css(e)):n.is(".tvcolorpicker-container")?(n.find("input").prop("disabled",!t),o.css(e)):(n.prop("disabled",!t),o.css(e))})}))),this.control().attr("checked",!!t)},inherit(b,n),b.prototype.value=function(){return this.control().is(":disabled")},b.prototype.setValue=function(t){return t=!!t,this._inverted&&(t=!t),this.control().parents("label").toggleClass("disabled",t),this.control().attr("disabled",t)},inherit(w,n),w.prototype.value=function(){return this.control().hasClass("active")},w.prototype.setValue=function(t){return this.control().toggleClass("active",!!t)},inherit(S,n),S.prototype.onActionCallback=function(t){this._undoModel.setProperty(this._property,this.value(),this._undoText)},S.prototype.value=function(){return this.control().checked},S.prototype.setValue=function(t){return this.control().checked=!!t},inherit(T,n),T.prototype.applyOldTransparency=function(){var t,e,i;this.transparencyProperty()&&(B.isHexColor(this.property().value())?(t=this.transparencyProperty().value?this.transparencyProperty().value():this.transparencyProperty(),e=D(this.property().value()),i=(100-t)/100,this.control().val(M(E(e,i)))):this.control().val(this.property().value()),this.control().change())},T.prototype.transparencyProperty=function(){return this._transparencyProperty},T.prototype.value=function(){return this._control.val()},T.prototype.setValue=function(t){this._control.val(t),this._control.change(),this._control.color&&this._control.color.fromString(t)},inherit(C,n),C.prototype.value=function(){return this._control.slider("option","value")},C.prototype.setValue=function(t){this._control.slider("option","value",t)},inherit(x,y),x.prototype.onIntervalChanged=function(){+this._intervalProperty.value()<1440?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})},x.prototype.value=function(){return this._control.is(":disabled")?this._property.value():y.prototype.value.call(this)},x.prototype.setValue=function(t){
@@ -31,7 +31,7 @@ data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
},this)):"right"===this._data.horzAlign?t.textAlign="end":"center"===this._data.horzAlign&&(t.textAlign="center"),h=this._textPoint.x,c=this._textPoint.y,t.fillStyle=this._data.color,d=0;d<this._lines.length;d++)t.fillText(this._lines[d],h,c),c+=o;return{width:n.w+2}}},n.prototype.hitTest=function(t){return 0===this._data.points.length?null:(this._preRender(),this._boundingRect&&d.pointInRect(t,this._boundingRect[0],this._boundingRect[1])?this._hittest:null)},r.prototype.drawArrow=function(t,e,i,o){var n,s,r,a,l,h,c,d,p;e.substract(t).length()<1||(n=e.substract(t).normalized(),s=5*o,r=n.scaled(s),a=e.substract(r),l=n.transponed(),h=3*o,c=l.scaled(h),d=a.add(c),p=a.substract(c),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),e.x,e.y),CanvasEx.drawLine(i,Math.round(p.x),Math.round(p.y),e.x,e.y))},r.prototype.expandPoints=function(t,e,i,o){var n,s,r=new d.Point(0,0),a=new d.Point(i,o);return this._data.extendleft&&(n=t.substract(e),(s=d.intersectRayWithRect(t,t.add(n),r,a))&&(t=s)),this._data.extendright&&(n=e.substract(t),(s=d.intersectRayWithRect(e,e.add(n),r,a))&&(e=s)),[t,e]},r.prototype.drawCircle=function(t,e,i,o){o=$.extend({fillStyle:"#000000"},o),e.save(),e.fillStyle=o.fillStyle,e.beginPath(),e.arc(t.x,t.y,i,0,2*Math.PI,!1),e.fill(),o.strokeWidth&&(e.lineWidth=o.strokeWidth,e.stroke()),e.restore()},r.prototype.draw=function(t){var e,i,o,n,s,r;this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.floatPoints||this._data.points,i=e[0],o=e[1],this._data.overlayLineEndings?n=[$.extend(!0,{},i),$.extend(!0,{},o)]:this.drawEnds(t,[i,o]),s=this.expandPoints(i,o,this._data.width,this._data.height),r=p(s[0],s[1],this._data.width,this._data.height),r&&this._data.linewidth>0&&CanvasEx.drawLine(t,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(t,n))},r.prototype.drawEnds=function(t,e){var i=e[0],o=e[1];switch(this._data.leftend){case _.LINEEND_ARROW:this.drawArrow(o,i,t,t.lineWidth);break;case _.LINEEND_CIRCLE:this.drawCircle(i,t,t.lineWidth,this._data.endstyle)}switch(this._data.rightend){case _.LINEEND_ARROW:this.drawArrow(i,o,t,t.lineWidth);break;case _.LINEEND_CIRCLE:this.drawCircle(o,t,t.lineWidth,this._data.endstyle)}},r.prototype.hitTest=function(t){var e,i,o,n,s,r;return this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(e=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,o=i[0],n=i[1],s=this.expandPoints(o,n,this._data.width,this._data.height),r=d.distanceToSegment(s[0],s[1],t),r.distance<=e?this._hittest:null)},inherit(a,u),a.prototype.update=function(){this._invalidated=!0,this._labelDataInvalidated=!0},a.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c=this._source.points();c.length<2||(t=c[0],e=c[1],void 0===(i=this._model.timeScale().visibleBars())||i.isEmpty()||(i=i.clone(),o=this._source.properties(),
t.index<i.firstBar()&&e.index<i.firstBar()&&!o.extendLeft.value()&&!o.extendRight.value()||(u.prototype.update.call(this),this._points.length<2||(n=o.showBarsRange.value(),s=o.showDateTimeRange.value(),r=o.showDistance.value(),a=o.showPriceRange.value(),l=o.showAngle.value(),a||n||s||r||l?(h=this,this._statCache=this._model._trendLineStatsCache.updateSource(this._source,function(){return h._statLabelData()})):(this._model._trendLineStatsCache.removeSource(this._source.id()),this._label=null,this._labelData&&(this._labelData.text="",this._labelData.lines=[])),this._invalidated=!1))))},a.prototype._statLabelData=function(){var t,e,i,o,n,s,r,a,h,c,p,u,_,f,m,g,v,y,b,w,S,C,x,P,L,k,I,A;return this._labelDataInvalidated&&(t=this._source.points(),e=t[0],i=t[1],o=this._source.properties(),n=[],p=o.showPriceRange.value(),p&&this._source.priceScale()&&(h=i.price-e.price,u=h/e.price,s=this._source.priceScale().formatter().format(h)+" ("+this._percentageFormatter.format(100*u)+")",_=this._model.mainSeries().base(),_&&(f=Math.round(h*_),s+=", "+f),n.push("priceRange")),m=o.showBarsRange.value(),g=o.showDateTimeRange.value(),v=o.showDistance.value(),(m||g||v)&&(r="",m&&(c=i.index-e.index,r+=$.t("{0} bars").format(c)),g&&(y=this._model.timeScale().indexToUserTime(e.index),b=this._model.timeScale().indexToUserTime(i.index),y&&b&&(w=(b.valueOf()-y.valueOf())/1e3,(S=(new T).format(w))&&(r+=m?" ("+S+")":S))),v&&(r&&(r+=", "),void 0===h&&(h=i.price-e.price),void 0===c&&(c=i.index-e.index),C=Math.round(1e5*Math.sqrt(h*h+c*c))/1e5,r+=$.t("distance: {0}").format(this._numericFormatter.format(C))),r&&n.push("barsRange")),x=o.showAngle.value(),x&&(P=this._source.pointToScreenPoint(e),L=this._source.pointToScreenPoint(i),P=P instanceof Array?P[0]:P instanceof d.Point?P:null,L=L instanceof Array?L[0]:L instanceof d.Point?L:null,P instanceof d.Point&&L instanceof d.Point&&(I=L.substract(P),I.length()>0&&(I=I.normalized(),k=Math.acos(I.x),I.y>0&&(k=-k))),"number"!=typeof k||TradingView.isNaN(k)||(a=Math.round(180*k/Math.PI)+"º",n.push("angle"))),this._label=[s,r,a].filter(function(t){return t}).join("\n")||null,this._icons=n,this._labelDataInvalidated=!1),A={points:[this._points[1]],text:this._label,color:this._source.properties().textcolor.value(),font:l.LABEL_FONT,fontsize:l.LABEL_FONTSIZE,lineSpacing:l.LABEL_LINESPACING,backgroundColor:l.LABEL_BGCOLOR,borderColor:l.LABEL_BORDERCOLOR,borderWidth:1,padding:l.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},this._points[1].y<this._points[0].y&&(A.vertAlign="bottom"),this._points[1].x<this._points[0].x&&(A.horzAlign="right"),this._labelData=A,A},a.prototype.renderer=function(){var t,e,i,o,n,s,a,h,c;return this._invalidated&&this.updateImpl(),t=new y,this._invalidated?t:this._source.priceScale()?(e={},e.points=this._points,e.floatPoints=this._floatPoints,e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),
e.linestyle=this._source.properties().linestyle.value(),e.extendleft=this._source.properties().extendLeft.value(),e.extendright=this._source.properties().extendRight.value(),e.leftend=this._source.properties().leftEnd.value(),e.rightend=this._source.properties().rightEnd.value(),t.append(new r(e)),i=this.isAnchorsRequired(),o=i||this._source.properties().alwaysShowStats.value(),o&&this._label&&2===this._points.length&&(n=this._points[1],s={left:0,top:this._model._trendLineStatsCache.topByRow(this._statCache.row),width:this._model._trendLineStatsCache.rowWidth(this._statCache.row),height:this._model._trendLineStatsCache.rowHeight(this._statCache.row)},a={left:n.x,top:n.y,width:s.width,height:s.height},"right"===this._labelData.horzAlign?a.left-=l.LABEL_PADDING+a.width:a.left+=l.LABEL_PADDING,"bottom"===this._labelData.vertAlign?a.top-=l.LABEL_PADDING+a.height:a.top+=l.LABEL_PADDING,h=this._model._trendLineStatsCache.canvas(),c=new m(h.get(0),s,a),t.append(c)),this.addAnchors(t),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e.points.length>=2&&this._source.getAlertIsActive(function(i){t.append(new v({point1:e.points[0],point2:e.points[1],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),t):t},inherit(l,_),l.LABEL_OFFSET=8,l.LABEL_FONT="Arial",l.LABEL_FONTSIZE=12,l.LABEL_LINESPACING=10,l.LABEL_BGCOLOR="rgba(255,255,255,.8)",l.LABEL_BORDERCOLOR="#e3e3e3",l.LABEL_PADDING=8,l.prototype.stop=function(){_.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},l.prototype.pointsCount=function(){return 2},l.prototype.title=function(){return"Trend Line"},l.prototype.canHasAlert=function(){return!0},l.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},e.TrendLineStatsRenderer=n,e.LineToolTrendLine=l,e.TrendLineRenderer=r},function(t,e,i){"use strict";function o(){return void 0===C&&(C=d.getInt(g)),C}function n(){return void 0===x&&(x=d.getBool(v)),x}function s(t){t="number"==typeof t?Math.max(u.ERROR,Math.min(u.DEBUG,t)):f,C=t,d.setValue(g,t)}function r(t,e){var i,o=0,n=0;for(i=t.length-1;i>=1&&(o+=8*(1+encodeURIComponent(t[i]).length),!(i-1>0&&(n=8*(1+encodeURIComponent(t[i-1]).length),o+n>e)));i--);return t.slice(i)}function a(t,e,i,o,n){var s={id:_,message:e,subSystemId:o,timestamp:+t};_+=1,i.unshift(s),void 0!==n&&i.length>n&&(i.length=n)}function l(t){var e,i=y.reduce(function(t,e){return t.concat(e)},[]);return i.sort(function(t,e){return t.id-e.id}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subSystemId+":"+t.message.replace(/"/g,"'")}),r(e,m)}function h(t,e,i,s){var r,l,h;if((e!==w||s.id!==S)&&(r=new Date,t<=u.NORMAL&&a(r,e,i,s.id,s.maxCount),void 0!==(h=o())&&t<=h&&(!s.highRate||n())&&(!b||s.id.match(b)))){switch(l=r.toISOString()+":"+s.id+":"+e,t){case u.DEBUG:console.debug(l);break;case u.INFO:case u.NORMAL:
s.color?console.log("%c"+l,"color: "+s.color):console.log(l);break;case u.WARNING:console.warn(l);break;case u.ERROR:console.error(l)}w=e,S=s.id,T&&clearTimeout(T),T=setTimeout(function(){w=null,S=null,T=NaN},1e3)}}function c(t,e){function i(t){return function(e){return h(t,e,o,n)}}var o,n;return void 0===e&&(e={}),o=[],y.push(o),n=Object.assign(e,{id:t}),{logDebug:i(u.DEBUG),logError:i(u.ERROR),logInfo:i(u.INFO),logNormal:i(u.NORMAL),logWarn:i(u.WARNING)}}var d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;Object.defineProperty(e,"__esModule",{value:!0}),d=i(69),p="undefined"!=typeof TradingView?TradingView:{},function(t){t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO",t[t.NORMAL=4]="NORMAL",t[t.DEBUG=5]="DEBUG"}(u=e.LOGLEVEL||(e.LOGLEVEL={})),_=0,f=u.INFO,m=75497472,g="loglevel",v="logHighRate",y=[],b=null,w=null,S=null,T=NaN,C=void 0,x=void 0,e.getLogLevel=o,e.isHighRateEnabled=n,e.setLogLevel=s,e.getLogHistory=l,e.getLogger=c,P=c("logger"),e.loggingOn=window.lon=p.loggingOn=function(t,e){s(u.DEBUG),P.logNormal("Debug logging enabled"),x=t,d.setValue(v,t),b=e||null},e.loggingNormal=p.loggingNormal=function(){s(u.NORMAL),P.logNormal("Logging set to normal level")},e.loggingOff=window.loff=function(){s(f),P.logInfo("Debug logging disabled")}},function(t,e,i){"use strict";function o(){return $('<div class="linewidth-slider">').slider({max:4,min:1,step:1})}Object.defineProperty(e,"__esModule",{value:!0}),i(17),e.createLineWidthEditor=o},function(t,e,i){"use strict";function o(t,e,i){var o,n,r,l,h;if(e=e||0,!s(t))return i?a.rgbaToString(a.rgba(a.parseRgb(t),a.normalizeAlphaComponent(1-e/100))):t;if(e<0&&e>100)throw Error("invalid transparency");return o=a.parseRgb(t),n=o[0],r=o[1],l=o[2],h=a.normalizeAlphaComponent(1-e/100),a.rgbaToString([n,r,l,h])}function n(t){return s(t)?t:a.rgbaToString(a.rgba(a.parseRgb(t),a.normalizeAlphaComponent(1)))}function s(t){return 0===t.indexOf("#")}function r(t){var e=a.parseRgb(t).map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return+(.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3)}Object.defineProperty(e,"__esModule",{value:!0});var a=i(36);e.generateColor=o,e.resetTransparency=n,e.isHexColor=s,e.getLuminance=r},function(t,e,i){(function(t){"use strict";function e(){this._listeners=[]}e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i<this._listeners.length;++i)if(o=this._listeners[i],o.object===t&&o.member.prototype===e.prototype){this._listeners.splice(i,1);break}},e.prototype.unsubscribeAll=function(t){var e,i;for(e=this._listeners.length-1;e>=0;--e)i=this._listeners[e],i.object===t&&this._listeners.splice(e,1)},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t<i.length;++t)e=i[t],e.member.apply(e.object||null,arguments);for(t=this._listeners.length-1;t>=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)
s.color?console.log("%c"+l,"color: "+s.color):console.log(l);break;case u.WARNING:console.warn(l);break;case u.ERROR:console.error(l)}w=e,S=s.id,T&&clearTimeout(T),T=setTimeout(function(){w=null,S=null,T=NaN},1e3)}}function c(t,e){function i(t){return function(e){return h(t,e,o,n)}}var o,n;return void 0===e&&(e={}),o=[],y.push(o),n=Object.assign(e,{id:t}),{logDebug:i(u.DEBUG),logError:i(u.ERROR),logInfo:i(u.INFO),logNormal:i(u.NORMAL),logWarn:i(u.WARNING)}}var d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;Object.defineProperty(e,"__esModule",{value:!0}),d=i(69),p="undefined"!=typeof TradingView?TradingView:{},function(t){t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO",t[t.NORMAL=4]="NORMAL",t[t.DEBUG=5]="DEBUG"}(u=e.LOGLEVEL||(e.LOGLEVEL={})),_=0,f=u.INFO,m=75497472,g="loglevel",v="logHighRate",y=[],b=null,w=null,S=null,T=NaN,C=void 0,x=void 0,e.getLogLevel=o,e.isHighRateEnabled=n,e.setLogLevel=s,e.getLogHistory=l,e.getLogger=c,P=c("logger"),e.loggingOn=window.lon=p.loggingOn=function(t,e){s(u.DEBUG),P.logNormal("Debug logging enabled"),x=t,d.setValue(v,t),b=e||null},e.loggingNormal=p.loggingNormal=function(){s(u.NORMAL),P.logNormal("Logging set to normal level")},e.loggingOff=window.loff=function(){s(f),P.logInfo("Debug logging disabled")}},function(t,e,i){"use strict";function o(){return $('<div class="linewidth-slider">').slider({max:4,min:1,step:1})}Object.defineProperty(e,"__esModule",{value:!0}),i(17),e.createLineWidthEditor=o},function(t,e,i){"use strict";function o(t,e,i){var o,n,r,l,h;if(e=e||0,!s(t))return i?a.rgbaToString(a.rgba(a.parseRgb(t),a.normalizeAlphaComponent(1-e/100))):t;if(e<0&&e>100)throw Error("invalid transparency");return o=a.parseRgb(t),n=o[0],r=o[1],l=o[2],h=a.normalizeAlphaComponent(1-e/100),a.rgbaToString([n,r,l,h])}function n(t){return s(t)?t:a.rgbaToString(a.rgba(a.parseRgb(t),a.normalizeAlphaComponent(1)))}function s(t){return 0===t.indexOf("#")}function r(t){var e=a.parseRgb(t).map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return+(.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3)}Object.defineProperty(e,"__esModule",{value:!0});var a=i(37);e.generateColor=o,e.resetTransparency=n,e.isHexColor=s,e.getLuminance=r},function(t,e,i){(function(t){"use strict";function e(){this._listeners=[]}e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i<this._listeners.length;++i)if(o=this._listeners[i],o.object===t&&o.member.prototype===e.prototype){this._listeners.splice(i,1);break}},e.prototype.unsubscribeAll=function(t){var e,i;for(e=this._listeners.length-1;e>=0;--e)i=this._listeners[e],i.object===t&&this._listeners.splice(e,1)},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t<i.length;++t)e=i[t],e.member.apply(e.object||null,arguments);for(t=this._listeners.length-1;t>=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)
}).call(e,i(50)(t))},function(t,e,i){"use strict";function o(t,e,i){this._textSizeCache=e,this._data=t,this._fontSize=t.fontsize?t.fontsize:t.fontSize?t.fontSize:20,t.lines=this._lines=this.wordWrap(t.text,t.wordWrapWidth),this._hittest=i||new d(d.MOVEPOINT)}function n(t,e,i,o,n,s){l.call(this,t,e),this._offsetX=i,this._offsetY=o,this._vertAlign=n,this._horzAlign=s,this._rendererCache={},this._renderer=null,this._invalidated=!0}function s(t,e){this._constructor="LineToolText";var i=e||new u("linetooltext");h.call(this,t,new n(this,t),i),this._timeScale=t.timeScale(),this._barSpacing=t.timeScale().barSpacing()}function r(t,e){var i=e||new u("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),s.call(this,t,i)}var a=i(2),l=i(9),h=i(1).LineDataSource,c=i(48).DataSource,d=i(8),p=i(6),u=i(7).DefaultProperty;!function(){function t(){var t=document.createElement("canvas");t.width=0,t.height=0,e=t.getContext("2d"),t=null}var e;o.prototype.setPoints=function(t,e){this._data.points=t,this._hittest=e||new d(d.MOVEPOINT)},o.prototype._calcLinesWidths=function(){var i,o,n,s;if(e||t(),e.textBaseline="alphabetic",e.font=this.fontStyle(),i=[],this._data.wordWrapWidth)for(o=this._data.wordWrapWidth,n=0;n<this._lines.length;n++)i.push(this._data.wordWrapWidth);else for(o=0,n=0;n<this._lines.length;n++)s=e.measureText(this._lines[n]).width,i.push(s),o=Math.max(o,s);return{widths:i,maxWidth:o}},o.prototype.measure=function(){var t=this._fontSize,e=this._calcLinesWidths().maxWidth,i=t*this._lines.length,o=~~(t/6);return this._data.backgroundHorzInflate&&(e+=2*this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(i+=2*this._data.backgroundVertInflate),e=Math.ceil(e+2*o),i=Math.ceil(i+2*o),e%2!=0&&e++,this._data.padding&&(i+=this._data.padding),{width:e,height:i,textBgPadding:o}},o.prototype.wordWrap=function(i,o,n){var s,r,a,l,h,c,d,p,u;if(e||t(),o=+o,i+="",s=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),s[s.length-1]||s.pop(),!isFinite(o)||o<=0)return s;for(e.font=n||this.fontStyle(),r=[],a=0;a<s.length;a++)if(l=s[a],(h=e.measureText(l).width)<=o)r.push(l);else for(c=l.split(/([-\)\]\},.!?:;])|(\s+)/);c.length;){if((d=~~(o/h*(c.length+2)/3))<=0||e.measureText(c.slice(0,3*d-1).join("")).width<=o)for(;e.measureText(c.slice(0,3*(d+1)-1).join("")).width<=o;)d++;else for(;d>0&&e.measureText(c.slice(0,3*--d-1).join("")).width>o;);if(d>0)r.push(c.slice(0,3*d-1).join("")),c.splice(0,3*d);else{if(p=c[0]+(c[1]||""),u=1===u?1:~~(o/e.measureText(p)*p.length),e.measureText(p.substr(0,u)).width<=o)for(;e.measureText(p.substr(0,u+1)).width<=o;)u++;else for(;u>1&&e.measureText(p.substr(0,--u)).width>o;);u<1&&(u=1),r.push(p.substr(0,u)),c[0]=p.substr(u),c[1]=""}if((h=e.measureText(c.join("")).width)<=o){r.push(c.join(""));break}}return r}}(),o.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},o.prototype._y=function(){var t,e=this._fontSize*this._lines.length;switch(this._data.scaleY&&(e*=this._data.scaleY),t=this._data.points[0].y+this._data.offsetY+e,this._data.vertAlign){case"top":break;case"bottom":t-=e;break
;case"middle":t-=e/2}return t},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(0!==this._data.points.length){switch(e=this._x(),i=this._y(),o=this._fontSize,this._data.scaleY&&(o*=this._data.scaleY),i-=o*(this._lines.length-1),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.horzAlign){case"left":t.textAlign="start";break;case"right":t.textAlign="end";break;case"center":t.textAlign="center"}if(t.translate(e+.5,i+.5),e=0,i=0,o=this._fontSize,this._data.scaleX&&this._data.scaleY&&(n=Math.min(this._data.scaleX,this._data.scaleY),t.scale(n,n)),s=this._calcLinesWidths(),r=s.maxWidth,a=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(l=e,this._data.horzAlign){case"left":break;case"right":l-=r;break;case"center":l-=r/2}h=o*this._lines.length,c=~~(o/6),this._data.backgroundHorzInflate&&(r+=2*this._data.backgroundHorzInflate,l-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(h+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),d={x:Math.floor(l-c),y:Math.floor(i-o),w:Math.ceil(r+2*c),h:Math.ceil(h+2*c)},d.w%2!=0&&d.w++,this._data.padding&&(d.h+=this._data.padding,a=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(t.roundRect(d.x,d.y,d.w,d.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fill()),this._data.borderColor&&(p=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=p,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fillRect(d.x,d.y,d.w,d.h)),this._data.borderColor?(p=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=p,t.strokeRect(d.x-p/2,d.y-p/2,d.w+p,d.h+p)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),f=[3,1],t.dashedLineTo(d.x-.5,_=d.y-.5,u=d.x+d.w+.5,_,f),t.dashedLineTo(u,_,u,_=d.y+d.h+.5,f),t.dashedLineTo(u=d.x-.5,_,d.x+d.w+.5,_,f),t.dashedLineTo(u,d.y-.5,u,_,f),t.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),t.fillStyle=this._data.color,m=0;m<this._lines.length;m++)t.fillText(this._lines[m],e,i),i+=o+a;this._textSizeCache&&(this._textSizeCache.widths=s.widths)}},o.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l;if(0===this._data.points.length)return null;if(e=this._fontSize,this._data.scaleY&&(e*=this._data.scaleY),!(i=this._textSizeCache.widths))return null;for(o=0,n=0;n<i.length;n++)o=Math.max(o,i[n]);return this._data.scaleX&&(o*=this._data.scaleX),s=this._data.points[0].x+this._data.offsetX,r=this._data.points[0].y+this._data.offsetY,"bottom"===this._data.vertAlign&&(r-=this._lines.length*this._fontSize),"middle"===this._data.vertAlign&&(r-=this._lines.length*this._fontSize/2),
"right"===this._data.horzAlign?s-=o:"center"===this._data.horzAlign&&(s-=o/2),a=this._data.backgroundColor||this._data.borderColor?~~(e/6):0,l=this._data.borderColor?~~Math.max(e/12,1):0,t.x>=s-a-l&&t.x<=s+o+a+l&&t.y>=r-l&&t.y<=r+this._lines.length*this._fontSize+2*a+l?this._hittest:null},inherit(n,l),n.prototype.update=function(){this._renderer=null,this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,r,l,h,c,d,u,_;return this._invalidated&&this.updateImpl(),this._renderer?this._renderer:!(t=this._source.priceScale())||t.isEmpty()?(this._renderer=new p,this._renderer):(e={},i=this._source.properties(),n=i.locked&&i.locked.value(),e.points=n?this._source.fixedPoints():this._points,e.text=i.text.value(),e.color=i.color.value(),e.font=i.font.value(),e.offsetX=this._offsetX?this._offsetX:0,e.offsetY=this._offsetY?this._offsetY:0,e.vertAlign=this._vertAlign?this._vertAlign:"top",e.horzAlign=this._horzAlign?this._horzAlign:"left",e.fontsize=i.fontsize.value(),i.fillBackground&&i.fillBackground.value()&&(e.backgroundColor=i.backgroundColor.value(),e.backgroundTransparency=1-i.backgroundTransparency.value()/100||0),i.drawBorder&&i.drawBorder.value()&&(e.borderColor=i.borderColor.value()),i.wordWrap&&i.wordWrap.value()&&(e.wordWrapWidth=i.wordWrapWidth.value()),e.bold=i.bold&&i.bold.value(),e.italic=i.italic&&i.italic.value(),e.highlightBorder=this._model.selectedSource()===this._source,n||!i.fixedSize||i.fixedSize.value()||(e.scaleX=this._source._model.timeScale().barSpacing()/this._source._barSpacing,s=t.height()/t.priceRange().length(),this._source._isPriceDencityLog&&!t.isLog()&&(r=t.priceRange().minValue(),l=t.priceRange().maxValue(),r=t._toLog(r),l=t._toLog(l),h=l-r,s=t.height()/h),!this._source._isPriceDencityLog&&t.isLog()&&(r=t.priceRange().minValue(),l=t.priceRange().maxValue(),r=t._fromLog(r),l=t._fromLog(l),h=l-r,s=t.height()/h),e.scaleY=s/this._source._priceDencity,(!isFinite(e.scaleY)||e.scaleY<=0)&&delete e.scaleY),c=new o(e,this._rendererCache),this.isAnchorsRequired()&&1===e.points.length&&!this._noSelection?(d=e.points[0],u=new p,u.append(c),e.wordWrapWidth&&(_=new a.Point(d.x+e.wordWrapWidth+~~(e.fontsize/6),d.y+(e.lines?e.lines.length*e.fontsize/2+~~(e.fontsize/6):0)),_.data=0,u.append(this.createLineAnchor({points:[_]}))),this._renderer=u,this._renderer):(this._renderer=c,this._renderer))},inherit(s,h),s.MIN_WIDTH=100,s.prototype.setPoint=function(t,e){var i,o,n=this.properties();if(0===t&&n.wordWrapWidth&&n.wordWrapWidth.value()){if(i=n.locked&&n.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),o=this._timeScale.indexToCoordinate(e.index)-i-~~(n.fontsize.value()/6),!isFinite(o))return;n.wordWrapWidth.setValue(Math.max(s.MIN_WIDTH,o))}},s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return $.t("Text")},s.prototype.setPriceScale=function(t){c.prototype.setPriceScale.call(this,t),
@@ -44,7 +44,7 @@ i&&void 0!==o&&o>0&&2!==o&&4!==o&&8!==o)return void r.logDebug("invalid minmove2
}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),h=o.exec(t),h?(n=parseInt(h[1]),s=this._priceScale,(r=this._patchFractPart(parseInt(h[2]),s))>=s||r<0?{error:a.fraction,res:!1}:(i=n+r/s,{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t.prototype._parseAsDoubleFractional=function(t){var i,o,n,s,r,l,h,c,d=RegExp(/^[0-9]+$/),p=d.exec(t);return p?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),p=o.exec(t),p?(n=parseInt(p[1]),s=void 0!==this._minMove2?this._minMove2:NaN,r=this._priceScale/s,l=this._minMove2,h=this._patchFractPart(parseInt(p[2]),r),c=this._patchFractPart(parseInt(p[3]),l),h>=r||h<0?{error:a.fraction,res:!1}:void 0!==l&&c>=l||c<0?{error:a.secondFraction,res:!1}:(i=void 0!==l?n+h/r+c/(r*l):NaN,{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t}(),e.PriceFormatter=l},function(t,e,i){"use strict";function o(t){return t?(window._tv_languages||{})[t]||null:null}function n(){document.body&&document.body.dispatchEvent(new a.CustomEvent("tradingview-i18next-initialized"))}var s,r,a,l,h,c,d,p;i(757),s=i(376),r=i(267),a=i(542),l={translate:s.translationFunction},window.__tradingviewI18nextInited||(h=window.language||null,c=o(h),h&&c||(console.error("No translation data"),h="en",c=o("en")),h&&c?(d={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:h,nsSeparator:":::",resources:(p={},p[h]={translation:c},p)},r.init(d,n),l.translate=r.t.bind(r),s.addTranslationFunctionToWindow(l.translate),s.addTranslationFunctionToJQuery(l.translate)):n(),window.__tradingviewI18nextInited=!0),t.exports=l},,,function(t,e,i){(function(e,o,n,s){"use strict";function r(t,e,i,o){this._study=t,this.m_series=e,this.m_model=i,this._plotName=o,this._visible=!1,this._points=[new it.Point(0,0)],this._invalidated=!0}function a(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:ht.PlotType.Line,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}function l(t,e,i,o){var n,s;return o.isTVScriptStrategy?n="StudyStrategy":(s="study_"+(o.classId||o.shortId),n=s in TradingView?s:"Study"),new TradingView[n](t,e,i,o)}function h(t,e,i,o,n){return c(t,e,i,o,"study_"+t.id,n)}function c(t,e,i,o,n,s){var r,a,l,h,c,d=u(t,e,i,o);for(s instanceof S&&(r=lt.getSourceInputIds(t),r.length>0&&(a=r[0],d.inputs[a]="{pid}$0")),l=new ot(n,d,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),h=0;h<t.inputs.length;++h)c=t.inputs[h],c.isHidden&&(l.addExclusion("inputs."+h),l.addExclusion("inputs."+c.id));return l}function d(t,e,i,o,n,s){return p(t,e,i,o,n,"study_"+t.id,s)}function p(t,e,i,o,n,s,r){var a,l,h,c=_(t,e,i,o,n),d=new ot(s,c,!0);for(d.addExclusion("visible"),d.addExclusion("precision"),d.addExclusion("minTick"),a=e||t,l=0;l<a.inputs.length;++l)h=a.inputs[l],h.isHidden&&(d.addExclusion("inputs."+l),d.addExclusion("inputs."+h.id));return d}function u(t,o,n,s){
var r,a,l,h,c,d,p=i(80);if(lt.versionOf(t)<1)throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");return r=TradingView.clone(defaults("study")),g(r,t),a=TradingView.clone(defaults("study_"+t.id,s)),t.isTVScript&&t.TVScriptSourceCode!==a.TVScriptSourceCode&&(a=TradingView.clone(TradingView.factoryDefaults("study_"+t.id,s))),TradingView.merge(r,a),o&&(ct(!(o instanceof e),"propsState should not be an instance of Property"),TradingView.merge(r,o)),l=v(t),h={},p.mergeInputs(h,l.defaults.inputs),p.mergeInputsObjPart(h,r.inputs),p.mergeInputsArrPart(h,l.inputs),r.inputs=h,delete l.inputs,delete l.defaults.inputs,c={},TradingView.merge(c,l.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+l.id)),TradingView.merge(c,r),TradingView.merge(c,l),delete c.defaults,r=c,d=y(n,t),TradingView.merge(r,b(r,d)),o&&TradingView.merge(r.styles,o.styles),r}function _(t,e,o,n,s){var r,a,l,h,c,d,p=i(80),u=lt.versionOf(t);return t.version&&o.version&&t.version!==o.version&&dt.logWarn("Serialized metaInfo version "+t.version+" is not equal to the saved state version "+o.version),r=TradingView.clone(defaults("study")),0===u?(TradingView.merge(r,TradingView.clone(t)),a=v(t),TradingView.merge(r.inputs,a.inputs)):u>=1&&TradingView.merge(r,TradingView.clone(t.defaults)),TradingView.merge(r,TradingView.factoryDefaults("study_"+t.id)),g(r,t),TradingView.merge(r,o),u>=1&&(TradingView.merge(r,TradingView.clone(t)),delete r.defaults),r=s.updateStudyState(r,t,e),l=e||t,l&&lt.versionOf(l)>=1&&(l=v(l),h={},p.mergeInputs(h,l.defaults.inputs),p.mergeInputs(h,r.inputs),p.mergeInputsArrPart(h,l.inputs),r.inputs=h,delete l.inputs,delete l.defaults.inputs,c={},TradingView.merge(c,l.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+l.id)),TradingView.merge(c,r),TradingView.merge(c,l),delete c.defaults,r=c),d=y(n,l),TradingView.merge(r,b(r,d)),r}function f(t){var e=JSON.stringify(t);return e=e.replace(/'/g,"\\'")}function m(t,e){var i,o,n,s,r,a={};if(e.isTVScript)i=e.defaults.inputs.text,a.text=TVScript.patchILTemplate(i,e,t);else for(o=Object.keys(t),n=o.length-1;n>=0;n--)s=o[n],(r=t[s]?t[s].id:null)&&t[r]&&(a[r]=t[r]);return f(a)}function g(t,e){var i,o,n,s;if(e.plots)for(i=0;i<e.plots.length;i++)o=e.plots[i].id,(n=e.plots[i].type)!==ht.PlotTypes.COLORER&&(s=a(),n===ht.PlotTypes.COLORER&&(s.transparency=0),s.plottype=n,s.title=o,t.styles&&o in t.styles&&TradingView.merge(s,t.styles[o]),t.styles[o]=s)}function v(t){var e,i,o=TradingView.clone(t);if(o.inputs={},t.inputs)for(e=0;e<t.inputs.length;e++)i=t.inputs[e].id,o.inputs[i]=t.inputs[e].defval,o.inputs[e]=t.inputs[e];return o}function y(t,e){var i,o,n,s,r=0;if(t)for(i=0;i<t.dataSources().length;i++)o=t.dataSources()[i],o.metaInfo&&o.metaInfo()&&(n=o.metaInfo().id===e.id,s=(o.metaInfo().pine&&o.metaInfo().pine.version)===(e.pine&&e.pine.version),n&&s&&r++);return r}function b(t,e){var i,o;if(!e)return t;for(i in t.styles)(o=t.styles[i].color)&&(t.styles[i].color=w(o,e));return t}function w(t,e){var i=Q(J(t)),o=i[0]+.05*e
;return i[0]=o-Math.floor(o),et(tt(i))}function S(t,e,s,r){var a,l,h,c,d,p,u,_,f=i(153);this._titleCache={},this._resolvedSymbols={},this._priceAxisViewsBase=[],this._paneViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],W.call(this,t),this.m_data=new at,this._graphics=new Y(r),this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._model=t,this._chartApi=t._chartApi,this._series=s instanceof TradingView.Series?s:this._model.mainSeries(),s instanceof S&&(this._source=s,this._isChildStudy=!0,this._source.setChild(this)),this._numericFormatter=new rt,this._metaInfo=r,this._properties=e,this._properties.listeners().subscribe(this,this.changeStyles),this._properties.visible.listeners().subscribe(this,this.visibleChanged),this._properties.visible.listeners().subscribe(this,this.processHibernate);for(a in this._metaInfo.graphics)for(l in this._metaInfo.graphics[a])h=this._properties.graphics[a][l],h.visible&&h.visible.listeners().subscribe(this,this.processHibernate);if(this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments,this._turnaroundCounter=1,this._turnaround="st"+this._turnaroundCounter,this._status="",this._plotFields=[],c=this.metaInfo().plots)for(d=0,p=c.length;d<p;d++)l=c[d].id,this._plotFields.push(l);this.clearData(),this._studyModified=!1,this._tagsChanged=new o,this.createViews(),u=this,this._handler=function(t){u.onData(t)},this._handler.isTVScriptStrategy=this._metaInfo.isTVScriptStrategy,this._createFormatter(),u=this,this._properties.precision.listeners().subscribe(null,function(){u._createFormatter(),u._model.invalidate(new G(G.FULL_UPDATE))}),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),n.enabled("update_study_formatter_on_symbol_resolve")&&t.mainSeries().onSymbolResolved().subscribe(this,S.prototype._createFormatter),u=this,_={},this._simplePlotsCount=r.plots.filter(function(t,e){if(u.isLinePlot(e))return!0;if(u.isOHLCSeriesPlot(e)){var i=u.metaInfo().plots[e].target;return!_[i]&&(_[i]=i,!0)}return!1}).length,this._properties.showInDataWindow.listeners().subscribe(t,f.prototype.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(t.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache),this.onStart=new o,this._childStudyByRebind=new o}
var T=i(196).StudyBarColorer,C=i(89).HorzLineRenderer,x=i(674),P=x.BandPaneView,L=x.BandBackgroundPaneView,k=x.HlineFillPaneView,I=i(352),A=i(79),E=A.StudyPaneView,M=A.StudyBackgroundPaneView,D=A.StudyPlotShapesPaneView,O=A.StudyPlotCharsPaneView,V=A.StudyPlotArrowsPaneView,B=A.StudyPlotBarsPaneView,R=A.StudyPlotCandlesPaneView,N=i(673),F=N.PlotFillPaneView,z=N.AreaBackgroundPaneView,W=i(48).PriceDataSource,H=i(158),U=i(154).StudyDataWindowView,j=i(156),q=i(8),Y=i(155),G=i(21),K=i(35).parseJSONorNot,X=i(278).ChartApiInterface,Z=i(36),J=Z.parseRgb,Q=Z.rgbToHsl,tt=Z.hslToRgb,et=Z.rgbToHexString,it=i(2),ot=i(7).DefaultProperty,nt=i(27).PriceFormatter,st=i(220).VolumeFormatter,rt=i(26).NumericFormatter,at=i(86),lt=i(25),ht=i(81),ct=i(44).assert,dt=i(12).getLogger("Chart.Study");r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){this._visible=!1;var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._visible=!0,this._points=[new it.Point(0,t.coordinate)],this._color=t.color)},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=q.REGULAR,t.visible=this._visible,new C(t)},inherit(S,W),TradingView.Study=S,i(701),S.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return S;if(o=this._model.timeScale().visibleBars(),o.isEmpty())return S;if(!this.properties().visible.value())return S;if(n=this.properties().styles,s=this.properties().ohlcPlots,n&&n[t]&&(r=n[t]),s&&s[t]&&(r=s[t]),!r||!r.visible.value())return S;if(a=this.offset(t),null==(l=this.nearestIndex(o.lastBar()-a,TradingView.SEARCH_NEAREST_LEFT))||void 0===l)return S;for(c=this.metaInfo().plots,h=0;h<c.length&&!(c[h].id===t||this.isOHLCClosePlot(h)&&c[h].target===t);h++);if(!(d=e?this.data().last().value:this.data().valueAt(l))||!isNumber(d[h+1]))return S;for(p={noData:!1},u=null,_=null,m=0;m<c.length;m++)c[m].target===t&&(this.isSelfColorerPlot(m)||this.isOHLCColorerPlot(m))&&(u=m,_=this.metaInfo().palettes[c[m].palette],f=this.properties().palettes[c[m].palette]);if(g=d[h+1],i&&(p.price=g),this.priceScale().properties().percentage.value()){if(!(v=this.firstValue(!0)))return S;g=this.priceScale().priceRange().convertToPercent(g,v)}return p.text=this.priceScale().formatter().format(g),y=r.color.value(),u&&d.length>u+1?(b=d[u+1],void 0!==b&&null!==b?(w=_.valToIndex?_.valToIndex[b]:b,p.color=f.colors[w].color.value()):p.color=y):p.color=y,p.floatCoordinate=this.priceScale().priceToCoordinate(g,!0),p.coordinate=Math.round(p.floatCoordinate),p.item=d,p},S.prototype.series=function(){return this._series},S.prototype.model=function(){return this._model},S.prototype.clearData=function(){this.m_data=new at(this._plotFields),
var T=i(196).StudyBarColorer,C=i(89).HorzLineRenderer,x=i(674),P=x.BandPaneView,L=x.BandBackgroundPaneView,k=x.HlineFillPaneView,I=i(352),A=i(79),E=A.StudyPaneView,M=A.StudyBackgroundPaneView,D=A.StudyPlotShapesPaneView,O=A.StudyPlotCharsPaneView,V=A.StudyPlotArrowsPaneView,B=A.StudyPlotBarsPaneView,R=A.StudyPlotCandlesPaneView,N=i(673),F=N.PlotFillPaneView,z=N.AreaBackgroundPaneView,W=i(48).PriceDataSource,H=i(158),U=i(154).StudyDataWindowView,j=i(156),q=i(8),Y=i(155),G=i(21),K=i(35).parseJSONorNot,X=i(278).ChartApiInterface,Z=i(37),J=Z.parseRgb,Q=Z.rgbToHsl,tt=Z.hslToRgb,et=Z.rgbToHexString,it=i(2),ot=i(7).DefaultProperty,nt=i(27).PriceFormatter,st=i(220).VolumeFormatter,rt=i(26).NumericFormatter,at=i(86),lt=i(25),ht=i(81),ct=i(44).assert,dt=i(12).getLogger("Chart.Study");r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){this._visible=!1;var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._visible=!0,this._points=[new it.Point(0,t.coordinate)],this._color=t.color)},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=q.REGULAR,t.visible=this._visible,new C(t)},inherit(S,W),TradingView.Study=S,i(701),S.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return S;if(o=this._model.timeScale().visibleBars(),o.isEmpty())return S;if(!this.properties().visible.value())return S;if(n=this.properties().styles,s=this.properties().ohlcPlots,n&&n[t]&&(r=n[t]),s&&s[t]&&(r=s[t]),!r||!r.visible.value())return S;if(a=this.offset(t),null==(l=this.nearestIndex(o.lastBar()-a,TradingView.SEARCH_NEAREST_LEFT))||void 0===l)return S;for(c=this.metaInfo().plots,h=0;h<c.length&&!(c[h].id===t||this.isOHLCClosePlot(h)&&c[h].target===t);h++);if(!(d=e?this.data().last().value:this.data().valueAt(l))||!isNumber(d[h+1]))return S;for(p={noData:!1},u=null,_=null,m=0;m<c.length;m++)c[m].target===t&&(this.isSelfColorerPlot(m)||this.isOHLCColorerPlot(m))&&(u=m,_=this.metaInfo().palettes[c[m].palette],f=this.properties().palettes[c[m].palette]);if(g=d[h+1],i&&(p.price=g),this.priceScale().properties().percentage.value()){if(!(v=this.firstValue(!0)))return S;g=this.priceScale().priceRange().convertToPercent(g,v)}return p.text=this.priceScale().formatter().format(g),y=r.color.value(),u&&d.length>u+1?(b=d[u+1],void 0!==b&&null!==b?(w=_.valToIndex?_.valToIndex[b]:b,p.color=f.colors[w].color.value()):p.color=y):p.color=y,p.floatCoordinate=this.priceScale().priceToCoordinate(g,!0),p.coordinate=Math.round(p.floatCoordinate),p.item=d,p},S.prototype.series=function(){return this._series},S.prototype.model=function(){return this._model},S.prototype.clearData=function(){this.m_data=new at(this._plotFields),
this._graphics=new Y(this._metaInfo),this._plotOffsets={}},S.prototype.onTagsChanged=function(){return this._tagsChanged},S.prototype.properties=function(){return this._properties},S.prototype.state=function(t){var e,i,o,n,s=TradingView.className(this.constructor),r={type:s,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof lt?r.metaInfo=TradingView.clone(this.metaInfo().state()):(r.metaInfo=TradingView.clone(this.metaInfo()),r.metaInfo.id=lt.parseIdString(r.metaInfo.id+(r.metaInfo.version?"-"+r.metaInfo.version:"")).fullId),t&&(r.data=this.m_data.state(),r.data.symbols=this._resolvedSymbols,r.data.graphics=this._graphics.graphics(),r.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(r.ownerSource=this.ownerSource().id()),e=0;e<this._metaInfo.inputs.length;e++)"bar_time"===this._metaInfo.inputs[e].type&&(i=this._metaInfo.inputs[e].id,(o=r.state.inputs[i])<0&&(n=this._rightOffsetToUnixTime(-o),r.state.inputs[i]=n&&n>=0?n:0));return this._isChildStudy&&lt.patchChildStudyMetaInfoState(r),r},S.prototype.dependenciesForAlerts=function(t){var e=this;return this.getAllOwnerSources().filter(function(t){return t instanceof TradingView.Study}).map(function(i){var o,n,s=i.inputs({onlyAtomValues:t}),r=TradingView.StudyMetaInfo.cutDollarHash(i._metaInfo.fullId);return"tv-scripting"===i._metaInfo.productId&&(o=TradingView.StudyMetaInfo.findStudyMetaInfo(e._model._studiesMetaData,"Script@tv-scripting").fullId,r=o),t||(r+="!"),n={id:i._studyId,study:r,inputs:s},t&&null!=i._metaInfo.pine&&(n.scriptIdPart=i._metaInfo.scriptIdPart,n.scriptVersion=i._metaInfo.pine.version),n})},S.prototype.stateForAlert=function(){var t,e,i,o=this,n=this._metaInfo,s=this.inputs({onlyAtomValues:!0});return s.text&&(t=s.text,s.text=TVScript.patchILTemplate(t,this._metaInfo,s)),e=[ht.PlotTypes.LINE,ht.PlotTypes.SHAPES,ht.PlotTypes.CHARS,ht.PlotTypes.ARROWS,ht.PlotTypes.OHLC_OPEN,ht.PlotTypes.OHLC_HIGH,ht.PlotTypes.OHLC_LOW,ht.PlotTypes.OHLC_CLOSE],i=n.plots.map(function(t,e){return t.pinePlotIndex=e,t}).filter(function(t){return-1!==e.indexOf(t.type)}).map(function(t){var e={id:t.id,type:t.type,pinePlotIndex:t.pinePlotIndex,offset:o.offset(t.id)};return n.styles&&void 0!==n.styles[t.id]&&(e.title=n.styles[t.id].title||""),t.target&&n.ohlcPlots&&n.ohlcPlots[t.target]&&(e.ohlcTitle=n.ohlcPlots[t.target].title),e}),{id:this.id(),uniqueId:this.uniqueId(),type:TradingView.className(this.constructor),title:TradingView.clean(this.title(),!0),shortTitle:TradingView.clean(this.title(!0),!0),shortDescription:TradingView.clean(n.shortDescription||"Study",!0),fullId:n.fullId,isTVScript:n.isTVScript,scriptIdPart:n.scriptIdPart,scriptVersion:n.pine?n.pine.version:"-1",plots:i,inputs:s,alerts:n.alerts,callStudyDependencies:f(this.dependenciesForAlerts(!0))}},S.prototype.uniqueId=function(){var t=this.inputsForAlert();return t=JSON.stringify(t).replace(/\W/g,""),this.id()+"|"+t},S.prototype.isSavedInStudyTemplates=function(){
for(var t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type)return!1;return!0},S.prototype.restoreData=function(t){this.m_data.restoreState(t),this._resolvedSymbols=t.symbols,this._graphics.setGraphics(t.graphics),this._postProcessGraphics(),this._plotOffsets=t.plotOffsets},S.prototype.restart=function(){this._restarting=!0,this.clearData(),n.enabled("stop_study_on_restart")&&this.stop(),setTimeout(this.start.bind(this),0)},S.prototype.stop=function(t){if(!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].stop(!0);this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),n.enabled("update_study_formatter_on_symbol_resolve")&&this._model.mainSeries().onSymbolResolved().unsubscribe(this,S.prototype._createFormatter),this._studyId=null,this.clearData(),this._unsubscribeExtendedHours(),this.recalculate()},S.prototype._resolveSymbol=function(t){var e=function e(i,o){this._chartApi.resolveSymbol(this._makeNextSymbolId(),i,function(i){switch(i.method){case"symbol_resolved":this._resolvedSymbols[t]=i.params[1],this.invalidateTitleCache(!0),o.resolve(t);break;case"symbol_error":if("permission denied"===i.params[1]&&i.params[2])switch(i.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(i.params[3])return void e(i.params[3],o);break;default:return void e(i.params[2],o)}o.reject(t)}}.bind(this))}.bind(this),i=$.Deferred();return e(t,i),i.promise()},S.prototype._allSymbolsAreResolved=function(){var t,e,i,o,n=$.Deferred(),s=[];for(t=0;t<this._metaInfo.inputs.length;t++)"symbol"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,i=this._properties.inputs[e].value(),this._resolvedSymbols[i]||(o=this._resolveSymbol(i),s.push(o)));return s.length>0?$.when.apply($,s).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),n.resolve("All symbols are resolved now")}.bind(this)).fail(function(t){this._status=$.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),n.reject("Invalid symbol, "+t)}.bind(this)):n.resolve("There are no symbols to resolve"),n.promise()},S.prototype._allInputsAreValid=function(){var t,e,i;for(t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,void 0===(i=this._properties.inputs[e].value())||null==i))return!1;return!0},S.prototype.sourceId=function(){return this._studyId},S.prototype.source=function(){return this._source||this._series},S.prototype.ownerSource=function(){return this._isChildStudy?this._source:W.prototype.ownerSource.call(this)},S.prototype.getAllOwnerSources=function(){for(var t=[],e=this.ownerSource();null!=e;)t.push(e),e=e.ownerSource();return t},S.prototype.isChildStudy=function(){return!!this._isChildStudy},S.prototype.setChild=function(t){t instanceof S&&t.source()===this&&(this._children||(this._children=[]),-1===this._children.indexOf(t)&&this._children.push(t))},S.prototype.unsetChild=function(t){
if(t instanceof S&&t.source()===this&&this._children){var e=this._children.indexOf(t);~e&&this._children.splice(e,1)}},S.prototype.hasChildren=function(){return!(!this._children||!this._children.length)},S.prototype.getAllChildren=function(){var t,e,i,o;if(!Array.isArray(this._children))return[];for(t=this._children.slice(),e=0;e<t.length;++e)for(i=t[e].getAllChildren(),o=0;o<i.length;++o)~t.indexOf(i[o])||t.push(i[o]);return t},S.prototype._debugId=function(){var t=[];return this._studyId&&t.push(this._studyId),t.push(this._metaInfo.fullId),t.push(this._metaInfo.description),JSON.stringify({study:t})},S.prototype.isStarted=function(){return!!this._studyId},S.prototype.isRestarting=function(){return!!this._restarting},S.prototype.isVisible=function(){var t,e,i,o;if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)for(t=0;t<this._metaInfo.plots.length;t++)if(!(e=this.properties().plots[t].visible)||e.value())return!0;for(i in this._metaInfo.graphics)for(o in this._metaInfo.graphics[i])if(e=this.properties().graphics[i][o],!e.visible||e.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},S.prototype.start=function(t,e){var i,o=this._model.mainSeries();if(!o.isStarted())return void o.onCompleted().subscribe(this,function(){this.start(t,e)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==e||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(t,e)}.bind(this)).fail(function(t){dt.logError("ERROR: "+this._debugId()+" start failed, "+t),delete this._restarting}.bind(this))},S.prototype._startAfterSymbolsResolved=function(t,e){var i,o;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);lt.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=S.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._metaInfo.id+"-"+(this._metaInfo.version||"1"),i=lt.cutDollarHash(i),(i.startsWith("Script@tv-scripting")||i.startsWith("StrategyScript@tv-scripting")||i.startsWith("ESD@tv-scripting"))&&(i+="!"),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),this.onStart.fire(this._studyId),!0===t&&this._children))for(o=0;o<this._children.length;++o)this._children[o].start(!0,e)}},S._nextSymbolId=0,S.prototype._makeNextSymbolId=function(){return"ss_"+ ++S._nextSymbolId},S._nextStudyId=0,S.makeNextStudyId=function(){return"st"+ ++S._nextStudyId},S.prototype._rightOffsetToUnixTime=function(t){
@@ -57,32 +57,32 @@ i=0;i<n.length;i+=1)if(n[i].data)for(o=0;o<n[i].data.length;o+=1)r.push(new S.St
!isNumber(g))continue;f.baseValue=g}a.push(f)}if(v=o.m_data.minMaxOnRange2(t,e,a),r&&(a=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],y=o.series().data().bars().minMaxOnRange2(t,e,a),v.min=null==v.min||void 0===v.min?y.min:Math.min(v.min,y.min),v.max=null==v.max||void 0===v.max?y.max:Math.max(v.max,y.max)),null!==v.min&&(i=new s(v.min,v.max)),n.bands)for(h=0;h<n.bands.length;h++)if(o.properties().bands[h].visible.value()){if(g=o.properties().bands[h].value.value(),!isNumber(g))continue;i?i.apply(g,g):i=new s(g,g)}return i&&i.minValue()===i.maxValue()&&(b=.005*i.minValue(),i=new s(i.minValue()-b,i.maxValue()+b)),w=this.priceScale(),w&&w.properties().percentage.value()&&i?(S=this.firstValue(),S?i.convertToPercents(S):null):w&&w.isLog()&&i?new s(o.priceScale().priceToLogical(i.minValue()),o.priceScale().priceToLogical(i.maxValue())):i},S.prototype.paneViews=function(t){return this.properties().visible.value()?this._paneViews:null},S.prototype.dataWindowView=function(){return this._dataWindowView},S.prototype.statusView=function(){return this._statusView},S.prototype.priceAxisViews=function(t,e){return this._model.paneForSource(this)===t&&e===this.priceScale()&&(this._showLastValueOnPriceScale()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},S.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showStudyLastValue.value()},S.prototype.isLinePlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.LINE},S.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===ht.PlotTypes.COLORER},S.prototype.isSelfColorerPlot=function(t){return S.isSelfColorerPlot(this,t)},S.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.TEXT_COLORER},S.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.BAR_COLORER},S.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.BG_COLORER},S.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.SHAPES},S.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.CHARS},S.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.ARROWS},S.prototype.isOHLCBarsPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===ht.OHLCType.BARS},S.prototype.isOHLCCandlesPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===ht.OHLCType.CANDLES},S.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type;return e===ht.PlotTypes.OHLC_OPEN||e===ht.PlotTypes.OHLC_HIGH||e===ht.PlotTypes.OHLC_LOW||e===ht.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCOpenPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.OHLC_OPEN},S.prototype.isOHLCHighPlot=function(t){
return this._metaInfo.plots[t].type===ht.PlotTypes.OHLC_HIGH},S.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.OHLC_LOW},S.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.OHLC_COLORER},S.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===ht.PlotTypes.DATAOFFSET},S.prototype.hasBarColorer=function(){for(var t=0;t<this._metaInfo.plots.length;++t)if(this.isBarColorerPlot(t))return!0;return!1},S.prototype.barColorer=function(){var t,e,i=null;for(t=0;t<this._metaInfo.plots.length;++t)this.isBarColorerPlot(t)&&(e=new T(this,t),null==i?i=e:i.pushBackBarColorer(e));if(null==i)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return i},S.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0},S.prototype._createFormatter=function(){var t,e,i;"default"===this.properties().precision.value()?this.metaInfo().defaults&&(t=parseInt(this.metaInfo().defaults.precision)):t=parseInt(this.properties().precision.value()),isFinite(t)||(t=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1e4),e=this.series().symbolInfo(),0===t?(i=0,e&&(i=e.volume_precision?e.volume_precision:e.has_fractional_volume?2:0),this._formatter=new st(i)):this._formatter=new nt(Math.pow(10,t)),this.priceScale()&&this.priceScale().updateFormatter()},S.prototype.formatter=function(){return this._formatter},S.prototype.nearestIndex=function(t,e){if(!TradingView.isInteger(t))return void dt.logDebug("Study.nearestIndex: incorrect logicalPoint");var i=this._series.data().bars().search(t,e);return i?i.index:void 0},S.prototype.updateAllViews=function(){var t;for(t=0;t<this._paneViews.length;t++)this._paneViews[t].update();for(this._dataWindowView.update(),this._statusView.update(),t=0;t<this._priceAxisViews.length;t++)this._priceAxisViews[t].update()},S.prototype.tags=function(){return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]},S.isPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":case"mtp_tsanalysis@mtp-mtpredictor":case"mtp_riskreward@mtp-mtpredictor":case"mtp_decisionpoint@mtp-mtpredictor":case"mtp_ew_main@mtp-mtpredictor":case"mtp_ew_major@mtp-mtpredictor":case"mtp_ew_minor@mtp-mtpredictor":case"mtp_wpt_down1ora@mtp-mtpredictor":case"mtp_wpt_down2orb@mtp-mtpredictor":case"mtp_wpt_down3@mtp-mtpredictor":case"mtp_wpt_down4@mtp-mtpredictor":case"mtp_wpt_down5@mtp-mtpredictor":case"mtp_wpt_downc@mtp-mtpredictor":case"mtp_wpt_up1ora@mtp-mtpredictor":case"mtp_wpt_up2orb@mtp-mtpredictor":case"mtp_wpt_up3@mtp-mtpredictor":case"mtp_wpt_up4@mtp-mtpredictor":case"mtp_wpt_up5@mtp-mtpredictor":case"mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}},
S.lineToolNameForPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case"RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case"mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case"mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case"mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case"mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case"mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";case"mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case"mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case"mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case"mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case"mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case"mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case"mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case"mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";case"mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case"mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case"mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case"mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case"mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+t)}},S.isStudyLineTool=function(t){var e=i(78).StudyLineDataSource,o=TradingView[t];return"function"==typeof o&&o.prototype instanceof e},S.prototype.onExtendedHoursChanged=function(){this.restart()},S.prototype.hasSymbolInputs=function(){for(var t=this._metaInfo.inputs.length;t--;)if("symbol"===this._metaInfo.inputs[t].type)return!0;return!1},S.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)},S.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)},S.prototype.removeByRemoveAllStudies=function(){return!0},S.prototype.canHaveChildren=function(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!lt.canHaveChildren(this._metaInfo)),this._canHaveChildren},S.getInputRebindType=function(t,e,i){var o=lt.isSourceInput(t);return o&&!~e.indexOf("$")&&~i.indexOf("$")?X.REBIND_STUDY_STANDALONE_TO_CHILD:o&&~e.indexOf("$")&&!~i.indexOf("$")?X.REBIND_STUDY_CHILD_TO_STANDALONE:0},S.prototype.getPlotFields=function(){return this._plotFields},t.exports={Study:S,createStudy:l,prepareCallStudyArgs:m,prepareStudyProperties:h,prepareStudyPropertiesForLoadChart:d,prepareStudyPropsStateForLoadChart:_,shiftColor:w}}).call(e,i(24),i(15),i(3),i(107))},function(t,e,i){"use strict";function o(t){var e=r.parseRgb(t),i=e.map(function(t){return t>50?t-50:0})
;return r.rgbToString(i)}function n(t){var e,i,o,n=[];for(e=0,i=t;e<i.length;e++)o=i[e],null!==r.tryParseRgb(o)&&n.push(o);return n}function s(t,e){void 0===e&&(e={});var i=$('<span class="tvcolorpicker-container">');return null!==t&&i.appendTo(t),void 0!==e.addClass&&i.addClass(e.addClass),$('<div class="tvcolorpicker-transparency">').appendTo(i),$('<input class="colorpicker-widget">').tvcolorpicker({customColors:n(a.getJSON("pickerCustomColors",[])),direction:e.direction,hideTransparency:!!e.hideTransparency}).on("change",function(){$(this).css("border-color",o($(this).val()||l))}).bind("customcolorchange",function(t,e){a.setJSON("pickerCustomColors",e)}).appendTo(i),i}var r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(17),i(360),r=i(36),a=i(69),l="#727272",e.addColorPicker=s},function(t,e,i){"use strict";function o(t,e,i){var o,r,h,c,d,p;if(s.enabled("charting_library_base")){for(e=e||t||i||"",o="",r=0;r<l.length;r++)if((h=e.match(l[r]))&&3===h.length){e=h[1],o=h[2];break}return void n.emit(e.toLowerCase().replace(" ","_"),{category:t,label:i,value:o})}c=(t?t+":":"")+e,i&&(c+=i),a.logNormal(c),d=window._gaq,window._UNIT_TESTS||void 0===d||(p=["_trackEvent",t,e],void 0!==i&&p.push(i),d.push(p))}var n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(34),s=i(3),r=i(12),a=r.getLogger("Common.TrackEvent"),l=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],e.trackEvent=o,window.TradingView=window.TradingView||{},window.TradingView.trackEvent=o},function(t,e,i){"use strict";function o(t,e,i){c[t].unsubscribe(i,e)}function n(t,e,i){s(t,e,i)}function s(t,e,i,o){if(c.hasOwnProperty(t)||(c[t]=new h),p[t])return void e.call(i);c[t].subscribe(i,e,o)}function r(t){d.push(t)}function a(t){var e,i,o=[];for(e=1;e<arguments.length;e++)o[e-1]=arguments[e];i=[t].concat(o),d.forEach(function(t){t.apply(null,i)}),c.hasOwnProperty(t)&&c[t].fire.apply(c[t],o)}function l(t){p[t]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+t+")"),p[t]=!0,a.apply(null,arguments)}var h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),h=i(15),c={},d=[],p={},e.unsubscribe=o,e.on=n,e.subscribe=s,e.subscribeToAll=r,e.emit=a,e.emitOnce=l},function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}function s(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function r(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")}function a(t){
;return r.rgbToString(i)}function n(t){var e,i,o,n=[];for(e=0,i=t;e<i.length;e++)o=i[e],null!==r.tryParseRgb(o)&&n.push(o);return n}function s(t,e){void 0===e&&(e={});var i=$('<span class="tvcolorpicker-container">');return null!==t&&i.appendTo(t),void 0!==e.addClass&&i.addClass(e.addClass),$('<div class="tvcolorpicker-transparency">').appendTo(i),$('<input class="colorpicker-widget">').tvcolorpicker({customColors:n(a.getJSON("pickerCustomColors",[])),direction:e.direction,hideTransparency:!!e.hideTransparency}).on("change",function(){$(this).css("border-color",o($(this).val()||l))}).bind("customcolorchange",function(t,e){a.setJSON("pickerCustomColors",e)}).appendTo(i),i}var r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(17),i(360),r=i(37),a=i(69),l="#727272",e.addColorPicker=s},function(t,e,i){"use strict";function o(t,e,i){var o,r,h,c,d,p;if(s.enabled("charting_library_base")){for(e=e||t||i||"",o="",r=0;r<l.length;r++)if((h=e.match(l[r]))&&3===h.length){e=h[1],o=h[2];break}return void n.emit(e.toLowerCase().replace(" ","_"),{category:t,label:i,value:o})}c=(t?t+":":"")+e,i&&(c+=i),a.logNormal(c),d=window._gaq,window._UNIT_TESTS||void 0===d||(p=["_trackEvent",t,e],void 0!==i&&p.push(i),d.push(p))}var n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(34),s=i(3),r=i(12),a=r.getLogger("Common.TrackEvent"),l=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],e.trackEvent=o,window.TradingView=window.TradingView||{},window.TradingView.trackEvent=o},function(t,e,i){"use strict";function o(t,e,i){c[t].unsubscribe(i,e)}function n(t,e,i){s(t,e,i)}function s(t,e,i,o){if(c.hasOwnProperty(t)||(c[t]=new h),p[t])return void e.call(i);c[t].subscribe(i,e,o)}function r(t){d.push(t)}function a(t){var e,i,o=[];for(e=1;e<arguments.length;e++)o[e-1]=arguments[e];i=[t].concat(o),d.forEach(function(t){t.apply(null,i)}),c.hasOwnProperty(t)&&c[t].fire.apply(c[t],o)}function l(t){p[t]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+t+")"),p[t]=!0,a.apply(null,arguments)}var h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),h=i(15),c={},d=[],p={},e.unsubscribe=o,e.on=n,e.subscribe=s,e.subscribeToAll=r,e.emit=a,e.emitOnce=l},function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}function s(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function r(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")}function a(t){
if(null===t||void 0===t)throw Error("Object is not defined");return t}var l,h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t){return"object"==typeof t&&null!==t},d=function(t){return c(t)&&-1!==(""+t.constructor).indexOf("function Object")};"undefined"!=typeof window?(l=window.TradingView=window.TradingView||{},window.isNumber=e,window.isFunction=o,window.inherit=n,window.isArray=h):l=this.TradingView=this.TradingView||{},l.isNaN=function(t){return!(t<=0||t>0)},l.isAbsent=function(t){return null===t||void 0===t},l.isExistent=function(t){return null!==t&&void 0!==t},Number.isNaN=Number.isNaN||function(t){return t!=t},l.isSameType=function(t,e){return Number.isNaN(t)||Number.isNaN(e)?Number.isNaN(t)===Number.isNaN(e):{}.toString.call(t)==={}.toString.call(e)},l.isInteger=function(t){return"number"==typeof t&&t%1==0},l.parseBool=function(t){return!0===t||"true"===t},l.isBoolean=function(t){return!0===t||!1===t},l.isString=function(t){return null!==t&&void 0!==t&&t.constructor===String},l.isInherited=function(t,e){return t===e||!(!t||!t.prototype)&&(void 0!==t.prototype.superclass&&null!==t.prototype.superclass&&(t.prototype.superclass===e||l.isInherited(t.prototype.superclass,e)))},l.TypeValidator=function(t){this.m_type=t},l.TypeValidator.prototype.check=function(t){return t.constructor===this.m_type||l.isInherited(t.constructor,this.m_type)},l.PredicateValidator=function(t){this.m_predicate=t},l.PredicateValidator.prototype.check=function(t){return this.m_predicate(t)},l.clone=function(t){var e,i,o;if(!t||"object"!=typeof t)return t;e="function"==typeof t.pop?[]:{};for(i in t)t.hasOwnProperty(i)&&(o=t[i],e[i]=o&&"object"==typeof o?l.clone(o):o);return e},l.deepEquals=function(t,e,i){var n,s,r,a,c;if(i||(i=""),t===e)return[!0,i];if(o(t)&&(t=void 0),o(e)&&(e=void 0),void 0===t&&void 0!==e)return[!1,i];if(void 0===e&&void 0!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if("object"!=typeof t&&"object"!=typeof e)return[t===e,i];if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,s=e.length,n!==s)return[!1,i];for(r=0;r<n;r++)if(a=l.deepEquals(t[r],e[r],i+"["+r+"]"),!a[0])return a;return[!0,i]}if(h(t)||h(e))return[!1,i];for(c in t)if(a=l.deepEquals(t[c],e[c],i+"["+c+"]"),!a[0])return a;return[!0,i]},l.merge=function(t,e){for(var i in e)"object"==typeof e[i]&&t.hasOwnProperty(i)?l.merge(t[i],e[i]):t[i]=e[i];return t},l.mergeObj=function(t,e){for(var i in e)e[i].constructor===Object&&t.hasOwnProperty(i)?l.mergeObj(t[i],e[i]):t[i]=e[i];return t},l.mergeWithRules=function(t,e,i,o){var n,s;for(n in e)s=o?o+"."+n:n,i&&s in i?t[n]=i[s](t[n],e[n]):"object"==typeof e[n]&&t.hasOwnProperty(n)?l.merge(t[n],e[n],i,s):t[n]=e[n]},l.sortMultipleFunction=function(){var t=[].slice.call(arguments),e=t.length;return function(i,o){var n,s,r,a,l,h,c;for(c=0;c<e&&(h=0,r=t[c],a="string"==typeof r?r:r.name,n=i[a],s=o[a],"function"==typeof r.fn&&(n=r.fn(n),s=r.fn(s)),l=r.reverse?-1:1,n<s&&(h=-1*l),n>s&&(h=1*l),0===h);c++);return h}},
void 0!==t&&t&&t.exports&&(t.exports={inherit:n,clone:l.clone,merge:l.merge,isNumber:e,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:c,isHashObject:d,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:h,parseBool:l.parseBool,parseJSONorNot:i,ensure:a,declareClassAsPureInterface:s,requireFullInterfaceImplementation:r})}).call(e,i(50)(t))},,,,,function(t,e,i){(function(t){"use strict";function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,s=this._owner?this._owner:this;if("function"==typeof s.hook&&(t=s.hook(t)),s.writeLock)return s._value;if(!e&&s._value===t&&s.hasOwnProperty("_value"))return t;for(s._value=t,i=s._listeners.slice(),o=0,n=0;n<i.length;n++)i[n].once&&(s._listeners.splice(n-o,1),o++),i[n].cb(t);return t},i.prototype.deleteValue=function(){var t,e,i,o=this._owner?this._owner:this;if(o.hasOwnProperty("_value")){if(o.writeLock)return o._value;for(delete o._value,t=o._listeners.slice(),e=0,i=0;i<t.length;i++)t[i].once&&(o._listeners.splice(i-e,1),e++),t[i].cb()}},i.prototype.subscribe=function(t,e){var i,o,n;if("function"!=typeof t)throw new TypeError("callback must be a function");i=!!e&&!!e.once,o=!!e&&!!e.callWithLast,n=this._owner?this._owner:this,o&&n.hasOwnProperty("_value")&&(t(n._value),i)||n._listeners.push({cb:t,owner:this,once:!!e&&!!e.once})},i.prototype.unsubscribe=function(t){var e,i,o=this._owner?this._owner:this;for(void 0===t&&(t=null),e=o._listeners,i=e.length;i--;)e[i].owner!==this&&o!==this||e[i].cb!==t&&null!==t||e.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var t=this._readonlyInstance=new e;return t.subscribe=this.subscribe.bind(this),t.unsubscribe=this.unsubscribe.bind(this),t.value=this.value.bind(this),t.when=this.when.bind(this),t.spawn=function(){return this.spawn().readonly()}.bind(this),t},i.prototype.spawn=function(){var t=new i;return delete t._listeners,t._owner=this._owner||this,t.destroy=function(){this.unsubscribe(),delete this._owner},t},i.prototype.when=function(t){var e,i=this;if(this.value())return void t();e=function(o){o&&(i.unsubscribe(e),t())},i.subscribe(e)},i.prototype.opposite=function(){var t,e;return this._opposite||(t=this,e=new i(!this.value()),this.subscribe(function(t){e.setValue(!t)}),e.subscribe(function(e){t.setValue(!e)}),this._opposite=e),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(50)(t))},function(t,e,i){(function(e,o,n){"use strict";function s(t){return"cursor"===t||"arrow"===t||"dot"===t}function r(t){!t&&d&&d.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(t,e){return function(e){t.inFire||(t.inFire=!0,t.fire(e),t.inFire=!1)}}function l(){
K||(g.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),g.subscribe(function(t){s(t)&&v.setValue(t)},{callWithLast:!0}),v.subscribe(function(t){t&&TVSettings.setValue("chart.cursorPreference",t)}),d=new h("drawings"),p=new n,u=new n,_=new n,f=new n,p.setValue(!1),u.setValue(!1),_.setValue(!1),f.setValue(!1),g.subscribe(function(){c.emit("onSelectedLineToolChanged")}),K=!0)}var h=i(7).DefaultProperty,c=i(34),d=null,p=null,u=null,_=null,f=null,m=new e,g=new e,v=new e,y=new o,b=new o,w=new o,S=new o,T=new o,C=new o,x=new o,P=new o,L=new o,k=new o,I=new o,A=new o,E=new o,M=new o,D=new o,O=a(y),$=a(b),V=a(w),B=a(S),R=a(T),N=a(C),F=a(x),z=a(P),W=a(L),H=a(k),U=a(I),j=a(A),q=a(E),Y=a(M),G=a(D),K=!1;t.exports={tool:g,cursorTool:v,toolIsCursor:s,resetToCursor:r,init:l,createdLineTool:y,continuedLineTool:b,cancelledLineTool:w,createLineTool:O,continueLineTool:$,cancelLineTool:V,startedMovingLineTool:S,movedLineTool:T,finishedMovingLineTool:C,startMovingLineTool:B,moveLineTool:R,finishMovingLineTool:N,startedChangingLineTool:x,changedLineTool:P,finishedChangingLineTool:L,startChangingLineTool:F,changeLineTool:z,finishChangingLineTool:W,removedLineTool:k,removeLineTool:H,restoredLineTool:M,restoreLineTool:Y,restoredLineToolState:D,restoreLineToolState:G,finishedLineTool:I,finishLineTool:U,changedLineStyle:A,changeLineStyle:j,copiedLineTool:E,copyLineTool:q,properties:function(){return d},hideAllDrawings:function(){return p},hideMarksOnBars:function(){return _},lockDrawings:function(){return u},drawOnAllCharts:function(){return d.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(e,i(40),i(15),i(24))},function(t,e,i){(function(e,o,n,s){"use strict";function r(t){this._series=t,this._model=t.m_model,this._points=[new D.Point(0,0)],this._invalidated=!0}function a(){return{count:TradingView.DEFAULT_BAR_COUNT}}function l(t,n,s){var u,_=i(153);x.call(this,t),this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._symbolResolved=new e,this._symbolError=new e,this._symbolNotPermitted=new e,this._symbolGroupNotPermitted=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this._extendedHoursNotPermitted=new e,this.chartTypeNotPermitted=new e,this.intradaySpreadNotPermitted=new e,this.intradayExchangeNotPermitted=new e,this.customIntervalNotPermitted=new e,this.chartWidgetInitialized=new e,this._startLoading=new e,this._dataLoaded=new e,this._tickmarksRangeChanged=new e,this._barReceived=new e,this._onChangedStyle=new e,this._onCompleted=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this.priceScaleChanged=new e,this._requestOptions=s||a(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new E(this,t),this.setProperties(n),this._prevChartStyle=n.style.value(),this.createPaneView(),this._dataWindowView=new p(this,t),this._statusView=new h(this,t.properties()),
this._priceAxisViews=[new d(this,t),new c(this,t)],this._symbolInfo=null,this._status=l.STATUS_OFFLINE,this._syncModel=null,u=this,this._turnaroundCounter=1,this._turnaround="s"+this._turnaroundCounter,this._handler=function(t){u.onData(t)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new V(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new o,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,l.prototype._recreateFormatter),u=this,this.properties().minTick.listeners().subscribe(null,function(){u.m_model.invalidate(new M(M.FULL_UPDATE))}),this._priceLineView=new r(this),this._gotoDateView=new C(this),this.bindStyleChange(),this.bindJapChartsInputs(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()}),this._extendedHoursNotPermitted.subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==l.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,l.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V,B,R,N,F,z,W,H,U,j;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,TradingView.SEARCH_FROM_LEFT=-1,TradingView.SEARCH_FROM_RIGHT=1,h=i(699),c=i(696),d=i(347),p=i(698),u=i(346),_=u.SeriesAreaPaneView,f=u.SeriesLinePaneView,m=u.SeriesHollowCandlesPaneView,g=u.SeriesCandlesPaneView,v=u.SeriesBarsPaneView,y=u.SeriesHeikenAshiPaneView,b=i(3),w=i(304),S=i(196).SeriesBarColorer,T=i(89).HorzLineRenderer,C=i(685),x=i(48).PriceDataSource,P=i(158),L=i(700).FutureBarsPaneView,k=i(43).Interval,I=i(8),A=i(198),E=i(345),M=i(21),D=i(2),O=i(285),V=i(27).PriceFormatter,B=i(86),R=i(25),N=i(356).SyncModel,F=i(33).trackEvent,z=i(164).translatedIntervalString,W=i(60),H=i(12),U=H.getLogger("Chart.Series"),j=H.getLogger("Chart.Series.Updates",{highRate:!0}),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){if(this._visible=!1,this._series.properties().showPriceLine.value()){var t=this._series.lastValueData(TradingView.CLOSE_PLOT,!0);t.noData||(this._visible=!0,this._points=[new D.Point(0,t.coordinate)],this._color=t.color)}},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().priceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=I.REGULAR,t.visible=this._visible,new T(t)},inherit(l,x),
l.prototype.endOfData=function(){return this._endOfData},l.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},l.prototype._onChangeShowCountdown=function(t){var e=this;t.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){e.isDWM()||(e._priceAxisViews[0].update(),e.m_model.invalidate(new M(M.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},l.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return u;if(o=this.m_model.timeScale().visibleBars(),o.isEmpty())return u;if(e){if(null===(r=this.data().bars().last())||void 0===r)return u;n=r.value,s=parseInt(r)}else{if(null===(a=this.data().bars().search(o.lastBar(),TradingView.SEARCH_NEAREST_LEFT))||void 0===a)return u;n=this.data().bars().valueAt(a.index),s=a.index}return l={noData:!1},h=n[TradingView.CLOSE_PLOT],i&&(l.price=h),this.priceScale().properties().percentage.value()&&(c=this.firstValue(),h=this.priceScale().priceRange().convertToPercent(h,c)),l.text=this.priceScale().formatter().format(h),d=this.barColorer(),p=d.barStyle(s,!1),l.color=p.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=s,l},l.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},l.prototype._nextSymbolId=1,l.prototype._nextSeriesId=1,l.STYLE_BARS=0,l.STYLE_CANDLES=1,l.STYLE_LINE=2,l.STYLE_LINE_TYPE_MARKERS=0,l.STYLE_LINE_TYPE_STEP=1,l.STYLE_LINE_TYPE_SIMPLE=2,l.STYLE_AREA=3,l.STYLE_RENKO=4,l.STYLE_KAGI=5,l.STYLE_PNF=6,l.STYLE_PB=7,l.STYLE_HEIKEN_ASHI=8,l.STYLE_HOLLOW_CANDLES=9,Object.assign(l,i(697)),l.PERMISSION_DENIED="permission denied",l.PD_REASON_SYMBOL="symbol",l.PD_REASON_EXTENDED_HOURS="extended_hours",l.PD_REASON_GROUP_PERMISSION="group",l.STUDY_NOT_AUTH="study_not_auth",l.STYLE_SHORT_NAMES={},l.STYLE_SHORT_NAMES[l.STYLE_BARS]="bar",l.STYLE_SHORT_NAMES[l.STYLE_CANDLES]="candle",l.STYLE_SHORT_NAMES[l.STYLE_HOLLOW_CANDLES]="hollowCandle",l.STYLE_SHORT_NAMES[l.STYLE_LINE]="line",l.STYLE_SHORT_NAMES[l.STYLE_AREA]="area",l.STYLE_SHORT_NAMES[l.STYLE_RENKO]="renko",l.STYLE_SHORT_NAMES[l.STYLE_PB]="pb",l.STYLE_SHORT_NAMES[l.STYLE_KAGI]="kagi",l.STYLE_SHORT_NAMES[l.STYLE_PNF]="pnf",l.STYLE_SHORT_NAMES[l.STYLE_HEIKEN_ASHI]="ha",l._SYMBOL_STRING_DATA={},l._SYMBOL_STRING_DATA[l.STYLE_RENKO]={type:"BarSetRenko@tv-prostudies-1!",inputNames:["source","style","boxSize","atrLength"]},l._SYMBOL_STRING_DATA[l.STYLE_PB]={type:"BarSetPriceBreak@tv-prostudies-1!",inputNames:["source","lb"]},
l._SYMBOL_STRING_DATA[l.STYLE_KAGI]={type:"BarSetKagi@tv-prostudies-1!",inputNames:["source","style","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_PNF]={type:"BarSetPnF@tv-prostudies-1!",inputNames:["sources","style","boxSize","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_HEIKEN_ASHI]={type:"BarSetHeikenAshi@tv-basicstudies-1!",inputNames:[]},l.prototype.model=function(){return this.m_model},l.prototype.fixLastBar=function(t){this._futureBarsPaneView||(this._futureBarsPaneView=new L(this,this.data().bars().lastTimeIndex(),t))},l.prototype.clearData=function(){this.data().clear()},l.prototype.data=function(){return this.m_data},l.prototype.symbolId=function(){return this._symbolId},l.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},l.prototype.onSymbolResolved=function(){return this._symbolResolved},l.prototype.onSymbolError=function(){return this._symbolError},l.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted},l.prototype.onSymbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},l.prototype.onIntervalChanged=function(){return this._intervalChanged},l.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},l.prototype.onStartLoading=function(){return this._startLoading},l.prototype.onDataLoaded=function(){return this._dataLoaded},l.prototype.onStatusChanged=function(){return this._onStatusChanged},l.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged},l.prototype.onBarReceived=function(){return this._barReceived},l.prototype.onChangedStyle=function(){return this._onChangedStyle},l.prototype.onCompleted=function(){return this._onCompleted},l.prototype.onRestarted=function(){return this._onRestarted},l.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},l.prototype.status=function(){return this._status},l.prototype.isDWM=function(){var t,e;return null!==this._isDWMCached?this._isDWMCached:(t=new k(this._properties.interval.value()),t.isDWM()?this._isDWMCached=!0:(e=t.kind()===k.SECONDS?t.multiplier():60*t.multiplier(),this._isDWMCached=!(e<216e3)),this._isDWMCached)},l.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},l.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._symbolLabelView=new P(this.m_model,this,TradingView.CLOSE_PLOT,"firstShortName","showSymbolLabels");var t=this._properties.style.value();switch(t){case l.STYLE_BARS:this._paneView=new v(this,this.m_model);break;case l.STYLE_CANDLES:this._paneView=new g(this,this.m_model);break;case l.STYLE_LINE:this._paneView=new f(this,this._properties.lineStyle.priceSource.value(),this.m_model);break;case l.STYLE_AREA:this._paneView=new _(this,this._properties.areaStyle.priceSource.value(),this.m_model);break;case l.STYLE_HEIKEN_ASHI:
this._paneView=new y(this,this.m_model);break;case l.STYLE_HOLLOW_CANDLES:this._paneView=new m(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+t)}},l.prototype._clearStylePlot=function(t,e){var i,o;t.size()&&(i=e||+t.first(),o=+t.last()+1,t.range(i,o).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},l.prototype.invalidateBarStylesCache=function(t){U.logDebug("Invalidate style cache starting from "+t),this._clearStylePlot(this.m_data.m_bars,t),this._clearStylePlot(this.m_data.m_nsBars)},l.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},l.prototype.barColorer=function(){var t,e,i,o;if(this._barColorerCache)return this._barColorerCache;for(t=null,e=this.m_model.dataSources().length-1;e>=0;e--)i=this.m_model.dataSources()[e],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(o=i.barColorer(),null===t?t=o:t.pushBackBarColorer(o));return null===t?t=new S(this):t.pushBackBarColorer(new S(this)),this._barColorerCache=t,this._barColorerCache},l.prototype.properties=function(){return this._properties},l.prototype._barsState=function(t){var e=t.state();return e.columns=e.columns.filter(function(t){return"style"!==t}),e.data.forEach(function(t){t.value.splice(7,1)}),e},l.prototype.state=function(t){var e=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),zorder:this.zorder()};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),t&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},l.prototype.stateForAlert=function(){var t=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor);return{id:this.id(),uniqueId:this.uniqueId(),type:t,proSymbol:this.proSymbol(),actualSymbol:this.actualSymbol(),symbolString:this.getSymbolString(),interval:this.interval(),style:this.properties().style.value(),styleInputs:this.getInputsProperties().state(),extendedHours:this.extendedHours.value(),boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount}},l.prototype.uniqueId=function(){return this.actualSymbol()+"|"+this.interval()},l.prototype.restoreData=function(t,e,i,o,n,s){this._status=l.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(t),this.m_data.m_nsBars.restoreState(e),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=o,this.m_data.boxSize=n,n||(this.properties().style.value()===l.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===l.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=s,
s||this.properties().style.value()===l.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},l.prototype.setProperties=function(t){t.timeframe||t.merge({timeframe:""}),t.shortName||t.merge({shortName:""}),this._properties=t,this._properties.symbol.listeners().subscribe(this,l.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,l.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,l.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,l.prototype.changeProperties)},l.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},l.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},l.prototype.changeTimeFrame=function(){F("GUI","Change timeframe")},l.prototype.title=function(){return this.properties().symbol.value()+", "+z(this.properties().interval.value())},l.generateTitleForGui=function(t){function e(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)||""}var i,o,n,s=t||{},r="QUANDL"===s.exchange,a="",h={symbolDescription:"",interval:"",exchange:"",chartStyle:""};switch(s.description&&r?2===s.description.split("/").length?h.symbolDescription=s.description.split("/")[1]:(i=s.description.split("'").filter(function(t){return t.length}),i.forEach(function(t){t=t&&("/"===t[0]||/\d+\/\(?/.test(t))?[t]:t.split("/").filter(function(t){return t.length}),h.symbolDescription+=t[2===t.length?1:0]})):s.description?h.symbolDescription=s.description:h.symbolDescription=s.symbol,s.interval&&(h.interval=z(s.interval)),r&&s.description&&(o=/[\w_]+\/[\w_]+/.exec(s.description),o&&o[0]?h.provider=o[0].split("/")[0]:h.provider=s.description.split("/")[0]),s.exchange&&(h.exchange=s.exchange),s.style){case l.STYLE_RENKO:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Renko")+" ["+s.inputs.source+", "+n+", "+e(s.boxSize,4)+"]";break;case l.STYLE_PB:h.chartStyle=$.t("Line Break")+" ["+s.inputs.source+", "+s.inputs.lb+"]";break;case l.STYLE_KAGI:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Kagi")+" ["+s.inputs.source+", "+n+", "+e(s.reversalAmount,8)+"]";break;case l.STYLE_PNF:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("PnF")+" ["+s.inputs.sources+", "+n+", "+e(s.boxSize,8)+", "+s.inputs.reversalAmount+"]";break;case l.STYLE_HEIKEN_ASHI:h.chartStyle=$.t("Heikin Ashi")}return a=h.symbolDescription+(h.interval?", "+h.interval:"")+(h.provider?", "+h.provider:"")+(h.exchange?", "+h.exchange:"")+(h.chartStyle?", "+h.chartStyle:""),a=a.replace(/\'/g,"")},l.prototype.changeProperties=function(t){t!==this._properties.symbol&&t!==this._properties.interval&&t!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},l.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},l.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},
l.prototype.onData=function(t){var e,i,o,n,s,r,a,h,c,d,p,u,_,f,m,g,v,y,w=this;switch(t.method){case"symbol_resolved":if(t.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}this.updateSymbolInfo(t.params[1]),this.m_model.updateSource(this),this._symbolResolved.fire(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||F("Symbol",t.params[1].listed_exchange,t.params[1].name),e=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===l.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<e?i.renkoStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<e?i.pnfStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<e&&i.kagiStyle.inputs.merge({reversalAmount:e});break;case"symbol_error":if(t.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}if(this._setStatus(l.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),t.params[1]===l.PERMISSION_DENIED)switch(t.params[2]){case l.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case l.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(t.params[3]);break;case l.PD_REASON_GROUP_PERMISSION:this._symbolGroupNotPermitted.fire(t.params[3]);break;default:this._symbolNotPermitted.fire(t.params[2])}else this.m_model.resetTimeScale(),this._symbolError.fire();this.m_model.realignLineTools();break;case"series_timeframe":if(t.params[1]!==this._turnaround)break;o=t.params[2],n=t.params[3],s=t.params[4],r=void 0!==s&&s?n:n+10,this.m_model.setTimeViewport(o,r);break;case"series_error":a=t.params[2],delete this._loadingStartTime,b.enabled("charting_library_debug_mode")&&U.logNormal("Error reason: "+a),this._setStatus(b.enabled("no_bars_status")&&this._symbolInfo?l.STATUS_NO_BARS:l.STATUS_INVALID_SYMBOL),a&&a.startsWith("study_not_auth:")?(h=a.split(":",2)[1].split("@",2)[0],h in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(h):"BarSetSpread"===h&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"===a?this.intradayExchangeNotPermitted.fire():"custom_resolution"===a&&this.customIntervalNotPermitted.fire(),this._seriesLoaded=!0;break;case"series_loading":if(t.params[1]!==this._turnaround)break;if(t.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}this._setStatus(l.STATUS_LOADING),w._loadingStartTime=(new Date).getTime();break;case"series_completed":if(t.params[2]!==this._turnaround)break;if(t.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}switch(c="chartSession:"+w._chartApi._sessionid,d=(new Date).getTime()-this._loadingStartTime,
U.logDebug(c+", Series loading took "+d+" ms, eod:"+this._endOfData),delete this._loadingStartTime,p=t.params[1],"pulsed"===p&&(p="delayed"),p){case"streaming":this._setStatus(l.STATUS_READY);break;case"endofday":this._setStatus(l.STATUS_EOD);break;case"delayed":this._setStatus(l.STATUS_DELAYED);break;case"pulsed":this._setStatus(l.STATUS_PULSE)}p.match(/delayed_streaming/)&&this._setStatus(l.STATUS_DELAYED_STREAMING),u=this.m_model.paneForSource(this),u.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new M(M.FULL_UPDATE)),this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TradingView.TIME_PLOT],end:this.data().last().value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),_=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(_.firstBar(),_.lastBar()))),this._seriesLoaded=!0,this._onCompleted.fire(this._endOfData),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(t.params.customId!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}if(this.status()===l.STATUS_INVALID_SYMBOL)break;t.params.plots.length?(f=this.m_data.m_bars.size(),m=this.m_data.m_bars.first(),g=void 0!==m?m.valueOf():null,v=this.m_data.m_bars.merge(t.params.plots),(null===g||v.earliestRow.index<g)&&(this._endOfData=!1),y="Merge bars. Changes:{length:"+v.length+", earliestRow:"+v.earliestRow.index+"} ",y+="bars state:{firstBar:"+this.m_data.m_bars.first()+",lastBar:"+this.m_data.m_bars.last()+",size:"+this.m_data.m_bars.size()+"}",j.logDebug(y),f!==this.bars().size()&&(this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):(this.m_data.clear(),this._startLoading.fire()),new Promise(function(e){var i=w.properties().style.value();!t.params.nonseries||i!==l.STYLE_RENKO&&i!==l.STYLE_KAGI&&i!==l.STYLE_PNF&&i!==l.STYLE_HEIKEN_ASHI&&i!==l.STYLE_PB?(t.params.nonseries||(w.m_data.m_nsBars.clear(),w.m_data.lastProjectionPrice=void 0),e(),e()):w.parseJapProjBars(t.params.nonseries).then(function(t){w.m_data.m_nsBars=t.nsBars,w.m_data.lastProjectionPrice=t.lastPrice;var i=w.m_data.boxSize!==t.boxSize;w.m_data.boxSize=t.boxSize,w.m_data.reversalAmount=t.reversalAmount,i&&w._boxSizeChanged.fire(w.m_data.boxSize),e()})}).then(function(){var t=w.m_model.paneForSource(w);w.m_model.updateAllVolumeStudies(),w.m_model.recalculatePane(t),w.m_model.updateSource(w),w.m_model.updateLineTools(),w.m_model.updateCrossHair()})}this._dataLoaded.fire(t)},l.prototype.fixBoxSize=function(){var t=this.model().timeScale(),e=this.priceScale();e.isEmpty()||t.isEmpty()||(this.m_data.boxSize=Math.abs(e.coordinateToPrice(t.barSpacing())-e.coordinateToPrice(0)))},l.prototype.parseJapProjBars=function(t){
var e,i,o,n=new B(["time","open","high","low","close","adt","style"]),s=this.model().timeScale(),r=this.properties().style.value(),a=this;return new Promise(function(h){t.d&&""!==t.d?TradingView.Study.prototype._makeJSONForNSData.call(a,{params:{nonseries:t}}).then(function(a){var c,d,p,u,_=a.data;for(e=_.price,i=_.boxSize,o=_.reversalAmount,c=_.bars,d=0;c&&d<c.length;d++)p=[],u=t.indexes[c[d].time],p.push(s.points().valueAt(u)),p.push(c[d].open),p.push(c[d].high),p.push(c[d].low),p.push(c[d].close),p.push(c[d].volume),r===l.STYLE_KAGI?p.push(c[d].additionalPrice):r===l.STYLE_PNF&&p.push(c[d].factor),n.add(u,p);h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})}):h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})})},l.prototype.disconnect=function(){this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=l.STATUS_OFFLINE},l.prototype.isStarted=function(){return!!this._symbolId},l.prototype.restart=function(){var t,e=i(153);this._onRestarted.fire(),this._setStatus(l.STATUS_RESOLVING),this.m_data=new E(this,this.model()),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},l.prototype._generateTimeframe=function(t,e){var i,o=e.right(1),n=t;return"ytd"===e?n+=",YTD":"d"===o?(i=e.left(e.length-1),n+=","+i,b.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===o?(i=e.left(e.length-1),n+=","+i+"M"):"all"===e&&(n+=",ALL"),n},l.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},l.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,(this._checkSymbolWillChanged(this._properties.symbol.value())||this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval))&&(this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay),this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30))},l.prototype._checkSymbolWillChanged=function(t){return!this.symbolSameAsCurrent(t)||b.enabled("same_data_requery")},l.prototype._checkIntervalWillChanged=function(t){return this.m_interval!==t||b.enabled("same_data_requery")},l.prototype._parseInterval=function(t){var e=(t+"").split(",");return{
interval:2===e.length?e[0]:t,timeframe:2===e.length?e[1]:0}},l.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},l.prototype._setSymbolInterval=function(t,e,i){var o,n,s,r,a,h;delete this._gotoDateResult,o=this._parseInterval(e),n=o.interval,s=o.timeframe,r=this._checkSymbolWillChanged(t),a=this._checkIntervalWillChanged(n),(r||a||i)&&(this._syncModel=null,this.m_symbol=t,this.m_interval=n,this.m_timeframe=s,this._symbolId&&!r||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==l.STATUS_SNAPSHOT&&(this._setStatus(l.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),a&&(h={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,h),this._pendingTimeRange=h.timeframe&&h.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!r||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler)),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._predictBars=0,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)))))},l.prototype.setDefaultTimeframe=function(t){this._pendingTimeRange=t},l.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},l.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},l.prototype.symbol=function(){return this.properties().symbol.value()},l.prototype.interval=function(){return this.properties().interval.value()},l.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&this.interval()<=1440},l.prototype.bars=function(){return this.m_data.m_bars},l.prototype.nsBars=function(){return this.m_data.m_nsBars},l.prototype.open=function(t){return this.m_data.valueAt(t)[TradingView.OPEN_PLOT]},l.prototype.high=function(t){return this.m_data.valueAt(t)[TradingView.HIGH_PLOT]},l.prototype.low=function(t){return this.m_data.valueAt(t)[TradingView.LOW_PLOT]},l.prototype.close=function(t){return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT]},l.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},l.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},l.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},l.prototype.priceRange=function(t,e){var i,o,s,r,a,l,h,c;return TradingView.isInteger(t)?TradingView.isInteger(e)?this.data().isEmpty()?null:(o=this.data().boxSize,this.isLockScale()?(void 0===o&&this.fixBoxSize(),s=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),
r=this.data().search(e,TradingView.SEARCH_NEAREST_LEFT),a=(r.value[TradingView.HIGH_PLOT]+r.value[TradingView.LOW_PLOT])/2,i=new n(a-.5*s,a+.5*s),l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),this.priceScale().properties().percentage.value()&&i?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):i):(h=this.data().bars().minMaxOnRange2(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),c=this.data().nsBars().minMaxOnRange(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),null!=c.min&&(h.min=Math.min(h.min,c.min)),null!=c.max&&(h.max=Math.max(h.max,c.max)),i=new n(h.min,h.max),i.minValue()===i.maxValue()&&(i=new n(i.minValue()-.5,i.maxValue()+.5)),this.priceScale().properties().percentage.value()&&i?(l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),l?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):null):this.priceScale().isLog()&&i?new n(this.priceScale().priceToLogical(i.minValue()),this.priceScale().priceToLogical(i.maxValue())):i)):(U.logDebug("Series.priceRange: incorrect endBar"),null):(U.logDebug("Series.priceRange: incorrect startBar"),null)},l.prototype.nearestData=function(t,e){return TradingView.isInteger(t)?this.data().search(t,e)||void 0:void U.logDebug("Series.nearestData: incorrect logicalPoint")},l.prototype.nearestIndex=function(t,e){var i=this.nearestData(t,e);return i?i.index:void 0},l.prototype.paneViews=function(t){if(!this.properties().visible.value())return null;var e=[this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),e.push(this._priceLineView),e.push(this._symbolLabelView),e.push(this._gotoDateView),e},l.prototype.dataWindowView=function(){return this._dataWindowView},l.prototype.statusView=function(){return this._statusView},l.prototype.priceAxisViews=function(t,e){return this.m_model.paneForSource(this)===t&&e===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},l.prototype.base=function(){return this._base},l.prototype.formatter=function(){return this._formatter},l.prototype.purgeSymbolInfo=function(){this._symbolInfo=null},l.prototype.symbolInfo=function(){return this._symbolInfo},l.prototype._recreateFormatter=function(){var t,e,i,o;"default"===this.properties().minTick.value()?this._formatter=new V(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(t=this.properties().minTick.value().split(","),e=parseInt(t[0]),i=parseInt(t[1]),o="true"===t[2],this._formatter=new V(e,i,o)),this.priceScale()&&this.priceScale().updateFormatter()},l.prototype.updateSymbolInfo=function(t){var e=this,i=t&&(t.pro_name||t.full_name||t.name);b.enabled("charting_library_single_symbol_request")&&this.m_symbol&&(i=this.m_symbol),this._symbolInfo=t,
t&&(this._properties.shortName.setValue(t.name),i&&this._properties.symbol.value().toUpperCase()!==i.toUpperCase()&&this._properties.symbol.setValue(i)),this._base=t?t.pricescale/t.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),"undefined"!=typeof quoteSessionMultiplexerInstance&&this._quoteSessionSymbol!==i&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+W.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),i&&(this._quoteSessionSymbol=i,quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(t,i){e.quoteData=t&&t.values||null,i&&i.values&&i.values.current_session&&e.marketStatus.setValue(i.values.current_session)}))),this.checkInterval(),this.dataPoweredBy=A(t)},l.prototype.symbolSameAsCurrent=function(t){if(this.m_symbol===t)return!0;var e=this._symbolInfo;if(e){if(e.full_name===t||e.pro_name===t)return!0;if(e.ticker===t)return!0;if(e.aliases&&-1!==e.aliases.indexOf(t))return!0;if(e.alternatives&&-1!==e.alternatives.indexOf(t))return!0}return!1},l.prototype.updateAllViews=function(){this._paneView.update(),this._dataWindowView.update(),this._statusView.update(),this._priceAxisViews[0].update(),this._priceAxisViews[1].update(),this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),this._priceLineView.update(),this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update()},l.prototype._setStatus=function(t){this._status=t,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},l.prototype.requestMoreData=function(t){var e,i,o,n;this._status!==l.STATUS_READY&&this._status!==l.STATUS_PULSE&&this._status!==l.STATUS_DELAYED&&this._status!==l.STATUS_DELAYED_STREAMING&&this._status!==l.STATUS_EOD||this.m_model.timeScale().isEmpty()||(e=this.m_model.timeScale().visibleBars(),e.isEmpty()||0!==this.bars().size()&&(i=t||e.lastBar()-this.data().last(),this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(o=this.bars()._indexAt(0),(n=t||o-e.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,n,this._handler),b.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(l.STATUS_LOADING)))))},l.prototype.bindStyleChange=function(){var t=this;["candleStyle","hollowCandleStyle","haStyle","barStyle","lineStyle","areaStyle","renkoStyle","pbStyle","kagiStyle","pnfStyle"].forEach(function(e){t._properties[e].listeners().subscribe(t,l.prototype.invalidateBarStylesCache)})},l.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),
this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var t=this;this._properties.lockScale.listeners().subscribe(this,function(e){e.value()&&t.model().timeScale().recalcLockedScale()})},l.prototype.createExtendedHoursProperty=function(){function t(){var t="undefined"!=typeof productFeatures&&b.enabled(productFeatures.EXTENDED_SESSION),i=e.model().readOnly(),o=e._properties.extendedHours.value(),n=b.enabled("widget");!o||n||i||t||(e._extendedHoursNotPermitted.fire(),o=!1),o&&!e.isIntradayInterval()&&(o=!1),e.extendedHours.setValue(o)}var e=this;e.extendedHours=new s,e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()},l.prototype.isNeedRestart=function(t){if(void 0===t&&(t=this.properties().style.value()),this._prevChartStyle!==t){var e=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_HOLLOW_CANDLES,l.STYLE_LINE,l.STYLE_AREA];if(!(e.indexOf(this._prevChartStyle)>-1&&e.indexOf(t)>-1))return!0}return!1},l.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onChangedStyle.fire(this.properties().style.value()),this.invalidateBarStylesCache()},l.prototype.onInputChanged=function(){this.restart()},l.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},l.prototype.getSymbolString=function(){var t,e,i;return t=b.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(t={symbol:t,session:"extended"}),l._SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e=this.getInputsProperties(),
i=l._SYMBOL_STRING_DATA[this._properties.style.value()],t={symbol:t,type:i.type,inputs:i.inputNames.map(function(t){return e[t].value()})}),"string"!=typeof t&&(t="="+JSON.stringify(t)),t},l.parseSymbolString=function(t){var e,i,o,n,s,r,a,h=Object.keys(l._SYMBOL_STRING_DATA),c={symbol:null,style:null,extendedHours:null,inputs:null};if(t&&0===t.indexOf("=")){if(e=t.slice(1),e=JSON.parse(e),c.symbol=e.symbol,e.type)for(r=0;r<h.length;r++)if(o=h[r],i=l._SYMBOL_STRING_DATA[o],i.type===e.type){for(c.style=parseInt(o),c.inputs={},a=0;a<i.inputNames.length;a++)s=e.inputs[a],n=i.inputNames[a],c.inputs[n]=s;break}"extended"===c.symbol.session&&(c.extendedHours=!0,c.symbol=c.symbol.symbol)}else c.symbol=t;return c},l.prototype.getStyleShortName=function(){var t=this._properties.style.value();if(l.STYLE_SHORT_NAMES.hasOwnProperty(t))return l.STYLE_SHORT_NAMES[t];throw Error("Missed short name for style "+t)},l.prototype.getInputsProperties=function(){return this._properties[this.getStyleShortName()+"Style"].inputs||new s},l.prototype.getRealVisibleRange=function(){var t=this.model().timeScale().visibleBars(),e=this.data().search(t.m_firstBar,TradingView.SEARCH_NEAREST_RIGHT),i=this.data().search(t.m_lastBar,TradingView.SEARCH_NEAREST_LEFT);return void 0===e||void 0===i?null:new w(e.index,i.index)},l.prototype.isLockScale=function(){return this.properties().lockScale.value()},l.prototype.firstValue=function(){return this.data().firstValue()},l.prototype.firstBar=function(){return this.data().firstBar()};l.prototype.sessionsStudy=function(){var t,e,i,o;if(this._sessionsStudy)return this._sessionsStudy;for(t=this.model().paneForSource(this),e=t.dataSources(),i=0;i<e.length;i++)if((o=e[i])instanceof TradingView.Study&&"Sessions"===o.metaInfo().shortId)return this._sessionsStudy=o,this._sessionsStudy;return!1},l.prototype.createSessStudy=function(){if(!b.enabled("charting_library_base")&&!this.sessionsStudy()){var t=R.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(t,!1,!0),this._onSessionsStudyCreated.fire()}},l.prototype.checkSessStudy=function(){b.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},l.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},l.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},l.prototype.firstShortName=function(){return O.ticker(this.firstSymbol())},l.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},l.prototype.loadDataTo=function(t){this._turnaround="s"+ ++this._turnaroundCounter;var e=this._properties.interval.value();e=this._generateTimeframe(e,t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler)},l.prototype.checkInterval=function(){if(this._symbolInfo&&(k.kind(this.interval())!==k.MINUTES||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){
var t=this._properties.interval.value();-1===this._symbolInfo.supported_resolutions.indexOf(t)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},l.prototype.setPriceScale=function(t){this.m_priceScale!==t&&(this.m_priceScale=t,this.priceScaleChanged.fire(t))},l.prototype.setGotoDateResult=function(t){this._gotoDateResult=t},l.prototype.gotoDateResult=function(){return this._gotoDateResult},l.prototype.syncModel=function(){var t,e;if(!this._syncModel){if(t=this.symbolInfo(),e=this.interval(),!t||!e)return null;this._syncModel=new N(t,e)}return this._syncModel},l.prototype.turnaround=function(){return this._turnaround},TradingView.Series=l,t.exports=l}).call(e,i(15),i(40),i(107),i(24))},function(t,e){"use strict";var i,o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),i={},o=RegExp("^([0-9]*)$"),n=RegExp("^(\\d*)([DWMS])$"),s=function(){function t(e,i){if(void 0===i&&e!==t.INVALID)return t.parse(e);var o=e;o!==t.SECONDS&&o!==t.MINUTES&&o!==t.HOURS&&o!==t.DAYS&&o!==t.WEEKS&&o!==t.MONTHS&&o!==t.INVALID&&(o="invalid"),this._kind=o,this._multiplier=i}return t.prototype.kind=function(){return this._kind},t.prototype.multiplier=function(){return this._multiplier},t.prototype.isValid=function(){return this.kind()!==t.INVALID},t.prototype.isDWM=function(){return this.isValid()&&!this.isIntraday()},t.prototype.isIntraday=function(){return-1!==[t.SECONDS,t.MINUTES,t.HOURS].indexOf(this.kind())},t.prototype.letter=function(){return this.isValid()&&this.kind()!==t.MINUTES?this.kind()[0].toUpperCase():""},t.prototype.value=function(){return this.isValid()?this.kind()===t.MINUTES?this.multiplier()+"":this.multiplier()+this.letter():""},t.prototype.isEqualTo=function(e){if(!(e instanceof t))throw Error("Argument is not an Interval");return this.kind()!==t.INVALID&&e.kind()!==t.INVALID&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())},t.prototype.inMilliseconds=function(){if(!this.isValid()||this.kind()===t.MONTHS)return NaN;var e=this.multiplier();return void 0===e?NaN:i[this.kind()]*e},t.isEqual=function(e,i){return t.parse(e).isEqualTo(t.parse(i))},t.parse=function(e){var i,s;return e=(e+"").toUpperCase().split(",")[0],i={D:t.DAYS,W:t.WEEKS,M:t.MONTHS,H:t.HOURS,S:t.SECONDS},(s=o.exec(e))?new t(t.MINUTES,parseInt(e,10)):(s=n.exec(e),s?new t(i[s[2]],parseInt(s[1],10)?parseInt(s[1],10):1):new t(t.INVALID))},t.isDWM=function(e){return t.parse(e).isDWM()},t.kind=function(e){return t.parse(e).kind()},t.isValid=function(e){return t.parse(e).isValid()},t}(),s.SECONDS="seconds",s.MINUTES="minutes",s.HOURS="hours",s.DAYS="days",s.WEEKS="weeks",s.MONTHS="months",s.INVALID="invalid",e.Interval=s,i[s.SECONDS]=1e3,i[s.MINUTES]=60*i[s.SECONDS],i[s.HOURS]=60*i[s.MINUTES],i[s.DAYS]=24*i[s.HOURS],i[s.WEEKS]=7*i[s.DAYS]},function(t,e){"use strict";function i(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=i},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittestResult=e||new c(c.MOVEPOINT),
this._backHittestResult=i||new c(c.MOVEPOINT_BACKGROUND)}function n(t,e){h.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolRectangle";var i=e||new p("linetoolrectangle");l.call(this,t,new n(this,t),i)}function r(t,e,i){o.call(this,t,e,i)}var a=i(2),l=i(1).LineDataSource,h=i(9),c=i(8),d=i(6),p=i(7).DefaultProperty,u=i(14);o.prototype.getColor=function(){return u.generateColor(this._data.backcolor,this._data.transparency)},o.prototype.draw=function(t){var e,i,o;this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=i.substract(e),t.beginPath(),t.rect(e.x,e.y,o.x,o.y),this._data.linewidth>0&&t.stroke(),this._data.fillBackground&&(t.fillStyle=this.getColor(),t.fill()))},o.prototype.hitTest=function(t){var e,i,o,n,s,r,l,h,c,d;return this._data.points.length<2||this._data.nohittest?null:(e=3,i=this._data.points[0],o=this._data.points[1],n=new a.Point(o.x,i.y),s=new a.Point(i.x,o.y),r=a.distanceToSegment(i,n,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(n,o,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(o,s,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(s,i,t),r.distance<=e?this._hittestResult:this._data.fillBackground&&(l=Math.min(i.x,o.x),h=Math.max(i.x,o.x),c=Math.min(i.y,o.y),d=Math.max(i.y,o.y),i=new a.Point(l,c),o=new a.Point(h,d),a.pointInRect(t,i,o))?this._backHittestResult:null))))},inherit(n,h),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){h.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,r;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.linewidth=this._source.properties().linewidth.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new d,e.append(new o(t)),i=this._points[0],n=this._points[1],s=new a.Point(i.x,n.y),s.data=2,r=new a.Point(n.x,i.y),r.data=3,e.append(this.createLineAnchor({points:[i,n,s,r]})),e):new o(t)},inherit(s,l),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Rectangle"},s.prototype.setPoint=function(t,e,i){var o,n,s;if(t<2)return void l.prototype.setPoint.call(this,t,e,i);i&&i.shift&&this._properties.snapTo45Degrees&&(o=this.points()[0],n=this.points()[1],s={price:2===t?o.price:n.price,index:2===t?n.index:o.index},this._snapPoint45Degree(e,s)),this._convertPriceFromPercentIfNeeded(e),3===t?(this._points[0].price=e.price,this._points[1].index=e.index):(this._points[1].price=e.price,this._points[0].index=e.index),this.normalizePoints()},inherit(r,o),r.prototype.getColor=function(){return u.generateColor(this._data.backcolor,this._data.transparency,!0)},e.RectangleRenderer=o,e.RectangleTransparencyRenderer=r,e.LineToolRectangle=s
},function(t,e,i){"use strict";function o(t){var e=$('<div class="transparency-slider"><div class="gradient"></div></div>').slider({max:100,min:0,step:1}),i=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];return e.updateColor=function(t){var o=e.find(".gradient");i.forEach(function(e){o.css("background-image",e.replace(/%COLOR/,t))})},t?(e.updateColor(t.val()||"black"),t.on("change",function(t){e.updateColor(t.target.value)})):e.updateColor("black"),e}Object.defineProperty(e,"__esModule",{value:!0}),i(17),e.createTransparencyEditor=o},function(t,e,i){(function(t){"use strict";function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function s(t){o.call(this),this.deferred=t}var r=i(366);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,!0!==e&&this._bindShortCut())},o.prototype._bindShortCut=function(){r.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){r.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(s,o),e.Action=o,e.ActionSeparator=n,e.ActionPlaceholder=s}).call(e,i(15))},function(t,e,i){(function(t){"use strict";function o(){this._zorder=0,this.m_priceScale=null,
this._id=r.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new t(!1)}function n(t){o.call(this),this._isOverlay=null,this._model=t}var s=i(7).DefaultProperty,r=i(60);o.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i)},o.prototype.id=function(){return this._id},o.prototype.uniqueId=function(){return this._id},o.prototype.setId=function(t){this._id=t},o.prototype.zorder=function(){return this._zorder},o.prototype.setZorder=function(t){"number"==typeof t&&this._zorder!==t&&(this._zorder=t)},o.prototype.title=function(){throw Error("Implement this fun in a subclass")},o.prototype.priceScale=function(){return this.m_priceScale},o.prototype.setPriceScale=function(t){this.m_priceScale=t},o.prototype.ownerSource=function(){return this._ownerSource},o.prototype.setOwnerSource=function(t){this._ownerSource=t,t&&this.setPriceScale(t.priceScale())},o.prototype.isSavedInChart=function(t){return!0},o.prototype.isSavedInStudyTemplates=function(){return!0},o.prototype.isRemovedByStudyTemplates=function(){return!0},o.prototype.hasContextMenu=function(){return!0},o.prototype.showInObjectTree=function(){return!0},o.prototype.setUserEditEnabled=function(t){this._userEditEnabled=t},o.prototype.userEditEnabled=function(){return this._userEditEnabled},o.prototype.canBeHidden=function(){return this.userEditEnabled()},o.prototype.isUserDeletable=function(){return this.userEditEnabled()},o.prototype.canHasAlert=function(){return!1},o.prototype.properties=function(){throw Error("Implement this fun in a subclass")},o.prototype.statusView=function(){return null},o.prototype.dataWindowView=function(){return null},o.prototype.priceAxisViews=function(t,e){return null},o.prototype.updateAllViews=function(){},o.prototype.paneViews=function(t){return null},o.prototype.isChildStudy=function(){return!1},o.prototype.hasChildren=function(){return!1},o.prototype.canHaveChildren=function(){return!1},o.prototype.onClickOutside=function(){},inherit(n,o),n.prototype.isNoScale=function(){return!!this._isOverlay},n.prototype.base=function(){return 0},n.prototype.formatter=function(){return null},n.prototype.model=function(){return this._model},n.prototype.priceRange=function(t,e){return null},n.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},e.DataSource=o,e.PriceDataSource=n}).call(e,i(40))},function(t,e,i){"use strict";function o(t,e,i,o,n){this._wptStudyId=o,this._pointsCount=n,m.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i,"mtp_wpt_down1ora",2)}function s(t,e,i){o.call(this,t,e,i,"mtp_wpt_down2orb",2)}function r(t,e,i){o.call(this,t,e,i,"mtp_wpt_down3",3)}function a(t,e,i){o.call(this,t,e,i,"mtp_wpt_down4",2)}function l(t,e,i){o.call(this,t,e,i,"mtp_wpt_down5",5)}function h(t,e,i){o.call(this,t,e,i,"mtp_wpt_downc",3)}function c(t,e,i){o.call(this,t,e,i,"mtp_wpt_up1ora",2)}function d(t,e,i){o.call(this,t,e,i,"mtp_wpt_up2orb",2)}function p(t,e,i){o.call(this,t,e,i,"mtp_wpt_up3",3)}function u(t,e,i){o.call(this,t,e,i,"mtp_wpt_up4",2)}function _(t,e,i){
o.call(this,t,e,i,"mtp_wpt_up5",5)}function f(t,e,i){o.call(this,t,e,i,"mtp_wpt_upc",3)}var m=i(104);inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o,n=this.points();if(n.length<this.pointsCount())return null;for(t=[this.properties().inputs.displayZoneLabels.value()],e=0;e<this.pointsCount();++e){if(i=n[e].index,!(o=this._model.mainSeries().bars().valueAt(i)))return null;t.push(1e3*o[TradingView.TIME_PLOT])}return t},o.prototype._mtpStudyId=function(){return this._wptStudyId},o.prototype.pointsCount=function(){return this._pointsCount},inherit(n,o),n.getTooltipText=function(t){return"Down Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(s,o),s.getTooltipText=function(t){return"Down Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(r,o),r.getTooltipText=function(t){return"Down Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(a,o),a.getTooltipText=function(t){return"Down Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(l,o),l.getTooltipText=function(t){return"Down Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(h,o),h.getTooltipText=function(t){return"Down Wave C: Select Point "+((t?t._points.length:0)+1)},inherit(c,o),c.getTooltipText=function(t){return"Up Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(d,o),d.getTooltipText=function(t){return"Up Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(p,o),p.getTooltipText=function(t){return"Up Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(u,o),u.getTooltipText=function(t){return"Up Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(_,o),_.getTooltipText=function(t){return"Up Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(f,o),f.getTooltipText=function(t){return"Up Wave C: Select Point "+((t?t._points.length:0)+1)},e.LineStudyMtpDownWave1OrA=n,e.LineStudyMtpDownWave2OrB=s,e.LineStudyMtpDownWave3=r,e.LineStudyMtpDownWave4=a,e.LineStudyMtpDownWave5=l,e.LineStudyMtpDownWaveC=h,e.LineStudyMtpUpWave1OrA=c,e.LineStudyMtpUpWave2OrB=d,e.LineStudyMtpUpWave3=p,e.LineStudyMtpUpWave4=u,e.LineStudyMtpUpWave5=_,e.LineStudyMtpUpWaveC=f},,,function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){c.call(this,t,e),this._invalidated=!0}function s(t,e){n.call(this,t,e),this._invalidated=!0}function r(t,e){s.call(this,t,e),this._invalidated=!0}function a(t,e){n.call(this,t,e),this._invalidated=!0}function l(t,e){this._constructor="LineToolPitchfork";var i=e||this.createPropertiesObject("linetoolpitchfork");d.call(this,t,new n(this,t),i),this._properties.style.listeners().subscribe(this,l.prototype._recreatePaneView),this._recreatePaneView()}var h=i(2),c=i(9),d=i(1).LineDataSource,p=i(23),u=i(11).TrendLineRenderer,_=i(47).Action,f=i(8),m=i(6),g=i(14);o.prototype.extendPoints=function(t,e,i){var o=new h.Point(0,-5e3),n=new h.Point(i,5e3),s=e.substract(t),r=h.intersectRayWithRect(e,e.add(s),o,n);return r&&(e=r),!h.pointInRect(t,o,n)&&h.pointInRect(e,o,n)&&(r=h.intersectRayWithRect(e,t,o,n))&&(t=r),
!h.pointInRect(e,o,n)&&h.pointInRect(t,o,n)&&(r=h.intersectRayWithRect(t,e,o,n))&&(e=r),[t,e]},o.prototype.draw=function(t){var e=t.canvas.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e);t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y),i[1].x<o[1].x&&t.lineTo(o[1].x,i[1].y),t.lineTo(o[1].x,o[1].y),t.lineTo(o[0].x,o[0].y),t.lineTo(i[0].x,i[0].y),t.fillStyle=g.generateColor(this._data.color,this._data.transparency,!0),t.fill()},o.prototype.hitTest=function(t){var e,i,o,n;return this._data.hittestOnBackground?(e=this._data.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e),n=[new h.Point(i[0].x,i[0].y),new h.Point(i[1].x,i[1].y)],i[1].x<o[1].x&&n.push(new h.Point(o[1].x,i[1].y)),n.push(new h.Point(o[1].x,o[1].y)),n.push(new h.Point(o[0].x,o[0].y)),n.push(new h.Point(i[0].x,i[0].y)),h.isInPolygon(n,t)?new f(f.MOVEPOINT_BACKGROUND):null):null},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){c.prototype.update.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},n.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint)return t;if(e={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),this._floatPoints.length<3)return this.addAnchors(t),t;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._medianPoint.substract(this._floatPoints[0]),r=0,a=this._source.properties().fillBackground.value(),l=this._source.properties().transparency.value(),h=0;h<=8;h++)c="level"+h,p=this._source.properties()[c],p.visible.value()&&(_=this._medianPoint.addScaled(n,p.coeff.value()),g=_.add(s),v=this._medianPoint.addScaled(n,-p.coeff.value()),y=v.add(s),a&&(b={},b.width=this._model.timeScale().width(),b.p1=_,b.p2=g,b.p3=this._medianPoint.addScaled(n,r),b.p4=b.p3.add(s),
b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b)),b={},b.width=this._model.timeScale().width(),b.p1=v,b.p2=y,b.p3=this._medianPoint.addScaled(n,-r),b.p4=b.p3.add(s),b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b))),r=p.coeff.value(),w={points:[_,g],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(w,S)),T={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(T,S)));return this.addAnchors(t),t},inherit(s,n),s.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(e={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(i={points:[this._modifiedBase,this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._medianPoint.substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),c=0;c<=8;c++)p="level"+c,_=this._source.properties()[p],_.visible.value()&&(g=this._medianPoint.addScaled(s,_.coeff.value()),v=g.add(r),y=this._medianPoint.addScaled(s,-_.coeff.value()),b=y.add(r),l&&(e={},e.p1=g,e.p2=v,e.p3=this._medianPoint.addScaled(s,a),
e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e)),e={},e.p1=y,e.p2=b,e.p3=this._medianPoint.addScaled(s,-a),e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e))),a=_.coeff.value(),w={points:[g,v],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(w,S)),T={points:[y,b],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(T,S)));return this.addAnchors(t),t},s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},inherit(r,s),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){var t,e,i;n.prototype.updateImpl.call(this),this._floatPoints.length>2&&(t=this._floatPoints[0].x,e=.5*(this._floatPoints[0].y+this._floatPoints[1].y),i=new h.Point(t,e),this._modifiedBase=i)},inherit(a,n),a.prototype.update=function(){this._invalidated=!0},a.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},a.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T,C;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(3===this._floatPoints.length&&(e={points:[this._modifiedBase,this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e))),i={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),
color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._floatPoints[2].substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),c={points:[this._medianPoint,this._medianPoint.add(r)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(c)),p=0;p<=8;p++)_="level"+p,g=this._source.properties()[_],g.visible.value()&&(v=this._medianPoint.addScaled(s,g.coeff.value()),y=v.add(r),b=this._medianPoint.addScaled(s,-g.coeff.value()),w=b.add(r),l&&(i={},i.p1=v,i.p2=y,i.p3=this._medianPoint.addScaled(s,a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i)),i={},i.p1=b,i.p2=w,i.p3=this._medianPoint.addScaled(s,-a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i))),a=g.coeff.value(),S={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(S,T)),C={points:[b,w],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(C,T)));return this.addAnchors(t),t},inherit(l,d),l.STYLE_ORIGINAL=0,l.STYLE_SCHIFF=1,l.STYLE_INSIDE=2,l.STYLE_SCHIFF2=3,l.prototype.additionalActions=function(){var t,e,i=[],o=["Original","Modified Schiff","Inside","Schiff"];for(t=0;t<4;t++)e=new _({checked:this.properties().style.value()===t,checkable:!0,text:$.t(o[t]),callbackContext:{target:this,value:t}}),e.callbacks().subscribe(null,function(t){var e=t.callbackContext(),i=e.target,o=e.value;i.properties().style.setValue(o),i.updateAllViews(),i._model.updateSource(i)}),i.push(e);return[i[0],i[3],i[1],i[2]]},l.prototype._recreatePaneView=function(){
void 0!==t&&t&&t.exports&&(t.exports={inherit:n,clone:l.clone,merge:l.merge,isNumber:e,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:c,isHashObject:d,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:h,parseBool:l.parseBool,parseJSONorNot:i,ensure:a,declareClassAsPureInterface:s,requireFullInterfaceImplementation:r})}).call(e,i(50)(t))},function(t,e){"use strict";var i,o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),i={},o=RegExp("^([0-9]*)$"),n=RegExp("^(\\d*)([DWMS])$"),s=function(){function t(e,i){if(void 0===i&&e!==t.INVALID)return t.parse(e);var o=e;o!==t.SECONDS&&o!==t.MINUTES&&o!==t.HOURS&&o!==t.DAYS&&o!==t.WEEKS&&o!==t.MONTHS&&o!==t.INVALID&&(o="invalid"),this._kind=o,this._multiplier=i}return t.prototype.kind=function(){return this._kind},t.prototype.multiplier=function(){return this._multiplier},t.prototype.isValid=function(){return this.kind()!==t.INVALID},t.prototype.isDWM=function(){return this.isValid()&&!this.isIntraday()},t.prototype.isIntraday=function(){return-1!==[t.SECONDS,t.MINUTES,t.HOURS].indexOf(this.kind())},t.prototype.letter=function(){return this.isValid()&&this.kind()!==t.MINUTES?this.kind()[0].toUpperCase():""},t.prototype.value=function(){return this.isValid()?this.kind()===t.MINUTES?this.multiplier()+"":this.multiplier()+this.letter():""},t.prototype.isEqualTo=function(e){if(!(e instanceof t))throw Error("Argument is not an Interval");return this.kind()!==t.INVALID&&e.kind()!==t.INVALID&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())},t.prototype.inMilliseconds=function(){if(!this.isValid()||this.kind()===t.MONTHS)return NaN;var e=this.multiplier();return void 0===e?NaN:i[this.kind()]*e},t.isEqual=function(e,i){return t.parse(e).isEqualTo(t.parse(i))},t.parse=function(e){var i,s;return e=(e+"").toUpperCase().split(",")[0],i={D:t.DAYS,W:t.WEEKS,M:t.MONTHS,H:t.HOURS,S:t.SECONDS},(s=o.exec(e))?new t(t.MINUTES,parseInt(e,10)):(s=n.exec(e),s?new t(i[s[2]],parseInt(s[1],10)?parseInt(s[1],10):1):new t(t.INVALID))},t.isDWM=function(e){return t.parse(e).isDWM()},t.kind=function(e){return t.parse(e).kind()},t.isValid=function(e){return t.parse(e).isValid()},t}(),s.SECONDS="seconds",s.MINUTES="minutes",s.HOURS="hours",s.DAYS="days",s.WEEKS="weeks",s.MONTHS="months",s.INVALID="invalid",e.Interval=s,i[s.SECONDS]=1e3,i[s.MINUTES]=60*i[s.SECONDS],i[s.HOURS]=60*i[s.MINUTES],i[s.DAYS]=24*i[s.HOURS],i[s.WEEKS]=7*i[s.DAYS]},,,,,function(t,e,i){(function(t){"use strict";function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,s=this._owner?this._owner:this;if("function"==typeof s.hook&&(t=s.hook(t)),s.writeLock)return s._value;if(!e&&s._value===t&&s.hasOwnProperty("_value"))return t;for(s._value=t,i=s._listeners.slice(),o=0,n=0;n<i.length;n++)i[n].once&&(s._listeners.splice(n-o,1),o++),i[n].cb(t);return t},
i.prototype.deleteValue=function(){var t,e,i,o=this._owner?this._owner:this;if(o.hasOwnProperty("_value")){if(o.writeLock)return o._value;for(delete o._value,t=o._listeners.slice(),e=0,i=0;i<t.length;i++)t[i].once&&(o._listeners.splice(i-e,1),e++),t[i].cb()}},i.prototype.subscribe=function(t,e){var i,o,n;if("function"!=typeof t)throw new TypeError("callback must be a function");i=!!e&&!!e.once,o=!!e&&!!e.callWithLast,n=this._owner?this._owner:this,o&&n.hasOwnProperty("_value")&&(t(n._value),i)||n._listeners.push({cb:t,owner:this,once:!!e&&!!e.once})},i.prototype.unsubscribe=function(t){var e,i,o=this._owner?this._owner:this;for(void 0===t&&(t=null),e=o._listeners,i=e.length;i--;)e[i].owner!==this&&o!==this||e[i].cb!==t&&null!==t||e.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var t=this._readonlyInstance=new e;return t.subscribe=this.subscribe.bind(this),t.unsubscribe=this.unsubscribe.bind(this),t.value=this.value.bind(this),t.when=this.when.bind(this),t.spawn=function(){return this.spawn().readonly()}.bind(this),t},i.prototype.spawn=function(){var t=new i;return delete t._listeners,t._owner=this._owner||this,t.destroy=function(){this.unsubscribe(),delete this._owner},t},i.prototype.when=function(t){var e,i=this;if(this.value())return void t();e=function(o){o&&(i.unsubscribe(e),t())},i.subscribe(e)},i.prototype.opposite=function(){var t,e;return this._opposite||(t=this,e=new i(!this.value()),this.subscribe(function(t){e.setValue(!t)}),e.subscribe(function(e){t.setValue(!e)}),this._opposite=e),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(50)(t))},function(t,e,i){(function(e,o,n){"use strict";function s(t){return"cursor"===t||"arrow"===t||"dot"===t}function r(t){!t&&d&&d.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(t,e){return function(e){t.inFire||(t.inFire=!0,t.fire(e),t.inFire=!1)}}function l(){K||(g.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),g.subscribe(function(t){s(t)&&v.setValue(t)},{callWithLast:!0}),v.subscribe(function(t){t&&TVSettings.setValue("chart.cursorPreference",t)}),d=new h("drawings"),p=new n,u=new n,_=new n,f=new n,p.setValue(!1),u.setValue(!1),_.setValue(!1),f.setValue(!1),g.subscribe(function(){c.emit("onSelectedLineToolChanged")}),K=!0)}var h=i(7).DefaultProperty,c=i(34),d=null,p=null,u=null,_=null,f=null,m=new e,g=new e,v=new e,y=new o,b=new o,w=new o,S=new o,T=new o,C=new o,x=new o,P=new o,L=new o,k=new o,I=new o,A=new o,E=new o,M=new o,D=new o,O=a(y),$=a(b),V=a(w),B=a(S),R=a(T),N=a(C),F=a(x),z=a(P),W=a(L),H=a(k),U=a(I),j=a(A),q=a(E),Y=a(M),G=a(D),K=!1;t.exports={tool:g,cursorTool:v,toolIsCursor:s,resetToCursor:r,init:l,createdLineTool:y,continuedLineTool:b,cancelledLineTool:w,createLineTool:O,continueLineTool:$,cancelLineTool:V,startedMovingLineTool:S,movedLineTool:T,finishedMovingLineTool:C,startMovingLineTool:B,
moveLineTool:R,finishMovingLineTool:N,startedChangingLineTool:x,changedLineTool:P,finishedChangingLineTool:L,startChangingLineTool:F,changeLineTool:z,finishChangingLineTool:W,removedLineTool:k,removeLineTool:H,restoredLineTool:M,restoreLineTool:Y,restoredLineToolState:D,restoreLineToolState:G,finishedLineTool:I,finishLineTool:U,changedLineStyle:A,changeLineStyle:j,copiedLineTool:E,copyLineTool:q,properties:function(){return d},hideAllDrawings:function(){return p},hideMarksOnBars:function(){return _},lockDrawings:function(){return u},drawOnAllCharts:function(){return d.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(e,i(41),i(15),i(24))},function(t,e,i){(function(e,o,n,s){"use strict";function r(t){this._series=t,this._model=t.m_model,this._points=[new D.Point(0,0)],this._invalidated=!0}function a(){return{count:TradingView.DEFAULT_BAR_COUNT}}function l(t,n,s){var u,_=i(153);x.call(this,t),this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._symbolResolved=new e,this._symbolError=new e,this._symbolNotPermitted=new e,this._symbolGroupNotPermitted=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this._extendedHoursNotPermitted=new e,this.chartTypeNotPermitted=new e,this.intradaySpreadNotPermitted=new e,this.intradayExchangeNotPermitted=new e,this.customIntervalNotPermitted=new e,this.chartWidgetInitialized=new e,this._startLoading=new e,this._dataLoaded=new e,this._tickmarksRangeChanged=new e,this._barReceived=new e,this._onChangedStyle=new e,this._onCompleted=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this.priceScaleChanged=new e,this._requestOptions=s||a(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new E(this,t),this.setProperties(n),this._prevChartStyle=n.style.value(),this.createPaneView(),this._dataWindowView=new p(this,t),this._statusView=new h(this,t.properties()),this._priceAxisViews=[new d(this,t),new c(this,t)],this._symbolInfo=null,this._status=l.STATUS_OFFLINE,this._syncModel=null,u=this,this._turnaroundCounter=1,this._turnaround="s"+this._turnaroundCounter,this._handler=function(t){u.onData(t)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new V(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new o,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,l.prototype._recreateFormatter),u=this,this.properties().minTick.listeners().subscribe(null,function(){u.m_model.invalidate(new M(M.FULL_UPDATE))}),this._priceLineView=new r(this),this._gotoDateView=new C(this),this.bindStyleChange(),this.bindJapChartsInputs(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()}),
this._extendedHoursNotPermitted.subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==l.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,l.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V,B,R,N,F,z,W,H,U,j;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,TradingView.SEARCH_FROM_LEFT=-1,TradingView.SEARCH_FROM_RIGHT=1,h=i(699),c=i(696),d=i(347),p=i(698),u=i(346),_=u.SeriesAreaPaneView,f=u.SeriesLinePaneView,m=u.SeriesHollowCandlesPaneView,g=u.SeriesCandlesPaneView,v=u.SeriesBarsPaneView,y=u.SeriesHeikenAshiPaneView,b=i(3),w=i(304),S=i(196).SeriesBarColorer,T=i(89).HorzLineRenderer,C=i(685),x=i(48).PriceDataSource,P=i(158),L=i(700).FutureBarsPaneView,k=i(36).Interval,I=i(8),A=i(198),E=i(345),M=i(21),D=i(2),O=i(285),V=i(27).PriceFormatter,B=i(86),R=i(25),N=i(356).SyncModel,F=i(33).trackEvent,z=i(164).translatedIntervalString,W=i(60),H=i(12),U=H.getLogger("Chart.Series"),j=H.getLogger("Chart.Series.Updates",{highRate:!0}),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){if(this._visible=!1,this._series.properties().showPriceLine.value()){var t=this._series.lastValueData(TradingView.CLOSE_PLOT,!0);t.noData||(this._visible=!0,this._points=[new D.Point(0,t.coordinate)],this._color=t.color)}},r.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().priceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=I.REGULAR,t.visible=this._visible,new T(t)},inherit(l,x),l.prototype.endOfData=function(){return this._endOfData},l.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},l.prototype._onChangeShowCountdown=function(t){var e=this;t.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){e.isDWM()||(e._priceAxisViews[0].update(),e.m_model.invalidate(new M(M.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},l.prototype.lastValueData=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return u;if(o=this.m_model.timeScale().visibleBars(),o.isEmpty())return u;if(e){if(null===(r=this.data().bars().last())||void 0===r)return u;n=r.value,s=parseInt(r)}else{if(null===(a=this.data().bars().search(o.lastBar(),TradingView.SEARCH_NEAREST_LEFT))||void 0===a)return u;n=this.data().bars().valueAt(a.index),s=a.index}return l={noData:!1},h=n[TradingView.CLOSE_PLOT],
i&&(l.price=h),this.priceScale().properties().percentage.value()&&(c=this.firstValue(),h=this.priceScale().priceRange().convertToPercent(h,c)),l.text=this.priceScale().formatter().format(h),d=this.barColorer(),p=d.barStyle(s,!1),l.color=p.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=s,l},l.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},l.prototype._nextSymbolId=1,l.prototype._nextSeriesId=1,l.STYLE_BARS=0,l.STYLE_CANDLES=1,l.STYLE_LINE=2,l.STYLE_LINE_TYPE_MARKERS=0,l.STYLE_LINE_TYPE_STEP=1,l.STYLE_LINE_TYPE_SIMPLE=2,l.STYLE_AREA=3,l.STYLE_RENKO=4,l.STYLE_KAGI=5,l.STYLE_PNF=6,l.STYLE_PB=7,l.STYLE_HEIKEN_ASHI=8,l.STYLE_HOLLOW_CANDLES=9,Object.assign(l,i(697)),l.PERMISSION_DENIED="permission denied",l.PD_REASON_SYMBOL="symbol",l.PD_REASON_EXTENDED_HOURS="extended_hours",l.PD_REASON_GROUP_PERMISSION="group",l.STUDY_NOT_AUTH="study_not_auth",l.STYLE_SHORT_NAMES={},l.STYLE_SHORT_NAMES[l.STYLE_BARS]="bar",l.STYLE_SHORT_NAMES[l.STYLE_CANDLES]="candle",l.STYLE_SHORT_NAMES[l.STYLE_HOLLOW_CANDLES]="hollowCandle",l.STYLE_SHORT_NAMES[l.STYLE_LINE]="line",l.STYLE_SHORT_NAMES[l.STYLE_AREA]="area",l.STYLE_SHORT_NAMES[l.STYLE_RENKO]="renko",l.STYLE_SHORT_NAMES[l.STYLE_PB]="pb",l.STYLE_SHORT_NAMES[l.STYLE_KAGI]="kagi",l.STYLE_SHORT_NAMES[l.STYLE_PNF]="pnf",l.STYLE_SHORT_NAMES[l.STYLE_HEIKEN_ASHI]="ha",l._SYMBOL_STRING_DATA={},l._SYMBOL_STRING_DATA[l.STYLE_RENKO]={type:"BarSetRenko@tv-prostudies-1!",inputNames:["source","style","boxSize","atrLength"]},l._SYMBOL_STRING_DATA[l.STYLE_PB]={type:"BarSetPriceBreak@tv-prostudies-1!",inputNames:["source","lb"]},l._SYMBOL_STRING_DATA[l.STYLE_KAGI]={type:"BarSetKagi@tv-prostudies-1!",inputNames:["source","style","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_PNF]={type:"BarSetPnF@tv-prostudies-1!",inputNames:["sources","style","boxSize","atrLength","reversalAmount"]},l._SYMBOL_STRING_DATA[l.STYLE_HEIKEN_ASHI]={type:"BarSetHeikenAshi@tv-basicstudies-1!",inputNames:[]},l.prototype.model=function(){return this.m_model},l.prototype.fixLastBar=function(t){this._futureBarsPaneView||(this._futureBarsPaneView=new L(this,this.data().bars().lastTimeIndex(),t))},l.prototype.clearData=function(){this.data().clear()},l.prototype.data=function(){return this.m_data},l.prototype.symbolId=function(){return this._symbolId},l.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},l.prototype.onSymbolResolved=function(){
return this._symbolResolved},l.prototype.onSymbolError=function(){return this._symbolError},l.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted},l.prototype.onSymbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},l.prototype.onIntervalChanged=function(){return this._intervalChanged},l.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},l.prototype.onStartLoading=function(){return this._startLoading},l.prototype.onDataLoaded=function(){return this._dataLoaded},l.prototype.onStatusChanged=function(){return this._onStatusChanged},l.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged},l.prototype.onBarReceived=function(){return this._barReceived},l.prototype.onChangedStyle=function(){return this._onChangedStyle},l.prototype.onCompleted=function(){return this._onCompleted},l.prototype.onRestarted=function(){return this._onRestarted},l.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},l.prototype.status=function(){return this._status},l.prototype.isDWM=function(){var t,e;return null!==this._isDWMCached?this._isDWMCached:(t=new k(this._properties.interval.value()),t.isDWM()?this._isDWMCached=!0:(e=t.kind()===k.SECONDS?t.multiplier():60*t.multiplier(),this._isDWMCached=!(e<216e3)),this._isDWMCached)},l.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},l.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._symbolLabelView=new P(this.m_model,this,TradingView.CLOSE_PLOT,"firstShortName","showSymbolLabels");var t=this._properties.style.value();switch(t){case l.STYLE_BARS:this._paneView=new v(this,this.m_model);break;case l.STYLE_CANDLES:this._paneView=new g(this,this.m_model);break;case l.STYLE_LINE:this._paneView=new f(this,this._properties.lineStyle.priceSource.value(),this.m_model);break;case l.STYLE_AREA:this._paneView=new _(this,this._properties.areaStyle.priceSource.value(),this.m_model);break;case l.STYLE_HEIKEN_ASHI:this._paneView=new y(this,this.m_model);break;case l.STYLE_HOLLOW_CANDLES:this._paneView=new m(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+t)}},l.prototype._clearStylePlot=function(t,e){var i,o;t.size()&&(i=e||+t.first(),o=+t.last()+1,t.range(i,o).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},l.prototype.invalidateBarStylesCache=function(t){U.logDebug("Invalidate style cache starting from "+t),this._clearStylePlot(this.m_data.m_bars,t),this._clearStylePlot(this.m_data.m_nsBars)},l.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},l.prototype.barColorer=function(){var t,e,i,o;if(this._barColorerCache)return this._barColorerCache;for(t=null,e=this.m_model.dataSources().length-1;e>=0;e--)i=this.m_model.dataSources()[e],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(o=i.barColorer(),null===t?t=o:t.pushBackBarColorer(o))
;return null===t?t=new S(this):t.pushBackBarColorer(new S(this)),this._barColorerCache=t,this._barColorerCache},l.prototype.properties=function(){return this._properties},l.prototype._barsState=function(t){var e=t.state();return e.columns=e.columns.filter(function(t){return"style"!==t}),e.data.forEach(function(t){t.value.splice(7,1)}),e},l.prototype.state=function(t){var e=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),zorder:this.zorder()};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),t&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},l.prototype.stateForAlert=function(){var t=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor);return{id:this.id(),uniqueId:this.uniqueId(),type:t,proSymbol:this.proSymbol(),actualSymbol:this.actualSymbol(),symbolString:this.getSymbolString(),interval:this.interval(),style:this.properties().style.value(),styleInputs:this.getInputsProperties().state(),extendedHours:this.extendedHours.value(),boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount}},l.prototype.uniqueId=function(){return this.actualSymbol()+"|"+this.interval()},l.prototype.restoreData=function(t,e,i,o,n,s){this._status=l.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(t),this.m_data.m_nsBars.restoreState(e),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=o,this.m_data.boxSize=n,n||(this.properties().style.value()===l.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===l.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=s,s||this.properties().style.value()===l.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},l.prototype.setProperties=function(t){t.timeframe||t.merge({timeframe:""}),t.shortName||t.merge({shortName:""}),this._properties=t,this._properties.symbol.listeners().subscribe(this,l.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,l.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,l.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,l.prototype.changeProperties)},l.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},l.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},l.prototype.changeTimeFrame=function(){F("GUI","Change timeframe")},l.prototype.title=function(){return this.properties().symbol.value()+", "+z(this.properties().interval.value())},l.generateTitleForGui=function(t){function e(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)||""}var i,o,n,s=t||{},r="QUANDL"===s.exchange,a="",h={
symbolDescription:"",interval:"",exchange:"",chartStyle:""};switch(s.description&&r?2===s.description.split("/").length?h.symbolDescription=s.description.split("/")[1]:(i=s.description.split("'").filter(function(t){return t.length}),i.forEach(function(t){t=t&&("/"===t[0]||/\d+\/\(?/.test(t))?[t]:t.split("/").filter(function(t){return t.length}),h.symbolDescription+=t[2===t.length?1:0]})):s.description?h.symbolDescription=s.description:h.symbolDescription=s.symbol,s.interval&&(h.interval=z(s.interval)),r&&s.description&&(o=/[\w_]+\/[\w_]+/.exec(s.description),o&&o[0]?h.provider=o[0].split("/")[0]:h.provider=s.description.split("/")[0]),s.exchange&&(h.exchange=s.exchange),s.style){case l.STYLE_RENKO:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Renko")+" ["+s.inputs.source+", "+n+", "+e(s.boxSize,4)+"]";break;case l.STYLE_PB:h.chartStyle=$.t("Line Break")+" ["+s.inputs.source+", "+s.inputs.lb+"]";break;case l.STYLE_KAGI:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("Kagi")+" ["+s.inputs.source+", "+n+", "+e(s.reversalAmount,8)+"]";break;case l.STYLE_PNF:n=s.inputs.style+("ATR"===s.inputs.style?"("+s.inputs.atrLength+")":""),h.chartStyle=$.t("PnF")+" ["+s.inputs.sources+", "+n+", "+e(s.boxSize,8)+", "+s.inputs.reversalAmount+"]";break;case l.STYLE_HEIKEN_ASHI:h.chartStyle=$.t("Heikin Ashi")}return a=h.symbolDescription+(h.interval?", "+h.interval:"")+(h.provider?", "+h.provider:"")+(h.exchange?", "+h.exchange:"")+(h.chartStyle?", "+h.chartStyle:""),a=a.replace(/\'/g,"")},l.prototype.changeProperties=function(t){t!==this._properties.symbol&&t!==this._properties.interval&&t!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},l.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},l.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},l.prototype.onData=function(t){var e,i,o,n,s,r,a,h,c,d,p,u,_,f,m,g,v,y,w=this;switch(t.method){case"symbol_resolved":if(t.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}this.updateSymbolInfo(t.params[1]),this.m_model.updateSource(this),this._symbolResolved.fire(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||F("Symbol",t.params[1].listed_exchange,t.params[1].name),e=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===l.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<e?i.renkoStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<e?i.pnfStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<e&&i.kagiStyle.inputs.merge({reversalAmount:e});break;case"symbol_error":if(t.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}if(this._setStatus(l.STATUS_INVALID_SYMBOL),
this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),t.params[1]===l.PERMISSION_DENIED)switch(t.params[2]){case l.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case l.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(t.params[3]);break;case l.PD_REASON_GROUP_PERMISSION:this._symbolGroupNotPermitted.fire(t.params[3]);break;default:this._symbolNotPermitted.fire(t.params[2])}else this.m_model.resetTimeScale(),this._symbolError.fire();this.m_model.realignLineTools();break;case"series_timeframe":if(t.params[1]!==this._turnaround)break;o=t.params[2],n=t.params[3],s=t.params[4],r=void 0!==s&&s?n:n+10,this.m_model.setTimeViewport(o,r);break;case"series_error":a=t.params[2],delete this._loadingStartTime,b.enabled("charting_library_debug_mode")&&U.logNormal("Error reason: "+a),this._setStatus(b.enabled("no_bars_status")&&this._symbolInfo?l.STATUS_NO_BARS:l.STATUS_INVALID_SYMBOL),a&&a.startsWith("study_not_auth:")?(h=a.split(":",2)[1].split("@",2)[0],h in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(h):"BarSetSpread"===h&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"===a?this.intradayExchangeNotPermitted.fire():"custom_resolution"===a&&this.customIntervalNotPermitted.fire(),this._seriesLoaded=!0;break;case"series_loading":if(t.params[1]!==this._turnaround)break;if(t.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}this._setStatus(l.STATUS_LOADING),w._loadingStartTime=(new Date).getTime();break;case"series_completed":if(t.params[2]!==this._turnaround)break;if(t.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}switch(c="chartSession:"+w._chartApi._sessionid,d=(new Date).getTime()-this._loadingStartTime,U.logDebug(c+", Series loading took "+d+" ms, eod:"+this._endOfData),delete this._loadingStartTime,p=t.params[1],"pulsed"===p&&(p="delayed"),p){case"streaming":this._setStatus(l.STATUS_READY);break;case"endofday":this._setStatus(l.STATUS_EOD);break;case"delayed":this._setStatus(l.STATUS_DELAYED);break;case"pulsed":this._setStatus(l.STATUS_PULSE)}p.match(/delayed_streaming/)&&this._setStatus(l.STATUS_DELAYED_STREAMING),u=this.m_model.paneForSource(this),u.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new M(M.FULL_UPDATE)),this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TradingView.TIME_PLOT],end:this.data().last().value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),_=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(_.firstBar(),_.lastBar()))),
this._seriesLoaded=!0,this._onCompleted.fire(this._endOfData),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(t.params.customId!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}if(this.status()===l.STATUS_INVALID_SYMBOL)break;t.params.plots.length?(f=this.m_data.m_bars.size(),m=this.m_data.m_bars.first(),g=void 0!==m?m.valueOf():null,v=this.m_data.m_bars.merge(t.params.plots),(null===g||v.earliestRow.index<g)&&(this._endOfData=!1),y="Merge bars. Changes:{length:"+v.length+", earliestRow:"+v.earliestRow.index+"} ",y+="bars state:{firstBar:"+this.m_data.m_bars.first()+",lastBar:"+this.m_data.m_bars.last()+",size:"+this.m_data.m_bars.size()+"}",j.logDebug(y),f!==this.bars().size()&&(this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):(this.m_data.clear(),this._startLoading.fire()),new Promise(function(e){var i=w.properties().style.value();!t.params.nonseries||i!==l.STYLE_RENKO&&i!==l.STYLE_KAGI&&i!==l.STYLE_PNF&&i!==l.STYLE_HEIKEN_ASHI&&i!==l.STYLE_PB?(t.params.nonseries||(w.m_data.m_nsBars.clear(),w.m_data.lastProjectionPrice=void 0),e(),e()):w.parseJapProjBars(t.params.nonseries).then(function(t){w.m_data.m_nsBars=t.nsBars,w.m_data.lastProjectionPrice=t.lastPrice;var i=w.m_data.boxSize!==t.boxSize;w.m_data.boxSize=t.boxSize,w.m_data.reversalAmount=t.reversalAmount,i&&w._boxSizeChanged.fire(w.m_data.boxSize),e()})}).then(function(){var t=w.m_model.paneForSource(w);w.m_model.updateAllVolumeStudies(),w.m_model.recalculatePane(t),w.m_model.updateSource(w),w.m_model.updateLineTools(),w.m_model.updateCrossHair()})}this._dataLoaded.fire(t)},l.prototype.fixBoxSize=function(){var t=this.model().timeScale(),e=this.priceScale();e.isEmpty()||t.isEmpty()||(this.m_data.boxSize=Math.abs(e.coordinateToPrice(t.barSpacing())-e.coordinateToPrice(0)))},l.prototype.parseJapProjBars=function(t){var e,i,o,n=new B(["time","open","high","low","close","adt","style"]),s=this.model().timeScale(),r=this.properties().style.value(),a=this;return new Promise(function(h){t.d&&""!==t.d?TradingView.Study.prototype._makeJSONForNSData.call(a,{params:{nonseries:t}}).then(function(a){var c,d,p,u,_=a.data;for(e=_.price,i=_.boxSize,o=_.reversalAmount,c=_.bars,d=0;c&&d<c.length;d++)p=[],u=t.indexes[c[d].time],p.push(s.points().valueAt(u)),p.push(c[d].open),p.push(c[d].high),p.push(c[d].low),p.push(c[d].close),p.push(c[d].volume),r===l.STYLE_KAGI?p.push(c[d].additionalPrice):r===l.STYLE_PNF&&p.push(c[d].factor),n.add(u,p);h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})}):h({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})})},l.prototype.disconnect=function(){this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=l.STATUS_OFFLINE},l.prototype.isStarted=function(){return!!this._symbolId},l.prototype.restart=function(){var t,e=i(153);this._onRestarted.fire(),this._setStatus(l.STATUS_RESOLVING),this.m_data=new E(this,this.model()),this._prevSymbolId=this._symbolId,
this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},l.prototype._generateTimeframe=function(t,e){var i,o=e.right(1),n=t;return"ytd"===e?n+=",YTD":"d"===o?(i=e.left(e.length-1),n+=","+i,b.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===o?(i=e.left(e.length-1),n+=","+i+"M"):"all"===e&&(n+=",ALL"),n},l.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},l.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,(this._checkSymbolWillChanged(this._properties.symbol.value())||this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval))&&(this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay),this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30))},l.prototype._checkSymbolWillChanged=function(t){return!this.symbolSameAsCurrent(t)||b.enabled("same_data_requery")},l.prototype._checkIntervalWillChanged=function(t){return this.m_interval!==t||b.enabled("same_data_requery")},l.prototype._parseInterval=function(t){var e=(t+"").split(",");return{interval:2===e.length?e[0]:t,timeframe:2===e.length?e[1]:0}},l.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},l.prototype._setSymbolInterval=function(t,e,i){var o,n,s,r,a,h;delete this._gotoDateResult,o=this._parseInterval(e),n=o.interval,s=o.timeframe,r=this._checkSymbolWillChanged(t),a=this._checkIntervalWillChanged(n),(r||a||i)&&(this._syncModel=null,this.m_symbol=t,this.m_interval=n,this.m_timeframe=s,this._symbolId&&!r||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==l.STATUS_SNAPSHOT&&(this._setStatus(l.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),a&&(h={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,h),this._pendingTimeRange=h.timeframe&&h.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!r||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler)),
this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._predictBars=0,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)))))},l.prototype.setDefaultTimeframe=function(t){this._pendingTimeRange=t},l.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},l.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},l.prototype.symbol=function(){return this.properties().symbol.value()},l.prototype.interval=function(){return this.properties().interval.value()},l.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&this.interval()<=1440},l.prototype.bars=function(){return this.m_data.m_bars},l.prototype.nsBars=function(){return this.m_data.m_nsBars},l.prototype.open=function(t){return this.m_data.valueAt(t)[TradingView.OPEN_PLOT]},l.prototype.high=function(t){return this.m_data.valueAt(t)[TradingView.HIGH_PLOT]},l.prototype.low=function(t){return this.m_data.valueAt(t)[TradingView.LOW_PLOT]},l.prototype.close=function(t){return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT]},l.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},l.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},l.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},l.prototype.priceRange=function(t,e){var i,o,s,r,a,l,h,c;return TradingView.isInteger(t)?TradingView.isInteger(e)?this.data().isEmpty()?null:(o=this.data().boxSize,this.isLockScale()?(void 0===o&&this.fixBoxSize(),s=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),r=this.data().search(e,TradingView.SEARCH_NEAREST_LEFT),a=(r.value[TradingView.HIGH_PLOT]+r.value[TradingView.LOW_PLOT])/2,i=new n(a-.5*s,a+.5*s),l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),this.priceScale().properties().percentage.value()&&i?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):i):(h=this.data().bars().minMaxOnRange2(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),c=this.data().nsBars().minMaxOnRange(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),null!=c.min&&(h.min=Math.min(h.min,c.min)),null!=c.max&&(h.max=Math.max(h.max,c.max)),i=new n(h.min,h.max),i.minValue()===i.maxValue()&&(i=new n(i.minValue()-.5,i.maxValue()+.5)),this.priceScale().properties().percentage.value()&&i?(l=this.data().search(t,TradingView.SEARCH_NEAREST_RIGHT),
l?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):null):this.priceScale().isLog()&&i?new n(this.priceScale().priceToLogical(i.minValue()),this.priceScale().priceToLogical(i.maxValue())):i)):(U.logDebug("Series.priceRange: incorrect endBar"),null):(U.logDebug("Series.priceRange: incorrect startBar"),null)},l.prototype.nearestData=function(t,e){return TradingView.isInteger(t)?this.data().search(t,e)||void 0:void U.logDebug("Series.nearestData: incorrect logicalPoint")},l.prototype.nearestIndex=function(t,e){var i=this.nearestData(t,e);return i?i.index:void 0},l.prototype.paneViews=function(t){if(!this.properties().visible.value())return null;var e=[this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),e.push(this._priceLineView),e.push(this._symbolLabelView),e.push(this._gotoDateView),e},l.prototype.dataWindowView=function(){return this._dataWindowView},l.prototype.statusView=function(){return this._statusView},l.prototype.priceAxisViews=function(t,e){return this.m_model.paneForSource(this)===t&&e===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},l.prototype.base=function(){return this._base},l.prototype.formatter=function(){return this._formatter},l.prototype.purgeSymbolInfo=function(){this._symbolInfo=null},l.prototype.symbolInfo=function(){return this._symbolInfo},l.prototype._recreateFormatter=function(){var t,e,i,o;"default"===this.properties().minTick.value()?this._formatter=new V(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(t=this.properties().minTick.value().split(","),e=parseInt(t[0]),i=parseInt(t[1]),o="true"===t[2],this._formatter=new V(e,i,o)),this.priceScale()&&this.priceScale().updateFormatter()},l.prototype.updateSymbolInfo=function(t){var e=this,i=t&&(t.pro_name||t.full_name||t.name);b.enabled("charting_library_single_symbol_request")&&this.m_symbol&&(i=this.m_symbol),this._symbolInfo=t,t&&(this._properties.shortName.setValue(t.name),i&&this._properties.symbol.value().toUpperCase()!==i.toUpperCase()&&this._properties.symbol.setValue(i)),this._base=t?t.pricescale/t.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),"undefined"!=typeof quoteSessionMultiplexerInstance&&this._quoteSessionSymbol!==i&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+W.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),i&&(this._quoteSessionSymbol=i,quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(t,i){e.quoteData=t&&t.values||null,i&&i.values&&i.values.current_session&&e.marketStatus.setValue(i.values.current_session)}))),
this.checkInterval(),this.dataPoweredBy=A(t)},l.prototype.symbolSameAsCurrent=function(t){if(this.m_symbol===t)return!0;var e=this._symbolInfo;if(e){if(e.full_name===t||e.pro_name===t)return!0;if(e.ticker===t)return!0;if(e.aliases&&-1!==e.aliases.indexOf(t))return!0;if(e.alternatives&&-1!==e.alternatives.indexOf(t))return!0}return!1},l.prototype.updateAllViews=function(){this._paneView.update(),this._dataWindowView.update(),this._statusView.update(),this._priceAxisViews[0].update(),this._priceAxisViews[1].update(),this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),this._priceLineView.update(),this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update()},l.prototype._setStatus=function(t){this._status=t,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},l.prototype.requestMoreData=function(t){var e,i,o,n;this._status!==l.STATUS_READY&&this._status!==l.STATUS_PULSE&&this._status!==l.STATUS_DELAYED&&this._status!==l.STATUS_DELAYED_STREAMING&&this._status!==l.STATUS_EOD||this.m_model.timeScale().isEmpty()||(e=this.m_model.timeScale().visibleBars(),e.isEmpty()||0!==this.bars().size()&&(i=t||e.lastBar()-this.data().last(),this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(o=this.bars()._indexAt(0),(n=t||o-e.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,n,this._handler),b.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(l.STATUS_LOADING)))))},l.prototype.bindStyleChange=function(){var t=this;["candleStyle","hollowCandleStyle","haStyle","barStyle","lineStyle","areaStyle","renkoStyle","pbStyle","kagiStyle","pnfStyle"].forEach(function(e){t._properties[e].listeners().subscribe(t,l.prototype.invalidateBarStylesCache)})},l.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged),
this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var t=this;this._properties.lockScale.listeners().subscribe(this,function(e){e.value()&&t.model().timeScale().recalcLockedScale()})},l.prototype.createExtendedHoursProperty=function(){function t(){var t="undefined"!=typeof productFeatures&&b.enabled(productFeatures.EXTENDED_SESSION),i=e.model().readOnly(),o=e._properties.extendedHours.value(),n=b.enabled("widget");!o||n||i||t||(e._extendedHoursNotPermitted.fire(),o=!1),o&&!e.isIntradayInterval()&&(o=!1),e.extendedHours.setValue(o)}var e=this;e.extendedHours=new s,e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()},l.prototype.isNeedRestart=function(t){if(void 0===t&&(t=this.properties().style.value()),this._prevChartStyle!==t){var e=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_HOLLOW_CANDLES,l.STYLE_LINE,l.STYLE_AREA];if(!(e.indexOf(this._prevChartStyle)>-1&&e.indexOf(t)>-1))return!0}return!1},l.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onChangedStyle.fire(this.properties().style.value()),this.invalidateBarStylesCache()},l.prototype.onInputChanged=function(){this.restart()},l.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},l.prototype.getSymbolString=function(){var t,e,i;return t=b.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(t={symbol:t,session:"extended"}),l._SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e=this.getInputsProperties(),i=l._SYMBOL_STRING_DATA[this._properties.style.value()],t={symbol:t,type:i.type,inputs:i.inputNames.map(function(t){return e[t].value()})}),"string"!=typeof t&&(t="="+JSON.stringify(t)),t},l.parseSymbolString=function(t){var e,i,o,n,s,r,a,h=Object.keys(l._SYMBOL_STRING_DATA),c={symbol:null,style:null,extendedHours:null,inputs:null};if(t&&0===t.indexOf("=")){if(e=t.slice(1),e=JSON.parse(e),c.symbol=e.symbol,e.type)for(r=0;r<h.length;r++)if(o=h[r],i=l._SYMBOL_STRING_DATA[o],i.type===e.type){for(c.style=parseInt(o),c.inputs={},a=0;a<i.inputNames.length;a++)s=e.inputs[a],n=i.inputNames[a],c.inputs[n]=s;break}"extended"===c.symbol.session&&(c.extendedHours=!0,c.symbol=c.symbol.symbol)}else c.symbol=t;return c},l.prototype.getStyleShortName=function(){var t=this._properties.style.value();if(l.STYLE_SHORT_NAMES.hasOwnProperty(t))return l.STYLE_SHORT_NAMES[t]
;throw Error("Missed short name for style "+t)},l.prototype.getInputsProperties=function(){return this._properties[this.getStyleShortName()+"Style"].inputs||new s},l.prototype.getRealVisibleRange=function(){var t=this.model().timeScale().visibleBars(),e=this.data().search(t.m_firstBar,TradingView.SEARCH_NEAREST_RIGHT),i=this.data().search(t.m_lastBar,TradingView.SEARCH_NEAREST_LEFT);return void 0===e||void 0===i?null:new w(e.index,i.index)},l.prototype.isLockScale=function(){return this.properties().lockScale.value()},l.prototype.firstValue=function(){return this.data().firstValue()},l.prototype.firstBar=function(){return this.data().firstBar()};l.prototype.sessionsStudy=function(){var t,e,i,o;if(this._sessionsStudy)return this._sessionsStudy;for(t=this.model().paneForSource(this),e=t.dataSources(),i=0;i<e.length;i++)if((o=e[i])instanceof TradingView.Study&&"Sessions"===o.metaInfo().shortId)return this._sessionsStudy=o,this._sessionsStudy;return!1},l.prototype.createSessStudy=function(){if(!b.enabled("charting_library_base")&&!this.sessionsStudy()){var t=R.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(t,!1,!0),this._onSessionsStudyCreated.fire()}},l.prototype.checkSessStudy=function(){b.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},l.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},l.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},l.prototype.firstShortName=function(){return O.ticker(this.firstSymbol())},l.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},l.prototype.loadDataTo=function(t){this._turnaround="s"+ ++this._turnaroundCounter;var e=this._properties.interval.value();e=this._generateTimeframe(e,t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler)},l.prototype.checkInterval=function(){if(this._symbolInfo&&(k.kind(this.interval())!==k.MINUTES||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var t=this._properties.interval.value();-1===this._symbolInfo.supported_resolutions.indexOf(t)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},l.prototype.setPriceScale=function(t){this.m_priceScale!==t&&(this.m_priceScale=t,this.priceScaleChanged.fire(t))},l.prototype.setGotoDateResult=function(t){this._gotoDateResult=t},l.prototype.gotoDateResult=function(){return this._gotoDateResult},l.prototype.syncModel=function(){var t,e;if(!this._syncModel){if(t=this.symbolInfo(),e=this.interval(),!t||!e)return null;this._syncModel=new N(t,e)}return this._syncModel},l.prototype.turnaround=function(){return this._turnaround},TradingView.Series=l,t.exports=l}).call(e,i(15),i(41),i(107),i(24))},function(t,e){"use strict";function i(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=i
},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittestResult=e||new c(c.MOVEPOINT),this._backHittestResult=i||new c(c.MOVEPOINT_BACKGROUND)}function n(t,e){h.call(this,t,e),this._invalidated=!0}function s(t,e){this._constructor="LineToolRectangle";var i=e||new p("linetoolrectangle");l.call(this,t,new n(this,t),i)}function r(t,e,i){o.call(this,t,e,i)}var a=i(2),l=i(1).LineDataSource,h=i(9),c=i(8),d=i(6),p=i(7).DefaultProperty,u=i(14);o.prototype.getColor=function(){return u.generateColor(this._data.backcolor,this._data.transparency)},o.prototype.draw=function(t){var e,i,o;this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=i.substract(e),t.beginPath(),t.rect(e.x,e.y,o.x,o.y),this._data.linewidth>0&&t.stroke(),this._data.fillBackground&&(t.fillStyle=this.getColor(),t.fill()))},o.prototype.hitTest=function(t){var e,i,o,n,s,r,l,h,c,d;return this._data.points.length<2||this._data.nohittest?null:(e=3,i=this._data.points[0],o=this._data.points[1],n=new a.Point(o.x,i.y),s=new a.Point(i.x,o.y),r=a.distanceToSegment(i,n,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(n,o,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(o,s,t),r.distance<=e?this._hittestResult:(r=a.distanceToSegment(s,i,t),r.distance<=e?this._hittestResult:this._data.fillBackground&&(l=Math.min(i.x,o.x),h=Math.max(i.x,o.x),c=Math.min(i.y,o.y),d=Math.max(i.y,o.y),i=new a.Point(l,c),o=new a.Point(h,d),a.pointInRect(t,i,o))?this._backHittestResult:null))))},inherit(n,h),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){h.prototype.update.call(this),this._invalidated=!1},n.prototype.renderer=function(){var t,e,i,n,s,r;return this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.linewidth=this._source.properties().linewidth.value(),t.backcolor=this._source.properties().backgroundColor.value(),t.fillBackground=this._source.properties().fillBackground.value(),t.transparency=this._source.properties().transparency.value(),this.isAnchorsRequired()?(e=new d,e.append(new o(t)),i=this._points[0],n=this._points[1],s=new a.Point(i.x,n.y),s.data=2,r=new a.Point(n.x,i.y),r.data=3,e.append(this.createLineAnchor({points:[i,n,s,r]})),e):new o(t)},inherit(s,l),s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Rectangle"},s.prototype.setPoint=function(t,e,i){var o,n,s;if(t<2)return void l.prototype.setPoint.call(this,t,e,i);i&&i.shift&&this._properties.snapTo45Degrees&&(o=this.points()[0],n=this.points()[1],s={price:2===t?o.price:n.price,index:2===t?n.index:o.index},this._snapPoint45Degree(e,s)),this._convertPriceFromPercentIfNeeded(e),3===t?(this._points[0].price=e.price,this._points[1].index=e.index):(this._points[1].price=e.price,this._points[0].index=e.index),this.normalizePoints()},inherit(r,o),r.prototype.getColor=function(){
return u.generateColor(this._data.backcolor,this._data.transparency,!0)},e.RectangleRenderer=o,e.RectangleTransparencyRenderer=r,e.LineToolRectangle=s},function(t,e,i){"use strict";function o(t){var e=$('<div class="transparency-slider"><div class="gradient"></div></div>').slider({max:100,min:0,step:1}),i=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];return e.updateColor=function(t){var o=e.find(".gradient");i.forEach(function(e){o.css("background-image",e.replace(/%COLOR/,t))})},t?(e.updateColor(t.val()||"black"),t.on("change",function(t){e.updateColor(t.target.value)})):e.updateColor("black"),e}Object.defineProperty(e,"__esModule",{value:!0}),i(17),e.createTransparencyEditor=o},function(t,e,i){(function(t){"use strict";function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function s(t){o.call(this),this.deferred=t}var r=i(366);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,!0!==e&&this._bindShortCut())},o.prototype._bindShortCut=function(){r.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){r.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(s,o),e.Action=o,
e.ActionSeparator=n,e.ActionPlaceholder=s}).call(e,i(15))},function(t,e,i){(function(t){"use strict";function o(){this._zorder=0,this.m_priceScale=null,this._id=r.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new t(!1)}function n(t){o.call(this),this._isOverlay=null,this._model=t}var s=i(7).DefaultProperty,r=i(60);o.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i)},o.prototype.id=function(){return this._id},o.prototype.uniqueId=function(){return this._id},o.prototype.setId=function(t){this._id=t},o.prototype.zorder=function(){return this._zorder},o.prototype.setZorder=function(t){"number"==typeof t&&this._zorder!==t&&(this._zorder=t)},o.prototype.title=function(){throw Error("Implement this fun in a subclass")},o.prototype.priceScale=function(){return this.m_priceScale},o.prototype.setPriceScale=function(t){this.m_priceScale=t},o.prototype.ownerSource=function(){return this._ownerSource},o.prototype.setOwnerSource=function(t){this._ownerSource=t,t&&this.setPriceScale(t.priceScale())},o.prototype.isSavedInChart=function(t){return!0},o.prototype.isSavedInStudyTemplates=function(){return!0},o.prototype.isRemovedByStudyTemplates=function(){return!0},o.prototype.hasContextMenu=function(){return!0},o.prototype.showInObjectTree=function(){return!0},o.prototype.setUserEditEnabled=function(t){this._userEditEnabled=t},o.prototype.userEditEnabled=function(){return this._userEditEnabled},o.prototype.canBeHidden=function(){return this.userEditEnabled()},o.prototype.isUserDeletable=function(){return this.userEditEnabled()},o.prototype.canHasAlert=function(){return!1},o.prototype.properties=function(){throw Error("Implement this fun in a subclass")},o.prototype.statusView=function(){return null},o.prototype.dataWindowView=function(){return null},o.prototype.priceAxisViews=function(t,e){return null},o.prototype.updateAllViews=function(){},o.prototype.paneViews=function(t){return null},o.prototype.isChildStudy=function(){return!1},o.prototype.hasChildren=function(){return!1},o.prototype.canHaveChildren=function(){return!1},o.prototype.onClickOutside=function(){},inherit(n,o),n.prototype.isNoScale=function(){return!!this._isOverlay},n.prototype.base=function(){return 0},n.prototype.formatter=function(){return null},n.prototype.model=function(){return this._model},n.prototype.priceRange=function(t,e){return null},n.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},e.DataSource=o,e.PriceDataSource=n}).call(e,i(41))},function(t,e,i){"use strict";function o(t,e,i,o,n){this._wptStudyId=o,this._pointsCount=n,m.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i,"mtp_wpt_down1ora",2)}function s(t,e,i){o.call(this,t,e,i,"mtp_wpt_down2orb",2)}function r(t,e,i){o.call(this,t,e,i,"mtp_wpt_down3",3)}function a(t,e,i){o.call(this,t,e,i,"mtp_wpt_down4",2)}function l(t,e,i){o.call(this,t,e,i,"mtp_wpt_down5",5)}function h(t,e,i){o.call(this,t,e,i,"mtp_wpt_downc",3)}function c(t,e,i){o.call(this,t,e,i,"mtp_wpt_up1ora",2)}function d(t,e,i){
o.call(this,t,e,i,"mtp_wpt_up2orb",2)}function p(t,e,i){o.call(this,t,e,i,"mtp_wpt_up3",3)}function u(t,e,i){o.call(this,t,e,i,"mtp_wpt_up4",2)}function _(t,e,i){o.call(this,t,e,i,"mtp_wpt_up5",5)}function f(t,e,i){o.call(this,t,e,i,"mtp_wpt_upc",3)}var m=i(104);inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o,n=this.points();if(n.length<this.pointsCount())return null;for(t=[this.properties().inputs.displayZoneLabels.value()],e=0;e<this.pointsCount();++e){if(i=n[e].index,!(o=this._model.mainSeries().bars().valueAt(i)))return null;t.push(1e3*o[TradingView.TIME_PLOT])}return t},o.prototype._mtpStudyId=function(){return this._wptStudyId},o.prototype.pointsCount=function(){return this._pointsCount},inherit(n,o),n.getTooltipText=function(t){return"Down Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(s,o),s.getTooltipText=function(t){return"Down Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(r,o),r.getTooltipText=function(t){return"Down Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(a,o),a.getTooltipText=function(t){return"Down Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(l,o),l.getTooltipText=function(t){return"Down Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(h,o),h.getTooltipText=function(t){return"Down Wave C: Select Point "+((t?t._points.length:0)+1)},inherit(c,o),c.getTooltipText=function(t){return"Up Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(d,o),d.getTooltipText=function(t){return"Up Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(p,o),p.getTooltipText=function(t){return"Up Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(u,o),u.getTooltipText=function(t){return"Up Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(_,o),_.getTooltipText=function(t){return"Up Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(f,o),f.getTooltipText=function(t){return"Up Wave C: Select Point "+((t?t._points.length:0)+1)},e.LineStudyMtpDownWave1OrA=n,e.LineStudyMtpDownWave2OrB=s,e.LineStudyMtpDownWave3=r,e.LineStudyMtpDownWave4=a,e.LineStudyMtpDownWave5=l,e.LineStudyMtpDownWaveC=h,e.LineStudyMtpUpWave1OrA=c,e.LineStudyMtpUpWave2OrB=d,e.LineStudyMtpUpWave3=p,e.LineStudyMtpUpWave4=u,e.LineStudyMtpUpWave5=_,e.LineStudyMtpUpWaveC=f},,,function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){c.call(this,t,e),this._invalidated=!0}function s(t,e){n.call(this,t,e),this._invalidated=!0}function r(t,e){s.call(this,t,e),this._invalidated=!0}function a(t,e){n.call(this,t,e),this._invalidated=!0}function l(t,e){this._constructor="LineToolPitchfork";var i=e||this.createPropertiesObject("linetoolpitchfork");d.call(this,t,new n(this,t),i),this._properties.style.listeners().subscribe(this,l.prototype._recreatePaneView),this._recreatePaneView()}var h=i(2),c=i(9),d=i(1).LineDataSource,p=i(23),u=i(11).TrendLineRenderer,_=i(47).Action,f=i(8),m=i(6),g=i(14);o.prototype.extendPoints=function(t,e,i){
var o=new h.Point(0,-5e3),n=new h.Point(i,5e3),s=e.substract(t),r=h.intersectRayWithRect(e,e.add(s),o,n);return r&&(e=r),!h.pointInRect(t,o,n)&&h.pointInRect(e,o,n)&&(r=h.intersectRayWithRect(e,t,o,n))&&(t=r),!h.pointInRect(e,o,n)&&h.pointInRect(t,o,n)&&(r=h.intersectRayWithRect(t,e,o,n))&&(e=r),[t,e]},o.prototype.draw=function(t){var e=t.canvas.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e);t.beginPath(),t.moveTo(i[0].x,i[0].y),t.lineTo(i[1].x,i[1].y),i[1].x<o[1].x&&t.lineTo(o[1].x,i[1].y),t.lineTo(o[1].x,o[1].y),t.lineTo(o[0].x,o[0].y),t.lineTo(i[0].x,i[0].y),t.fillStyle=g.generateColor(this._data.color,this._data.transparency,!0),t.fill()},o.prototype.hitTest=function(t){var e,i,o,n;return this._data.hittestOnBackground?(e=this._data.width,i=this.extendPoints(this._data.p1,this._data.p2,e),o=this.extendPoints(this._data.p3,this._data.p4,e),n=[new h.Point(i[0].x,i[0].y),new h.Point(i[1].x,i[1].y)],i[1].x<o[1].x&&n.push(new h.Point(o[1].x,i[1].y)),n.push(new h.Point(o[1].x,o[1].y)),n.push(new h.Point(o[0].x,o[0].y)),n.push(new h.Point(i[0].x,i[0].y)),h.isInPolygon(n,t)?new f(f.MOVEPOINT_BACKGROUND):null):null},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){c.prototype.update.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},n.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint)return t;if(e={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),this._floatPoints.length<3)return this.addAnchors(t),t;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._medianPoint.substract(this._floatPoints[0]),r=0,a=this._source.properties().fillBackground.value(),l=this._source.properties().transparency.value(),h=0;h<=8;h++)c="level"+h,p=this._source.properties()[c],
p.visible.value()&&(_=this._medianPoint.addScaled(n,p.coeff.value()),g=_.add(s),v=this._medianPoint.addScaled(n,-p.coeff.value()),y=v.add(s),a&&(b={},b.width=this._model.timeScale().width(),b.p1=_,b.p2=g,b.p3=this._medianPoint.addScaled(n,r),b.p4=b.p3.add(s),b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b)),b={},b.width=this._model.timeScale().width(),b.p1=v,b.p2=y,b.p3=this._medianPoint.addScaled(n,-r),b.p4=b.p3.add(s),b.color=p.color.value(),b.width=this._model.timeScale().width(),b.transparency=l,b.hittestOnBackground=!0,t.append(new o(b))),r=p.coeff.value(),w={points:[_,g],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(w,S)),T={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.color.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,h),t.append(new u(T,S)));return this.addAnchors(t),t},inherit(s,n),s.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(e={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e)),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(i={points:[this._modifiedBase,this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._medianPoint.substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),
c=0;c<=8;c++)p="level"+c,_=this._source.properties()[p],_.visible.value()&&(g=this._medianPoint.addScaled(s,_.coeff.value()),v=g.add(r),y=this._medianPoint.addScaled(s,-_.coeff.value()),b=y.add(r),l&&(e={},e.p1=g,e.p2=v,e.p3=this._medianPoint.addScaled(s,a),e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e)),e={},e.p1=y,e.p2=b,e.p3=this._medianPoint.addScaled(s,-a),e.p4=e.p3.add(r),e.color=_.color.value(),e.width=this._model.timeScale().width(),e.transparency=h,e.hittestOnBackground=!0,t.append(new o(e))),a=_.coeff.value(),w={points:[g,v],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(w,S)),T={points:[y,b],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},S=new f(f.MOVEPOINT,null,c),t.append(new u(T,S)));return this.addAnchors(t),t},s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},inherit(r,s),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){var t,e,i;n.prototype.updateImpl.call(this),this._floatPoints.length>2&&(t=this._floatPoints[0].x,e=.5*(this._floatPoints[0].y+this._floatPoints[1].y),i=new h.Point(t,e),this._modifiedBase=i)},inherit(a,n),a.prototype.update=function(){this._invalidated=!0},a.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},a.prototype.renderer=function(){var t,e,i,n,s,r,a,l,h,c,p,_,g,v,y,b,w,S,T,C;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new m,this._floatPoints.length<2)return t;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),t;if(3===this._floatPoints.length&&(e={points:[this._modifiedBase,this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(e))),i={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,
leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(i)),this._floatPoints.length<3)return this.addAnchors(t),t;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(n)),s=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),r=this._floatPoints[2].substract(this._modifiedBase),a=0,l=this._source.properties().fillBackground.value(),h=this._source.properties().transparency.value(),c={points:[this._medianPoint,this._medianPoint.add(r)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},t.append(new u(c)),p=0;p<=8;p++)_="level"+p,g=this._source.properties()[_],g.visible.value()&&(v=this._medianPoint.addScaled(s,g.coeff.value()),y=v.add(r),b=this._medianPoint.addScaled(s,-g.coeff.value()),w=b.add(r),l&&(i={},i.p1=v,i.p2=y,i.p3=this._medianPoint.addScaled(s,a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i)),i={},i.p1=b,i.p2=w,i.p3=this._medianPoint.addScaled(s,-a),i.p4=i.p3.add(r),i.color=g.color.value(),i.width=this._model.timeScale().width(),i.transparency=h,i.hittestOnBackground=!0,t.append(new o(i))),a=g.coeff.value(),S={points:[v,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(S,T)),C={points:[b,w],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:d.LINEEND_NORMAL,rightend:d.LINEEND_NORMAL},T=new f(f.MOVEPOINT,null,p),t.append(new u(C,T)));return this.addAnchors(t),t},inherit(l,d),l.STYLE_ORIGINAL=0,l.STYLE_SCHIFF=1,l.STYLE_INSIDE=2,l.STYLE_SCHIFF2=3,l.prototype.additionalActions=function(){var t,e,i=[],o=["Original","Modified Schiff","Inside","Schiff"];for(t=0;t<4;t++)e=new _({checked:this.properties().style.value()===t,checkable:!0,text:$.t(o[t]),callbackContext:{target:this,value:t}}),e.callbacks().subscribe(null,function(t){var e=t.callbackContext(),i=e.target,o=e.value;i.properties().style.setValue(o),i.updateAllViews(),i._model.updateSource(i)}),i.push(e);return[i[0],i[3],i[1],i[2]]},l.prototype._recreatePaneView=function(){
this._properties.style.value()===l.STYLE_ORIGINAL?this._paneViews=[new n(this,this._model)]:this._properties.style.value()===l.STYLE_SCHIFF?this._paneViews=[new s(this,this._model)]:this._properties.style.value()===l.STYLE_SCHIFF2?this._paneViews=[new r(this,this._model)]:this._properties.style.value()===l.STYLE_INSIDE&&(this._paneViews=[new a(this,this._model)])},l.prototype.pointsCount=function(){return 3},l.prototype.title=function(){return $.t("Pitchfork")},l.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},l.prototype.createPropertiesObject=function(t,e,i){return new p(t,e,i,{range:[0,8]})},e.ChannelRenderer=o,e.LineToolPitchfork=l},function(t,e,i){"use strict";var o,n,s,r,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(374),n=i(373),s=i(742),r=i(12),a=r.getLogger("Common.UndoHistory"),e.UndoHistory=function(){function t(t){return f&&e(),f=new n.UndoMacroCommand(t)}function e(){if(f){var t=f;f=null,t.isEmpty()||l(t)}}function i(){if(m.isEmpty())return!1;var t=m.pop();return!!t&&(t.undo(),g.push(t),a.logNormal("UNDO: "+t.text()),!0)}function r(){if(g.isEmpty())return!1;var t=g.pop();return!!t&&(t.redo(),m.push(t),a.logNormal("REDO: "+t.text()),!0)}function l(t){var e,i,o;f?f.addCommand(t):(g.clear(),e=m.head(),i=e&&e.text(),m.push(t),""!==(o=t.text())&&o!==i&&a.logNormal("DO: "+o)),t.executeOnPush()&&t.redo()}function h(){return{lastActualCommand:m.isEmpty()?null:m.head()}}function c(t){for(;!m.isEmpty()&&t.lastActualCommand!==m.head();)m.pop().undo();g.clear()}function d(){return m}function p(){return g}function u(){m.clear(),g.clear()}function _(t,e,i){if(t.value()!==e){var o=new s.SetWatchedValueCommand(t,e,i);this.pushUndoCommand(o),o.redo()}}var f=null,m=new o.UndoStack,g=new o.UndoStack;return{beginUndoMacro:t,clearStack:u,createUndoCheckpoint:h,endUndoMacro:e,pushUndoCommand:l,redo:r,redoStack:p,setWatchedValue:_,undo:i,undoStack:d,undoToCheckpoint:c}}()},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dur=350,e.easingFunc={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.color={black0:"#000",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",
brand255:"#3BB3FF",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30"}},,function(t,e,i){(function(e){"use strict";var o=i(364),n=1e-10,s=function(){function t(t,e,i,o,n){var s,r=n,a=0;if(isNaN(t.get(e-1)))return{index:NaN,value:NaN};for(s=0;s<e;++s)o(t.get(s),r)&&(a=s,r=t.get(s));return{index:a,value:r}}function s(t,e){return 100*t/e}function r(t,e,i,o,n){var s,r,a;this._areaRight=t,this._areaLeft=e,this._pivotType=i,this._series=o,this._currentIndex=n.new_var(0),this._currentValue=n.new_var(NaN),this._pivotIndex=n.new_var(-1),this._index=S.n(n),this._isNewBar=n.symbol.isNewBar,s=this._currentIndex.get(1),r=this._currentValue.get(1),a=this._pivotIndex.get(1),this._index>1&&(this._currentIndex.set(s),this._currentValue.set(r),this._pivotIndex.set(a))}function a(t,e,i){var o,n,s,a,l;this._deviation=t,o=i.new_var(S.high(i)),n=i.new_var(S.low(i)),o.get(2*e+1),n.get(2*e+1),this._pivotHigh=new r(e,e,r.HIGH,o,i),this._pivotLow=new r(e,e,r.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=S.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,s=this._lastIndex.get(1),a=this._lastVal.get(1),l=this._lastType.get(1),this._index>1&&this.addPivot(s,a,l),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function l(t){this.symbol=t,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function h(t){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=t}function c(t,e){this.timezone=t||"America/New_York",this.session=e||"0000-0000"}function d(t,e,i,o,n){this.periodBase=i,this.tickerid=t,this.period=e,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new w.Session,this.other_sessions={},this.script=o,this.ticker=d.parseTicker(t);var s=d.parsePeriod(e);this.resolution=s.resolution,this.interval=s.interval,this.bb_cache={},this.minTick=n}function p(t,e,i,o,n,s,r,a,h){this.body=n,this.symbols=[],this.runner=o,this.inputCallback=r,this.out=s,this.nonseriesOut=h,this.ctx=new l(this.add_sym(t,e,i,a)),this.init()}function u(t){this.symbols=[],this.barsets=[],this.subscription=[],this.host=t,this.isRecalculated=!1,this.start()}function _(t){u.feed=t}function f(t){this.runner=new u(t)}function m(t,e){this.info=t,this.bars=e||[],this.isBarClosed=!0}function g(t,e){this.period=t,this.generateEmptyBars=!!e}function v(){}var y="undefined"!=typeof window?window:e,b=y.PineJsCalendar?y.PineJsCalendar:i(57),w=i(58),S={}
;return S.max_series_size=10001,S.n=function(t){return t.symbol.index+1},S.nz=function(t,e){return e=e||0,isFinite(t)?t:e},S.na=function(t){return 0===arguments.length?NaN:isNaN(t)?1:0},S.isZero=function(t){return Math.abs(t)<=1e-10},S.toBool=function(t){return isFinite(t)&&!S.isZero(t)},S.eq=function(t,e){return S.isZero(t-e)},S.neq=function(t,e){return!S.eq(t,e)},S.ge=function(t,e){return S.isZero(t-e)||t>e},S.gt=function(t,e){return!S.isZero(t-e)&&t>e},S.lt=function(t,e){return!S.isZero(t-e)&&t<e},S.le=function(t,e){return S.isZero(t-e)||t<e},S.and=function(t,e){return isNaN(t)||isNaN(e)?NaN:S.isZero(t)||S.isZero(e)?0:1},S.or=function(t,e){return isNaN(t)||isNaN(e)?NaN:S.isZero(t)&&S.isZero(e)?0:1},S.not=function(t){return isNaN(t)?NaN:S.isZero(t)?1:0},S.greaterOrEqual=function(t,e){return e-t<n},S.lessOrEqual=function(t,e){return t-e<n},S.equal=function(t,e){return Math.abs(t-e)<n},S.greater=function(t,e){return t-e>n},S.less=function(t,e){return e-t>n},S.max=Math.max,S.min=Math.min,S.pow=Math.pow,S.abs=Math.abs,S.log=Math.log,S.log10=function(t){return Math.log(t)/Math.LN10},S.sqrt=Math.sqrt,S.sign=function(t){return isNaN(t)?NaN:S.isZero(t)?0:t>0?1:-1},S.exp=Math.exp,S.sin=Math.sin,S.cos=Math.cos,S.tan=Math.tan,S.asin=Math.asin,S.acos=Math.acos,S.atan=Math.atan,S.floor=Math.floor,S.ceil=Math.ceil,S.round=Math.round,S.avg=function(t,e,i,o,n,s){var r,a;if(2===arguments.length)return(t+e)/2;for(r=0,a=0;a<arguments.length;a++)r+=arguments[a];return r/arguments.length},S.open=function(t){return t.symbol.open},S.high=function(t){return t.symbol.high},S.low=function(t){return t.symbol.low},S.close=function(t){return t.symbol.close},S.hl2=function(t){return(t.symbol.high+t.symbol.low)/2},S.hlc3=function(t){return(t.symbol.high+t.symbol.low+t.symbol.close)/3},S.ohlc4=function(t){return(t.symbol.open+t.symbol.high+t.symbol.low+t.symbol.close)/4},S.volume=function(t){return t.symbol.volume},S.updatetime=function(t){return t.symbol.updatetime},S.time=function(t,e,i){return t.symbol.bartime(e,i)},S.period=function(t){return t.symbol.period},S.tickerid=function(t){return t.symbol.tickerid},S.ticker=function(t){return t.symbol.ticker},S.interval=function(t){return t.symbol.interval},S.isdwm=function(t){return t.symbol.isdwm()},S.isintraday=function(t){return!t.symbol.isdwm()},S.isdaily=function(t){return"D"===t.symbol.resolution},S.isweekly=function(t){return"W"===t.symbol.resolution},S.ismonthly=function(t){return"M"===t.symbol.resolution},S.year=function(t){return S.timepart(t.symbol,b.YEAR,arguments[1])},S.month=function(t){return S.timepart(t.symbol,b.MONTH,arguments[1])},S.weekofyear=function(t){return S.timepart(t.symbol,b.WEEK_OF_YEAR,arguments[1])},S.dayofmonth=function(t){return S.timepart(t.symbol,b.DAY_OF_MONTH,arguments[1])},S.dayofweek=function(t){return S.timepart(t.symbol,b.DAY_OF_WEEK,arguments[1])},S.hour=function(t){return S.timepart(t.symbol,b.HOUR_OF_DAY,arguments[1])},S.minute=function(t){return S.timepart(t.symbol,b.MINUTE,arguments[1])},S.second=function(t){
@@ -111,16 +111,16 @@ e.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=_,e.Pane
n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show(),t&&t.preventDefault(),"function"==typeof e.onChange&&e.onChange.call(e,i.name))}),h&&!i.active||(h=n,l.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show()))})):void $.each(e.tabs[0].items,function(){u(this,void 0,r)})}return e instanceof n.Group?(c=$('<div class="charts-popup-group"></div>').appendTo(r),e.title&&(d=$('<div class="charts-popup-itemheader"></div>').text(e.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),e.collapsible&&(c.addClass("charts-popup-group-collapsible"),c.toggleClass("collapsed",e.collapsed),d.on("click",function(){c.toggleClass("collapsed"),"function"==typeof e.onChange&&e.onChange(c.hasClass("collapsed")),f.height()===parseInt(f.css("max-height"))?f.addClass("popup-menu-scroll-y"):f.height()<parseInt(f.css("max-height"))&&f.removeClass("popup-menu-scroll-y")})),c.append(d)),void $.each(e.items,function(t){u(this,1,c)})):e instanceof n.Header?void r.append($('<div class="charts-popup-itemheader"></div>').text(e.title)):e.separator?(p=$('<span class="separator"></span>'),void r.append(p)):(p=$('<a class="item" href="#">'),e.url&&p.attr("href",e.url),e.target&&p.attr("target",e.target),s||p.addClass("first"),"function"==typeof e.active?e.active(e)&&p.addClass("active"):e.active&&p.addClass("active"),e.addClass&&p.addClass(e.addClass),e.addData&&p.data(e.addData),e.disabled&&p.addClass("disabled"),"function"==typeof e.action&&(_=e.action,m=function(t){$(t.target).parents().andSelf().is(S)||(_.apply(p,arguments),!e.url&&t&&"function"==typeof t.preventDefault&&t.preventDefault())},o.upAction?p.bind("mouseup",m):p.bind("click",m)),e.date?(g=$('<span class="title"></span>').appendTo(p),$('<span class="date"></span>').text(e.date||"").appendTo(p)):e.icon&&!o.svg?(v=$('<span class="icon"></span>').appendTo(p),v.css("background-image",e.icon.image||""),e.icon.offset&&v.css("background-position","string"==typeof e.icon.offset?e.icon.offset:e.icon.offset.x+"px "+e.icon.offset.y+"px"),g=$('<span class="title"></span>').appendTo(p)):!0===o.svg&&e.svg?(o.wrapIcon?p.append($('<span class="icon-wrap">').append(e.svg)):p.append(e.svg),g=$('<span class="title"></span>').appendTo(p)):e.iconClass?(p.append($('<span class="icon"></span>').addClass(e.iconClass)),g=$('<span class="title"></span>').appendTo(p)):g=$('<span class="title-expanded"></span>').appendTo(p),e.html?g.html(e.html):g.text(TradingView.clean(e.title,!0)||""),y=$('<span class="shortcut"></span>').appendTo(p),e.shortcut&&y.text(e.shortcut.keys),"function"==typeof e.deleteAction&&(b=e.deleteAction,w=e.deleteAction.title||$.t("Delete"),S=$('<span class="icon-delete">'),S.html(i(129)),S.attr("title",w),S.on("click",function(t){b.apply(p,arguments),t.preventDefault()}),p.append(S)),e.buttons instanceof Array&&e.buttons.length&&e.buttons.forEach(function(t){t.el instanceof $||(t.el=$(t.el)),t.el.appendTo(p),t.handler&&t.el.on("click",function(e){t.handler.apply(p,arguments)})}),
void 0!==e.counter&&("function"==typeof e.counter?(T=$('<span class="counter"></span>').html(e.counter()),T.appendTo(p)):(C=e.counterBlue?"blue":"",$('<span class="counter"></span>').text(e.counter+"").addClass(C).appendTo(p))),r.append(p),void t.data("popup-menu",r))}var _,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V,B,R,N,F,z=r||e;if("function"==typeof z&&(z=z()),$(this).hasClass("open")||$(this).hasClass("active"))return s.preventDefault(),l(),void(_=h.scrollTop);switch(l=function(){h.scrollTop=f.scrollTop(),f.remove(),t.removeClass("active open "+o.activeClass),t.data("popup-menu",null),$(document).off("click",p),$(document).off("mousedown",d),Modernizr.touch&&$(document).off("touchstart.chartgui",d),$(document).off("selectstart.popup-menu"),l=a,o.onRemove&&o.onRemove()},t.addClass("active open "+o.activeClass),f=$('<div class="charts-popup-list">'),o.addClass&&f.addClass(o.addClass),o.zIndex&&f.css("z-index",o.zIndex),m=f,o.listInner&&(m=$('<div class="list-inner">').appendTo(m)),o.listTable&&(m=$('<div class="list-table">').appendTo(m)),$.each(z,function(t){u(this,t,m)}),setTimeout(function(){$(document).on("click",p),$(document).on("mousedown",d),Modernizr.touch&&$(document).on("touchstart.chartgui",d)},0),o.upAction&&$(document).on("selectstart.popup-menu",function(){return!1}),f.appendTo(document.body),g=$(window).width(),v=Math.min($(window).height(),$("body").height()),y=t.outerWidth(),b=t.outerHeight(),w=t.offset(),_=$(window).scrollTop()||0,w.top-=_,w.top=Math.round(w.top),w.left=Math.round(w.left),S=f.outerWidth(),T=f.outerHeight(),C=void 0!==o.viewportSpacing?o.viewportSpacing:10,x=o.popupSpacing?~~o.popupSpacing:1,P=o.popupDrift?~~o.popupDrift:0,L=T-f.height(),k="down",o.direction&&(k="function"==typeof o.direction?o.direction():o.direction),I=!!o.reverse,"down"===k?(A=v-w.top-b-x-C-L,E=w.top-x-C-L,A<Math.max(T||0,100)&&E>A&&(k="up")):"right"===k&&(M=g-w.left-y-x-C-L,D=w.left-x-C-L,M<Math.max(S||0,100)&&D>M&&(k="left")),k){case"down":case"up":"down"===k?f.css("top",w.top+b+x+"px"):f.css("bottom",v-w.top+x+"px").css("top","auto"),I?f.css("left",Math.max(w.left+P+y-S,C)+"px").css("right","auto"):f.css("left",w.left+P+"px").css("right","auto");break;case"right":case"left":x=Math.max(x,4),"right"===k?f.css("left",Math.floor(w.left+y+x)+"px").css("right","auto"):f.css("left",Math.floor(Math.max(w.left-S-x,C))+"px").css("right","auto"),I?f.css("top",Math.floor(Math.max(w.top+P+b-T,C))+"px"):f.css("top",Math.floor(w.top+P)+"px")}for(f.show(),O=w.top,"up"===k||{left:1,right:1}[k]&&I?"up"!==k?O+=b:O-=b+x+L+C:O=v-O-b-2*x-L,f.height()>O&&f.addClass("popup-menu-scroll-y"),f.css("max-height",O+"px"),o.careRightBorder&&(V=g+$(window).scrollLeft(),parseInt(f.css("left"))+f.width()+C>V&&f.css("left",V-f.width()-C+"px").css("right","auto")),o.careBottomBorder&&parseInt(f.css("top"))+f.height()+C>v+_&&f.css("top",v-f.height()-C+_+"px"),R=t.parents().andSelf(),N=R.size();N--;)if("fixed"===R.eq(N).css("position")){B=R.eq(N);break}B&&(F=f.offset(),f.css({position:"fixed",left:F.left-$(document).scrollLeft(),right:"auto"})),
f[0].scrollHeight>f.height()&&f.addClass("popup-with-scroll"),s&&s.preventDefault()},s&&t.bind(s,c),r&&t.bind(r,function(){l()}),o.runOpened&&c()};n.TabGroup=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.tabs=[],"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.TabGroup.prototype.appendTab=function(t,e,i){if(null==t?t="":t+="",e||(e=[]),i||(i={}),!Array.isArray(e))throw new TypeError("items must be an array");return this.tabs.push({name:t,items:e,active:!!i.active}),e},n.Header=function t(e){if(!(this instanceof t))return new t(e);this.title=e},n.Group=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.items=[],this.title=null==e.title?"":e.title+"",this.collapsible=!!e.collapsible,this.collapsed=!!e.collapsed,"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)},e.bindPopupMenu=n,o=function(t){t=$(t),t.unbind(".popup-menu"),t.removeData("popup-menu")},e.unbindPopupMenu=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._linetool=i,this.prepareLayout()}var n=i(5),s=n.PropertyPage,r=n.GreateTransformer,a=n.LessTransformer,l=n.ToIntTransformer,h=n.SimpleStringBinder;i(126),inherit(o,s),o.BarIndexPastLimit=-5e4,o.BarIndexFutureLimit=15e3,o.prototype.bindBarIndex=function(t,e,i,n){var s=[l(t.value()),r(o.BarIndexPastLimit),a(o.BarIndexFutureLimit)];this.bindControl(new h(e,t,s,!1,i,n))},o.prototype.createPriceEditor=function(t){var e,i=this._linetool.ownerSource().formatter(),o=function(t){return i.format(t)},n=function(t){var e=i.parse(t);if(e.res)return e.price?e.price:e.value},s=$("<input type='text'>");return s.TVTicker({step:i._minMove/i._priceScale||1,formatter:o,parser:n}),t&&(e=[function(e){var i=n(e);return void 0===i?t.value():i}],this.bindControl(new h(s,t,e,!1,this.model(),"Change "+this._linetool+" point price")).addFormatter(function(t){return i.format(t)})),s},o.prototype._createPointRow=function(t,e,i){var o,n,s,r,a,l=$("<tr>"),h=$("<td>");return h.html($.t("Price")+i),h.appendTo(l),o=$("<td>"),o.appendTo(l),n=this.createPriceEditor(e.price),n.appendTo(o),s=$("<td>"),s.html($.t("Bar #")),s.appendTo(l),r=$("<td>"),r.appendTo(l),a=$("<input type='text'>"),a.appendTo(r),a.addClass("ticker"),this.bindBarIndex(e.bar,a,this.model(),"Change "+this._linetool+" point bar index"),l},o.prototype.prepareLayoutForTable=function(t){var e,i,o,n,s,r=this._linetool.points(),a=r.length;for(e=0;e<r.length;e++)i=r[e],(o=this._linetool.properties().points[e])&&(n=e||a>1?" "+(e+1):"",s=this._createPointRow(i,o,n),s.appendTo(t))},o.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e){b.call(this,t,e),this._rendererCache=[{},{},{},{},{},{}],this._invalidated=!0}function n(t,e){
var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i)}function s(t,e){var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i),this.version=s.version}function r(t,e){this._constructor="LineToolElliottImpulse";var i=e||new P("linetoolelliottimpulse");s.call(this,t,i)}function a(t,e){this._constructor="LineToolElliottTriangle";var i=e||new P("linetoolelliotttriangle");s.call(this,t,i)}function l(t,e){this._constructor="LineToolElliottTripleCombo";var i=e||new P("linetoolelliotttriplecombo");s.call(this,t,i)}function h(t,e){var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i),this.version=h.version}function c(t,e){this._constructor="LineToolElliottCorrection";var i=e||new P("linetoolelliottcorrection");h.call(this,t,i)}function d(t,e){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=e||new P("linetoolelliottdoublecombo");h.call(this,t,i)}var p=i(36),u=p.parseRgb,_=p.darkenRgb,f=p.rgbToHexString,m=p.rgbToBlackWhiteString,g=i(204).EllipseRendererSimple,v=i(16).TextRenderer,y=i(1).LineDataSource,b=i(9),w=i(11).TrendLineRenderer,S=i(47).Action,T=i(8),C=i(6),x=i(2),P=i(7).DefaultProperty,L=i(14);inherit(o,b),o.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,y,b,S,P,L,k,I,A;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),!this._wave)return null;for(t=this.isAnchorsRequired()?0:1,e=new C,i=this._source.properties(),o=0;o<this._wave.length;o++)e.append(new w(this._wave[o]));for(n=1,this._points.length>2&&(s=this._points[2],r=this._points[1],n=x.sign(s.y-r.y)),a=[],l=0,this._model.lineBeingCreated()===this._source&&(l=1),h=m(u(this._model.backgroundColor())),c=i.color.value(),o=0;o<this._points.length-l;o++,n=-n)o<t||(d=this._source.label(o),p=d.label,"circle"===d.decoration&&(y=this._points[o].clone(),1===n?y.y+=13+d.fontIncrease/2:y.y-=14+d.fontIncrease/2,b=(12+d.fontIncrease)/2+2,s=y.substract(new x.Point(b,b)),r=y.add(new x.Point(b,b)),S={points:[s,r],color:f(_(u(c),"black"===h?15:-15)),linewidth:1,fillBackground:!1},P=new g(S),e.append(P)),"brackets"===d.decoration&&(p="("+p+")"),L={points:[this._points[o]],text:p,color:f(_(u(c),"black"===h?15:-15)),vertAlign:1===n?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1===n?5:-10,fontsize:12+d.fontIncrease,bold:d.bold},a.push(L),""!==d&&e.append(new v(L,this._rendererCache[o],new T(T.CHANGEPOINT,o))));if(this.isAnchorsRequired()){for(k=[],I=0;I<a.length;I++)A=this._points[I].clone(),A.y=a[I].points[0].y,A.data=I,k.push(A);this._model.lineBeingCreated()===this._source&&k.pop(),e.append(this.createLineAnchor({points:k}))}return e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(b.prototype.update.call(this),this._wave=[],t=this._source.properties(),e=this._source.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&!i.isEmpty()&&(this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),n=t.color.value(),t.showWave.value()))for(s=this._source.points(),r=1;r<s.length;r++)a=s[r-1],l=s[r],
var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i)}function s(t,e){var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i),this.version=s.version}function r(t,e){this._constructor="LineToolElliottImpulse";var i=e||new P("linetoolelliottimpulse");s.call(this,t,i)}function a(t,e){this._constructor="LineToolElliottTriangle";var i=e||new P("linetoolelliotttriangle");s.call(this,t,i)}function l(t,e){this._constructor="LineToolElliottTripleCombo";var i=e||new P("linetoolelliotttriplecombo");s.call(this,t,i)}function h(t,e){var i=e||new P("linetoolelliott");y.call(this,t,new o(this,t),i),this.version=h.version}function c(t,e){this._constructor="LineToolElliottCorrection";var i=e||new P("linetoolelliottcorrection");h.call(this,t,i)}function d(t,e){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=e||new P("linetoolelliottdoublecombo");h.call(this,t,i)}var p=i(37),u=p.parseRgb,_=p.darkenRgb,f=p.rgbToHexString,m=p.rgbToBlackWhiteString,g=i(204).EllipseRendererSimple,v=i(16).TextRenderer,y=i(1).LineDataSource,b=i(9),w=i(11).TrendLineRenderer,S=i(47).Action,T=i(8),C=i(6),x=i(2),P=i(7).DefaultProperty,L=i(14);inherit(o,b),o.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,y,b,S,P,L,k,I,A;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),!this._wave)return null;for(t=this.isAnchorsRequired()?0:1,e=new C,i=this._source.properties(),o=0;o<this._wave.length;o++)e.append(new w(this._wave[o]));for(n=1,this._points.length>2&&(s=this._points[2],r=this._points[1],n=x.sign(s.y-r.y)),a=[],l=0,this._model.lineBeingCreated()===this._source&&(l=1),h=m(u(this._model.backgroundColor())),c=i.color.value(),o=0;o<this._points.length-l;o++,n=-n)o<t||(d=this._source.label(o),p=d.label,"circle"===d.decoration&&(y=this._points[o].clone(),1===n?y.y+=13+d.fontIncrease/2:y.y-=14+d.fontIncrease/2,b=(12+d.fontIncrease)/2+2,s=y.substract(new x.Point(b,b)),r=y.add(new x.Point(b,b)),S={points:[s,r],color:f(_(u(c),"black"===h?15:-15)),linewidth:1,fillBackground:!1},P=new g(S),e.append(P)),"brackets"===d.decoration&&(p="("+p+")"),L={points:[this._points[o]],text:p,color:f(_(u(c),"black"===h?15:-15)),vertAlign:1===n?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1===n?5:-10,fontsize:12+d.fontIncrease,bold:d.bold},a.push(L),""!==d&&e.append(new v(L,this._rendererCache[o],new T(T.CHANGEPOINT,o))));if(this.isAnchorsRequired()){for(k=[],I=0;I<a.length;I++)A=this._points[I].clone(),A.y=a[I].points[0].y,A.data=I,k.push(A);this._model.lineBeingCreated()===this._source&&k.pop(),e.append(this.createLineAnchor({points:k}))}return e},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(b.prototype.update.call(this),this._wave=[],t=this._source.properties(),e=this._source.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&!i.isEmpty()&&(this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),n=t.color.value(),t.showWave.value()))for(s=this._source.points(),r=1;r<s.length;r++)a=s[r-1],l=s[r],
h=i.indexToCoordinate(a.index),c=i.indexToCoordinate(l.index),d=a.price,p=l.price,this._source.priceScale().isPercent()&&(d=this._source.priceScale().priceRange().convertToPercent(d,o),p=this._source.priceScale().priceRange().convertToPercent(p,o)),u=e.priceToCoordinate(d),_=e.priceToCoordinate(p),f={points:[new x.Point(h,u),new x.Point(c,_)],width:i.width(),height:e.height(),color:L.generateColor(n,0),linewidth:t.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:y.LINEEND_CIRCLE,rightend:y.LINEEND_CIRCLE,endstyle:{strokeWidth:1,fillStyle:this._model.backgroundColor()},overlayLineEndings:!0},this._wave.push(f)},inherit(n,y),n.migrateState=function(t){var e={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinor"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottCircle"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize]),"LineToolElliottMajorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize])},n.prototype.title=function(){return"Elliott Labels"},n.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor"),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],n.prototype.additionalActions=function(t){var e=new S({text:$.t("Degree")}),i=this;return e.subActions=n.degrees.map(function(e,o){var n=new S({text:e,checkable:!0,checked:i.properties().degree.value()===o});return n.callbacks().subscribe(null,function(){t.setProperty(i.properties().degree,o,"Change Elliott Degree")}),n}),[e]},n.prototype.label=function(t){var e=n.degrees.length-this.properties().degree.value()-1,i=Math.floor(e/3),o=e%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][o],label:this.labelsGroup()[i][t]}},inherit(s,n),s.version=3,s.prototype.pointsCount=function(){return 6},s.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.unshift(o),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.unshift(o))}},inherit(r,s),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(a,s),a._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,s),l._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],
l.prototype.labelsGroup=function(){return l._labelsGroups},inherit(h,n),h.version=3,h.prototype.pointsCount=function(){return 4},h.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.insert(o,0),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.insert(o,0))}},inherit(c,h),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(d,h),d._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],d.prototype.labelsGroup=function(){return d._labelsGroups},e.LineToolElliott=n,e.LineToolElliottImpulse=r,e.LineToolElliottTriangle=a,e.LineToolElliottTripleCombo=l,e.LineToolElliottCorrection=c,e.LineToolElliottDoubleCombo=d},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(36),s=n.parseRgb,r=n.rgbToBlackWhiteString;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return r(s(this._background))},o.prototype.coordinate=function(){return this._coordinate},o.prototype.floatCoordinate=function(){return this._floatCoordinate||this._coordinate},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}var n=i(14);o.prototype.draw=function(t,e){var i,o,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;this._data.visible&&(i=e.fontSize,t.font=e.font,o=e.tickLength,s=e.borderSize,r=e.paddingTop,a=e.paddingBottom,l=e.paddingInner,h=e.paddingOuter,c=Math.ceil(e.widthCache.measureText(t,this._data.text)),d=e.baselineOffset,t.strokeStyle=this._data.borderColor,t.fillStyle=n.resetTransparency(this._data.background),t.lineWidth=1,p=e.fontSize+r+a,u=s+c+l+h+o,_=this._data.coordinate,f=_-Math.floor(i/2)-r-.5,m=f+p,g=e.isLeft?e.width-s-.5:.5,v=g,this._data.text&&(e.isLeft?(v=g-u,y=g-o,b=v+h):(v=g+u,y=g+o,b=g+s+o+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(g,_),t.lineTo(y,_),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,b,m-a-d)),this._data.secondLine&&(w=Math.ceil(e.widthCache.measureText(t,this._data.secondLine)),S=w+l+h,t.fillStyle=this._data.background,this._data.text&&(f+=p+1,m+=p+1),e.isLeft?(v=Math.min(v,e.width-o),g=v+S,b=v+h):(g=Math.max(v-S,s),v=g+S,b=g+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.secondLine,b,m-a-d)))},o.prototype.height=function(t,e){var i=t.fontSize+t.paddingTop+t.paddingBottom;return this._data.secondLine&&e?2*i+1:i},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){this._data=t,this._model=e,this.radius=this._data.radius||n.OUTER_RADIUS}function s(t){o.call(this,t)}var r=i(8),a=i(59).PaneRendererArrowsUpDown;o.RADIUS=3.5,o.prototype.tolerance=2,o.prototype.draw=function(t){
l.prototype.labelsGroup=function(){return l._labelsGroups},inherit(h,n),h.version=3,h.prototype.pointsCount=function(){return 4},h.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.insert(o,0),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.insert(o,0))}},inherit(c,h),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(d,h),d._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],d.prototype.labelsGroup=function(){return d._labelsGroups},e.LineToolElliott=n,e.LineToolElliottImpulse=r,e.LineToolElliottTriangle=a,e.LineToolElliottTripleCombo=l,e.LineToolElliottCorrection=c,e.LineToolElliottDoubleCombo=d},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(37),s=n.parseRgb,r=n.rgbToBlackWhiteString;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return r(s(this._background))},o.prototype.coordinate=function(){return this._coordinate},o.prototype.floatCoordinate=function(){return this._floatCoordinate||this._coordinate},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}var n=i(14);o.prototype.draw=function(t,e){var i,o,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;this._data.visible&&(i=e.fontSize,t.font=e.font,o=e.tickLength,s=e.borderSize,r=e.paddingTop,a=e.paddingBottom,l=e.paddingInner,h=e.paddingOuter,c=Math.ceil(e.widthCache.measureText(t,this._data.text)),d=e.baselineOffset,t.strokeStyle=this._data.borderColor,t.fillStyle=n.resetTransparency(this._data.background),t.lineWidth=1,p=e.fontSize+r+a,u=s+c+l+h+o,_=this._data.coordinate,f=_-Math.floor(i/2)-r-.5,m=f+p,g=e.isLeft?e.width-s-.5:.5,v=g,this._data.text&&(e.isLeft?(v=g-u,y=g-o,b=v+h):(v=g+u,y=g+o,b=g+s+o+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(g,_),t.lineTo(y,_),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,b,m-a-d)),this._data.secondLine&&(w=Math.ceil(e.widthCache.measureText(t,this._data.secondLine)),S=w+l+h,t.fillStyle=this._data.background,this._data.text&&(f+=p+1,m+=p+1),e.isLeft?(v=Math.min(v,e.width-o),g=v+S,b=v+h):(g=Math.max(v-S,s),v=g+S,b=g+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.secondLine,b,m-a-d)))},o.prototype.height=function(t,e){var i=t.fontSize+t.paddingTop+t.paddingBottom;return this._data.secondLine&&e?2*i+1:i},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){this._data=t,this._model=e,this.radius=this._data.radius||n.OUTER_RADIUS}function s(t){o.call(this,t)}var r=i(8),a=i(59).PaneRendererArrowsUpDown;o.RADIUS=3.5,o.prototype.tolerance=2,o.prototype.draw=function(t){
function e(t){return void 0===t.x||TradingView.isNaN(t.x)||null===t.x||void 0===t.y||TradingView.isNaN(t.y)||null===t.y}var i,o,n;if(this._data)for(t.strokeStyle="#6B6B6B",t.fillStyle="#D6D6D6",i=this._data.vertOffset||0,o=0;o<this._data.points.length;o++)n=this._data.points[o],e(n)||this._drawMarker(t,n,i)},o.prototype._drawMarker=function(t,e,i){t.beginPath(),t.arc(e.x+.5,e.y+.5+i,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},o.prototype.hitTest=function(t){var e,i;if(!this._data)return null;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],i.substract(t).length()<=o.RADIUS+this.tolerance)return new r(this._data.hittestResult,i.data);return null},n.OUTER_RADIUS=TradingView.isMobile.any()?16:8,n.prototype.tolerance=2,n.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c=this._data.currentPoint,d=this._data.outerStrokeWidth||1;for(e=0;e<this._data.points.length;e++)i=this._data.points[e],o=i.substract(c).length(),n=TradingView.isInteger(i.data)&&this._data.linePointBeingEdited===i.data,s=this.radius,r=this._data.strokeWidth||2,a=o<=s+this.tolerance,l=a?1:0,s+=l,r+=l,n||(i.square?(t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-s,i.y-s,2*s,2*s),t.fillStyle=this._data.color,h=s-d,t.fillRect(i.x-h,i.y-h,2*h,2*h),h=s-d-r,t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-h,i.y-h,2*h,2*h)):(t.beginPath(),t.arc(i.x,i.y,s,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill(),t.beginPath(),t.arc(i.x,i.y,s-d,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.color,t.fill(),t.beginPath(),t.arc(i.x,i.y,s-d-r,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill()))},n.prototype.hitTest=function(t){var e,i,o;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],o=i.substract(t).length(),o<=this.radius+this.tolerance)return new r(this._data.hittestResult,i.data);return null},inherit(s,o),s.prototype._drawMarker=function(t,e,i){var n=e.isUp?1:-1,s=a.prototype._calculateVerticalOffset(this._data.barSpacing),r=a.prototype._calculateMinHeight(this._data.barSpacing),l=i+n*s+n*r;t.beginPath(),t.arc(e.x+.5,e.y+.5+l,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},e.SelectionRenderer=o,e.LineAnchor=n,e.SelectionRendererArrowsUpDown=s},function(t,e,i){(function(t,e,o){"use strict";var n=i(222).regExpEscape,s=i(128).TVXWindowEvents,r=i(216).TVLocalStorage,a=window.TVSettings=function(){function i(t){return E+"."+t}function o(t,e){var i;return i=M[t],window.is_authenticated&&!F||null!=i||(i=M[t]),null==i?e:i}function l(t,e){var i=o(t,void 0);if(null==i)return e;try{return JSON.parse(i)}catch(i){return _(t),e}}function h(t,e){var i=o(t);return null==i?e:!(!i||"false"===i||0==+i)}function c(t,e,i){var n,s=o(t,void 0,i);if(null==s)return e;if(n=parseFloat(s),!isFinite(n))throw new TypeError('"'+s+'" is not float (key: "'+t+'")');return n}function d(t,e,i){var n,s=o(t,void 0,i);if(null==s)return e;if(n=parseInt(s,10),!isFinite(n))throw new TypeError('"'+s+'" is not int (key: "'+t+'")');return n}function p(t,e,i){i=i||{};var o=""+e
;return M[t]!==o&&(M[t]=o,m(t)),i.forceFlush&&!V&&(V=setTimeout(function(){V=void 0,g()},A)),a}function u(t,e,i){return p(t,JSON.stringify(e),i),a}function _(t,e){return e=e||{},null!=M[t]&&(delete M[t],m(t)),e.forceFlush&&g(),a}function f(){O=void 0,D.length&&g()}function m(t){if(z)null==M[t]?z.removeValue(i(t)):z.setValue(i(t),M[t]);else if(!window.is_authenticated||F)try{null==M[t]?r.removeItem(i(t)):r.setItem(i(t),M[t])}catch(t){}else D.push(t),O||(O=setTimeout(f,I));s.emit("settings",JSON.stringify({key:t,value:M[t]}))}function g(e){var i,o,n,s,r;if(!t.enabled("widget")&&window.is_authenticated&&!F&&0!==D.length){for(i=D,D=[],o={},n=i.length;n--;)s=i[n],r=M[s],void 0===r&&(r=null),o[s]=r;$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(o)},async:!e})}}function v(){var t,e,i;for(t=0;t<r.length;t++)e=r.key(t),i=E.length,e.substring(0,i+1)===E+"."&&(D=[],r.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function y(){return Object.keys(M)}function b(t,e){var i,o=y(e),s=[];for(t=RegExp("^"+n(t).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i=o.length-1;i>=0;i--)t.test(o[i])&&s.push(o[i]),t.lastIndex=0;return s}function w(t){for(var e=0;e<B.length;++e)if(B[e].exec(t))return!0;return!1}function S(){var e,i,o,n,s;for(M={},e=E+".",i=!t.enabled("save_chart_properties_to_local_storage"),o=r.length;o--;)(n=r.key(o))&&n.substring(0,e.length)===e&&(s=n.substring(e.length),i&&!w(s)||(M[s]=r.getItem(n)))}function T(t){var e,i,o,n,s;for(M={},e=0===Object.keys(t).length,i=E+".",o=r.length;o--;)(n=r.key(o))&&n.substring(0,i.length)===i&&(e&&(s=n.substring(i.length),p(s,r.getItem(n))),r.removeItem(n));Object.keys(t).forEach(function(e){M[e]=t[e]+""})}function C(t){z?T(z.initialSettings||{}):window.is_authenticated&&!F?T(t||{}):S(),R.fire()}function x(t){z=t}var P,L,k,I,A,E,M,D,O,V,B,R,N=!1,F=t.enabled("cqg_terminal"),z=null;try{N=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return N?(P={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},L=function(t,e,i){var o=P[t];return null==o?e:o},k=function(){},{loaded:!1,loadedModel:!1,getValue:L,getJSON:L,getBool:L,getFloat:L,getInt:L,setValue:k,setJSON:k,remove:k,restoreDefaults:k,keys:function(){return Object.keys(P)},keysMask:function(){return[]},sync:k,onSync:{subscribe:function(){}}}):(I=12e4,A=10,"local"===window.environment&&(I=5e3),E="tradingview",M={},D=[],B=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/],s.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete M[e.key]:M[e.key]=e.value}),R=new e,document.addEventListener("visibilitychange",function(){
"hidden"!==document.visibiltyState&&!0!==document.hidden||g()}),window.addEventListener("unload",function(){g(!0)}),{loaded:!1,loadedModel:!1,getValue:o,getJSON:l,getBool:h,getFloat:c,getInt:d,setValue:p,setJSON:u,remove:_,restoreDefaults:v,keys:y,keysMask:b,sync:C,onSync:R,setSettingsAdapter:x})}();void 0!==o&&o&&o.exports&&(o.exports=a)}).call(e,i(3),i(15),i(50)(t))},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),n=i(27),s=function(t){function e(e){return void 0===e&&(e=100),t.call(this,e)||this}return o.__extends(e,t),e.prototype.state=function(){var t=n.PriceFormatter.prototype.state.call(this);return t.percent=!0,t},e.prototype.format=function(e,i,o,n){return t.prototype.format.call(this,e,i,o,n)+"%"},e}(n.PriceFormatter),e.PercentageFormatter=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(749);e.createDialog=o.createDialog},function(t,e,i){"use strict";var o,n,s=i(40),r=i(3);!function(t){t[t.NotBound=0]="NotBound",t[t.BoundToWidget=1]="BoundToWidget",t[t.BoundToModel=2]="BoundToModel"}(o||(o={})),n=function(){function t(){this._watchedSymbol=new s,this._seriesShortSymbol=new s,this._proSymbol=new s,this._watchedInterval=new s,this._watchedIntraday=new s,this._watchedSupportedResolutions=new s,this._symbolNamesList=new s,this._chartWidgetBindingState=o.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1}return Object.defineProperty(t.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),t.prototype.bindToChartWidget=function(t){var e,i;if(this.unbindFromChartWidget(),this._activeChartWidget=t,e=t.model())return void this._onChartModelCreated(e);t.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=o.BoundToWidget,i=t.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},t.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){
"hidden"!==document.visibiltyState&&!0!==document.hidden||g()}),window.addEventListener("unload",function(){g(!0)}),{loaded:!1,loadedModel:!1,getValue:o,getJSON:l,getBool:h,getFloat:c,getInt:d,setValue:p,setJSON:u,remove:_,restoreDefaults:v,keys:y,keysMask:b,sync:C,onSync:R,setSettingsAdapter:x})}();void 0!==o&&o&&o.exports&&(o.exports=a)}).call(e,i(3),i(15),i(50)(t))},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),n=i(27),s=function(t){function e(e){return void 0===e&&(e=100),t.call(this,e)||this}return o.__extends(e,t),e.prototype.state=function(){var t=n.PriceFormatter.prototype.state.call(this);return t.percent=!0,t},e.prototype.format=function(e,i,o,n){return t.prototype.format.call(this,e,i,o,n)+"%"},e}(n.PriceFormatter),e.PercentageFormatter=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(749);e.createDialog=o.createDialog},function(t,e,i){"use strict";var o,n,s=i(41),r=i(3);!function(t){t[t.NotBound=0]="NotBound",t[t.BoundToWidget=1]="BoundToWidget",t[t.BoundToModel=2]="BoundToModel"}(o||(o={})),n=function(){function t(){this._watchedSymbol=new s,this._seriesShortSymbol=new s,this._proSymbol=new s,this._watchedInterval=new s,this._watchedIntraday=new s,this._watchedSupportedResolutions=new s,this._symbolNamesList=new s,this._chartWidgetBindingState=o.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1}return Object.defineProperty(t.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),t.prototype.bindToChartWidget=function(t){var e,i;if(this.unbindFromChartWidget(),this._activeChartWidget=t,e=t.model())return void this._onChartModelCreated(e);t.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=o.BoundToWidget,i=t.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},t.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){
case o.BoundToWidget:if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case o.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().onSymbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().onSymbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=o.NotBound},t.prototype.getChartWidget=function(){return this._activeChartWidget},t.prototype.bindToChartWidgetCollection=function(t){var e=this;this._chartWidgetCollection=t,this.unbindFromChartWidget(),t.activeChartWidget.subscribe(function(t){e.unbindFromChartWidget(),e.bindToChartWidget(t)},{callWithLast:!0})},t.prototype.bindToSearchCharts=function(t){this.unbindFromSearchCharts(),this._searchCharts=t,t.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),this._watchedSymbol.subscribe(this._onSymbolLinkBound)},t.prototype.unbindFromSearchCharts=function(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)},t.prototype._onSearchBySymbol=function(t){if(!t.resolved_symbol)throw Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(t.resolved_symbol),this._selfEmit=!1},t.prototype._onSymbolLink=function(t){if(!this._selfEmit){if(!this._searchCharts)throw Error("No search charts defined");this._searchCharts.search(t)}},t.prototype._mainSeries=function(){if(!this._activeChartWidget)throw Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()},t.prototype._properties=function(){return this._mainSeries().properties()},t.prototype._symbolProperty=function(){return this._properties().symbol},t.prototype._intervalProperty=function(){return this._properties().interval},t.prototype._watchedSymbolListener=function(t){(r.enabled("same_data_requery")||this._symbolProperty().value()!==t)&&this._chartWidgetCollection.setSymbol(t)},t.prototype._onSymbolPropertyChange=function(){this._watchedSymbol.setValue(this._symbolProperty().value())},t.prototype._onSymbolResolved=function(t){this._proSymbol.setValue(t.pro_name||r.enabled("trading_terminal")&&(t.full_name||t.name)||""),t.aliases&&this._symbolNamesList.setValue(t.aliases)},t.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var t=this._mainSeries().symbolInfo();t?(this._onSymbolResolved(t),t.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(t.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),
this._watchedIntraday.setValue(!!t.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},t.prototype._watchedIntervalListener=function(t){(r.enabled("same_data_requery")||this._intervalProperty().value()!==t)&&this._chartWidgetCollection.setResolution(t)},t.prototype._onIntervalPropertyChange=function(){this._watchedInterval.setValue(this._intervalProperty().value())},t.prototype._onChartModelCreated=function(t){var e,i,n;if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._chartWidgetBindingState=o.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated),e=this._symbolProperty(),e.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(e.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound),i=this._mainSeries(),i.onSymbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(t){return i.symbolSameAsCurrent(t)&&(t=i.symbol()),t},i.onSymbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolError().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onExtendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),n=this._intervalProperty(),n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},t}(),window.TradingView=window.TradingView||{},window.TradingView.Linking=new n,t.exports=window.TradingView.Linking},function(t,e,i){var o,n;(function(i){var s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b;!function(s){function r(t,e){return function(i,o){return t[i]=e?e(i,o):o}}var a="object"==typeof i?i:"object"==typeof self?self:"object"==typeof this?this:{};o=[e],void 0!==(n=function(t){s(r(a,r(t)))}.apply(e,o))&&(t.exports=n)}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};s=function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)},r=Object.assign||function(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++){e=arguments[i];for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},a=function(t,e){var i,o,n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]]);return n},l=function(t,e,i,o){var n,s,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(s=t.length-1;s>=0;s--)(n=t[s])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a)
;return r>3&&a&&Object.defineProperty(e,i,a),a},h=function(t,e){return function(i,o){e(i,o,t)}},c=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},d=function(t,e,i,o){return new(i||(i=Promise))(function(n,s){function r(t){try{l(o.next(t))}catch(t){s(t)}}function a(t){try{l(o.throw(t))}catch(t){s(t)}}function l(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(r,a)}l((o=o.apply(t,e||[])).next())})},p=function(t,e){function i(t){return function(e){return o([t,e])}}function o(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,s&&(r=s[2&i[0]?"return":i[0]?"throw":"next"])&&!(r=r.call(s,i[1])).done)return r;switch(s=0,r&&(i=[0,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,s=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){l.label=i[1];break}if(6===i[0]&&l.label<r[1]){l.label=r[1],r=i;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(i);break}r[2]&&l.ops.pop(),l.trys.pop();continue}i=e.call(t,l)}catch(t){i=[6,t],s=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},u=function(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])},_=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},f=function(t,e){var i,o,n,s,r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;i=r.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)n.push(o.value)}catch(t){s={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return n},m=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t},g=function(t){return this instanceof g?(this.v=t,this):new g(t)},v=function(t,e,i){function o(t){c[t]&&(h[t]=function(e){return new Promise(function(i,o){d.push([t,e,i,o])>1||n(t,e)})})}function n(t,e){try{s(c[t](e))}catch(t){l(d[0][3],t)}}function s(t){t.value instanceof g?Promise.resolve(t.value.v).then(r,a):l(d[0][2],t)}function r(t){n("next",t)}function a(t){n("throw",t)}function l(t,e){t(e),d.shift(),d.length&&n(d[0][0],d[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var h,c=i.apply(t,e||[]),d=[];return h={},o("next"),o("throw"),o("return"),h[Symbol.asyncIterator]=function(){return this},h},y=function(t){function e(e,n){t[e]&&(i[e]=function(i){return(o=!o)?{value:g(t[e](i)),done:"return"===e}:n?n(i):i})}var i,o;return i={},e("next"),e("throw",function(t){throw t}),e("return"),i[Symbol.iterator]=function(){return this},i},b=function(t){
if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof _?_(t):t[Symbol.iterator]()},t("__extends",s),t("__assign",r),t("__rest",a),t("__decorate",l),t("__param",h),t("__metadata",c),t("__awaiter",d),t("__generator",p),t("__exportStar",u),t("__values",_),t("__read",f),t("__spread",m),t("__await",g),t("__asyncGenerator",v),t("__asyncDelegator",y),t("__asyncValues",b)})}).call(e,function(){return this}())},,,function(t,e,i){(function(e){"use strict";function o(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}var n=i(1).LineDataSource,s=i(31).Study,r=i(42),a=i(48).DataSource,l=i(34),h=i(63).bindPopupMenu,c=i(191),d=i(33).trackEvent;i(126),$.extend(o,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_PRIORITY_PROPERTIES:250,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_PROPERTIES:"Properties",TAB_NAME_GRAPHICS:"Graphics",TAB_NAME_VISIBILITY:"Visibility",TAB_NAME_SOURCE_CODE:"Source Code",LOCALIZED_TAB_NAME_COORDINATES:$.t("Coordinates"),LOCALIZED_TAB_NAME_DISPLAY:$.t("Properties"),LOCALIZED_TAB_NAME_STYLE:$.t("Style"),LOCALIZED_TAB_NAME_INPUTS:$.t("Inputs"),LOCALIZED_TAB_NAME_PROPERTIES:$.t("Properties"),LOCALIZED_TAB_NAME_GRAPHICS:$.t("Graphics"),LOCALIZED_TAB_NAME_VISIBILITY:$.t("Visibility"),LOCALIZED_TAB_NAME_SOURCE_CODE:$.t("Source Code"),TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300}),o.prototype.hide=function(t){TVDialogs.destroy(this._dialogTitle,{undoChanges:!!t})},o.prototype._onDestroy=function(t,e){var i,o=(e||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog"),o?(i=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this._model.undoToCheckpoint(i):this._source.hasAlert.value()&&this._source.localAndServerAlersMismatch&&this._source.synchronizeAlert(!0),this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},o.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},o.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},o.prototype.switchTab=function(t,e){var i,o;if(this._tabs)return i=null,t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,function(e,o){if(o.name===t)return i=o,!1}),"object"==typeof t&&$.each(this._tabs,function(e,o){if(t===o||$(o.labelObject).is(t)||$(o.wrapperObject).is(t))return i=o,!1}),i||(i=this._tabs[~~t]),!!i&&($.each(this._tabs,function(t,e){var o=e===i;$(e.wrapperObject)[o?"show":"hide"](),$(e.labelObject)[o?"addClass":"removeClass"]("active")}),e&&(o=this.activeTabSettingsName())&&TVSettings.setValue(o,i.name),this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0)},o.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),o=i.width();e.css({
if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof _?_(t):t[Symbol.iterator]()},t("__extends",s),t("__assign",r),t("__rest",a),t("__decorate",l),t("__param",h),t("__metadata",c),t("__awaiter",d),t("__generator",p),t("__exportStar",u),t("__values",_),t("__read",f),t("__spread",m),t("__await",g),t("__asyncGenerator",v),t("__asyncDelegator",y),t("__asyncValues",b)})}).call(e,function(){return this}())},,,function(t,e,i){(function(e){"use strict";function o(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}var n=i(1).LineDataSource,s=i(31).Study,r=i(43),a=i(48).DataSource,l=i(34),h=i(63).bindPopupMenu,c=i(191),d=i(33).trackEvent;i(126),$.extend(o,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_PRIORITY_PROPERTIES:250,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_PROPERTIES:"Properties",TAB_NAME_GRAPHICS:"Graphics",TAB_NAME_VISIBILITY:"Visibility",TAB_NAME_SOURCE_CODE:"Source Code",LOCALIZED_TAB_NAME_COORDINATES:$.t("Coordinates"),LOCALIZED_TAB_NAME_DISPLAY:$.t("Properties"),LOCALIZED_TAB_NAME_STYLE:$.t("Style"),LOCALIZED_TAB_NAME_INPUTS:$.t("Inputs"),LOCALIZED_TAB_NAME_PROPERTIES:$.t("Properties"),LOCALIZED_TAB_NAME_GRAPHICS:$.t("Graphics"),LOCALIZED_TAB_NAME_VISIBILITY:$.t("Visibility"),LOCALIZED_TAB_NAME_SOURCE_CODE:$.t("Source Code"),TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300}),o.prototype.hide=function(t){TVDialogs.destroy(this._dialogTitle,{undoChanges:!!t})},o.prototype._onDestroy=function(t,e){var i,o=(e||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog"),o?(i=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this._model.undoToCheckpoint(i):this._source.hasAlert.value()&&this._source.localAndServerAlersMismatch&&this._source.synchronizeAlert(!0),this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},o.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},o.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},o.prototype.switchTab=function(t,e){var i,o;if(this._tabs)return i=null,t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,function(e,o){if(o.name===t)return i=o,!1}),"object"==typeof t&&$.each(this._tabs,function(e,o){if(t===o||$(o.labelObject).is(t)||$(o.wrapperObject).is(t))return i=o,!1}),i||(i=this._tabs[~~t]),!!i&&($.each(this._tabs,function(t,e){var o=e===i;$(e.wrapperObject)[o?"show":"hide"](),$(e.labelObject)[o?"addClass":"removeClass"]("active")}),e&&(o=this.activeTabSettingsName())&&TVSettings.setValue(o,i.name),this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0)},o.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),o=i.width();e.css({
height:$(window).height()/1.4,overflow:"auto"}),i.css("width",o+20),t.isScrollable=!0},o.prototype.appendToTab=function(t,e,i,o,n,s){var r,a;$(t).is("table")&&!$(t).find("tr").size()||(this._tabs||(this._tabs=[]),$.each(this._tabs,function(t,i){if(i.name===e)return r=t,!1}),void 0===r&&(this._tabs.push({name:e,localizedName:$.t(e),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!n,callback:n?s||function(){}:null}),r=this._tabs.length-1),a=this._tabs[r],a.objects=a.objects.add(t),a.displayPriority=Math.max(a.displayPriority||0,i||0),a.defaultOpen=Math.max(a.defaultOpen||0,o||0))},o.prototype.insertTabs=function(){function t(t){r&&r===t.name&&(t.defaultOpen=Math.max(~~t.defaultOpen,o.TAB_OPEN_USERSAVE)),(!n||~~n.defaultOpen<~~t.defaultOpen)&&(n=t),t.labelObject=$('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.bind("click",function(t){t.preventDefault(),i.switchTab(this,!0)});var e=$('<div class="main-properties"></div>');t.wrapperObject=$().add(e),t.objects.each(function(i,o){var n=$(o);n.is("table")?(n.data("layout-separated")&&(t.wrapperObject=t.wrapperObject.add('<div class="properties-separator"></div>').add(e=$('<div class="main-properties"></div>')),n.removeData("layout-separated")),e.append(n),n.children("tbody").each(function(i,n){if(0!==i&&$(n).data("layout-separated")){t.wrapperObject=t.wrapperObject.add('<div class="properties-separator"></div>').add(e=$('<div class="main-properties"></div>'));var s=$(o).clone(!0,!1).appendTo(e);s.children().remove(),s.append(n),$(n).removeData("layout-separated")}})):e.append(n)}),t.wrapperObject.appendTo(i._container)}function e(t){t.labelObject=$('<a href="#" class="properties-tabs-label tv-tabs__tab"></a>').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.bind("click",t.callback)}var i,n,s,r;this._tabs&&(this._tabs.sort(function(t,e){return(e.displayPriority||0)-(t.displayPriority||0)}),i=this,n=null,s=this.activeTabSettingsName(),s&&(r=TVSettings.getValue(s)),$.each(this._tabs,function(i,o){o.isButton?e(o):t(o)}),this.switchTab(n))},o.prototype.activeTabSettingsName=function(){var t=this._source;if(t)return t instanceof r||t instanceof c.ChartWidget?"properties_dialog.active_tab.chart":t instanceof n?"properties_dialog.active_tab.drawing":t instanceof s?"properties_dialog.active_tab.study":void 0},o.prototype.show=function(t){function c(){y.hide(!0)}var p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V;if(e.enabled("property_pages")&&(p=i(195),t=t||{},u=t.onWidget||!1,TradingView.isInherited(this._source.constructor,r)&&d("GUI","Series Properties"),TradingView.isInherited(this._source.constructor,s)&&d("GUI","Study Properties"),TradingView.isInherited(this._source.constructor,a)&&this._model.setSelectedSource(this._source),_=p.createStudyStrategyPropertyPage(this._source,this._model),f=p.createInputsPropertyPage(this._source,this._model),m=p.createStylesPropertyPage(this._source,this._model),g=p.createVisibilitiesPropertyPage(this._source,this._model),
v=p.createDisplayPropertyPage(this._source,this._model),f&&!f.widget().is(":empty")||m||_))return y=this,b=null!==f,w=this._source.title(),S=TVDialogs.createDialog(w,{hideTitle:!0,dragHandle:".properties-tabs"}),T=S.find("._tv-dialog-content"),C=$('<div class="properties-tabs tv-tabs"></div>').appendTo(T),x=[],P=400,this._tabs=x,this._dialog=S,this._dialogTitle=w,this._dialog=S,this._container=T,this._tabContainer=C,this._undoCheckpointOnShow=this._model.createUndoCheckpoint(),S.on("destroy",function(t,e){y._onDestroy(t,e),f&&f.destroy(),_&&_.destroy(),m&&m.destroy(),v&&v.destroy(),g&&g.destroy(),$("select",T).each(function(){$(this).selectbox("detach")})}),t.selectScales&&m.setScalesOpenTab&&m.setScalesOpenTab(),t.selectTmz&&m.setTmzOpenTab&&m.setTmzOpenTab(),!this._model.readOnly()&&_&&_.widget().each(function(t,e){var i,n,s=+$(e).data("layout-tab-priority");isNaN(s)&&(s=o.TAB_PRIORITY_PROPERTIES),i=~~$(e).data("layout-tab-open"),n=$(e).data("layout-tab"),void 0===n&&(n=o.TAB_NAME_PROPERTIES),y.appendToTab(e,n,s,i)}),this._model.readOnly()||!b||f.widget().is(":empty")||f.widget().each(function(t,e){var n,s,r=i(64),a=f instanceof r,l=+$(e).data("layout-tab-priority");TradingView.isNaN(l)&&(l=a?o.TAB_PRIORITY_COORDINATES:o.TAB_PRIORITY_INPUTS),n=~~$(e).data("layout-tab-open"),s=$(e).data("layout-tab"),void 0===s&&(s=a?o.TAB_NAME_COORDINATES:o.TAB_NAME_INPUTS),y.appendToTab(e,s,l,n)}),m&&m.widget().each(function(t,e){var n,s,r,a=+$(e).data("layout-tab-priority");TradingView.isNaN(a)&&(a=o.TAB_PRIORITY_STYLE),n=~~$(e).data("layout-tab-open"),s=i(10),!n&&m instanceof s&&(n=o.TAB_OPEN_DEFAULT),r=$(e).data("layout-tab"),void 0===r&&(r=o.TAB_NAME_STYLE),y.appendToTab(e,r,a,n)}),v&&v.widget().each(function(t,e){var i,n,s=+$(e).data("layout-tab-priority");TradingView.isNaN(s)&&(s=o.TAB_PRIORITY_DISPLAY),i=~~$(e).data("layout-tab-open"),n=$(e).data("layout-tab"),void 0===n&&(n=o.TAB_NAME_DISPLAY),y.appendToTab(e,n,s,i)}),g&&g.widget().each(function(t,e){y.appendToTab(e,o.TAB_NAME_VISIBILITY,o.TAB_PRIORITY_DISPLAY,!1)}),I=this._source instanceof s&&!!this._source.metaInfo().pine,I&&this._source.metaInfo(),this.insertTabs(),this._helpItemRequired()&&this._createHelp(),A=110,$(".js-dialog").each(function(){var t=parseInt($(this).css("z-index"),10);t>A&&(A=t)}),S.css("z-index",A),L=$('<div class="main-properties main-properties-aftertabs"></div>').appendTo(T),k=$('<div class="dialog-buttons">').appendTo(L),E=function(){function t(e){e._childs&&e._childs.length&&$.each(e._childs,function(i,o){"percentage"===o?e.percentage.listeners().fire(e.percentage):t(e[o])})}var e=[];m&&"function"==typeof m.defaultProperties&&(e=e.concat(m.defaultProperties())),f&&"function"==typeof f.defaultProperties&&(e=e.concat(f.defaultProperties())),0===e.length&&y._source.properties?e=[y._source.properties()]:y._source._sessionsStudy&&(e=e.concat(y._source._sessionsStudy.properties())),e.length&&($.each(e,function(e,i){y._model.restoreFactoryDefaults(i),y._source.calcIsActualSymbol&&y._source.calcIsActualSymbol(),t(i)}),
y._source.properties().minTick&&y._source.properties().minTick.listeners().fire(y._source.properties().minTick),y._source.properties().precision&&y._source.properties().precision.listeners().fire(y._source.properties().precision),f&&f.loadData(),_&&_.loadData(),m.onResoreDefaults&&m.onResoreDefaults(),m&&m.loadData(),g&&g.loadData())},M=function(){g&&g.loadData(),f&&f.loadData()},(!u||window.is_authenticated)&&m&&"function"==typeof m.createTemplateButton&&e.enabled("linetoolpropertieswidget_template_button")?m.createTemplateButton({popupZIndex:A,defaultsCallback:E,loadTemplateCallback:M}).addClass("tv-left").appendTo(k):TradingView.isInherited(this._source.constructor,s)?(D=[{title:$.t("Reset Settings"),action:E},{title:$.t("Save As Default"),action:function(){y._source.properties().saveDefaults()}}],O=$('<a href="#" class="_tv-button tv-left">'+$.t("Defaults")+'<span class="icon-dropdown"></span></a>'),O.on("click",function(t){t.preventDefault();var e=$(this);e.is(".active")||e.trigger("button-popup",[D,!0])}).appendTo(k),h(O,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0,zIndex:A})):$('<a class="_tv-button tv-left">'+$.t("Defaults")+"</a>").appendTo(k).click(E),$('<a class="_tv-button ok">'+$.t("OK")+"</a>").appendTo(k).click(function(){y.hide()}),$('<a class="_tv-button cancel">'+$.t("Cancel")+"</a>").appendTo(k).on("click",c),S.find("._tv-dialog-title a").on("click",c),$(window).bind("keyup.hidePropertyDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&y.hide()}),$("select",T).each(function(){var t=$(this),e="tv-select-container dialog";t.hasClass("tv-select-container-fontsize")&&(e+=" tv-select-container-fontsize"),t.selectbox({speed:100,classHolder:e})}),$('input[type="text"]',T).addClass("tv-text-input inset dialog"),$("input.ticker",T).TVTicker(),S.css("min-width",P+"px"),TVDialogs.applyHandlers(S,t),V={top:($(window).height()-S.height())/2,left:($(window).width()-S.width())/2},m&&"function"==typeof m.dialogPosition&&(V=m.dialogPosition(V,S)||V),TVDialogs.positionDialog(S,V),window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide(),l.emit("edit_object_dialog",{objectType:this._source===this._model.mainSeries()?"mainSeries":this._source instanceof n?"drawing":this._source instanceof s?"study":"other",scriptTitle:this._source.title()}),S},o.prototype._helpItemRequired=function(){return this._source._metaInfo&&!!this._source._metaInfo.helpURL},o.prototype._createHelp=function(){var t=$('<a class="help" href="#" target="_blank" title="'+$.t("Help")+'"></a>');t.attr("href",this._source._metaInfo.helpURL),this._tabContainer.prepend(t)},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";var o=i(215),n=i(72),s=i(668),r=i(140),a=i(127).unifiedSpinner,l=i(125),h=i(222).regExpEscape,c=i(740),d=i(214).isFeatureEnabled,p=i(113),u=function(){function t(i){var o,n,s,r;if(!(this instanceof t))throw new TypeError("SymbolSearch is a constructor");if(i=i||{},
@@ -135,7 +135,7 @@ var e=n.symbol.value()||"";e=h(e,t),i.val(e),S.resetState()}var u,_,f,g,v,y,b,w,
r.setAttribute("data-item-ticker",l),this._roots[o].tbody.appendChild(r);else this._currentTbody||(this._currentTbody=document.createElement("tbody"),this._container.appendChild(this._currentTbody)),a=t.createSuggestListRow(e,this._tickerRegExp,this._translationCache),this._currentTbody.appendChild(a);l=e.ticker||e.full_name,this._itemsByTicker[l]=e,a.setAttribute("data-item-ticker",l)},v.prototype.toggleCollapsed=function(t,e){var i;if(t)(i=this._roots[t])&&($(i.titleRow).toggleClass("collapsed",!!e),$(i.tbody).find("tr:not(.group-title)").toggleClass("hidden",!!e));else for(t in this._roots)this.toggleCollapsed(t,e)},v.prototype.collapse=function(t){this.toggleCollapsed(t,!0)},v.prototype.expand=function(t){this.toggleCollapsed(t,!1)},v.prototype.getItemByTicker=function(t){return this._itemsByTicker[t]||null},t.GroupListHandler=v,t.isIntervalInit=function(t){return/[\d,]/.test(t)&&e.enabled("show_interval_dialog_on_key_press")},t.isIntervalChar=function(t){return e.enabled("seconds_resolution")?/[\dhdwms]/i.test(t):/[\dhdwm]/i.test(t)},t.parseIntervalValue=function(t){var e=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(t)||[],i=~~e[1],o=e[2]&&e[2].toUpperCase(),n={qty:!i&&o?1:i,unit:o||null};return n.error=!i&&!o,n.intraday=!(n.error||n.unit&&"H"!==n.unit),n},t.sanitizeIntervalValue=function(e){var i=t.parseIntervalValue(e),o=i.qty,n=i.unit;return i.error?null:("H"===n&&(o*=60,n=null),o&&!n?o+"":n&&(!o||1===o&&"S"!==n)?n:o+n)},t.detachInterval=function(t){var e=/,[^,]*$/i.exec(t)||[];if(e[0])return{rest:t.substr(0,t.length-e[0].length),detached:e[0]}},t.intervalIsSupported=function(i){var s,r,a;return e.enabled("allow_supported_resolutions_set_only")?null!==(s=this.sanitizeIntervalValue(i))&&o.isAvailable(s):(r=t.parseIntervalValue(i),!r.error&&(r.intraday?n.intraday.value():!(a=n.supportedResolutions.value())||!!~a.indexOf(r.unit)))},function(){var e="",i=null;t.resetStoredInterval=function(){e="",i=null},t.detachStoreInterval=function(o){var n=t.detachInterval(o);return n?(e=n.detached,i=t.sanitizeIntervalValue(e),n.rest):(t.resetStoredInterval(),o)},t.recallAttachInterval=function(t){return t+e},t.getInterval=function(e){var o=i;return!0===e&&t.resetStoredInterval(),o},t.getInputValueGetter=function(e){return function(){return t.detachStoreInterval(e.value)}},t.getInputValueSetter=function(e){return function(i){e.value=t.recallAttachInterval(i)}},t.intervalError=function(){return!(!e||/^,\s*$/.test(e))&&!i}}(),t.registerDialogKeypressHandler=function(o){if(!o)throw new TypeError("chartWidget is required");r.pushBackListener("symbolEdit",function(o){var s,r=i(190);if(g(o))if(o.preventDefault(),s=String.fromCharCode(o.charCode),t.isIntervalInit(s))new r({callback:function(t){n.interval.setValue(t)}}).show(s);else{if(!e.enabled("symbol_search_hot_key"))return;t.showDialog({initialValue:s,callback:function(t,e){n.symbol.setValue(t),e&&n.interval.setValue(e)}})}})},t.canShowSpreadActions=function(){
return"undefined"!=typeof SymbolSearchInputParserMixin&&"cme"!==TradingView.widgetCustomer&&"bovespa"!==TradingView.widgetCustomer},t}();t.exports=u}).call(e,i(3))},function(t,e,i){"use strict";function o(t,e,i,s){var a=new n(this,t);e.push(a),r.call(this,t,e,i),this.properties().listeners().subscribe(this,o.prototype.changeStyles),this._constructor=s,this._studyId=null,this._nonseriesdata=null,this._indexes=null,this._metaInfo=null,this._graphics=null,this._inputs=null}function n(t,e){a.call(this,t,e)}function s(t,e){a.call(this,t,e)}var r=i(1).LineDataSource,a=i(9),l=i(90).VertLineRenderer,h=i(11).TrendLineRenderer,c=i(68).SelectionRenderer,d=i(6),p=i(155),u=i(86),_=i(25);inherit(o,r),o.prototype.pointsCount=function(){throw Error("Reimplement this in a child class")},o.prototype.title=function(){return this._metaInfo.description},o.prototype.studyId=function(){return this._metaInfo.id},o.prototype._requestStudy=function(){throw Error("Reimplement this in a child class")},o.prototype.changeStyles=function(){var t,e,o,n=i(80);if(this._inputs){t=n.splitInputs(this.properties().inputs.state()),e=t.obj;for(o in e)if(e[o]!==this._inputs[o]){this._inputs=e,this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf());break}}else t=n.splitInputs(this.properties().inputs.state()),this._inputs=TradingView.clone(t.obj),this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries()._turnaround||t===this._model.mainSeries()._turnaround+"_"+this._turnaround},o.prototype.stop=function(){r.prototype.stop.call(this),this._studyId&&this._model.chartApi().removeStudy(this._studyId)},o.prototype.onData=function(t){throw Error("Reimplement this in a child class")},o.prototype._correctedPoint=function(t){var e=parseInt(this._model.mainSeries().bars().first(),10),i=parseInt(this._model.mainSeries().bars().last(),10);return t.index=Math.max(t.index,e),t.index=Math.min(t.index,i),t},o.prototype.addPoint=function(t){return r.prototype.addPoint.call(this,this._correctedPoint(t))},o.prototype.setLastPoint=function(t){return r.prototype.setLastPoint.call(this,this._correctedPoint(t))},o.prototype.move=function(t){},o.prototype.clearData=function(){void 0!==this.m_data&&(this.m_data=new u(this._plotFields)),this._nonseriesdata=null,this._indexes=null,this._graphics=new p(this._metaInfo),this.updateAllViews()},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(void 0!==this.m_data&&(e.data=this.m_data.state()),e.nonseriesdata=this._nonseriesdata,e.nonseriesindexes=this._indexes,e.graphics=this._graphics.graphics()),this.metaInfo()instanceof _?e.metaInfo=this.metaInfo().state():(e.metaInfo=$.extend({},this.metaInfo()),e.metaInfo.id=_.parseIdString(e.metaInfo.id+(e.metaInfo.version?"-"+e.metaInfo.version:"")).fullId),e},o.prototype.restoreData=function(t){void 0!==this.m_data&&void 0!==t.data&&this.m_data.restoreState(t.data),
this._nonseriesdata=t.nonseriesdata?t.nonseriesdata:null,this._indexes=t.nonseriesindexes?t.nonseriesindexes:null,this._graphics.setGraphics(t.graphics?t.graphics:p.emptyGraphics())},o.prototype.setPoint=function(t,e){this._nonseriesdata=null,this._indexes=null,r.prototype.setPoint.call(this,t,this._correctedPoint(e))},o.prototype.disconnect=function(){this._studyId=0},o.prototype.graphics=function(){return this._graphics.graphics()},o.prototype.firstValue=function(){return this._model.mainSeries().data().firstValue()},o.prototype.formatter=function(){return this._model.mainSeries().data().formatter()},o.prototype.metaInfo=function(){return this._metaInfo},inherit(n,a),n.prototype.renderer=function(){var t,e,i,o,n,s=new d;return this._points.length<2?s:this._source._nonseriesdata?s:this._source._graphics&&!this._source._graphics.isEmpty()?s:(t=this._points[0],e=this._points[1],i={},i.points=[t],i.color="#808080",i.linewidth=this._source._doNotNeedLine?0:1,i.linestyle=CanvasEx.LINESTYLE_SOLID,s.append(new l(i)),o={},o.points=[e],o.color="#808080",o.linewidth=this._source._doNotNeedLine?0:1,o.linestyle=CanvasEx.LINESTYLE_SOLID,s.append(new l(o)),n={points:[t,e],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:this._source._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},s.append(new h(n)),s)},inherit(s,a),s.prototype.renderer=function(){var t=new d;return this.isAnchorsRequired()&&(t.append(new c({points:this._points})),t.append(this.createLineAnchor({points:this._points}))),t},e.StudyLineDataSource=o,e.StudyLineDataSourcePaneView=s},function(t,e,i){"use strict";function o(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this._plotName=o,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=H.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s),this.m_study.isSelfColorerPlot(s)&&n[s].target===this._plotName&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette])}function n(t,e,i,o){var n,s;for(this._study=t,this._series=e,this._model=i,this._plotName=o,this._items=[],this._invalidated=!0,this._isMarkersEnabled=H.enabled("source_selection_markers"),n=this._study.metaInfo().plots,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s,z(this._study.isBgColorerPlot(s),"Plot '"+this._plotName+"' is not a background colorer!"))}function s(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_items=[],this.m_invalidated=!0,this._isMarkersEnabled=H.enabled("source_selection_markers"),this.m_plotIndex=null,n=this.m_study.metaInfo().plots,s=0;s<n.length;s++)if(n[s].id===this.m_plotName){this.m_plotIndex=s;break}for(n=this.m_study.metaInfo().plots,this._colorer=null,
this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,s=0;s<n.length;s++)n[s].id===this.m_plotName&&(this._plotIndex=s),this.m_study.isSelfColorerPlot(s)&&n[s].target===this.m_plotName&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]),this.m_study.isTextColorerPlot(s)&&n[s].target===this.m_plotName&&(this._textColorer=s,this._textPalette=this.m_study.metaInfo().palettes[n[s].palette],this._textPaletterProps=this.m_study.properties().palettes[n[s].palette])}function r(t,e,i,o){s.call(this,t,e,i,o)}function a(t,e,i,o){r.call(this,t,e,i,o)}function l(t,e,i,o){s.call(this,t,e,i,o),this._maxAbsValue=0}function h(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=H.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},s=0;s<n.length;s++)n[s].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(s)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=s),this.m_study.isOHLCHighPlot(s)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=s),this.m_study.isOHLCLowPlot(s)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=s),this.m_study.isOHLCClosePlot(s)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=s),this.m_study.isOHLCColorerPlot(s)&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]))}function c(t,e,i,o){h.call(this,t,e,i,o)}function d(t,e,i,o){h.call(this,t,e,i,o)}var p=i(36),u=p.rgbToHsl,_=p.hslToRgb,f=p.rgbToHexString,m=p.parseRgb,g=p.parseRgba,v=i(8),y=i(68),b=y.SelectionRenderer,w=y.SelectionRendererArrowsUpDown,S=i(59),T=S.PaneRendererBars,C=S.PaneRendererHistogram,x=S.PaneRendererColumns,P=S.PaneRendererLine,L=S.PaneRendererArea,k=S.PaneRendererCandles,I=S.PaneRendererCross,A=S.PaneRendererCircles,E=S.PaneRendererArrowsUpDownItem,M=S.PaneRendererArrowsUpDown,D=S.PaneRendererUnicodeChar,O=S.PaneRendererBackground,$=i(303),V=i(6),B=i(344),R=i(2),N=i(81),F=i(552),z=i(44).assert,W=i(14),H=i(3);o.isIndexValid=function(t,e){return t>=0&&t<e._length()},o.prototype.items=function(){return this.m_items},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,$;if(this._histogramBase=null,this.m_items=[],!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){if(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),n=this.m_study.offset(this._plotName),n>0?(e-=n,i+=n):(e+=n,i-=n),s=this.m_study.properties().styles[this._plotName].plottype.value(),
this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,s=0;s<n.length;s++)n[s].id===this.m_plotName&&(this._plotIndex=s),this.m_study.isSelfColorerPlot(s)&&n[s].target===this.m_plotName&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]),this.m_study.isTextColorerPlot(s)&&n[s].target===this.m_plotName&&(this._textColorer=s,this._textPalette=this.m_study.metaInfo().palettes[n[s].palette],this._textPaletterProps=this.m_study.properties().palettes[n[s].palette])}function r(t,e,i,o){s.call(this,t,e,i,o)}function a(t,e,i,o){r.call(this,t,e,i,o)}function l(t,e,i,o){s.call(this,t,e,i,o),this._maxAbsValue=0}function h(t,e,i,o){var n,s;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=H.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},s=0;s<n.length;s++)n[s].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(s)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=s),this.m_study.isOHLCHighPlot(s)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=s),this.m_study.isOHLCLowPlot(s)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=s),this.m_study.isOHLCClosePlot(s)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=s),this.m_study.isOHLCColorerPlot(s)&&(this._colorer=s,this._palette=this.m_study.metaInfo().palettes[n[s].palette],this._paletterProps=this.m_study.properties().palettes[n[s].palette]))}function c(t,e,i,o){h.call(this,t,e,i,o)}function d(t,e,i,o){h.call(this,t,e,i,o)}var p=i(37),u=p.rgbToHsl,_=p.hslToRgb,f=p.rgbToHexString,m=p.parseRgb,g=p.parseRgba,v=i(8),y=i(68),b=y.SelectionRenderer,w=y.SelectionRendererArrowsUpDown,S=i(59),T=S.PaneRendererBars,C=S.PaneRendererHistogram,x=S.PaneRendererColumns,P=S.PaneRendererLine,L=S.PaneRendererArea,k=S.PaneRendererCandles,I=S.PaneRendererCross,A=S.PaneRendererCircles,E=S.PaneRendererArrowsUpDownItem,M=S.PaneRendererArrowsUpDown,D=S.PaneRendererUnicodeChar,O=S.PaneRendererBackground,$=i(303),V=i(6),B=i(344),R=i(2),N=i(81),F=i(552),z=i(44).assert,W=i(14),H=i(3);o.isIndexValid=function(t,e){return t>=0&&t<e._length()},o.prototype.items=function(){return this.m_items},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,s,r,a,l,h,c,d,p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,$;if(this._histogramBase=null,this.m_items=[],!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){if(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),n=this.m_study.offset(this._plotName),n>0?(e-=n,i+=n):(e+=n,i-=n),s=this.m_study.properties().styles[this._plotName].plottype.value(),
r=[N.PlotType.Line,N.PlotType.Area,N.PlotType.Circles,N.PlotType.Cross].indexOf(s)>=0,a=this.m_study.data(),l=this.m_study.firstValue(),r&&a._length()>0){for(h=a._bsearch(e);o.isIndexValid(h,a)&&void 0===a._valueAt(h)[this._plotIndex+1];)h-=1;for(e=o.isIndexValid(h,a)?a._indexAt(h):e,c=a._bsearch(i);o.isIndexValid(c,a)&&void 0===a._valueAt(c)[this._plotIndex+1];)c+=1;i=o.isIndexValid(c,a)?a._indexAt(c):i}for(d=a.range(e,i),p=this.m_study.priceScale(),u=p.properties().percentage.value(),_=R.clamp(this._getTranspValue(),0,100),f={},m=function(t,e){var i=t+"@"+e;return f[i]||(this._plotName&&"vol"===this._plotName?f[i]=W.generateColor(t,e):f[i]=W.generateColor(t,e,!0)),f[i]}.bind(this),g=d._start;g<d._end;++g)y=d._indexAt(g),y+=n,y=Math.floor(y),b=d._valueAt(g),w=b[this._plotIndex+1],S=void 0===w||null===w,w=S?NaN:w,u&&!S&&(w=100*(w-l)/l),r&&S||(T=new R.Point(y,w),C=void 0!==b[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&C&&(w=b[this._colorer+1],T.style={},x=this.m_study.properties().styles[this._plotName],null!=w?(P=this._palette.valToIndex?this._palette.valToIndex[w]:w,L=this._paletterProps.colors[P],k=L.color.value(),T.style.color=W.isHexColor(k)?m(k,_):k):(k=x.color.value(),T.style.color=m(k,100)),I=void 0!==P?L.width.value():x.linewidth.value(),A=void 0!==P?L.style.value():x.linestyle.value(),T.style.width=I,T.style.style=A),this.m_items.push(T));if(p.pricesToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),this.m_study.properties().styles[this._plotName].histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(this.m_study.properties().styles[this._plotName].histogramBase.value())),this.m_study===this.m_model.selectedSource())for(E=B(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=v.REGULAR,g=0;g<E.length;g++)y=E[g],b=this.m_study.data().valueAt(y),y+=n,void 0!==b&&(w=b[this._plotIndex+1],p.properties().percentage.value()&&(w=100*(w-l)/l),M=this.m_model.timeScale().indexToCoordinate(Math.floor(y)),D=this.m_study.priceScale().priceToCoordinate(w),this._selectionData.points.push(new R.Point(M,D)));O=this.m_study.properties().styles[this._plotName],this._lineColor=W.generateColor(O.color.value(),_),this._lineWidth=O.linewidth.value(),$=O.color.value(),this._colorer&&null!=(w=this._paletterProps.colors[0])&&($=w.color.value(),this._lineWidth=w.width.value(),this._lineColor=W.generateColor(w.color.value(),_)),this._color2=W.generateColor($,_),this._color1=W.generateColor(o.addHueForColor($),_)}},o.addHueForColor=F(function(t){var e=u(m(t)),i=e[0]+.05;return e[0]=i-Math.floor(i),f(_(e))}),o.prototype._getTranspValue=function(){var t=this.m_study.properties(),e=t.styles[this._plotName],i=0,o=0,n=this.m_study.metaInfo();return"Volume@tv-basicstudies"===n.id&&n.version<=46&&"transparency"in t?(i=t.transparency.value(),i=isNumber(i)?i:o):(e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:o),i)},o.prototype.renderer=function(){var t,e,i,o,n=this.m_study.properties().styles[this._plotName]
;if(n.visible.value()&&this.m_study.priceScale()){switch(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height(),t.lineIndex=0,t.lineStyle=n.linestyle.value(),t.lineColor=this._lineColor,t.lineWidth=this._lineWidth,t.lineWidth=isNumber(t.lineWidth)?t.lineWidth:1,t.color1=this._color1,t.color2=this._color2,t.bottom=t.histogramBase,this._colorer||(t.simpleMode=!0),e=new V,i=!!n.joinPoints&&n.joinPoints.value(),n.plottype.value()){case N.PlotType.Line:case N.PlotType.Line_with_breaks:e.append(new P(t));break;case N.PlotType.Area:case N.PlotType.Area_with_breaks:e.append(new L(t));break;case N.PlotType.Histogram:e.append(new C(t));break;case N.PlotType.Columns:e.append(new x(t));break;case N.PlotType.Cross:e.append(new I(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new P(o)));break;case N.PlotType.Circles:e.append(new A(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new P(o)));break;default:e.append(new P(t))}return this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new b(this._selectionData)),e}},n.prototype.items=function(){return this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype._scalesReady=function(){var t=this._model.timeScale(),e=this._study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},n.prototype._getTranspValue=function(){var t=this._study.properties(),e=t.styles[this._plotName],i=0;return e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:40),i},n.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;if(this._items=[],z(this._scalesReady(),"Scales must be ready!"),t=this._model.timeScale().visibleBars().clone(),!t.isEmpty()){for(e=this._study.metaInfo().plots,i=e[this._plotIndex].palette,o=this._study.properties().palettes[i],n=o.colors,s=this._study.metaInfo().palettes[i],r=this._getTranspValue(),a=this._series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),l=this._series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),h=this._study.offset(this._plotName),h>0?(a-=h,l+=h):(a+=h,l-=h),c=this._study.data(),d=c.range(a,l),p=d._start;p<d._end;++p)u=d._indexAt(p),u+=h,_=d._valueAt(p),f=_[this._plotIndex+1],m=new R.Point(Math.floor(u)-.5),g=isNumber(r)?r:50,g=Math.min(g,100),g=Math.max(g,0),null!=f?(v=s.valToIndex?s.valToIndex[f]:f,m.color=W.generateColor(n[v].color.value(),g)):m.color=null,this._items.push(m);this._model.timeScale().indexesToCoordinates(this._items)}},n.prototype.renderer=function(){var t,e;if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},e=new V,e.append(new O(t)),e},
s.prototype.items=function(){return this.m_items},s.prototype.update=function(){this.m_invalidated=!0},s.prototype._scalesReady=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I;if(this.m_items=[],this._scalesReady()&&(t=this.m_model.timeScale(),e=this.m_study.priceScale(),i=t.visibleBars().clone(),!i.isEmpty())){for(o=this.m_series.nearestIndex(i.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this.m_series.nearestIndex(i.lastBar(),TradingView.SEARCH_NEAREST_LEFT),s=this.m_study.offset(this.m_plotName),s>0?(o-=s,n+=s):(o+=s,n-=s),r=this.m_study.data(),a=this.m_study.firstValue(),l=r.range(o,n),h=e.properties().percentage.value(),c=this._getTranspValue(),d=B(o,n),p=this.m_study===this.m_model.selectedSource(),p&&(this.m_selectionData={points:[],hittestResult:v.REGULAR,vertOffset:0}),u=this.m_series.properties().style.value(),_=u===TradingView.Series.STYLE_LINE?"lineStyle":u===TradingView.Series.STYLE_AREA?"areaStyle":null,_?(f=this.m_series.properties()[_].priceSource.value(),m=f):(f="high",m="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),g=l._start;g<l._end;++g)y=l._indexAt(g),b=Math.floor(y+s),w=l._valueAt(g),null!==(S=w[this.m_plotIndex+1])&&void 0!==S&&void 0!==(T=this._createItem(b,S,f,m,h,a))&&null!==T&&(C=void 0!==w[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&C&&(S=w[this._colorer+1],T.style={},null!=S?(P=this._palette.valToIndex?this._palette.valToIndex[S]:S,x=this._paletterProps.colors[P].color.value(),T.style.color=W.generateColor(x,c)):(x=this.m_study.properties().styles[this.m_plotName].color.value(),T.style.color=W.generateColor(x,100)),L=c>9?c-10:0,T.style.borderColor=W.generateColor(x,L)),k=void 0!==w[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&k&&(S=w[this._textColorer+1],T.style||(T.style={}),null!=S?(P=this._textPalette.valToIndex?this._textPalette.valToIndex[S]:S,I=this._textPaletterProps.colors[P].color.value(),T.style.textColor=W.generateColor(I,c)):(I=this.m_study.properties().styles[this.m_plotName].textColor.value(),T.style.textColor=W.generateColor(I,100))),p&&-1!==d.indexOf(y)&&this.m_selectionData.points.push(T),this.m_items.push(T));this._convertItemsToCoordinates()}},s.prototype._getSeriesVal=function(t,e){var i;t=t||"close",i=null;try{i=this.m_series[t](e)}catch(t){}return i},s.prototype._getTranspValue=function(){var t,e=0;return this.m_study.properties().transparency&&(e=this.m_study.properties().transparency.value(),e=isNumber(e)?e:50),t=this.m_study.properties().styles[this.m_plotName],t.transparency&&(e=t.transparency.value(),e=isNumber(e)?e:50),R.clamp(e,0,100)},s.prototype._createItem=function(t,e,i,o,n,s){var r,a,l,h=this.m_study.properties().styles[this.m_plotName].location.value();if(!e&&h!==CanvasEx.MARKLOC_ABSOLUTE)return null;switch(h){
@@ -230,13 +230,13 @@ i=r.TOOLTIP_WIDTH-2*r.TOOLTIP_PADDING,o=d.prototype.wordWrap(e,i,t.font),n=this.
if(this._data.hittestOnBackground&&this._data.fillBackground&&4===this._data.points.length){if(p=(n.y-o.y)/(n.x-o.x),u=o.y+p*(t.x-o.x),_=s.y+p*(t.x-s.x),f=Math.max(u,_),m=Math.min(u,_),g=Math.min(o.x,n.x),v=Math.max(o.x,n.x),!this._data.extendleft&&t.x<g)return null;if(!this._data.extendright&&t.x>v)return null;if(t.y>=m&&t.y<=f)return this._backHittestResult}return null},inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d;l.prototype.update.call(this),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&0!==this._source.points().length&&(this._source._priceOffset||this._source.calculatePriceDiff(),3===this._points.length&&this._source._priceOffset&&(t=this._points[0],e=this._points[1],i=this._source._priceOffset+this._source.points()[0].price,o=this._source._priceOffset+this._source.points()[1].price,this._p3=t.clone(),this._p4=e.clone(),n=this._source.priceScale(),n.isLog()?(s=.5*(i+o)-this._source._priceOffset,r=.5*(i+o),a=this._source.priceScale().priceToCoordinate(s),h=this._source.priceScale().priceToCoordinate(r),c=h-a,this._p3.y+=c,this._p4.y+=c):(n.isPercent()&&(d=this._source.ownerSource().firstValue(),i=n.priceRange().convertToPercent(i,d),o=n.priceRange().convertToPercent(o,d)),this._p3.y=this._source.priceScale().priceToCoordinate(i),this._p4.y=this._source.priceScale().priceToCoordinate(o))))},n.prototype.renderer=function(){var t,e,i,n,s,r;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t={},t.points=[],this._points.length>1&&(t.points.push(this._points[0]),t.points.push(this._points[1])),this._points.length>2&&(t.points.push(this._p3),t.points.push(this._p4)),t.color=this._source.properties().linecolor.value(),t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),e=this._source.properties(),t.linewidth=e.linewidth.value(),t.linestyle=e.linestyle.value(),t.extendleft=e.extendLeft.value(),t.extendright=e.extendRight.value(),t.fillBackground=e.fillBackground.value(),t.backcolor=e.backgroundColor.value(),t.transparency=e.transparency.value(),t.showMidline=e.showMidline.value(),t.midlinewidth=e.midlinewidth.value(),t.midlinestyle=e.midlinestyle.value(),t.midcolor=e.midlinecolor.value(),t.fillBackground=e.fillBackground.value(),t.hittestOnBackground=!0,i=new p,i.append(new o(t)),this.isAnchorsRequired()&&(n=[],n.push(this._points[0]),this._points[1]&&n.push(this._points[1]),this._p3&&(n.push(this._p3.add(this._p4).scaled(.5)),n[2].data=2),s=3===this._points.length&&!this._p3,this._model.lineBeingCreated()!==this._source||s||n.pop(),i.append(this.createLineAnchor({points:n}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&this._points.length>=2&&(r=this._points,this._source.getAlertIsActive(function(t){i.append(new d({point1:r[0],point2:r[1],color:t?e.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),i},inherit(s,h),s.prototype.addPoint=function(t){var e,i=h.prototype.addPoint.call(this,t)
;return i&&(e=this.points()[0],this._points[2].index=e.index,this._points[2].price=e.price+this._priceOffset),i},s.prototype.calculatePriceDiff=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v;if(3===this.points().length){if(t=this.points()[0],e=this.points()[1],i=this.points()[2],t.index===e.index)return;if(null===(o=this.priceScale()))return;if(o.isLog()){if(n=this._model.timeScale(),n.isEmpty())return;s=n.indexToCoordinate(t.index),r=n.indexToCoordinate(e.index),a=o.priceToCoordinate(t.price),l=o.priceToCoordinate(e.price),h=n.indexToCoordinate(i.index),c=(l-a)/(r-s),d=a+c*(h-s),p=o.priceToCoordinate(i.price),u=p-d,_=.5*(a+l),f=o.coordinateToPrice(_),m=_+u,g=o.coordinateToPrice(m),this._priceOffset=g-f}else c=(e.price-t.price)/(e.index-t.index),v=t.price+c*(i.index-t.index),this._priceOffset=i.price-v}},s.prototype.setLastPoint=function(t,e){e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),h.prototype.setLastPoint.call(this,t),this.calculatePriceDiff()},s.prototype.restorePoints=function(t,e,i){h.prototype.restorePoints.call(this,t,e,i),t&&t.length>=3&&(this._priceOffset=t[2].price-t[0].price)},s.prototype.setPoint=function(t,e,i){i&&i.shift&&t<2&&this._snapPoint45Degree(e,this.points()[1-t]),h.prototype.setPoint.call(this,t,e,i),2===t&&this.calculatePriceDiff();var o=this.points()[0];this._points[2].index=o.index,this._points[2].price=o.price+this._priceOffset},s.prototype.pointsCount=function(){return 3},s.prototype.title=function(){return"Parallel Channel"},s.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),h.prototype.addPoint.call(this,t,e)},s.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},s.prototype.cloneData=function(t){this._priceOffset=t._priceOffset},s.prototype.restoreData=function(t){t.priceOffset&&(this._priceOffset=t.priceOffset)},s.prototype.state=function(t){var e=h.prototype.state.call(this,t);return e.priceOffset=this._priceOffset,e},s.prototype.canHasAlert=function(){return!0},s.prototype._getAlertPlots=function(){function t(t,e){return t.index<=e.index?[t,e]:[e,t]}var e,i,o,n,s,r,a,l,h=[].concat(this._points).splice(0,2);return h=h.concat([{price:h[0].price+this._priceOffset,time:h[0].time,index:h[0].index},{price:h[1].price+this._priceOffset,time:h[1].time,index:h[1].index}]),e=t(h[0],h[1]),i=t(h[2],h[3]),this._priceOffset<0?(n=i,o=e):(n=e,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),h[0].index<=h[1].index?(s=a,r=l):(s=l,r=a),[this._linePointsToAlertPlot(o,"Upper",s,r),this._linePointsToAlertPlot(n,"Lower",s,r)]},e.LineToolParallelChannel=s,e.ParallelChannelRenderer=o},function(t,e,i){(function(t){"use strict";function o(t,e){h.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new b,this._numericFormatter=new w,this._pipFormatter=null}function n(t,e,i,o){this._source=t,this._model=e,this._text="",this._invalidated=!0,this._coordinate=0,this._background="black",
this._pricePropName=i,this._colorPropName=o}function s(e,i){var r,a,l,h,d,p,u,_,f,m,g=i||new y("linetoolriskreward");this._entryPriceAxisView=new n(this,e,"entryPrice","linecolor"),this._stopPriceAxisView=new n(this,e,"stopPrice","stopBackground"),this._profitPriceAxisView=new n(this,e,"targetPrice","profitBackground"),c.call(this,e,new o(this,e),g),this._properties.addExclusion&&(this._properties.addExclusion("stopLevel"),this._properties.addExclusion("profitLevel")),i.stopLevel||i.profitLevel||(r=e.timeScale().visibleBars(),a=r.firstBar(),l=r.lastBar(),h=e.mainSeries().priceRange(a,l),d=e.mainSeries().priceScale(),d.isLog()&&(p=d.logicalToPrice(h.minValue()),u=d.logicalToPrice(h.maxValue()),h=new t(p,u)),d.isPercent()&&(_=e.mainSeries().firstValue(),p=d.priceRange().convertFromPercent(h.minValue(),_),u=d.priceRange().convertFromPercent(h.maxValue(),_),h=new t(p,u)),h&&!h.isEmpty()&&(f=Math.round(.2*h.length()*e.mainSeries().base()),g.merge({stopLevel:f,profitLevel:f}))),m=this,g.stopLevel.listeners().subscribe(this,this.recalculate),g.stopLevel.listeners().subscribe(null,function(){m.properties().stopPrice._listeners.fire(m.properties().stopPrice)}),g.profitLevel.listeners().subscribe(this,this.recalculate),g.profitLevel.listeners().subscribe(null,function(){m.properties().targetPrice._listeners.fire(m.properties().targetPrice)}),g.addChild("entryPrice",new s.PriceProperty(this,0)),g.addChild("stopPrice",new s.StopPriceProperty(this)),g.addChild("targetPrice",new s.TargetPriceProperty(this)),g.addProperty("riskSize",250),g.addProperty("qty",0),g.addProperty("amountTarget",g.accountSize.value()),g.addProperty("amountStop",g.accountSize.value()),g.risk.subscribe(this,this._recalculateRiskSize),g.accountSize.subscribe(this,this._recalculateRiskSize),g.showRiskInPercents.subscribe(this,this._recalculateRisk),g.showRiskInPercents.subscribe(this,this._recalculateRiskSize),this.version=s.version}function r(t,e){var i,o;this._constructor="LineToolRiskRewardShort",i=e||new y("linetoolriskrewardshort"),s.call(this,t,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount),o.accountSize.subscribe(this,this._recalculateAmount),o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}function a(t,e){var i,o;this._constructor="LineToolRiskRewardLong",i=e||new y("linetoolriskrewardlong"),s.call(this,t,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount),o.accountSize.subscribe(this,this._recalculateAmount),
o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}var l=i(2),h=i(9),c=i(1).LineDataSource,d=i(11).TrendLineRenderer,p=i(66),u=i(67),_=i(16).TextRenderer,f=i(45).RectangleRenderer,m=i(41),g=i(8),v=i(6),y=i(7).DefaultProperty,b=i(70).PercentageFormatter,w=i(26).NumericFormatter,S=i(219).PipFormatter,T=i(14);inherit(o,h),o.prototype.i18nCache={pnl:$.t("{0} P&L: {1}"),open:$.t("Open",{context:"line_tool_position"}),closed:$.t("Closed",{context:"line_tool_position"}),ratio:$.t("Risk/Reward Ratio: {0}"),stop:$.t("Stop: {0} ({1}) {2}, Amount: {3}"),target:$.t("Target: {0} ({1}) {2}, Amount: {3}"),qty:$.t("Qty: {0}")},o.prototype._formatInTicks=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)},o.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,r,a;h.prototype.update.call(this),this._stopLevel=null,this._profitLevel=null,t=this._model.timeScale(),!(e=this._source.priceScale())||e.isEmpty()||t.isEmpty()||0!==this._source.points().length&&0!==this._points.length&&this._model.mainSeries().bars().last()&&(this._source.points().length<2||0!==this._model.mainSeries().bars().length&&(this._isClosed=4===this._source.points().length,(i=this._source.lastBarData())&&(o=this._source.priceScale(),n=this._source.stopPrice(),r=this._source.profitPrice(),this._pl=this._source.points().length>1?this._source.calculatePL(i.closePrice):0,o.isPercent()&&(a=this._source.ownerSource().firstValue(),n=o.priceRange().convertToPercent(n,a),r=o.priceRange().convertToPercent(r,a),i.closePrice=o.priceRange().convertToPercent(i.closePrice,a)),this._entryLevel=this._points[s.INDEX_ENTRY].y,this._stopLevel=e.priceToCoordinate(n),this._profitLevel=e.priceToCoordinate(r),this._closeLevel=e.priceToCoordinate(i.closePrice),this._closeBar=this._source._model.timeScale().indexToCoordinate(i.index))))},o.prototype.renderer=function(){var t,e,i,o,n,r,a,h,p,u,m,y,b,w,C,x,P,L,k,I,A,E,M,D,O,$,V,B,R,N,F,z,W,H,U,j,q,Y;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new v,this._points.length<2||this._source.points().length<2?t:(e=this,i=this._source.properties(),o=this._points[s.INDEX_ENTRY].x,n=this._points[s.INDEX_ACTUALENTRY]?this._points[s.INDEX_ACTUALENTRY].x:this._points[s.INDEX_CLOSE].x,r=this._points[s.INDEX_ACTUALCLOSE]?this._points[s.INDEX_ACTUALCLOSE].x:this._points[s.INDEX_CLOSE].x,a=this._points[s.INDEX_CLOSE].x,h=new l.Point(o,this._entryLevel),p=new l.Point(a,this._stopLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,u.transparency=i.stopBackgroundTransparency.value(),t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT))),this._pl<0&&(h=new l.Point(n,this._entryLevel),p=new l.Point(r,this._closeLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,m=.01*i.stopBackgroundTransparency.value(),
o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}var l=i(2),h=i(9),c=i(1).LineDataSource,d=i(11).TrendLineRenderer,p=i(66),u=i(67),_=i(16).TextRenderer,f=i(45).RectangleRenderer,m=i(42),g=i(8),v=i(6),y=i(7).DefaultProperty,b=i(70).PercentageFormatter,w=i(26).NumericFormatter,S=i(219).PipFormatter,T=i(14);inherit(o,h),o.prototype.i18nCache={pnl:$.t("{0} P&L: {1}"),open:$.t("Open",{context:"line_tool_position"}),closed:$.t("Closed",{context:"line_tool_position"}),ratio:$.t("Risk/Reward Ratio: {0}"),stop:$.t("Stop: {0} ({1}) {2}, Amount: {3}"),target:$.t("Target: {0} ({1}) {2}, Amount: {3}"),qty:$.t("Qty: {0}")},o.prototype._formatInTicks=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)},o.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,r,a;h.prototype.update.call(this),this._stopLevel=null,this._profitLevel=null,t=this._model.timeScale(),!(e=this._source.priceScale())||e.isEmpty()||t.isEmpty()||0!==this._source.points().length&&0!==this._points.length&&this._model.mainSeries().bars().last()&&(this._source.points().length<2||0!==this._model.mainSeries().bars().length&&(this._isClosed=4===this._source.points().length,(i=this._source.lastBarData())&&(o=this._source.priceScale(),n=this._source.stopPrice(),r=this._source.profitPrice(),this._pl=this._source.points().length>1?this._source.calculatePL(i.closePrice):0,o.isPercent()&&(a=this._source.ownerSource().firstValue(),n=o.priceRange().convertToPercent(n,a),r=o.priceRange().convertToPercent(r,a),i.closePrice=o.priceRange().convertToPercent(i.closePrice,a)),this._entryLevel=this._points[s.INDEX_ENTRY].y,this._stopLevel=e.priceToCoordinate(n),this._profitLevel=e.priceToCoordinate(r),this._closeLevel=e.priceToCoordinate(i.closePrice),this._closeBar=this._source._model.timeScale().indexToCoordinate(i.index))))},o.prototype.renderer=function(){var t,e,i,o,n,r,a,h,p,u,m,y,b,w,C,x,P,L,k,I,A,E,M,D,O,$,V,B,R,N,F,z,W,H,U,j,q,Y;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new v,this._points.length<2||this._source.points().length<2?t:(e=this,i=this._source.properties(),o=this._points[s.INDEX_ENTRY].x,n=this._points[s.INDEX_ACTUALENTRY]?this._points[s.INDEX_ACTUALENTRY].x:this._points[s.INDEX_CLOSE].x,r=this._points[s.INDEX_ACTUALCLOSE]?this._points[s.INDEX_ACTUALCLOSE].x:this._points[s.INDEX_CLOSE].x,a=this._points[s.INDEX_CLOSE].x,h=new l.Point(o,this._entryLevel),p=new l.Point(a,this._stopLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,u.transparency=i.stopBackgroundTransparency.value(),t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT))),this._pl<0&&(h=new l.Point(n,this._entryLevel),p=new l.Point(r,this._closeLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.stopBackground.value(),u.fillBackground=!0,m=.01*i.stopBackgroundTransparency.value(),
y=100*(1-m*m*m),b=100-y,u.transparency=b,t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT)))),h=new l.Point(o,this._entryLevel),p=new l.Point(a,this._profitLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.profitBackground.value(),u.fillBackground=!0,u.transparency=i.profitBackgroundTransparency.value(),t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT))),this._pl>0&&(h=new l.Point(n,this._entryLevel),p=new l.Point(r,this._closeLevel),u={},u.points=[h,p],u.color="white",u.linewidth=0,u.backcolor=i.profitBackground.value(),u.fillBackground=!0,m=.01*i.profitBackgroundTransparency.value(),w=100*(1-m*m*m),C=100-w,u.transparency=C,t.append(new f(u,new g(g.MOVEPOINT),new g(g.MOVEPOINT)))),x=function(i,o,n){var s={};s.points=[i,o],s.width=e._model.timeScale().width(),s.height=e._source.priceScale().height(),s.color=n||e._source.properties().linecolor.value(),s.linewidth=e._source.properties().linewidth.value(),s.linestyle=CanvasEx.LINESTYLE_SOLID,s.extendleft=!1,s.extendright=!1,s.leftend=c.LINEEND_NORMAL,s.rightend=c.LINEEND_NORMAL,t.append(new d(s))},this._points[s.INDEX_ACTUALENTRY]&&(h=this._points[s.INDEX_ACTUALENTRY],p=this._isClosed?this._points[s.INDEX_ACTUALCLOSE]:new l.Point(this._closeBar,this._closeLevel),u={},u.points=[h,p],u.width=e._model.timeScale().width(),u.height=e._source.priceScale().height(),u.color=e._source.properties().linecolor.value(),u.linewidth=1,u.linestyle=CanvasEx.LINESTYLE_DASHED,u.extendleft=!1,u.extendright=!1,u.leftend=c.LINEEND_NORMAL,u.rightend=c.LINEEND_ARROW,t.append(new d(u))),e=this,P=function(o,n,s,r,a,l){if(e.isLabelVisible()||TradingView.printing){var h={};h.points=[o],h.text=n,h.color=i.textcolor.value(),h.font=i.font.value(),h.offsetX=3,h.offsetY=a,h.vertAlign=r,h.horzAlign="center",h.backgroundRoundRect=4,h.backgroundColor=T.resetTransparency(s),h.fontsize=i.fontsize.value(),h.backgroundHorzInflate=4,h.backgroundVertInflate=2,l&&(h.borderColor=l),t.append(new _(h,e._rendererCache))}},L=this._source.entryPrice(),k=this._source.stopPrice(),I=this._source.profitPrice(),A=Math.abs(k-L),E=Math.round(1e4*A/L)/100,M=Math.abs(I-L),D=Math.round(1e4*M/L)/100,O=Math.abs(L-I)/Math.abs(L-k),h=new l.Point(o,this._points[s.INDEX_ENTRY].y),p=new l.Point(a,this._points[s.INDEX_ENTRY].y),x(h,p),$=new l.Point((o+a)/2,Math.round(this._points[0].y)+.5),V="",B="",R=this._numericFormatter.format(Math.round(100*O)/100),this._points[1]&&void 0!==this._pl&&(B=this._source.priceScale().formatter().format(this._pl)),i.compact.value()?(V+=B?B+" ~ ":"",V+=i.qty.value()+"\n",V+=R):(N=this._isClosed?this.i18nCache.closed:this.i18nCache.open,V+=B?this.i18nCache.pnl.format(N,B)+", ":"",V+=this.i18nCache.qty.format(i.qty.value())+"\n",V+=this.i18nCache.ratio.format(R)+" "),F=i.linecolor.value(),this._pl<0?F=i.stopBackground.value():this._pl>0&&(F=i.profitBackground.value()),P($,V,F,"middle",0,"white"),h=new l.Point(o,this._stopLevel),p=new l.Point(a,this._stopLevel),x(h,p,i.stopBackground.value()),z=this._model.mainSeries().symbolInfo(),
!this._pipFormatter&&z&&(this._pipFormatter=new S(z.pricescale,z.minmov,z.type,z.minmove2)),$=new l.Point((o+a)/2,this._stopLevel),V="",W=this._source.priceScale().formatter().format(A),H=this._percentageFormatter.format(E),V=i.compact.value()?W+" ("+H+") "+i.amountStop.value():this.i18nCache.stop.format(this._source.priceScale().formatter().format(A),this._percentageFormatter.format(E),this._pipFormatter?this._pipFormatter.format(A):"",i.amountStop.value()),P($,V,i.stopBackground.value(),L<k?"bottom":"top",L<k?-12:-1),h=new l.Point(o,this._profitLevel),p=new l.Point(a,this._profitLevel),x(h,p,i.profitBackground.value()),$=new l.Point((o+a)/2,this._profitLevel),V="",W=this._source.priceScale().formatter().format(M),H=this._percentageFormatter.format(D),V=i.compact.value()?W+" ("+H+") "+i.amountTarget.value():this.i18nCache.target.format(this._source.priceScale().formatter().format(M),this._percentageFormatter.format(D),this._pipFormatter.format(M),i.amountTarget.value()),P($,V,i.profitBackground.value(),L<k?"top":"bottom",L<k?-1:-12),this.isAnchorsRequired()&&(U=this._points[0].clone(),U.data=0,j=new l.Point(o,this._stopLevel),j.data=1,q=new l.Point(o,this._profitLevel),q.data=2,Y=new l.Point(a,U.y),Y.data=3,t.append(this.createLineAnchor({points:[U,j,q,Y]}))),t)},inherit(n,p),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){if(0!==this._source.points().length&&this._source.priceScale()&&!this._source.priceScale().isEmpty()){var t=this._source.properties()[this._pricePropName].value();this._background=this._source.properties()[this._colorPropName].value(),this._coordinate=this._source.priceScale().priceToCoordinate(t),this._text=this._source.priceScale()?this._source.priceScale().formatter().format(t):""}},n.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this.color(),background:T.resetTransparency(this._background),visible:!0};return new u(t)},inherit(s,c),s.prototype._roundValue=function(t){return parseFloat(t.toFixed(2))},s.prototype._recalculateRisk=function(){var t=this.properties(),e=t.showRiskInPercents.value(),i=t.riskSize.value(),o=t.accountSize.value(),n=t.risk.value();n=e?this._roundValue(i/o*100):this._roundValue(o/100*n),this._riskInChange=!0,t.risk.setValue(n),this._riskInChange=!1},s.prototype._recalculateRiskSize=function(t){var e,i,o,n;this._riskInChange||(e=this.properties(),i=e.risk.value(),o=e.showRiskInPercents.value(),n=e.accountSize.value(),o?e.riskSize.setValue(i/100*n,t):i>n?(e.risk.setValue(n),e.riskSize.setValue(n,t)):e.riskSize.setValue(i,t))},s.version=2,s.INDEX_ENTRY=0,s.INDEX_CLOSE=1,s.INDEX_ACTUALENTRY=2,s.INDEX_ACTUALCLOSE=3,s.prototype.i18nCache={title:$.t("Risk/Reward")},s.prototype.lastBarData=function(){var t,e,i,o,n,r=parseInt(this._model.mainSeries().bars().first()),a=parseInt(this._model.mainSeries().bars().last());return isNaN(r)||isNaN(a)?null:(t=this.points(),4===t.length?(e=t[s.INDEX_ACTUALCLOSE],e.index<r?null:{closePrice:e.price,
index:Math.min(a,e.index)}):(i=t[s.INDEX_CLOSE],i.index<r?null:(o=Math.min(a,i.index),n=this._model.mainSeries().bars().valueAt(o),{closePrice:n[TradingView.CLOSE_PLOT],index:o})))},s.prototype.migrateVersion=function(t,e,i){var o,n,s,r;1===t&&this._points.length>=1&&(o=[],o.push(this._points[0]),n=this._points[0],n={price:n.price,index:n.index+50},o.push(n),this._points[1]&&o.push(this._points[1]),this._points[2]&&o.push(this._points[2]),this._points=o,this._timePoint.length>=1&&(s=[],n=this._timePoint[0],s.push(n),r={price:n.price,time_t:n.time_t,offset:n.offset+50},s.push(r),this._timePoint[1]&&o.push(this._points[1]),this._timePoint[2]&&o.push(this._points[2]),this._timePoint=s))},s.prototype.checkAlert=function(){this.recalculate()},s.prototype.priceAxisViews=function(t,e){return this._isActualSymbol?e!==this.priceScale()||this._model.paneForSource(this)!==t?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]:null},s.prototype.updateAllViews=function(){this._isActualSymbol&&this._properties.visible.value()&&(m.hideAllDrawings().value()&&this.userEditEnabled()||(c.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},s.prototype.setPoint=function(t,e){var i,o=this.priceScale();switch(o.isPercent()&&(i=this.ownerSource().firstValue(),e.price=o.priceRange().convertFromPercent(e.price,i)),t){case 0:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),c.prototype.setPoint.call(this,t,e),this.recalculate();break;case 1:this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));break;case 2:this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));break;case 3:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),c.prototype.setPoint.call(this,1,e),this.recalculate()}},s.PriceProperty=function(t,e){c.PointPriceProperty.call(this,t,e)},inherit(s.PriceProperty,c.PointPriceProperty),s.PriceProperty.prototype.setValue=function(t){var e=this._lineSource.points()[this._pointIndex];e.price=parseFloat(t),this._lineSource.setPoint(this._pointIndex,e),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},s.StopPriceProperty=function(t){s.PriceProperty.call(this,t,1)},inherit(s.StopPriceProperty,s.PriceProperty),s.StopPriceProperty.prototype.value=function(){var t=this._lineSource.stopPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.StopPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(e),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},s.TargetPriceProperty=function(t){s.PriceProperty.call(this,t,2)},
inherit(s.TargetPriceProperty,s.PriceProperty),s.TargetPriceProperty.prototype.value=function(){var t=this._lineSource.profitPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},s.TargetPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(e),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)},s.prototype.pointsCount=function(){return 1},s.prototype.title=function(){return this.i18nCache.title},s.prototype.addPoint=function(t){var e,i;return t.price=this._roundPrice(t.price),c.prototype.addPoint.call(this,t,null,!0),e={price:t.price,index:t.index+50},c.prototype._addPointIntenal.call(this,e,null,!0),i=this.calculateActualEntry(t,e),i&&(c.prototype._addPointIntenal.call(this,i,null,!0),(e=this.findClosePoint(i,e))&&c.prototype._addPointIntenal.call(this,e,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},s.prototype._roundPrice=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)/e},s.prototype.recalculate=function(){var t,e,i,o,n;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(t=this.properties().targetPrice.value(),e=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],o=this.calculateActualEntry(this.points()[0],this.points()[1]),o&&(i.push(o),(n=this.findClosePoint(o,this.points()[1]))&&i.push(n)),this._points=i,t!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),e!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice),this._recalculateRiskSize(!0))},s.prototype.start=function(){c.prototype.start.call(this),this.recalculate()},s.prototype.startMoving=function(t){t.price=this._roundPrice(t.price),c.prototype.startMoving.call(this,t)},s.prototype.move=function(t){t.price=this._roundPrice(t.price),c.prototype.move.call(this,t),this.recalculate(),this._entryPriceAxisView.update()},s.prototype.correctPoints=function(t){return c.prototype.correctPoints.call(this,[t[0],t[1]])},s.prototype.entryPrice=function(){return this.points()[0].price},s.prototype.findClosePoint=function(t,e){var i,o,n,s=this._model.mainSeries().bars(),r=parseInt(s.first(),10),a=Math.max(t.index,r),l=parseInt(s.last(),10);for(i=a;i<=Math.min(l,e.index);i++)if(o=s.valueAt(i),null!=(n=this.checkStopPrice(o)))return{index:i,price:n};return null},s.prototype.calculateActualEntry=function(t,e){var i,o,n=this._model.mainSeries().bars(),s=parseInt(n.first(),10),r=Math.max(t.index,s),a=t.price,l=parseInt(n.last(),10);for(i=r;i<=Math.min(l,e.index);i++)if(o=n.valueAt(i),o[TradingView.HIGH_PLOT]>=a&&o[TradingView.LOW_PLOT]<=a)return{index:i,price:a};return null},s.prototype.axisPoints=function(){var t,e,i;if(!this._points[s.INDEX_ACTUALENTRY])return[]
;if(t=this._points[s.INDEX_ACTUALENTRY],e=null,4===this._points.length)e=this._points[s.INDEX_ACTUALCLOSE];else{if(!(i=this.lastBarData()))return[];e={index:i.index,price:i.closePrice}}return[t,e]},inherit(r,s),r.prototype.i18nCache={title:$.t("Risk/Reward short")},r.prototype._recalculateQty=function(){var t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(i-e));t.qty.setValue(n)},r.prototype._recalculateAmount=function(){var t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),s=t.targetPrice.value(),r=this._roundValue(e+(i-s)*o),a=this._roundValue(e-(n-i)*o);t.amountTarget.setValue(r),t.amountStop.setValue(a)},r.prototype.title=function(){return this.i18nCache.title},r.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(t){return this.entryPrice()-t},r.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},r.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},r.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.HIGH_PLOT]>=e?this.stopPrice():t[TradingView.LOW_PLOT]<=i?this.profitPrice():null},a.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(a,s),a.prototype._recalculateQty=function(){var t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(e-i));t.qty.setValue(n)},a.prototype._recalculateAmount=function(){var t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),s=t.targetPrice.value(),r=this._roundValue(e+(s-i)*o),a=this._roundValue(e-(i-n)*o);t.amountTarget.setValue(r),t.amountStop.setValue(a)},a.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},a.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},a.prototype.calculatePL=function(t){return t-this.entryPrice()},a.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},a.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},a.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.LOW_PLOT]<=e?this.stopPrice():t[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},a.prototype.title=function(){return this.i18nCache.title},e.LineToolRiskReward=s,e.LineToolRiskRewardLong=a,e.LineToolRiskRewardShort=r
}).call(e,i(107))},function(t,e,i){"use strict";function o(t,e,i){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e,i)}var n=i(1).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,s;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n<t.length;n++)s=t[n],this._cursorMoved&&(s.price=this._currentMovingPoint.price),s.price=o*Math.round(s.price/o),t[n]=s},o.prototype.userEditEnabled=function(){return!0},o.prototype.canBeHidden=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.showInObjectTree=function(){return!1},t.exports=o},function(t,e,i){"use strict";var o,n=i(36),s=n.rgba,r=n.rgbaToString,a=n.parseRgb,l=i(675),h=i(210),c=i(157),d=i(199),p=i(1).LineDataSource,u=i(78).StudyLineDataSource,_=i(147),f=i(202),m=i(31),g=m.Study,v=m.prepareStudyPropsStateForLoadChart,y=m.prepareStudyPropertiesForLoadChart,b=m.createStudy,w=i(42),S=i(7).DefaultProperty,T=i(25),C=i(3),x=i(12).getLogger("Chart.Serialization"),P=i(150).LineToolParallelChannel,L=i(208),k=i(207),I=i(65).LineToolElliott,A=i(48).PriceDataSource,E=i(209),M=i(21),D=i(44).assert,O=i(14);l.version=2,l.prototype.state=function(t,e){var i,o,n,s={};for(s.panes=[],i=0;i<this.panes().length;i++)s.panes.push(this.panes()[i].state(!0,t,!1,e));return s.timeScale=this.m_timeScale.state(t),o=null,n=this.properties(),s.chartProperties={paneProperties:n.paneProperties.state(),scalesProperties:n.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(t):void 0,chartEventsSourceProperties:n.chartEventsSourceProperties.state()},n.chartEventsSourceProperties&&(s.chartProperties.chartEventsSourceProperties=n.chartEventsSourceProperties.state()),s.version=l.version,s.timezone=this.timezone(),s},l.prototype.chartPropertiesTransparencyMigrate=function(t){var e,i,o;t.chartProperties.paneProperties.crossHairProperties&&(o=t.chartProperties.paneProperties.crossHairProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=a(o.color),o.color=r(s(e,i)))),t.chartProperties.paneProperties.dataWindowProperties&&(o=t.chartProperties.paneProperties.dataWindowProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=a(o.color),o.color=r(s(e,i))))},l.prototype.resetDeferredStudies=function(){new o(this).reset()},l.prototype._getExceedingChildStudies=function(t){var e,i,o,n,s,r,a,l,h=[];for(e=0;e<t.length;++e)h=h.concat(t[e].sources||[]);for(i=0,o=1,n=[],s={},r=0,a=1e6;h.length&&--a;)l=h[r],(l.ownerSource&&s[l.ownerSource]||!l.ownerSource)&&(s[l.id]=l,
}).call(e,i(107))},function(t,e,i){"use strict";function o(t,e,i){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e,i)}var n=i(1).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,s;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n<t.length;n++)s=t[n],this._cursorMoved&&(s.price=this._currentMovingPoint.price),s.price=o*Math.round(s.price/o),t[n]=s},o.prototype.userEditEnabled=function(){return!0},o.prototype.canBeHidden=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.showInObjectTree=function(){return!1},t.exports=o},function(t,e,i){"use strict";var o,n=i(37),s=n.rgba,r=n.rgbaToString,a=n.parseRgb,l=i(675),h=i(210),c=i(157),d=i(199),p=i(1).LineDataSource,u=i(78).StudyLineDataSource,_=i(147),f=i(202),m=i(31),g=m.Study,v=m.prepareStudyPropsStateForLoadChart,y=m.prepareStudyPropertiesForLoadChart,b=m.createStudy,w=i(43),S=i(7).DefaultProperty,T=i(25),C=i(3),x=i(12).getLogger("Chart.Serialization"),P=i(150).LineToolParallelChannel,L=i(208),k=i(207),I=i(65).LineToolElliott,A=i(48).PriceDataSource,E=i(209),M=i(21),D=i(44).assert,O=i(14);l.version=2,l.prototype.state=function(t,e){var i,o,n,s={};for(s.panes=[],i=0;i<this.panes().length;i++)s.panes.push(this.panes()[i].state(!0,t,!1,e));return s.timeScale=this.m_timeScale.state(t),o=null,n=this.properties(),s.chartProperties={paneProperties:n.paneProperties.state(),scalesProperties:n.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(t):void 0,chartEventsSourceProperties:n.chartEventsSourceProperties.state()},n.chartEventsSourceProperties&&(s.chartProperties.chartEventsSourceProperties=n.chartEventsSourceProperties.state()),s.version=l.version,s.timezone=this.timezone(),s},l.prototype.chartPropertiesTransparencyMigrate=function(t){var e,i,o;t.chartProperties.paneProperties.crossHairProperties&&(o=t.chartProperties.paneProperties.crossHairProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=a(o.color),o.color=r(s(e,i)))),t.chartProperties.paneProperties.dataWindowProperties&&(o=t.chartProperties.paneProperties.dataWindowProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=a(o.color),o.color=r(s(e,i))))},l.prototype.resetDeferredStudies=function(){new o(this).reset()},l.prototype._getExceedingChildStudies=function(t){var e,i,o,n,s,r,a,l,h=[];for(e=0;e<t.length;++e)h=h.concat(t[e].sources||[]);for(i=0,o=1,n=[],s={},r=0,a=1e6;h.length&&--a;)l=h[r],(l.ownerSource&&s[l.ownerSource]||!l.ownerSource)&&(s[l.id]=l,
h.splice(h.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++i>o&&n.push(l)),r=(r+1)%h.length;return n},l.prototype.restoreState=function(t,e){var i,n,s,r,a,l,h,c,d,u,_,f;if(new o(this).reset(),i={},!t.panes)return void x.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(t.panes))return void x.logDebug("ChartModel.restoreState: invalid state");if(t.panes.length<1)return void x.logDebug("ChartModel.restoreState: invalid state");if(t.chartProperties&&!t.chartProperties.timezone&&(t.chartProperties.timezone=t.timezone),t.chartProperties&&(n=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(n,t.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(i.showStudyLastValueProperty=!0),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(t.chartProperties.paneProperties),this._properties.scalesProperties.merge(n),t.chartProperties.timezone&&this._properties.timezone.setValue(t.chartProperties.timezone),t.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(t.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(t.timeScale,e)),t.timeScale&&this.m_timeScale.restoreState(t.timeScale,e),!this.readOnly()&&(s=this._getExceedingChildStudies(t.panes),s.length)){for(r=t.panes.length-1;r>=0;--r){for(a=t.panes[r],l=a.sources.length-1;l>=0;--l)h=a.sources[l],~s.indexOf(h)&&a.sources.splice(l,1);a.sources.length||t.panes.splice(r,1)}setTimeout(function(){goProDialog({feature:"studyOnStudy"}).open()},500)}for(c=t.panes,this.panes()[0].restoreState(c[0],e,t.version,i),r=1;r<t.panes.length;r++)a=this.panes()[r]||this.createPane(),a.restoreState(t.panes[r],e,t.version,i);for(this._invalidateBarColorerCaches(),d=this.dataSources(),u=0,r=0;r<d.length;r++)_=d[r],TradingView.isInherited(_.constructor,p)&&(u++,_.calcIsActualSymbol());return this._version=t.version,this.timeScale().recalcLockedScale(),this.recalculateAllPanes(),this.invalidate(new M(M.FULL_UPDATE)),window.saver&&window.is_authenticated&&this.isJustClonedChart()&&this.mainSeries().onSymbolResolved().subscribe(this,function(){window.saver.saveChartSilently()},!0),f=TVLocalStorage.getItem("linetools_limit")||1e3,window.is_authenticated&&window.user&&window.user.settings&&(f=window.user.settings.linetools_limit||f),u>f?{lines_limit_exceeded:!0,line_tools_count:u}:{}},l.prototype.restoreAxisState=function(t){var e,i
;if(!t.panes)return void x.logDebug("ChartModel.restoreAxisState: invalid state");if(!Array.isArray(t.panes))return void x.logDebug("ChartModel.restoreAxisState: invalid state");if(t.panes.length<1)return void x.logDebug("ChartModel.restoreAxisState: invalid state");for(this.m_timeScale.restoreState(t.timeScale,!1,!0),e=0;e<t.panes.length;e++)i=this.panes()[e],i.m_leftPriceScale.restoreState(t.panes[e].leftAxisState),i.m_rightPriceScale.restoreState(t.panes[e].rightAxisState);this.recalculateAllPanes(),this.invalidate(new M(M.FULL_UPDATE))},E.prototype.state=function(t,e,i,o){function n(t){return i&&!t.isSavedInStudyTemplates()||!t.state||!t.state()||!t.isSavedInChart(e)||o&&t.isActualSymbol&&!t.isActualSymbol()}var s,r,a={};if(t)for(a.sources=[],s=0;s<this.m_dataSources.length;s++)n(this.m_dataSources[s])||a.sources.push(this.m_dataSources[s].state(e));for(a.leftAxisState=this.m_leftPriceScale.state(),a.leftAxisSources=[],s=0;s<this.m_leftPriceScale.dataSources().length;s++)n(this.m_leftPriceScale.dataSources()[s])||a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[s].id());for(a.rightAxisState=this.m_rightPriceScale.state(),a.rightAxisSources=[],s=0;s<this.m_rightPriceScale.dataSources().length;s++)n(this.m_rightPriceScale.dataSources()[s])||a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[s].id());for(a.overlayPriceScales={},s=0;s<this.m_dataSources.length;s++)r=this.m_dataSources[s],this.isOverlay(r)&&r.isSavedInChart(e)&&(a.overlayPriceScales[r.id()]=r.priceScale().state());return a.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(a.mainSourceId=this.m_mainDataSource.id()),a},E.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},E.prototype.isESDStudy=function(t){return"Script$TV_EARNINGS@tv-scripting"===t.id||"Script$TV_DIVIDENDS@tv-scripting"===t.id||"Script$TV_SPLITS@tv-scripting"===t.id||"ESD$TV_EARNINGS@tv-scripting"===t.id||"ESD$TV_DIVIDENDS@tv-scripting"===t.id||"ESD$TV_SPLITS@tv-scripting"===t.id},E.prototype.restoreState=function(t,e,i,o){var n,s,r,a,l,c,d,u,_,f,m,v,y,b,S;if(o=o||{},!t.leftAxisState||!t.rightAxisState)throw Error("invalid state");if(!t.leftAxisSources||!t.rightAxisSources)throw Error("invalid state");if(t.stretchFactor&&(this._stretchFactor=t.stretchFactor),n={},t.sources)for(s=-1!==this.m_dataSources.indexOf(this._model.mainSeries()),this.clearSeries(),this.m_mainDataSource=null,s&&this.m_dataSources.push(this._model.mainSeries()),r=this.getZOrderMinMax(),a=r.minZOrder,l=r.maxZOrder,c=0;c<t.sources.length;c++)d=t.sources[c],u=d.type,Math.abs(d.zorder)>1e200?(_=a-1,x.logWarn("Datasource zorder has bad value: "+d.zorder+" Resetting it to "+_),d.zorder=_):this.isZOrderAvailable(d.zorder)||s&&"MainSeries"===u&&this._model.mainSeries().zorder()===d.zorder||(d.zorder=l+1),f=d.id,n[f]=d.ownerSource,
u&&("MainSeries"===u?this._restoreMainSeries(d,e,s,o):u.toLowerCase().startsWith("study")?this._restoreStudy(d,e,o):TradingView.isInherited(TradingView[u],p)?this._restoreLineTool(d,e):TradingView[u]&&TradingView[u].createFromState&&this._restoreSpecialSource(d,e)),a=Math.min(a,d.zorder),l=Math.max(l,d.zorder);for(this.m_leftPriceScale.dataSources().splice(0,1/0),this.m_leftPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.leftAxisProperties,TradingView.merge(m,t.leftAxisState),this.m_leftPriceScale.restoreState(m),c=0;c<t.leftAxisSources.length;c++)(v=this.dataSourceForId(t.leftAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&v instanceof w&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),v.setPriceScale(this.m_leftPriceScale),this.m_leftPriceScale.addDataSource(v));for(this.m_rightPriceScale.dataSources().splice(0,1/0),this.m_rightPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.rightAxisProperties,TradingView.merge(m,t.rightAxisState),this.m_rightPriceScale.restoreState(m),c=0;c<t.rightAxisSources.length;c++)(v=this.dataSourceForId(t.rightAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&v instanceof w&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),v.setPriceScale(this.m_rightPriceScale),this.m_rightPriceScale.addDataSource(v));for(c=0;c<this.m_dataSources.length;c++)v=this.m_dataSources[c],-1===this.m_rightPriceScale.dataSources().indexOf(v)&&-1===this.m_leftPriceScale.dataSources().indexOf(v)?(v._isOverlay=!0,y=new h(this._properties.overlayPropreties,this._model.properties().scalesProperties),y.setHeight(this.m_height),y.setTopMargin(this.m_rightPriceScale.topMargin()),y.setBottomMargin(this.m_rightPriceScale.bottomMargin()),y.addDataSource(v),t.overlayPriceScales&&t.overlayPriceScales[v.id()]&&(m=t.overlayPriceScales[v.id()],m.m_isAutoScale=!0,m.m_isLog=!1,m.m_isPercentage=!1,y.restoreState(m)),v.setPriceScale(y)):v._isOverlay=!1;for(f in n)(b=n[f])&&(v=this.sourceById(f))&&this.sourceById(f).setOwnerSource(this.sourceById(b));if(t.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(t.mainSourceId)),!this.m_mainDataSource)for(c=0;c<this.m_dataSources.length;c++)if(v=this.m_dataSources[c],TradingView.isInherited(v.constructor,A)){this.m_mainDataSource=v;break}for(c=0;c<this.m_dataSources.length;c++)v=this.m_dataSources[c],TradingView.isInherited(v.constructor,p)?(v.ownerSource()||v.setOwnerSource(this.mainDataSource()),v.isFixed()&&v.restoreFixedPoints(),1===i&&v.priceScale().isPercent()&&!v.isFixed()&&v.correctPricesToPercents(),v.fixAfterRestorePriceAxis&&v.fixAfterRestorePriceAxis()):TradingView.isInherited(v.constructor,g)&&(S=v.properties(),S.linkedToSeries&&S.linkedToSeries.value()&&(v.ownerSource()||v.setOwnerSource(this.model().mainSeries())));this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},E.prototype._restoreMainSeries=function(t,e,i,o){var n,s,r,a,l=t.id,h=t.state,c=t.zorder
@@ -244,7 +244,7 @@ u&&("MainSeries"===u?this._restoreMainSeries(d,e,s,o):u.toLowerCase().startsWith
I.migrateState(t),o=t.type,n=t.id,s=t.state,r=i?t.zorder:this._newZOrderForLineTool(),a=TradingView[o],D(TradingView.isInherited(a,p),"invalid data source type:"+o+" (expected to be a Line Tool)"),l=t.points,h=!1,m=0;m<l.length;m++)if(Math.abs(l[m].offset)>1e4){h=!0;break}if(!h){if(g=null,y=TradingView.factoryDefaults("linetool"),TradingView.isInherited(a,u)){if(g=this._model.studyVersioning(),t=g.patchPointsBasedStudyState(t),TradingView.merge(y,s),x=t.metaInfo,$.extend(x,T.parseIdString(x.fullId)),!e&&(A=x.productId,!pro.hasPackage(A)))return E=new c(this._model,t,x.shortDescription),E.setId(n),this.m_dataSources.push(E),void 0!==r&&E.setZorder(r),E.setStatus($.t("not authorized")),void E.setFailed(!0);M=g.updateMetaInfo(x),O=M||x,y=v(O,x,y,null,g),e?TradingView.merge(y,{fixedSize:!1}):TradingView.merge(y,{fixedSize:!0}),w=new S("study_"+O.id,y,!0),b=d.create(o,this._model,w,O,this.mainDataSource())}else V=o.toLowerCase(),TradingView.merge(y,TradingView.factoryDefaults(V)),w=TradingView[o].prototype.createPropertiesObject(V,y),w.merge(s),e?w.merge({fixedSize:!1}):w.merge({fixedSize:!0}),b=new TradingView[o](this._model,w,!0);return b.setId(n),b.linkKey=t.linkKey,B=t.alertId,B&&"function"==typeof b.setAlert&&C.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&b.setAlert(B,{noChartSave:!0}),R=t.indexes?t.indexes:[],R=R.slice(0,t.points.length),b.isFixed()?b.restorePositionPercents(t.positionPercents):b.restorePoints(t.points,R,e),b instanceof _||b instanceof f||b instanceof L||b instanceof k||b instanceof P?b.restoreData(t):e&&b.restoreData&&(N=t,g&&(N.graphics=g.patchPointsBasedStudyData(N.metaInfo,N.graphics)),b.restoreData(N)),F=null==t.version?1:t.version,z=null==b.version?1:b.version,F!==z&&"function"==typeof b.migrateVersion&&b.migrateVersion(F,z,{pane:this,model:this._model,properties:w}),this.m_dataSources.push(b),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==r&&b.setZorder(r),b}},E.prototype._restoreSpecialSource=function(t,e){var i,o=TradingView[t.type];o&&o.createFromState&&(i=o.createFromState(t,e,this._model))&&(i.setId(t.id),this.m_dataSources.push(i),i.zorder&&i.setZorder(i.zorder))},l.prototype.studyTemplate=function(t){var e,i,o,n,s={};for(s.panes=[],e=0;e<this.panes().length;e++)i=!0,o=!1,n=!0,s.panes.push(this.panes()[e].state(i,o,n));return t&&(s.interval=this.mainSeries().interval()),s.version=l.version,s},l.prototype.restoreStudyTemplate=function(t,e){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),t,e)},l.prototype.theme=function(){var t={};return t.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()},t.mainSourceProperties=this.mainSeries().state().state,delete t.mainSourceProperties.symbol,delete t.mainSourceProperties.interval,delete t.chartProperties.paneProperties.topMargin,delete t.chartProperties.paneProperties.bottomMargin,t.version=l.version,t},
l.prototype.restoreTheme=function(t){var e,i,o={hollowCandle:{related:"candle"}};for(e in o)t.mainSourceProperties[e+"Style"]||(i=t.mainSourceProperties[o[e].related+"Style"],t.mainSourceProperties[e+"Style"]=TradingView.clone(i));this._undoModel.chartLoadTheme(this,t)},o=function(){function t(o){var n=e.indexOf(o);return~n?i[n]:this instanceof t?(this._source=o,this._studies={},this._deferreds={},e.push(o),void i.push(this)):new t(o)}var e=[],i=[];return t.prototype.add=function(t,e){this._deferreds[t]&&(this._deferreds[t].resolve(e),delete this._deferreds[t]),this._studies[t]=e},t.prototype.get=function(t){return this._studies[t]?$.Deferred().resolve(this._studies[t]):(this._deferreds[t]||(this._deferreds[t]=$.Deferred()),this._deferreds[t].promise())},t.prototype.reset=function(){var t=e.indexOf(this._source);~t&&(e.splice(t,1),i.splice(t,1))},t}(),t.exports=l},function(t,e,i){(function(t){"use strict";function o(t,e){var i,o,n,s,l;if(r.call(this),this._study=t,this._model=e,i=t.metaInfo().plots){for(o=0;o<i.length;++o)if(!(this._study.isSelfColorerPlot(o)||this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o)||this._study.isDataOffsetPlot(o)||this._study.isOHLCColorerPlot(o))){if(n=i[o].id,"Compare@tv-basicstudies"===this._study.metaInfo().id)s=new a(this._study.inputsForGUI()[1],"");else{l=this._study.title();try{l=this._study.properties().styles[n].title.value()}catch(t){}s=new a(l,"")}s.plotId=n,s.plotIndex=o,this._items.push(s)}this.update(),this._invalidated=!0}}function n(t,e){o.call(this,t,e)}var s=i(146),r=s.DataWindowView,a=s.DataWindowItem,l=i(198);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b=!0;for(this._header=this._study.title(b),this._title=this._study.title(),e=this._study.isVisible()?$.t("n/a"):"",i=0;i<this._items.length;++i)this._items[i].setValue(e);if(t.enabled("hide_last_na_study_output")&&this._items.length&&this._items[this._items.length-1].setValue(""),!this._model.timeScale().isEmpty()){if(o=this._study.metaInfo().plots,n=null,s={},o)for(i=0;i<o.length;i++)(this._study.isSelfColorerPlot(i)||this._study.isOHLCColorerPlot(i))&&(s[o[i].target]={index:i},s[o[i].target].palette=this._study.metaInfo().palettes[o[i].palette],s[o[i].target].paletterProps=this._study.properties().palettes[o[i].palette]);for(r=this._study.data().size()-1,a=this._model.crossHairSource().appliedIndex(),l=this._study.formatter(),i=0;i<this._items.length;++i)h=this._items[i],c=h.plotId,d=h.plotIndex,p=this._study.offset(c),void 0!==(u=isNumber(a)?this._study.nearestIndex(a-p,TradingView.SEARCH_NEAREST_LEFT):r)&&(_=this._study.data().valueAt(u)||this._study.data().last())&&(f=_[d+1],isNumber(f)&&(h.setValue(l.format(f)),m=this._study.properties().styles[c].color.value(),this._study.isOHLCSeriesPlot(d)&&(c=o[d].target,m=this._study.properties().ohlcPlots[c].color.value()),s[c]&&_.length>s[c].index+1?(g=_[s[c].index+1],void 0!==g&&null!==g?(n=s[c].palette,v=s[c].paletterProps,y=n.valToIndex?n.valToIndex[g]:g,
this._items[i].setColor(v.colors[y].color.value())):this._items[i].setColor(m)):this._items[i].setColor(m)))}},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},inherit(n,o),n.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},n.prototype._updateImpl=function(){var t=l(this._study.symbolInfo());return this._additional=t?"(Data Provided by "+t+")":void 0,o.prototype._updateImpl.call(this)},e.StudyDataWindowView=o,e.DataVendorStudyDataWindowView=n}).call(e,i(3))},function(t,e,i){"use strict";function o(t){this._graphics=o.emptyGraphics(),n(!!t,"Study metaInfo is absent!"),this._metaInfo=t}var n=i(44).assert,s=i(12).getLogger("Chart.StudyGraphics");o.emptyGraphics=function(){return{indexes:[]}},o.prototype.isEmpty=function(){var t=Object.keys(this._graphics).length>1;return 0===this._graphics.indexes.length&&!t},o.prototype.graphics=function(){return this._graphics},o.prototype.setGraphics=function(t){this._graphics=t,this._postProcessGraphicsData()},o.prototype.process=function(t){if(""!==t.d)return t.d.indexes_replace?void this.replaceIndexes(t):void(t.d.graphicsCmds&&(this.processEraseCmds(t.d.graphicsCmds.erase),this.processCreateCmds(t.d.graphicsCmds.create,t.indexes)))},o.prototype.replaceIndexes=function(t){""!==t.d&&(n(!!t.d.indexes_replace),this._graphics.indexes=t.indexes)},o.prototype.processEraseCmds=function(t){var e,i,s,r,a;if(t)for(n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!"),e=0;e<t.length;++e)if(i=t[e],"all"===i.action)this._graphics=o.emptyGraphics();else{if("one"!==i.action)throw Error("Unknown graphics command "+i.action);for(s in this._graphics[i.type])r=this._graphics[i.type][s],(a=o._findGraphicsObjIndexById(r.data,i.id))>=0&&r.data.splice(a,1)}},o._findGraphicsObjIndexById=function(t,e){for(var i=0;i<t.length;++i)if(t[i].id===e)return i;return-1},o.prototype.processCreateCmds=function(t,e){var i,o,s,r,a,l;if(t){n(!!e,"indexes are missing in the study nonseries response!"),n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(i in t){n(i in this._metaInfo.graphics,"There is a '"+i+"' in study response, but it doesn't present in metaInfo!");for(o=0;o<t[i].length;++o){s=t[i][o],r=s.styleId,n(r in this._metaInfo.graphics[i]),this._graphics[i]||(this._graphics[i]=[]),a=null;for(l=0;l<this._graphics[i].length;++l)if(this._graphics[i][l].styleId===r){a=this._graphics[i][l];break}null===a&&(a={styleId:r,data:[]},this._graphics[i].push(a)),a.data=a.data.concat(s.data)}}"nochange"===e||(n(Array.isArray(e)),this._graphics.indexes=e),this._postProcessGraphicsData()}},o.prototype._postProcessGraphicsData=function(){var t,e,i;if(this._graphics)for(t in this._graphics.hhists)e=this._graphics.hhists[t],o._sortHHistItemsByPrice(e.data),i=this._graphics.indexes,
e.dataObj=o._splitHHistItemsBySession(e.data,i)},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,r={};for(i=0;i<t.length;++i)o=t[i],n=e[o.firstBarTime],void 0!==n?(n in r||(r[n]=[]),r[n].push(o)):s.logError("Cannot find index "+o.firstBarTime+" in study timescale indexes");return r},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(348);inherit(o,n),o.prototype.color=function(){return this._study._failed||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":n.prototype.color.call(this)},o.prototype.update=function(){this._study._failed?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o){s.call(this,t),this._origState=i,this._title=o;var a={visible:!0};this._properties=new e(a),this._statusView=new n(this,t.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new r(Math.pow(10,2)),this._failed=!1}var n=i(156),s=i(48).PriceDataSource,r=i(27).PriceFormatter;inherit(o,s),o.prototype.properties=function(){return this._properties},o.prototype.statusView=function(){return this._statusView},o.prototype.state=function(t){return this._origState},o.prototype.setStatus=function(t){this._status=t,this._statusView.setText(this._title+" "+this._status)},o.prototype.formatter=function(){return this._formatter},o.prototype.title=function(){return this._title},o.prototype.setFailed=function(t){this._failed=t},o.prototype.start=function(t){},o.prototype.firstValue=function(t){return null},t.exports=o}).call(e,i(24))},function(t,e,i){(function(e){"use strict";function o(t){this._data=t,this._textWidthCache=new l}function n(t,e,i,o,n){this._model=t,this._source=e,this._plotIndex=i,this._getterName=o||"symbol",this._propertyName=n,this._cache={},this._invalidated=!0,this._rendererData={}}var s=i(36),r=s.parseRgb,a=s.rgbToBlackWhiteString,l=i(159),h=i(6),c=i(163).makeFont,d=i(14);o.prototype.hitTest=function(t){return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),t.font=this._data.font,e=this._data.fontSize,i=Math.floor(e/4.5),o=Math.ceil(e/4.5),n=Math.ceil(e/3),s=Math.ceil(this._textWidthCache.measureText(t,this._data.text)),r=Math.round(e/10),a=e+i+o,l=s+2*n,h=this._data.x-.5,"right"===this._data.align&&(h-=l),c=this._data.y-Math.floor(e/2)-i-.5,t.fillStyle=d.resetTransparency(this._data.backColor),t.fillRect(h,c,l,a),t.fillStyle=this._data.color,t.textAlign="left",t.fillText(this._data.text,h+n,c+i+e-r))},n.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},
e.dataObj=o._splitHHistItemsBySession(e.data,i)},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,r={};for(i=0;i<t.length;++i)o=t[i],n=e[o.firstBarTime],void 0!==n?(n in r||(r[n]=[]),r[n].push(o)):s.logError("Cannot find index "+o.firstBarTime+" in study timescale indexes");return r},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(348);inherit(o,n),o.prototype.color=function(){return this._study._failed||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":n.prototype.color.call(this)},o.prototype.update=function(){this._study._failed?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o){s.call(this,t),this._origState=i,this._title=o;var a={visible:!0};this._properties=new e(a),this._statusView=new n(this,t.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new r(Math.pow(10,2)),this._failed=!1}var n=i(156),s=i(48).PriceDataSource,r=i(27).PriceFormatter;inherit(o,s),o.prototype.properties=function(){return this._properties},o.prototype.statusView=function(){return this._statusView},o.prototype.state=function(t){return this._origState},o.prototype.setStatus=function(t){this._status=t,this._statusView.setText(this._title+" "+this._status)},o.prototype.formatter=function(){return this._formatter},o.prototype.title=function(){return this._title},o.prototype.setFailed=function(t){this._failed=t},o.prototype.start=function(t){},o.prototype.firstValue=function(t){return null},t.exports=o}).call(e,i(24))},function(t,e,i){(function(e){"use strict";function o(t){this._data=t,this._textWidthCache=new l}function n(t,e,i,o,n){this._model=t,this._source=e,this._plotIndex=i,this._getterName=o||"symbol",this._propertyName=n,this._cache={},this._invalidated=!0,this._rendererData={}}var s=i(37),r=s.parseRgb,a=s.rgbToBlackWhiteString,l=i(159),h=i(6),c=i(163).makeFont,d=i(14);o.prototype.hitTest=function(t){return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),t.font=this._data.font,e=this._data.fontSize,i=Math.floor(e/4.5),o=Math.ceil(e/4.5),n=Math.ceil(e/3),s=Math.ceil(this._textWidthCache.measureText(t,this._data.text)),r=Math.round(e/10),a=e+i+o,l=s+2*n,h=this._data.x-.5,"right"===this._data.align&&(h-=l),c=this._data.y-Math.floor(e/2)-i-.5,t.fillStyle=d.resetTransparency(this._data.backColor),t.fillRect(h,c,l,a),t.fillStyle=this._data.color,t.textAlign="left",t.fillText(this._data.text,h+n,c+i+e-r))},n.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},
n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,i,o,n,s,l,d,p=this._rendererData;if(p.visible=!1,p.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(t=this._source.lastValueData(this._plotIndex,e.enabled("price_scale_always_last_bar_value")),!t.noData)){if(i=this._model.paneForSource(this._source),o="right",i.leftPriceScale()===this._source.priceScale()&&(o="left"),n=this._model.properties(),s=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),s&&n.scalesProperties.showLeftScale.value()&&!n.scalesProperties.showRightScale.value()&&(o="left"),!s){if("left"===o&&!n.scalesProperties.showLeftScale.value())return new h;if("right"===o&&!n.scalesProperties.showRightScale.value())return new h}l=t.coordinate,d=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,this._source.lastPriceLabelFixedCoordinate&&!d&&"showSymbolLabels"===!this._propertyName&&(l=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||l),p.visible=!0,t.color!==p.backColor&&(p.backColor=t.color,p.color=a(r(t.color))),p.text=this._source[this._getterName](this._plotIndex),p.align=o,p.x="right"===o?this._model.timeScale().width():0,p.y=l,p.fontSize=this._model.properties().scalesProperties.fontSize.value(),p.font=c(p.fontSize,"Arial","")}},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new o(this._rendererData)),this._renderer},t.exports=n}).call(e,i(3))},function(t,e){"use strict";function i(t){this._maxSize=t||50,this.reset()}i.prototype.measureText=function(t,e){var i,o,n=(e+"").replace(this._re,"0");return this._cache[n]?this._cache[n].width:(this._actualSize===this._maxSize&&(i=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[i],this._oldestTick++,this._actualSize--),0===(o=t.measureText(n).width)&&e.length?0:(this._cache[n]={width:o,tick:this._usageTick},this._tick2Labels[this._usageTick]=n,this._actualSize++,this._usageTick++,o))},i.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},i.prototype._re=/[2-9]/g,t.exports=i},function(t,e,i){"use strict";i(117),t.exports=TradingView.templates={dialogs:{},lists:{},onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',
miniWidgetWizardAddSymbol:'<tr class="tv-external-tools__symbol-item"><td class="tv-external-tools__symbol-item-cell">{{symbol}}</td><td class="tv-external-tools__symbol-item-cell{{#descriptionShortening}} apply-common-tooltip" title="{{description}}"{{/descriptionShortening}}">{{#descriptionShortening}}{{descriptionShortening}}{{/descriptionShortening}}{{^descriptionShortening}}{{description}}{{/descriptionShortening}}</td>{{#timeframeSelectAllow}}<td class="tv-external-tools__symbol-item-cell">{{timeframe}}</td>{{/timeframeSelectAllow}}<td class="tv-external-tools__remove-cell"><div class="tv-external-tools__remove-symbol"></div></td></tr>',textNotesWidgetLayout:'<div class="notes-block"><div class="textnotes-search-header"><div class="search-input-block">'+i(847)+'<div class="search-clean"></div><input type="text" class="search-input" placeholder="'+$.t("Search Note")+'" maxlength="1000" autocomplete="off"></div><div class="new-note-btn">'+i(835)+$.t("NEW")+'</div></div><div class="notes-wrapper"><div class="notes"></div></div></div><div class="notes-desc-block"><div class="notes-desc-wrapper"><div class="notes-desc-inner"><div class="remove-note-btn">'+i(892)+'</div><div class="title-wrap"><input type="text" maxlength="100" value="" class="title"></div><div class="date"><span class="created">'+$.t("Created ")+'<span class="created-val"></span>. </span><span class="modified">'+$.t("Last edited ")+'<span class="modified-val"></span></span></div><textarea></textarea></div></div></div>',textNotesWidgetItem:'<div class="note"><div class="note-header"><div {{#symbol}}title="'+$.t("Open {{symbol}} Text Note")+'"{{/symbol}} class="title {{#symbol}}title_with-badge{{/symbol}}">{{title}}</div>{{#symbol}}<div class="symbol-badge">'+i(838)+'<span class="symbol">{{symbol}}</span></div>{{/symbol}}</div><div class="note-desc">{{description}}</div><span class="favorite"></span></div>',tvDataTable:'<table class="tv-data-table {{className}}"><thead class="tv-data-table__thead"><tr class="tv-data-table__stroke">{{#columns}}<th class="tv-data-table__cell tv-data-table__cell--bold {{className}}"><span class="tv-data-table__cell-text{{^notSortable}} tv-data-table__sortable{{/notSortable}}{{#help}} apply-common-tooltip{{/help}}{{#htmlHelp}} common-tooltip-html{{/htmlHelp}}" {{#help}}title="{{help}}"{{/help}}>{{{label}}}</span></th>{{/columns}}</tr></thead>{{#bodies}}<tbody class="tv-data-table__tbody {{className}}">{{#strokes}}<tr class="tv-data-table__stroke">{{#cells}}<td class="tv-data-table__cell {{className}}"{{#colspan}}colspan="{{colspan}}"{{/colspan}}>{{#contain}}{{{contain}}}{{/contain}}</td>{{/cells}}</tr>{{/strokes}}</tbody>{{/bodies}}</table>',tvDataTableRow:'<tr class="tv-data-table__stroke">{{#columns}}<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>{{/columns}}</tr>',tvDataTableCell:'<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>',
tvWidgetChartLikeButton:'<div data-id="{{chartId}}" class="tv-widget-chart-like-button {{typeClass}}"><span class="tv-widget-chart-like-button__icon-place">'+i(907)+'</span><span class="js-likes-counter"></span></div>'}},function(t,e,i){"use strict";function o(t){for(var i=0;i<e.availableTimezones.length;i++)if(t===e.availableTimezones[i].id)return!0;return!1}var n,s,r;for(Object.defineProperty(e,"__esModule",{value:!0}),i(28),n=i(375),e.availableTimezones=[{id:"Etc/UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")},{id:"Pacific/Honolulu",title:$.t("Honolulu")},{id:"America/Vancouver",title:$.t("Vancouver")},{id:"America/Los_Angeles",title:$.t("Los Angeles")},{id:"America/Phoenix",title:$.t("Phoenix")},{id:"America/El_Salvador",title:$.t("San Salvador")},{id:"America/Mexico_City",title:$.t("Mexico City")},{id:"America/Chicago",title:$.t("Chicago")},{id:"America/Bogota",title:$.t("Bogota")},{id:"America/Toronto",title:$.t("Toronto")},{id:"America/New_York",title:$.t("New York")},{id:"America/Caracas",title:$.t("Caracas")},{id:"America/Argentina/Buenos_Aires",title:$.t("Buenos Aires")},{id:"America/Sao_Paulo",title:$.t("Sao Paulo")},{id:"Europe/London",title:$.t("London")},{id:"Europe/Madrid",title:$.t("Madrid")},{id:"Europe/Paris",title:$.t("Paris")},{id:"Europe/Berlin",title:$.t("Berlin")},{id:"Europe/Zurich",title:$.t("Zurich")},{id:"Europe/Warsaw",title:$.t("Warsaw")},{id:"Europe/Athens",title:$.t("Athens")},{id:"Europe/Istanbul",title:$.t("Istanbul")},{id:"Europe/Moscow",title:$.t("Moscow")},{id:"Asia/Tehran",title:$.t("Tehran")},{id:"Asia/Dubai",title:$.t("Dubai")},{id:"Asia/Ashkhabad",title:$.t("Ashkhabad")},{id:"Asia/Kolkata",title:$.t("Kolkata")},{id:"Asia/Almaty",title:$.t("Almaty")},{id:"Asia/Bangkok",title:$.t("Bangkok")},{id:"Asia/Taipei",title:$.t("Taipei")},{id:"Asia/Singapore",title:$.t("Singapore")},{id:"Asia/Shanghai",title:$.t("Shanghai")},{id:"Asia/Hong_Kong",title:$.t("Hong Kong")},{id:"Asia/Seoul",title:$.t("Seoul")},{id:"Asia/Tokyo",title:$.t("Tokyo")},{id:"Australia/Brisbane",title:$.t("Brisbane")},{id:"Australia/Adelaide",title:$.t("Adelaide")},{id:"Australia/Sydney",title:$.t("Sydney")},{id:"Pacific/Auckland",title:$.t("New Zealand")},{id:"Pacific/Fakaofo",title:$.t("Tokelau")},{id:"Pacific/Chatham",title:$.t("Chatham Islands")}],s=0;s<e.availableTimezones.length;s++)-1===["Etc/UTC","exchange"].indexOf(e.availableTimezones[s].id)&&(r=n.parseTzOffset(e.availableTimezones[s].id).string,e.availableTimezones[s].title="("+r+") "+e.availableTimezones[s].title);e.timezoneIsAvailable=o,e.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}]},function(t,e,i){"use strict";var o,n
@@ -255,7 +255,7 @@ extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChann
this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate(),this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))},o.prototype._validate=function(){var t=this._input.val();this._parsed=s.parseIntervalValue(t),this._valid=!this._parsed.error,this._supported=!this._parsed.error&&s.intervalIsSupported(t),!this._supported||this._parsed.unit&&"H"!==this._parsed.unit||this._parsed.qty*("H"===this._parsed.unit?60:1)>1440&&(this._supported=!1)},o.prototype._updateCaption=function(){var t,e,i;this._valid&&this._supported?(e=this._parsed.qty||1,i=this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month",S:"second"}[this._parsed.unit]:"minute",t=e+" "+$.t(i,{count:e}),this._input.add(this._caption).removeClass("error")):(t=this._parsed.error?"&nbsp;":$.t("Not applicable"),this._input.add(this._caption).addClass("error")),this._caption.html(t)},o.prototype._handleInput=function(t){if(13===t.which)return void this._submit();t.ctrlKey||t.metaKey||!t.charCode||!t.which||t.which<=32||s.isIntervalChar(String.fromCharCode(t.charCode))||t.preventDefault()},o.prototype._submit=function(){var t,e;TVDialogs.isOpen(this._dialogTitle)&&(this._valid&&this._supported&&(t=s.sanitizeIntervalValue(this._input.val()),e=n.interval.value(),t&&e!==t&&"function"==typeof this._options.callback&&this._options.callback(t)),TVDialogs.destroy(this._dialogTitle))},o.prototype._setInitialValue=function(t){var e,i;t=t||this._options.initialValue,e="",i=!1,t&&","!==t?e=s.sanitizeIntervalValue(t)||"":(t=n.interval.value(),e=t,i=!0),this._input.val(e),i&&this._input.select()},o.prototype.isValid=function(){return!!this._valid},o.prototype.show=function(t){var e=TVDialogs.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),i=e.find("._tv-dialog-content");return e.css("min-width",0),i.css("min-width",0).mousedown(function(t){this._input.is(t.target)||t.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger)),TVDialogs.applyHandlers(e),TVDialogs.positionDialog(e),this._setInitialValue(t),this._validate(),this._updateCaption(),e},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t){var i,o,n,s,r,a,l,h,c,d,p,_,m,g,y,b,w,C,x,P,L,k=this;this._guid=H(),this._startSpinner(t.jqParent),S.init(),i=this,S.tool.subscribe(function(t){var e,o,n,s;i._model&&(e=t,i._model.model().setCurrentTool(e),TradingView.isMobile.any()&&(o=i._paneWidgets[0],v.isLineTool(e)&&"LineToolBrush"!==e?(n=.5*i._model.model().timeScale().width(),s=.5*o._state.defaultPriceScale().height(),i._model.model().setCurrentPosition(n,s,o._state),o._updateTooltip(n,s)):o._hideTooltip()),i._model&&TradingView.isMobile.any()&&i._model.model().crossHairSource().updateAllViews())}),o=function(t,e,i){var o,n=e.mainSeries().syncModel(),s=t.mainSeries().syncModel(),r=i;return n&&s&&(o=t._createSyncPoint(n,s),r=o.sourceTimeToTargetTime(i)),t.timeScale().points().roughIndex(r,s&&s.distance.bind(s))},n=function(t,e,i){
var o,n=e.mainSeries().syncModel(),s=i.mainSeries().syncModel(),r=n&&s&&i._createSyncPoint(n,s);return r?(o=e.timeScale(),t.map(function(t){var e=$.extend({},t),a=o.timePointToIndex(e.time_t),l=t.timeStamp||o.points().roughTime(a+e.offset,n.projectTime.bind(n));return e.time_t=r.sourceTimeToTargetTime(l),e.index=i.timeScale().points().roughIndex(e.time_t,s&&s.distance.bind(s)),e.offset=0,e})):t},S.createdLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.paneForSource(k._model.model().mainSeries()),i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.createLineTool(e,i,t.linetool,t.properties,t.linkKey))}),S.continuedLineTool.subscribe(null,function(t){var e,i,s,r=k._model.model();t.model!==r&&(e={index:o(r,t.model,t.point.timeStamp),price:t.point.price},(i=k._model.lineBeingCreated())&&k._model.model().coninueCreatingLine(e,t.envState,!!t.finalState)&&t.finalState&&(s=$.extend({},t.finalState),s.points=n(t.finalState.points,t.model,r),i.restoreExternalPoints(s)))}),S.cancelledLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&k._model.model().cancelCreatingLine()}),S.startedMovingLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&e.isActualSymbol()&&(i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.model().startMovingSource(e,i))}),S.movedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&i.sourceBeingMoved()&&i.sourceBeingMoved().linkKey===t.linkKey&&(e={index:o(i,t.model,t.point.timeStamp),price:t.point.price},k._model.model().moveSource(e))}),S.finishedMovingLineTool.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.sourceBeingMoved())&&(k._model.model().endMovingSource(!!t.finalState),t.finalState&&(i=$.extend({},t.finalState),i.points=n(t.finalState.points,t.model,o),e.restoreExternalPoints(i)))}),S.startedChangingLineTool.subscribe(null,function(t){var e,i,n=k._model.model();t.model!==n&&k._model.model().mainSeries().symbol()===t.symbol&&(e=n.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&e.isActualSymbol()&&(i={index:o(n,t.model,t.point.timeStamp),price:t.point.price},k._model.model().startChangingLinetool(e,i,t.pointIndex,t.envState))}),S.changedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&i.lineBeingEdited()&&i.lineBeingEdited().linkKey===t.linkKey&&(e={index:o(i,t.model,t.point.timeStamp),price:t.point.price},k._model.model().changeLinePoint(e,t.envState))}),S.finishedChangingLineTool.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0],o.lineBeingEdited()&&k._model.model().endChangingLinetool(!!t.finalState),e&&e.isActualSymbol()&&t.finalState&&(i=$.extend({},t.finalState),i.points=n(t.finalState.points,t.model,o),e.restoreExternalPoints(i)))
}),S.removedLineTool.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&(e=i.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&k._model.model().removeSource(e)}),S.finishedLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0]&&k._model.model().finishLineTool()}),S.changedLineStyle.subscribe(null,function(t){var e,i=k._model.model();t.model!==i&&(e=i.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(e.properties().merge(t.state),e.propertiesChanged())}),S.restoredLineToolState.subscribe(null,function(t){var e,i,o=k._model.model();t.model!==o&&(e=o.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(i=$.extend({},t.state),i.points=n(t.state.points,t.model,o),i.indexes=i.points.map(function(t){return{index:t.index,price:t.price}}),o.restoreLineToolState(e,i))}),S.restoredLineTool.subscribe(null,function(t){var e=k._model.model();t.model!==e&&e.restoreSource(t.state.restorePane,t.state.paneIndex,t.state.paneState,t.state.sourceState,t.state.priceScaleName)}),S.copiedLineTool.subscribe(null,function(t){var e,i,o,s,r,a=k._model.model();if(t.model!==a&&k._model.model().mainSeries().symbol()===t.symbol){if(t.model.mainSeries().syncModel(),a.mainSeries().syncModel(),e=a.paneForSource(k._model.model().mainSeries()),i=n(t.points,t.model,a),o=i[0],s=a.createLineTool(e,o,t.linetool,null,t.linkKey),a.lineBeingCreated())for(r=1;r<i.length;r++)r!==i.length-1||"LineToolBrush"!==t.linetool&&"LineToolGhostFeed"!==t.linetool||a.finishLineTool(!0),a.coninueCreatingLine(i[r],{},r<i.length-1,!0);s.properties().interval.setValue(t.state.interval),s.properties().merge(t.state),s.restoreData&&s.restoreData(t),s.propertiesChanged()}}),this._options=t=t||{},s=t.jqParent,r=t.sizeFunc,a=t.content,l=t.readOnly,h=t.containsData,c=t.onWidget,d=t.onCmeWidget,d&&X.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),p=t.widgetCustomer,_=t.timezone,m=t.withDateRanges,g=t.hideSymbolSearch,y=t.defSymbol,b=t.defInterval,w=t.defExtendedHours,C=t.defTimeframe,x=-1!==$.inArray(t.defStyle,$.map($.grep(Object.keys(u),function(t){return/^STYLE_\w+/.test(t)}),function(t){return u[t]})),P=x?t.defStyle:void 0,this._chartWidgetCollection=t.chartWidgetCollection||null,this._withDateRanges=(void 0===m?!l:!!m)&&f.enabled("timeframes_toolbar"),this._jqParent=void 0!==s?s:$(document.body),this._setContent(a),this._readOnly=l,this._containsData=h,this._defSymbol=y,this._defInterval=b,this._defTimeframe=C,this._defStyle=P,this._onWidget=!!c,this._onWidget&&(d?this._widgetCustomer="cme":p&&(this._widgetCustomer=p)),this.controlBarHeight=22,this._sizeFunc=r||function(){var t=k._jqParent.width(),e=k._jqParent.height(),i=k._jqParent[0];return window.self!==window.top&&i.offsetWidth<i.clientWidth&&i.getBoundingClientRect().width<100&&(t=Math.round(100*i.getBoundingClientRect().width),e=Math.round(100*i.getBoundingClientRect().height)),{x:0,y:0,w:t,h:e-(k._withDateRanges?k.controlBarHeight:0)}},
this._hideSymbolSearch=g,this._jqMainDiv=null,this._rect=this._sizeFunc(),this._jqMainTable=null,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},L=this._contentSeriesProperties(),L&&(y=L.symbol,b=L.interval),void 0===T||T.isValid(b)||(b=void 0),this._properties=new M("chartproperties"),this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")),this._properties.mainSeriesProperties.merge({visible:!0,symbol:y||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:b||"D",style:P,extendedHours:w,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),_&&V(_)&&this._properties.timezone.setValue(_),this._tagsChanged=new e,this._modelCreated=new e,this._disconnected=new e,this._reconnectBailout=new e,this._connected=new e,this._redrawPanes=new e,this._onScroll=new e,this.chartWidgetInitialized=new e,this._studiesMetaData=[],this._studiesMigrations=[],this._chartSession=new R(ChartApiInstance),this.lhsPriceAxisWidthChanged=new e,this.rhsPriceAxisWidthChanged=new e,this._isActive=t.isActive}function n(t){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[t]||"exchange"}function s(t){return t.description_localized=$.t(t.description,{context:"study"}),t}var r=i(659),a=i(658),l=i(53).UndoHistory,h=i(682),c=i(194),d=i(669),p=(i(80),i(102).BarsMarksContainer),u=i(42),_=i(298),f=i(3),m=i(31).Study,g=i(157),v=i(1).LineDataSource,y=i(47),b=y.Action,w=y.ActionSeparator,S=i(41),T=i(43).Interval,C=i(601),x=i(661),P=i(667),L=(i(345),i(21)),k=i(255).AddCompareDialog,I=i(72),A=i(190),E=i(77),M=(i(285),i(7).DefaultProperty),D=i(161),O=D.availableTimezones,V=D.timezoneIsAvailable,B=i(71).createDialog,R=i(282),N=(i(86),i(25)),F=i(127).unifiedSpinner,z=i(33).trackEvent,W=i(44).assert,H=i(60).guid,U=i(120),j=(U.addCanvasTo,U.Size),q=i(257),Y=i(93).createConfirmDialog,G=i(727).MarketStatusIndicator,K=i(726).DataModeIndicator,X=i(12).getLogger("ChartWidget",{color:"#606"});o.prototype.setTimezone=function(t){t&&V(t)?this._properties.timezone.setValue(t):console.warn("Incorrect timezone: "+JSON.stringify(t))},o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(t){t.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(t){t.clearMarks()})},o._nextMetadataId=1,o.prototype._setAlertsStudiesList=function(t){this._alertsStudiesList=$.map($.grep(t,function(t){var e,i=t.plots||[];for(e=0;e<i.length;e++)if("line"===i[e].type)return!0;return!1}),function(t){return t.id})},o.prototype.canCreateAlertForDataSource=function(t){if(!f.enabled("alerts"))return!1},o._filterAuthorizedMetaInfo=function(t){var e,i,o,n,s=[];for(e=0;t&&e<t.length;++e)i=t[e],o=N.parseIdString(i.id),n=o.productId,pro.hasPackage(n)&&s.push(i);return s},o.prototype.privateMetaInfo=function(t){if(t){
this._hideSymbolSearch=g,this._jqMainDiv=null,this._rect=this._sizeFunc(),this._jqMainTable=null,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},L=this._contentSeriesProperties(),L&&(y=L.symbol,b=L.interval),void 0===T||T.isValid(b)||(b=void 0),this._properties=new M("chartproperties"),this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")),this._properties.mainSeriesProperties.merge({visible:!0,symbol:y||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:b||"D",style:P,extendedHours:w,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),_&&V(_)&&this._properties.timezone.setValue(_),this._tagsChanged=new e,this._modelCreated=new e,this._disconnected=new e,this._reconnectBailout=new e,this._connected=new e,this._redrawPanes=new e,this._onScroll=new e,this.chartWidgetInitialized=new e,this._studiesMetaData=[],this._studiesMigrations=[],this._chartSession=new R(ChartApiInstance),this.lhsPriceAxisWidthChanged=new e,this.rhsPriceAxisWidthChanged=new e,this._isActive=t.isActive}function n(t){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[t]||"exchange"}function s(t){return t.description_localized=$.t(t.description,{context:"study"}),t}var r=i(659),a=i(658),l=i(53).UndoHistory,h=i(682),c=i(194),d=i(669),p=(i(80),i(102).BarsMarksContainer),u=i(43),_=i(298),f=i(3),m=i(31).Study,g=i(157),v=i(1).LineDataSource,y=i(47),b=y.Action,w=y.ActionSeparator,S=i(42),T=i(36).Interval,C=i(601),x=i(661),P=i(667),L=(i(345),i(21)),k=i(255).AddCompareDialog,I=i(72),A=i(190),E=i(77),M=(i(285),i(7).DefaultProperty),D=i(161),O=D.availableTimezones,V=D.timezoneIsAvailable,B=i(71).createDialog,R=i(282),N=(i(86),i(25)),F=i(127).unifiedSpinner,z=i(33).trackEvent,W=i(44).assert,H=i(60).guid,U=i(120),j=(U.addCanvasTo,U.Size),q=i(257),Y=i(93).createConfirmDialog,G=i(727).MarketStatusIndicator,K=i(726).DataModeIndicator,X=i(12).getLogger("ChartWidget",{color:"#606"});o.prototype.setTimezone=function(t){t&&V(t)?this._properties.timezone.setValue(t):console.warn("Incorrect timezone: "+JSON.stringify(t))},o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(t){t.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(t){t.clearMarks()})},o._nextMetadataId=1,o.prototype._setAlertsStudiesList=function(t){this._alertsStudiesList=$.map($.grep(t,function(t){var e,i=t.plots||[];for(e=0;e<i.length;e++)if("line"===i[e].type)return!0;return!1}),function(t){return t.id})},o.prototype.canCreateAlertForDataSource=function(t){if(!f.enabled("alerts"))return!1},o._filterAuthorizedMetaInfo=function(t){var e,i,o,n,s=[];for(e=0;t&&e<t.length;++e)i=t[e],o=N.parseIdString(i.id),n=o.productId,pro.hasPackage(n)&&s.push(i);return s},o.prototype.privateMetaInfo=function(t){if(t){
return new t(N.CURRENT_METAINFO_FORMAT_VERSION).generateMetaInfo()}return[]},o.prototype._onScriptSources=function(t,e){var i,o,n,s,r,a,l,h;for(X.logDebug("ChartWidget _onScriptSources called"),i=null,o=0;o<e.length;++o)if(n=e[o],n.id.startsWith("Script@tv-scripting-")){i=N.parseIdString(n.id).version;break}if(null!=i){for(this.studyScriptingPkgVers=i,s=0,r=0,o=0;o<t.length;++o){a=t[o],l=a&&a.scriptName,s++;try{h=N.createMetaInfoStub(a,i),e.push(h)}catch(t){X.logError("Could not process script (skipped): "+l+" ("+t.message+")"),r++}}X.logDebug("User's Pine Scripts loaded "+s+", skipped "+r)}else X.logError("Could not find tv-scripting package in metadata response");for(o=0;o<e.length;o++)N.addOrReplaceStudyMetaInfo(this._studiesMetaData,e[o]);this._inited?this.model().model().setStudiesMetaData(this._studiesMetaData,this._studiesMigrations):(this._init(),this.chartWidgetInitialized.fire(),X.logDebug("ChartWidget _onScriptSources done"))},o.prototype._init=function(){var t,e,o=this;this._containsData||this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this._properties.timeScale.rightOffset.value()),this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),t=function(){var t,e;o._checkObsoleteTimezone(),o._chartSession&&o._chartSession.connected()&&o._restartModel(),this._content&&(this.initColors(),this._updateGui(),this.update()),t=o._model.mainSeries(),t.marketStatus.subscribe(function(e){o.indicatorImage&&o._updateDataAndMarketStatus(e,t.status(),t.quoteData.update_mode_seconds)},{callWithLast:!0}),this._resizeHandler=function(t){this._rect=this._sizeFunc(),t&&(this._rect.w+=t,this._rect.h+=t),this._updateAbsoluteRect(),this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),t||(this.paint(),this.resizeSeriesControlUI(),this.checkCompactMode(),this.resizeIndicator())}.bind(this),this._resizeHandler(),this._jqMainDiv.appendTo(this._jqParent),this._spinner&&(this._spinner.stop(),delete this._spinner),e=i(214),e.isFeatureEnabled("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange",function(t,e){e&&(o._resizeHandler(1),setTimeout(function(){o._resizeHandler()},0))}),$(window).keydown(function(t){27===t.which&&t.preventDefault()}),this._containsData||this._jqMainDiv.mousewheel(function(t,e,i,o){var n,s,r,a,l;if((TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty())return n=t.pageX-5,s=this._paneWidgets[0].lhsPriceAxisWidget.size.w,r=this._timeAxisWidget.size.w,s&&(n=Math.max(0,n-s)),n=Math.min(n,r),a=f.enabled("right_bar_stays_on_scroll")?1:2*(n/r-.5),l=Math.min(1,Math.abs(o)),o>0?this.model().zoomIn(a,l):o<0&&this.model().zoomOut(a,l),i&&this.model().scrollChart(-80*i),!1}.bind(this)),this._initBarsMarksSources(),this.setAutoScaleOnSymbolChange(),this.readOnly()||this._hideSymbolSearch||E.registerDialogKeypressHandler(this),
this.model().timeScale().onScroll().subscribe(this,function(){this._onScroll.fire()}),this._inited=!0}.bind(this),e=this._makeDefaultModel(),void 0===e?t():e.then(t)},o.prototype._checkObsoleteTimezone=function(){var t=this._properties.timezone.value();V(t)||this._properties.timezone.setValue(n(t))},o.prototype._initBarsMarksSources=function(){var t=this;this.withModel(this,function(){this.model().barsMarksSources().forEach(function(e){e.onNeedRepaint.subscribe(t,t.paint)})})},o.prototype.initESDTimelineWidget=function(){new ESDTimelineWidget(this)},o.prototype.applyAutoScaleOnNewSymbol=function(){(!this.model().mainSeries()instanceof u||!this.model().mainSeries().properties().lockScale.value())&&this.model().mainSeries().priceScale().setAutoScale(!0)},o.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().properties().symbol.listeners().subscribe(this,function(){this.applyAutoScaleOnNewSymbol()})})},o.prototype.initColors=function(){this._properties.paneProperties.background.listeners().subscribe(this,o.prototype.setBackgroundColor),this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,o.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,o.prototype.setScaleTextColor)},o.prototype.paneWidgets=function(){return this._paneWidgets},o.prototype.paneByCanvas=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e].canvas===t||this._paneWidgets[e].top_canvas===t)return this._paneWidgets[e];return null},o.prototype.paneByState=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e]._state===t)return this._paneWidgets[e];return null},o.prototype.priceAxisByCanvas=function(t){var e,i,o;for(e=0;e<this._paneWidgets.length;e++)if(i=this._paneWidgets[e],o=i.priceAxisByCanvas(t))return o;return null},o.prototype.timeAxisByCanvas=function(t){return t===this._timeAxisWidget.canvas||t===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null},o.prototype.properties=function(){return this._properties},o.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)},o.prototype.readOnly=function(){return this._readOnly},o.prototype.onDisconnected=function(){return this._disconnected},o.prototype.onReconnectBailout=function(){return this._reconnectBailout},o.prototype.onConnected=function(){return this._connected},o.prototype.onRedrawPanes=function(){return this._redrawPanes},o.prototype.onScroll=function(){return this._onScroll},o.prototype.modelCreated=function(){return this._modelCreated},o.prototype.setResolution=function(t){if(!this._model)return void this._properties.mainSeriesProperties.merge({interval:t});var e=this._model.mainSeries().properties().interval;this._model.setScreenChartProperty(e,t,this,$.t("Change Resolution"))},
o.prototype.getResolution=function(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()},o.prototype._addSymbol=function(t,e){var i=this.model(),o=i.studiesMetaData(),n="study_Overlay@tv-basicstudies",s=f.enabled("use_overrides_for_overlay")&&TradingView.defaultProperties[n]&&TradingView.defaultProperties[n].style,r=s||(i.mainSeries().properties().style.value()===u.STYLE_CANDLES?u.STYLE_BARS:u.STYLE_CANDLES),a={inputs:{symbol:t},style:r},l=o.filter(function(t){return"Overlay@tv-basicstudies"===t.id})[0];i.insertStudy(l,a,e)},o.prototype.addSymbol=function(t,e){this._addSymbol.apply(this,arguments)},o.prototype.updateActions=function(){function t(){var t,e,i=studyTemplates.plainList("custom"),o=studyTemplates.plainList("default");l.applyStudyTemplate.subActions||(l.applyStudyTemplate.subActions=[]),t=l.applyStudyTemplate.subActions,t.splice(0,t.length),e=new b({text:studyTemplates._SAVE_AS_TITLE}),e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDialog),t.push(e,new w),i.length||o.length?(i.length&&($.each(i,function(e,i){function o(t){return function(){return studyTemplates.deleteStudyTemplate(t),this._parentMenu._parentMenuItem._parentMenu.destroy(),!1}}var n=new b({text:i});n.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),n.deleteButton={action:o(n.text)},t.push(n)}),o.length&&t.push(new w)),$.each(o,function(e,i){var o=new b({text:i});o.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),t.push(o)})):t.push(new b({text:$.t("No study templates saved"),enabled:!1}))}var e,i,o,n,s,r,a,l=this.actions(),h=this._model.dataSources(),c=!1,d=!1;for(e=0,i=h.length;e<i;e++)o=h[e],TradingView.isInherited(o.constructor,v)&&o.isUserDeletable()&&(c=!0),TradingView.isInherited(o.constructor,m)&&o.removeByRemoveAllStudies()&&(d=!0),TradingView.isInherited(o.constructor,g)&&(d=!0);this._readOnly||(l.paneRemoveAllStudies&&l.paneRemoveAllStudies.setEnabled(d),l.paneRemoveAllDrawingTools&&l.paneRemoveAllDrawingTools.setEnabled(c),l.paneRemoveAllStudiesDrawingTools&&l.paneRemoveAllStudiesDrawingTools.setEnabled(d||c)),window.studyTemplates&&(t(),studyTemplates.refreshStudyTemplateList(t)),n=this,s=[],r=O,a=function(t){return t.id===n.model().model().properties().timezone.value()},r.forEach(function(t){if(!t.separator){var e=new b({text:t.title,checkable:!0,checked:a(t)});e.callbacks().subscribe(this,function(){n.model().setProperty(n.model().model().properties().timezone,t.id,"Changed Time Zone")}),s.push(e)}},this),l.applyTimeZone.subActions=s,l.addToWatchlist&&(l.addToWatchlist.text=$.t("Add {0} To Watchlist").format(this.getSymbol(!0))),l.addToTextNotes&&(l.addToTextNotes.text=$.t("Add Text Note For {0}").format(this.getSymbol(!0))),this.updateActionForIntradayOnly(l.sessionBreaks)},o.prototype.actions=function(){return this._actions||this._setActions(),this._actions},o.prototype._setActions=function(){
@@ -284,7 +284,7 @@ var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();e.scaleP
this.actions.setAutoScale.setChecked(t._properties.autoScale.value()),this.actions.setAutoScale.setEnabled(!t.properties().autoScaleDisabled.value())},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){this.reset(),v("GUI","Double click price scale")},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions())},o.prototype.getContextMenuActions=function(){var t,i;return this._initActions(),t=this.pane.chart().actions(),i=[],i.push(this.actions.reset,new l,t.showLeftAxis,t.showRightAxis,new l,this.actions.setAutoScale),this.actions.setLockScale&&i.push(this.actions.setLockScale),i.push(t.scaleSeriesOnly,new l,this.actions.setPercentage,this.actions.setLog,new l),e.enabled("fundamental_widget")||i.push(t.showSymbolLabelsAction,t.showSeriesLastValue),i.push(t.showStudyPlotNamesAction,t.showStudyLastValue),e.enabled("countdown")&&i.push(t.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_scales")&&t.scalesProperties&&i.push(new l,t.scalesProperties),i},o.prototype.backLabels=function(t){var e,i,o,n,s,r=[],a=this.priceScale().orderedSources().slice(),l=this.pane,h=l.chart().model(),c=l.state(),d=[],p=h.sourceBeingMoved()||h.lineBeingEdited()||h.lineBeingCreated();if(p&&d.push(p),h.selectedSource()&&d.push(h.selectedSource()),h.hoveredSource()&&d.push(h.hoveredSource()),this.priceScale()===c.defaultPriceScale())for(e=this.pane.state().dataSources(),i=0;i<e.length;i++)c.isOverlay(e[i])&&a.push(e[i]);for(i=0;i<a.length;++i)if(o=a[i],(t||-1===d.indexOf(o))&&(n=o.priceAxisViews(c,o.priceScale())))for(s=0;s<n.length;s++)r.push(n[s]);return r},o.prototype.optimalWidth=function(){var t,e,i,o,n,s,r;if(!this.isVisible())return 0;if(t=0,e=this.rendererOptions(),this.pane.state())for(i=this.ctx,o=this.priceScale().marks(),i.setFont(this.baseFont()),o.length>0&&(t=Math.max(e.widthCache.measureText(i,o[0].label),e.widthCache.measureText(i,o[o.length-1].label))),n=this.backLabels(!0),s=n.length;s--;)(r=e.widthCache.measureText(i,n[s].text()))>t&&(t=r);return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.paddingInner+e.paddingOuter+t)},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,u(this.canvas,t),u(this.top_canvas,t),this.jqCell.css({width:t.w,"min-width":t.w,height:t.h}))},o.prototype.update=function(){},o.prototype._hightlightBackground=function(t,e,i){var o,n,s,r,a,l,h=e[0].price,c=e[0].price;for(o=1;o<e.length;o++)h=Math.min(h,e[o].price),c=Math.max(c,e[o].price);n=this.priceScale(),n.isPercent()&&i&&(s=i.firstValue(),h=n.priceRange().convertToPercent(h,s),c=n.priceRange().convertToPercent(c,s)),r=this.priceScale().priceToCoordinate(h),a=this.priceScale().priceToCoordinate(c),l="rgba(109, 158, 235, 0.3)",_(t,1,r,this.size.w-1,a-r,l)},o.prototype.drawBackground=function(t){var e,i,o,s
;if(_(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.pane.chart().model(),(i=e.model().selectedSource())&&i.priceScale()===this.priceScale()&&i instanceof n){if(o=i.axisPoints(),0===o.length)return;this._hightlightBackground(t,o,i.ownerSource())}s=e.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(t,s.measurePoints(),this.pane.state().mainDataSource())},o.prototype.drawBorder=function(t){var e,i,o;t.save(),t.fillStyle=this.lineColor(),e=this.size.h,this._isLeft?(t.translate(-.5,-.5),i=this.size.w-this._BORDER_SIZE-1,o=this.size.w-1):(t.translate(.5,-.5),i=0,o=i+this._BORDER_SIZE),t.fillRect(i,0,o-i,e),t.restore()},o.prototype.drawTickMarks=function(t){var e,i,o,n,s,r;if(t.save(),t.strokeStyle=this.lineColor(),e=this.priceScale().marks(),t.fillStyle=this.textColor(),t.setFont(this.baseFont()),i=this,t.translate(-.5,-.5),o=this.rendererOptions(),i._isLeft){for(t.fillStyle=i.lineColor(),t.beginPath(),n=this.size.w-i._OFFSET_SIZE-i._BORDER_SIZE-i._TICK_LENGTH,s=e.length;s--;)t.rect(n,e[s].coord,i._TICK_LENGTH,1);for(t.fill(),s=e.length;s--;)o._tickmarksCache.paintTo(t,e[s].label,n-o.paddingInner,e[s].coord,"right")}else{for(t.fillStyle=i.lineColor(),t.beginPath(),r=i._BORDER_SIZE+i._OFFSET_SIZE,s=e.length;s--;)t.rect(r,e[s].coord,i._TICK_LENGTH,1);for(t.fill(),s=e.length;s--;)o._tickmarksCache.paintTo(t,e[s].label,r+i._TICK_LENGTH+o.paddingInner,e[s].coord,"left")}t.restore()},o.prototype._alignLabels=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u=this.size.h/2,_=[],f=this.priceScale().orderedSources().slice(),m=this.pane,g=m.state(),v=this.rendererOptions();if(this.priceScale()===g.defaultPriceScale())for(t=this.pane.state().dataSources(),e=0;e<t.length;e++)g.isOverlay(t[e])&&f.push(t[e]);for(i=this.priceScale().mainSource(),e=0;e<f.length;++e)if(o=f[e],n=o.priceAxisViews(g,o.priceScale())){for(s=0;s<n.length;s++)_.push(n[s]);i===o&&n.length>0&&(u=n[0].floatCoordinate())}if(r=_.filter(function(t){return t.floatCoordinate()<=u}),a=_.filter(function(t){return t.floatCoordinate()>u}),r.sort(function(t,e){return e.floatCoordinate()-t.floatCoordinate()}),r.length&&a.length&&a.push(r[0]),a.sort(function(t,e){return t.floatCoordinate()-e.floatCoordinate()}),_.forEach(function(t){t._fixedCoordinate=t.coordinate()}),l=this.priceScale().properties(),l.alignLabels&&l.alignLabels.value()){for(e=1;e<r.length;e++)h=r[e],c=r[e-1],d=c.renderer().height(v,!1),(h.coordinate()||c._fixedCoordinate)&&h.coordinate()>c._fixedCoordinate-d&&(p=c._fixedCoordinate-d,h._fixedCoordinate=p);for(s=1;s<a.length;s++)h=a[s],c=a[s-1],d=c.renderer().height(v,!0),(h.coordinate()||c._fixedCoordinate)&&h.coordinate()<c._fixedCoordinate+d&&(p=c._fixedCoordinate+d,h._fixedCoordinate=p)}},o.prototype.drawBackLabels=function(t){var e,i,o,n,s;for(t.save(),e=this.backLabels(),i=this.rendererOptions(),o=0;o<e.length;o++)n=e[o],s=n.renderer(),n._fixedCoordinate&&(s._data.coordinate=n._fixedCoordinate),s.draw(t,i);t.restore()},o.prototype.drawCrossHairLabel=function(t){
var e,i,o,n,s,r,a,l=this.pane.chart().model().model(),h=[],c=l.sourceBeingMoved()||l.lineBeingEdited()||l.lineBeingCreated();for(c&&h.push({source:c,scale:c.priceScale()}),l.selectedSource()&&h.push({source:l.selectedSource(),scale:l.selectedSource().priceScale()}),l.hoveredSource()&&h.push({source:l.hoveredSource(),scale:l.hoveredSource().priceScale()}),h.push({source:l.crossHairSource(),scale:this.priceScale()}),e=this.pane.state(),i=0;i<h.length;i++)if(o=h[i],n=o.source.priceAxisViews(e,o.scale))for(s=0;s<n.length;s++)r=n[s],t.save(),a=r.renderer(),r._fixedCoordinate&&(a._data.coordinate=r._fixedCoordinate),a.draw(t,this.rendererOptions()),t.restore()},o.prototype.priceScale=function(){var t=this.pane.state(),e=[];return e=this._isLeft?[t.leftPriceScale(),t.rightPriceScale()]:[t.rightPriceScale(),t.leftPriceScale()],null===e[0].mainSource()?null===e[1].mainSource()?e[0]:e[1]:e[0]},o.prototype.isVisible=function(){return this._isVisible},o.prototype.setVisible=function(t){(t=!!t)!==this._isVisible&&(t?this.jqCell.css("display","table-cell"):this.jqCell.css("display","none"),this._isVisible=t)},o.prototype.setAutoScale=function(t){var e=this.pane.state,i=this.priceScale();this.pane.chart().model().setPriceAutoScale(e,i,t)},o.prototype.reset=function(){var t=this.pane.state(),e=this.priceScale();this.pane.chart().model().resetPriceScale(t,e)},o.prototype.paint=function(t){this._isVisible&&t&&(t===d.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this._alignLabels(),this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ns-resize"!==t||(e="price-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype.onMarksChanged=function(){var t,e=this.optimalWidth();this._prevOptimalWidth<e&&(t=this,this.updateTimeout||(this.updateTimeout=setTimeout(function(){t.pane&&t.pane.chart&&t.pane.chart()&&t.pane.chart().model().model().fullUpdate(),t.updateTimeout=null},100))),this._prevOptimalWidth=e},t.exports=o}).call(e,i(3))},function(t,e,i){(function(t){"use strict";function o(t){
return t instanceof h?t instanceof Q?Ot:t instanceof pt?null:t instanceof j?null:t instanceof st?null:t instanceof E?Mt:t instanceof A?null:t instanceof tt?null:t instanceof lt?null:t instanceof F?null:t instanceof nt?null:t instanceof ht?At:t instanceof T?null:t instanceof W?null:t instanceof H?null:t instanceof S?Vt:t instanceof yt?Lt:t instanceof U?null:t instanceof w?null:t instanceof O?null:t instanceof ft?Rt:kt:t instanceof vt?t instanceof wt?Pt:Ct:null}function n(e,i){if(e instanceof l||e instanceof a.ChartWidget)return t.enabled("show_chart_property_page")?xe:null;if(e instanceof vt)return e instanceof bt?Tt:"Volume@tv-basicstudies"===e.metaInfo().id?Wt:xt;if(e instanceof h){if(e instanceof M)return zt;if(e instanceof E)return Et;if(e instanceof L)return fe;if(e instanceof k)return fe;if(e instanceof I)return me;if(e instanceof ht)return It;if(e instanceof ct)return It;if(e instanceof S)return $t;if(e instanceof z)return Ut;if(e instanceof $)return jt;if(e instanceof lt)return qt;if(e instanceof ot)return ye;if(e instanceof rt)return Ft;if(e instanceof dt||e instanceof j)return Yt;if(e instanceof pt)return Gt;if(e instanceof st)return Kt;if(e instanceof G)return Xt;if(e instanceof A)return Zt;if(e instanceof W)return we;if(e instanceof H)return Se;if(e instanceof D)return Jt;if(e instanceof it)return Qt;if(e instanceof U)return Te;if(e instanceof at)return te;if(e instanceof nt)return ee;if(e instanceof et)return ie;if(e instanceof tt)return oe;if(e instanceof V)return ne;if(e instanceof R)return se;if(e instanceof N)return re;if(e instanceof c)return d;if(e instanceof p)return u;if(e instanceof b)return ae;if(e instanceof q)return ce;if(e instanceof _)return f;if(e instanceof v)return Ce;if(e instanceof C)return le;if(e instanceof B)return he;if(e instanceof x)return de;if(e instanceof m)return g;if(e instanceof F)return pe;if(e instanceof P)return ue;if(e instanceof ut||e instanceof _t)return _e;if(e instanceof y)return St;if(e instanceof T)return Bt;if(e instanceof Q)return Dt;if(e instanceof X)return ge;if(e instanceof J)return ve;if(e instanceof K)return be;if(e instanceof Z)return ve;if(e instanceof Y)return ge;if(e instanceof yt)return xt;if(e instanceof gt||e instanceof mt)return Ht;if(e instanceof ft)return Nt}return null}function s(t){var e=i(87).StudyDisplayPropertyPage;return t instanceof vt?e:null}function r(t){var e=i(650);if(t instanceof h)return e}var a=i(191),l=i(42),h=(i(334),i(353),i(1).LineDataSource),c=i(205),d=i(193),p=i(314),u=i(621),_=i(315),f=i(623),m=i(332),g=i(642),v=i(338),y=i(65).LineToolElliott,b=i(204).LineToolFibCircles,w=i(152),S=(i(341),
return t instanceof h?t instanceof Q?Ot:t instanceof pt?null:t instanceof j?null:t instanceof st?null:t instanceof E?Mt:t instanceof A?null:t instanceof tt?null:t instanceof lt?null:t instanceof F?null:t instanceof nt?null:t instanceof ht?At:t instanceof T?null:t instanceof W?null:t instanceof H?null:t instanceof S?Vt:t instanceof yt?Lt:t instanceof U?null:t instanceof w?null:t instanceof O?null:t instanceof ft?Rt:kt:t instanceof vt?t instanceof wt?Pt:Ct:null}function n(e,i){if(e instanceof l||e instanceof a.ChartWidget)return t.enabled("show_chart_property_page")?xe:null;if(e instanceof vt)return e instanceof bt?Tt:"Volume@tv-basicstudies"===e.metaInfo().id?Wt:xt;if(e instanceof h){if(e instanceof M)return zt;if(e instanceof E)return Et;if(e instanceof L)return fe;if(e instanceof k)return fe;if(e instanceof I)return me;if(e instanceof ht)return It;if(e instanceof ct)return It;if(e instanceof S)return $t;if(e instanceof z)return Ut;if(e instanceof $)return jt;if(e instanceof lt)return qt;if(e instanceof ot)return ye;if(e instanceof rt)return Ft;if(e instanceof dt||e instanceof j)return Yt;if(e instanceof pt)return Gt;if(e instanceof st)return Kt;if(e instanceof G)return Xt;if(e instanceof A)return Zt;if(e instanceof W)return we;if(e instanceof H)return Se;if(e instanceof D)return Jt;if(e instanceof it)return Qt;if(e instanceof U)return Te;if(e instanceof at)return te;if(e instanceof nt)return ee;if(e instanceof et)return ie;if(e instanceof tt)return oe;if(e instanceof V)return ne;if(e instanceof R)return se;if(e instanceof N)return re;if(e instanceof c)return d;if(e instanceof p)return u;if(e instanceof b)return ae;if(e instanceof q)return ce;if(e instanceof _)return f;if(e instanceof v)return Ce;if(e instanceof C)return le;if(e instanceof B)return he;if(e instanceof x)return de;if(e instanceof m)return g;if(e instanceof F)return pe;if(e instanceof P)return ue;if(e instanceof ut||e instanceof _t)return _e;if(e instanceof y)return St;if(e instanceof T)return Bt;if(e instanceof Q)return Dt;if(e instanceof X)return ge;if(e instanceof J)return ve;if(e instanceof K)return be;if(e instanceof Z)return ve;if(e instanceof Y)return ge;if(e instanceof yt)return xt;if(e instanceof gt||e instanceof mt)return Ht;if(e instanceof ft)return Nt}return null}function s(t){var e=i(87).StudyDisplayPropertyPage;return t instanceof vt?e:null}function r(t){var e=i(650);if(t instanceof h)return e}var a=i(191),l=i(43),h=(i(334),i(353),i(1).LineDataSource),c=i(205),d=i(193),p=i(314),u=i(621),_=i(315),f=i(623),m=i(332),g=i(642),v=i(338),y=i(65).LineToolElliott,b=i(204).LineToolFibCircles,w=i(152),S=(i(341),
i(90).LineToolVertLine),T=i(147),C=i(339),x=i(318),P=i(309),L=i(311),k=i(331),I=i(310),A=i(150).LineToolParallelChannel,E=i(208),M=i(11).LineToolTrendLine,D=i(103).LineToolArrowMark,O=i(203).LineToolExecution,$=i(326),V=i(322),B=i(316),R=i(320),N=i(321),F=i(206).LineToolFibWedge,z=i(52).LineToolPitchfork,W=i(312),H=i(319),U=i(118),j=i(333),q=i(317),Y=i(323),G=i(119).LineToolTriangle,K=i(340),X=i(200).LineTool5PointsPattern,Z=i(337),J=i(306),Q=i(151).LineToolRiskReward,tt=i(327),et=i(329),it=i(330),ot=i(149).LineToolNote,nt=i(201),st=i(307),rt=i(202),at=i(308),lt=i(16).LineToolText,ht=i(89).LineToolHorzLine,ct=i(324),dt=i(45).LineToolRectangle,pt=i(313),ut=i(336),_t=i(335),ft=i(207),mt=i(148).LineToolBezierQuadro,gt=i(148).LineToolBezierCubic,vt=i(31).Study,yt=i(78).StudyLineDataSource,bt=i(351).study_Overlay,wt=i(349),St=i(619),Tt=i(302),Ct=i(87).StudyInputsPropertyPage,xt=i(87).StudyStylesPropertyPage,Pt=i(599),Lt=i(663),kt=i(64),It=i(293).LineToolHorzLineStylesPropertyPage,At=i(293).LineToolHorzLineInputsPropertyPage,Et=i(296).LineToolTrendAngleStylesPropertyPage,Mt=i(296).LineToolTrendAngleInputsPropertyPage,Dt=i(294).LineToolRiskRewardStylesPropertyPage,Ot=i(294).LineToolRiskRewardInputsPropertyPage,$t=i(297).LineToolVertLineStylesPropertyPage,Vt=i(297).LineToolVertLineInputsPropertyPage,Bt=i(611).LineToolBarsPatternStylesPropertyPage,Rt=i(292).LineToolGhostFeedInputsPropertyPage,Nt=i(292).LineToolGhostFeedStylesPropertyPage,Ft=i(614),zt=i(647),Wt=i(672),Ht=i(612),Ut=i(638),jt=i(637),qt=i(645),Yt=i(644),Gt=i(620),Kt=i(608),Xt=i(649),Zt=i(636),Jt=i(609),Qt=i(641),te=i(610),ee=i(613),ie=i(640),oe=i(639),ne=i(633),se=i(631),re=i(632),ae=i(622),le=i(628),he=i(624),ce=i(625),de=i(626),pe=i(629),ue=i(615),_e=i(646),fe=i(617),me=i(616),ge=i(606),ve=i(607),ye=i(635),be=i(648),we=i(618),Se=i(630),Te=i(634),Ce=i(627),xe=i(596);e.createInputsPropertyPage=function(t,e){var i=o(t);return i?new i(t.properties(),e,t):null},e.createStudyStrategyPropertyPage=function(t,e){var o=i(354),n=i(665);return t instanceof o?new n(t.properties(),e,t):null},e.createStylesPropertyPage=function(t,e){var i=n(t);return i?new i(t.properties(),e,t):null},e.createDisplayPropertyPage=function(t,e){var i=s(t);return i?new i(t.properties(),e,t):null},e.createVisibilitiesPropertyPage=function(t,e){var i=r(t);return i?new i(t.properties(),e,t):null},e.hasInputsPropertyPage=function(t){return!!o(t)},e.hasStylesPropertyPage=function(t){return!!n(t)},e.hasDisplayPropertyPage=function(t){return!!s(t)}}).call(e,i(3))},function(t,e){"use strict";function i(){this.backColorers=[]}function o(t){i.call(this),this._series=t}function n(t,e){i.call(this),this._study=t,this._plotIndex=e}i.prototype.barStyle=function(t,e,i){var o,n={};for(o=this.backColorers.length-1;o>=0;o--)this.backColorers[o].applyBarStyle(t,e,n,i);return this.applyBarStyle(t,e,n,i),n},i.prototype.pushBackBarColorer=function(t){this.backColorers.push(t)},i.prototype.applyBarStyle=function(t,e,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(o,i),
o.prototype.applyBarStyle=function(t,e,i,o){var n,s,r,a,l,h,c,d,p,u,_;switch(i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,n=this._series.properties(),n.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=n.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=n.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:s=n.barStyle.upColor.value(),r=n.barStyle.downColor.value(),a=s,l=r,h=this.findBar(t,!1,o),n.barStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,!1,o),i.barColor=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?s:r,i.barBorderColor=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?a:l):(i.barColor=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?s:r,i.barBorderColor=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:s=n.candleStyle.upColor.value(),r=n.candleStyle.downColor.value(),a=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),l=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),d=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),p=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),h=this.findBar(t,!1,o),n.candleStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,!1,o),u=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]):u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.barColor=u?s:r,i.barBorderColor=u?a:l,i.barWickColor=u?d:p;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:s=n.hollowCandleStyle.upColor.value(),r=n.hollowCandleStyle.downColor.value(),a=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),l=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),d=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),p=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),h=this.findBar(t,!1,o),c=this.findPrevBar(t,!1,o),c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]?(i.barColor=s,i.barBorderColor=a,i.barWickColor=d):(i.barColor=r,i.barBorderColor=l,i.barWickColor=p),h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:s=n.haStyle.upColor.value(),r=n.haStyle.downColor.value(),a=n.haStyle.borderUpColor.value(),l=n.haStyle.borderDownColor.value(),d=n.haStyle.wickUpColor.value(),p=n.haStyle.wickDownColor.value(),h=this.findBar(t,e,o),n.haStyle.barColorsOnPrevClose.value()?(c=this.findPrevBar(t,e,o),u=c[TradingView.CLOSE_PLOT]<=h[TradingView.CLOSE_PLOT]):u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.barColor=u?s:r,i.barBorderColor=u?a:l,
i.barWickColor=u?d:p;break;case TradingView.Series.STYLE_RENKO:h=this.findBar(t,e,o),u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],s=e?n.renkoStyle.upColorProjection.value():n.renkoStyle.upColor.value(),r=e?n.renkoStyle.downColorProjection.value():n.renkoStyle.downColor.value(),a=e?n.renkoStyle.borderUpColorProjection.value():n.renkoStyle.borderUpColor.value(),l=e?n.renkoStyle.borderDownColorProjection.value():n.renkoStyle.borderDownColor.value(),i.barColor=u?s:r,i.barBorderColor=u?a:l,i.isBarUp=u;break;case TradingView.Series.STYLE_PB:h=this.findBar(t,e,o),u=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],s=e?n.pbStyle.upColorProjection.value():n.pbStyle.upColor.value(),r=e?n.pbStyle.downColorProjection.value():n.pbStyle.downColor.value(),a=e?n.pbStyle.borderUpColorProjection.value():n.pbStyle.borderUpColor.value(),l=e?n.pbStyle.borderDownColorProjection.value():n.pbStyle.borderDownColor.value(),i.barColor=u?s:r,i.barBorderColor=u?a:l,i.isBarUp=u;break;case TradingView.Series.STYLE_KAGI:i.upColor=e?n.kagiStyle.upColorProjection.value():n.kagiStyle.upColor.value(),i.downColor=e?n.kagiStyle.downColorProjection.value():n.kagiStyle.downColor.value(),_=null,h=this.findBar(t,e,o),h[TradingView.LOW_PLOT]<h[TradingView.ADT_PLOT]&&h[TradingView.ADT_PLOT]<h[TradingView.HIGH_PLOT]?(_=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT],i.isTwoColorBar=!0):(_=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?h[TradingView.OPEN_PLOT]===h[TradingView.ADT_PLOT]:h[TradingView.OPEN_PLOT]!==h[TradingView.ADT_PLOT],i.isTwoColorBar=!1),i.barColor=_?i.upColor:i.downColor,i.isBarUp=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:h=this.findBar(t,e,o),u=h[TradingView.ADT_PLOT]>0,s=e?n.pnfStyle.upColorProjection.value():n.pnfStyle.upColor.value(),r=e?n.pnfStyle.downColorProjection.value():n.pnfStyle.downColor.value(),i.isBarUp=u,i.barColor=u?s:r}return i},o.prototype.getSeriesBars=function(t){return t?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(t,e,i){var o=this.getSeriesBars(i).valueAt(t);if(void 0!==o)return o[e]},o.prototype.findBar=function(t,e,i){return i?i.value:this.getSeriesBars(e).valueAt(t)||[]},o.prototype.findPrevBar=function(t,e,i){var o,n;return i&&i.previousValue?i.previousValue:(o=this._series.bars(),n=o._search(t,TradingView.SEARCH_EXACT),n>0?this._series.bars()._valueAt(n-1):[])},inherit(n,i),n.prototype.applyBarStyle=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f;return i||(i={}),e?i:(o=this._study.properties(),o.visible.value()?(n=this._study.metaInfo(),(s=this._study.data())&&0!==s.size()?(r=n.plots[this._plotIndex],a=o.styles[r.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(r.id),(h=s.valueAt(t-l))?null==(c=h[this._plotIndex+1])?i:(c=Math.round(c),d=n.plots[this._plotIndex].palette,p=o.palettes,u=p[d],_=n.palettes[d].valToIndex?n.palettes[d].valToIndex[c]:c,f=u.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i):i)):i):i)},e.SeriesBarColorer=o,e.StudyBarColorer=n},function(t,e,i){
@@ -313,13 +313,13 @@ n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSo
for(var t=0;t<this.m_dataSources.length;t++)this.m_dataSources[t].updateAllViews()},n.prototype.defaultPriceScale=function(){var t=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();return void 0===t&&(t=new h(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties)),t},n.prototype._priceScaleIsPrice=function(t){var e=t.mainSource();return!!e&&(!!TradingView.isInherited(e.constructor,TradingView.Series)||!!TradingView.isInherited(e.constructor,TradingView.Study)&&e.metaInfo().is_price_study)},n.prototype.findSuitableScale=function(t){if(TradingView.isInherited(t.constructor,TradingView.Study)&&"Volume@tv-basicstudies"===t.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var e=!1;if(TradingView.isInherited(t.constructor,TradingView.Study)?e=t.metaInfo().is_price_study:TradingView.isInherited(t.constructor,TradingView.Series)&&(e=!0),e){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale},n.prototype.mainDataSource=function(){return this.m_mainDataSource},n.prototype.recalculatePriceScale=function(t){if(t){if(t.isAutoScale()&&!this.timeScale().isEmpty()){var e=this.timeScale().visibleBars();t.recalculatePriceRange(e)}t.updatePaneViews()}},n.prototype.resetPriceScale=function(t){var e=this.timeScale().visibleBars();t.mainSource()instanceof TradingView.Series&&t.mainSource().isLockScale()||t.setAutoScale(!0),t.recalculatePriceRange(e),this.updateAllViews()},n.prototype.recalculate=function(){var t,e;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],!this.isOverlay(e)||e instanceof r||this.recalculatePriceScale(e.priceScale());this.updateAllViews(),this._model.updatePane(this)},n.prototype.isEmpty=function(){return null===this.m_mainDataSource},n.prototype.move=function(t,e,i){var o=this.m_dataSources.slice(),n=null!==e;this.removeDataSource(t,n),this.addDataSource(t,e,i),this.m_dataSources=o,this.invalidateSourcesCache()},n.prototype.dataSourceForId=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.priceScaleForSource=function(t){return-1!==this.rightPriceScale().dataSources().indexOf(t)?this.rightPriceScale():-1!==this.leftPriceScale().dataSources().indexOf(t)?this.leftPriceScale():null},n.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.containsMainSeries=function(){return-1!==this.m_dataSources.indexOf(this._model.mainSeries())},n.prototype.priceScaleByName=function(t){
return"left"===t?this.m_leftPriceScale:"right"===t?this.m_rightPriceScale:null},n.prototype.priceScaleName=function(t){return t===this.m_leftPriceScale?"left":t===this.m_rightPriceScale?"right":""},n.prototype.hitTestSources=function(){var t,e,i,o,n;if(this._cachedHitTestSources)return this._cachedHitTestSources;for(t=this.orderedSources(),e=[],i=[],o=0;o<t.length;o++)n=t[o],TradingView.isInherited(n.constructor,r)?e.push(n):i.push(n);return this._cachedHitTestSources=i.concat(e),this._cachedHitTestSources},n.prototype.orderedSources=function(){var t,e,i,o;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0,i=this.m_dataSources.length;e<i;e++)o=this.m_dataSources[e],TradingView.isInherited(o.constructor,r)&&!o.isActualSymbol()||t.push(o);return t=n.sortSources(t),this._cachedOrderedSoruces=t,t},n.prototype.createDrawingsCaches=function(){s.recreateOrderedByBarsSourcesCache(this)},n.prototype.clearDrawingCaches=function(){s.clearOrderedByBarsSourcesCache()},n.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null,this._cachedHitTestSources=null,this.m_leftPriceScale.invalidateSourcesCache(),this.m_rightPriceScale.invalidateSourcesCache()},n.prototype.getZOrderMinMax=function(){var t,e,i,o,n=this.orderedSources();if(0===n.length)return{minZOrder:0,maxZOrder:0};for(t=n[0].zorder(),e=n[0].zorder(),i=1;i<n.length;i++)o=n[i],o.zorder()<t&&(t=o.zorder()),o.zorder()>e&&(e=o.zorder());return{minZOrder:t,maxZOrder:e}},n.prototype.isZOrderAvailable=function(t){var e,i;for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],i.zorder()===t)return!1;return!0},n.prototype.sendToBack=function(t){var e,i=this.getZOrderMinMax().minZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,-1)},n.prototype.bringToFront=function(t){var e,i=this.getZOrderMinMax().maxZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,1)},n.prototype.changeZOrder=function(t,e){var i,o,n,s,r,a=this.orderedSources().filter(function(t){return t.showInObjectTree()}),l=0;for(i=0,o=a.length;i<o;i++)if(a[i]===t){l=i;break}l>0&&e<0?(n=a[l-1].zorder(),s=t.zorder(),a[l-1].setZorder(s),t.setZorder(n)):l<a.length-1&&e>0&&(r=a[l+1].zorder(),s=t.zorder(),a[l+1].setZorder(s),t.setZorder(r)),this.invalidateSourcesCache()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.dumpPriceScale=function(t){var e,i,o,n=t.dataSources(),s=[];for(e=0;e<n.length;e++)if(i=n[e].priceAxisViews(this,t))for(o=0;o<i.length;o++)s.push(i[o].dump());return s},n.prototype.dumpViews=function(){var t,e,i,o,n,s={};for(s.paneViews={},t=this.orderedSources(),e=0;e<t.length;e++)if(i=t[e],s.paneViews[e]=[],o=i.paneViews())for(n=0;n<o.size();n++)s.paneViews[e].push(o.item(e).dump());return s.leftAxis=this.dumpPriceScale(this.m_leftPriceScale),s.rightAxis=this.dumpPriceScale(this.m_rightPriceScale),s},n.prototype.clearSeries=function(){
for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this.m_dataSources.splice(t,1)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(t){return(!t.properties().linkedToSeries||!t.properties().linkedToSeries.value())&&(TradingView.isInherited(t.constructor,a)&&t.showInObjectTree()&&!t.isNoScale())}).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(t){return!(!this.isOverlay(t)&&TradingView.isInherited(t.constructor,a))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new s(this,this._model.timeScale())),this._executionsPositionController},n.prototype.isLast=function(){var t=this._model.panes();return t[t.length-1]===this},n.prototype.setMaximized=function(t){this._maximized=t},n.prototype.isMaximized=function(){return this._maximized},n.prototype.isMainPane=function(){var t=this._model.mainSeries(),e=!1;return this.m_dataSources.forEach(function(i){e||(e=i===t)}),this._isMainPane=e,e},n.prototype.properties=function(){return this._properties},t.exports=n}).call(e,i(24),i(15))},function(t,e,i){(function(e,o){"use strict";function n(t,e){if(this.m_base=t,this.m_integralDividers=e,this.m_fractionalDividers=[],l.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function s(t,e,i){this.m_marks=[],this.m_base=e,this.m_priceScale=t,this._formatter=i,i&&(this._cache=new h(function(t){return i.format(t)})),this._currentFormatBase=0}function r(t){for(var e=1;t*e!==Math.round(t*e);)e*=10;return e}function a(t,i){function n(){var t,e,i=r.m_dataSources;for(t=0;t<i.length;t++)e=i[t],e.priceScaleChanged&&e.priceScaleChanged.fire(r)}this._properties=t,this._scalesProperties=i,this.m_height=0,this.m_priceRange=null,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new e,this.m_markBuilder=new s(this,100,new u(100)),this._properties.percentage.listeners().subscribe(this,a.prototype.updateFormatter);var r=this;this._properties.log.listeners().subscribe(null,function(t){var e,i,n;r.m_priceRange&&(e=r.m_priceRange,t.value()?r.m_priceRange=new o(r._toLog(e.minValue()),r._toLog(e.maxValue())):(i=r._fromLog(e.minValue()),n=r._fromLog(e.maxValue()),isFinite(i)&&isFinite(n)?r.m_priceRange=new o(i,n):r.properties().autoScale.setValue(!0)))}),this._properties.percentage.listeners().subscribe(null,function(){
r._properties.autoScale.setValue(!0)}),this._properties.percentage.listeners().subscribe(null,function(){var t,e,i;r._properties.autoScaleDisabled.setValue(r._properties.percentage.value()),t=r.priceRange(),!r.mainSource()||r.mainSource().model().timeScale().isEmpty()||r.mainSource().data().isEmpty()||r.mainSource()instanceof p&&!r.mainSource().properties().lockScale.value()||!t||(e=r.mainSource().model().timeScale().visibleBars(),i=r.mainSource().data().search(e.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT],null!=t&&void 0!==i&&(r._properties.percentage.value()?r.setPriceRange(t.convertToPercents(i)):r.setPriceRange(t.convertFromPercents(i))))}),this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._properties.percentage.listeners().subscribe(null,n),this._properties.log.listeners().subscribe(null,n),this._properties.listeners().subscribe(null,function(){r.mainSource()&&r.mainSource().model()&&r.mainSource().model().fullUpdate()})}var l=i(2),h=i(305),c=i(1).LineDataSource,d=i(48).PriceDataSource,p=i(42),u=i(27).PriceFormatter,_=i(70).PercentageFormatter;n.prototype.TICK_SPAN_EPSILON=1e-9,n.prototype.tickSpan=function(t,e,i){var o,n=0===this.m_base?0:1/this.m_base,s=this.TICK_SPAN_EPSILON,r=Math.pow(10,Math.max(0,Math.ceil(l.log10(t-e)))),a=0;for(a=0,o=this.m_integralDividers[0];r>n+s&&l.greaterOrEqual(r,n,s)&&l.greaterOrEqual(r,i*o,s)&&l.greaterOrEqual(r,1,s);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])r/=o;if(r<=n+s&&(r=n),r=Math.max(1,r),this.m_fractionalDividers.length>0&&l.equal(r,1,s))for(a=0,o=this.m_fractionalDividers[0];r>n+s&&l.greaterOrEqual(r,i*o,s);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])r/=o;return r},s.prototype.TICK_DENSITY=2.5,s.prototype.base=function(){return this.m_base},s.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t},s.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},s.prototype.tickSpan=function(t,e){var i,o,s,r,a,h,c;if(t<e)throw new RangeError("high < low");return i=this.m_priceScale.height(),o=this.tickMarkHeight(),s=(t-e)*o/i,r=new n(this.m_base,[2,2.5,2]),a=new n(this.m_base,[2,2,2.5]),h=new n(this.m_base,[2.5,2,2]),c=[],c.push(r.tickSpan(t,e,s)),c.push(a.tickSpan(t,e,s)),c.push(h.tickSpan(t,e,s)),l.min(c)},s.prototype.tickMarkHeight=function(){return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},s.prototype.rebuildTickMarks=function(){var t,e,i,o,n,s,a,l,c,d,p,_,f;if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())return void(this.m_marks=[]);if(t=this.m_priceScale.height(),e=this.m_priceScale.coordinateToPrice(t-1),i=this.m_priceScale.coordinateToPrice(0),o=i>=e?1:-1,n=Math.max(i,e),s=Math.min(i,e),i=n,e=s,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(c=r(a),this._cache&&this._currentFormatBase===c||(d=new u(c),this._cache=new h(function(t){return d.format(t)}))),p=null,_=i-l;_>e;_-=a)f=this.m_priceScale.priceToCoordinate(_),
r._properties.autoScale.setValue(!0)}),this._properties.percentage.listeners().subscribe(null,function(){var t,e,i;r._properties.autoScaleDisabled.setValue(r._properties.percentage.value()),t=r.priceRange(),!r.mainSource()||r.mainSource().model().timeScale().isEmpty()||r.mainSource().data().isEmpty()||r.mainSource()instanceof p&&!r.mainSource().properties().lockScale.value()||!t||(e=r.mainSource().model().timeScale().visibleBars(),i=r.mainSource().data().search(e.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT],null!=t&&void 0!==i&&(r._properties.percentage.value()?r.setPriceRange(t.convertToPercents(i)):r.setPriceRange(t.convertFromPercents(i))))}),this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._properties.percentage.listeners().subscribe(null,n),this._properties.log.listeners().subscribe(null,n),this._properties.listeners().subscribe(null,function(){r.mainSource()&&r.mainSource().model()&&r.mainSource().model().fullUpdate()})}var l=i(2),h=i(305),c=i(1).LineDataSource,d=i(48).PriceDataSource,p=i(43),u=i(27).PriceFormatter,_=i(70).PercentageFormatter;n.prototype.TICK_SPAN_EPSILON=1e-9,n.prototype.tickSpan=function(t,e,i){var o,n=0===this.m_base?0:1/this.m_base,s=this.TICK_SPAN_EPSILON,r=Math.pow(10,Math.max(0,Math.ceil(l.log10(t-e)))),a=0;for(a=0,o=this.m_integralDividers[0];r>n+s&&l.greaterOrEqual(r,n,s)&&l.greaterOrEqual(r,i*o,s)&&l.greaterOrEqual(r,1,s);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])r/=o;if(r<=n+s&&(r=n),r=Math.max(1,r),this.m_fractionalDividers.length>0&&l.equal(r,1,s))for(a=0,o=this.m_fractionalDividers[0];r>n+s&&l.greaterOrEqual(r,i*o,s);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])r/=o;return r},s.prototype.TICK_DENSITY=2.5,s.prototype.base=function(){return this.m_base},s.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t},s.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},s.prototype.tickSpan=function(t,e){var i,o,s,r,a,h,c;if(t<e)throw new RangeError("high < low");return i=this.m_priceScale.height(),o=this.tickMarkHeight(),s=(t-e)*o/i,r=new n(this.m_base,[2,2.5,2]),a=new n(this.m_base,[2,2,2.5]),h=new n(this.m_base,[2.5,2,2]),c=[],c.push(r.tickSpan(t,e,s)),c.push(a.tickSpan(t,e,s)),c.push(h.tickSpan(t,e,s)),l.min(c)},s.prototype.tickMarkHeight=function(){return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},s.prototype.rebuildTickMarks=function(){var t,e,i,o,n,s,a,l,c,d,p,_,f;if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())return void(this.m_marks=[]);if(t=this.m_priceScale.height(),e=this.m_priceScale.coordinateToPrice(t-1),i=this.m_priceScale.coordinateToPrice(0),o=i>=e?1:-1,n=Math.max(i,e),s=Math.min(i,e),i=n,e=s,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(c=r(a),this._cache&&this._currentFormatBase===c||(d=new u(c),this._cache=new h(function(t){return d.format(t)}))),p=null,_=i-l;_>e;_-=a)f=this.m_priceScale.priceToCoordinate(_),
null!==p&&Math.abs(f-p)<this.tickMarkHeight()||(this.m_marks.push({coord:f,label:this._cache.format(_)}),p=f,this.m_priceScale.isLog()&&(a=this.tickSpan(_*o,e)))},s.prototype.marks=function(){return this.m_marks},a.prototype.isLog=function(){return this._properties.log.value()},a.prototype.isPercent=function(){return this._properties.percentage.value()},a.prototype.properties=function(){return this._properties},a.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},a.prototype.height=function(){return this.m_height},a.prototype.setHeight=function(t){var e=this.m_height;this.m_height=t,this._internalHeightCache=void 0,this._marksCache=null,e!==t&&this.mainSource()instanceof p&&this.mainSource().isLockScale()&&this.mainSource().model().timeScale().recalcLockedScale()},a.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)},a.prototype.setTopMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_topMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},a.prototype.setBottomMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_bottomMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var t=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=t,t},a.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},a.prototype.setPriceRange=function(t){if(!t instanceof o)throw new TypeError("incorrect price range");this.m_priceRange&&this.m_priceRange.equals(t)||(this.m_priceRange=t,this._marksCache=null)},a.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},a.prototype.invertedCoordinate=function(t){return this.height()-1-t},a._logicalOffset=4,a._coordOffset=1e-4,a.prototype.log10=function(t){return Math.log(t)/Math.log(10)},a.prototype._toLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=this.log10(i+a._coordOffset)+a._logicalOffset,t<0?-e:e)},a.prototype.priceToLogical=function(t){return this.isLog()&&t?this._toLog(t):t},a.prototype._fromLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=Math.pow(10,i-a._logicalOffset)-a._coordOffset,t<0?-e:e)},a.prototype.logicalToPrice=function(t){return this.isLog()?this._fromLog(t):t},a.prototype.priceToCoordinate=function(t,e){var i,o;return this.makeSureItIsValid(),this.isEmpty()?0:(t=this.priceToLogical(t),i=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(t-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(i),e?o:Math.round(o))},a.prototype.pricesToCoordinates=function(t){this.pricesToCoordinatesEx(t,function(t){return t.y},function(t,e){
t.y=e})},a.prototype.pricesToCoordinatesEx=function(t,e,i){var o,n,s,r,a,l,h,c,d;if(this.makeSureItIsValid(),o=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),s=this.priceRange().maxValue(),r=this.internalHeight()-1,a=r/(s-n),this.isLog())for(l=0;l<t.length;l++)h=e(t[l]),i(t[l],this.priceToLogical(h));for(l=0;l<t.length;l++)h=e(t[l]),TradingView.isNaN(h)||void 0===h||null===h||(c=o+a*(h-n),d=this.m_height-1-c,i(t[l],Math.round(d)))},a.prototype.pointsArrayToCoordinates=function(t){var e,i,o,n,s,r,a,l,h;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,s=n/(o-i),this.isLog())for(r=0;r<t.length;r++)t[r].y=this.priceToLogical(t[r].y);for(r=0;r<t.length;r++)a=t[r].y,TradingView.isNaN(a)||void 0===a||null===a||(l=e+s*(a-i),h=this.m_height-1-l,t[r].y=Math.round(h))},a.prototype.pricesArrayToCoordinates=function(t){var e,i,o,n,s,r,a,l,h;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,s=n/(o-i),this.isLog())for(r=0;r<t.length;r++)t[r]=this.priceToLogical(t[r]);for(r=0;r<t.length;r++)void 0!==(a=t[r])&&null!==a&&(l=e+s*(a-i),h=this.m_height-1-l,t[r]=Math.round(h))},a.prototype.barPricesToCoordinates=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(this.makeSureItIsValid(),e=t,i=this.bottomMargin()*this.height(),o=this.priceRange().minValue(),n=this.priceRange().maxValue(),s=this.internalHeight()-1,r=s/(n-o),this.isLog())for(a=0;a<e.length;a++)e[a]&&(e[a].open=this.priceToLogical(e[a].open),e[a].high=this.priceToLogical(e[a].high),e[a].low=this.priceToLogical(e[a].low),e[a].close=this.priceToLogical(e[a].close),e[a].additionalPrice&&(e[a].additionalPrice=this.priceToLogical(e[a].additionalPrice)));for(a=0;a<e.length;a++)(l=e[a])&&(h=l.open,c=i+r*(h-o),d=this.m_height-1-c,l.open=Math.round(d),h=l.high,c=i+r*(h-o),d=this.m_height-1-c,l.high=Math.round(d),h=l.low,c=i+r*(h-o),d=this.m_height-1-c,l.low=Math.round(d),h=l.close,c=i+r*(h-o),d=this.m_height-1-c,l.close=Math.round(d),l.additionalPrice&&(h=l.additionalPrice,c=i+r*(h-o),d=this.m_height-1-c,l.additionalPrice=Math.round(d)))},a.prototype.coordinateToPrice=function(t){var e,i;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.invertedCoordinate(t),i=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((e-this.bottomMargin()*this.height())/(this.internalHeight()-1)),this.logicalToPrice(i))},a.prototype.isAutoScale=function(){return this._properties.autoScale.value()&&!(this.mainSource()instanceof p&&this.mainSource().isLockScale())},a.prototype.isPercentage=function(){return this._properties.percentage.value()},a.prototype.dataSources=function(){return this.m_dataSources},a.prototype.orderedSources=function(){var t,e,o,n;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0;e<this.m_dataSources.length;e++)o=this.m_dataSources[e],null==o.zorder()&&o.setZorder(e+1),t.push(o);return n=i(209),
t=n.sortSources(t),this._cachedOrderedSoruces=t,this._cachedOrderedSoruces},a.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null},a.prototype.hasSeries=function(){return this._hasSeries},a.prototype.addDataSource=function(t,e){if(e||-1===this.m_dataSources.indexOf(t)){TradingView.isInherited(t.constructor,p)&&(this._hasSeries=!0);var i=this;t.properties().visible.listeners().subscribe(null,function(){i._sourcesForAutoscale=null}),this.m_dataSources.push(t),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.initScaleProperties(),this.invalidateSourcesCache()}},a.prototype.initScaleProperties=function(){var t=this.mainSource()instanceof p&&this.mainSource().properties().lockScale.value();t&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1)),this.properties().percentageDisabled.setValue(t),this.properties().logDisabled.setValue(t),this.properties().autoScaleDisabled.setValue(this.properties().percentage.value()),this.properties().percentage.value()&&this.properties().log.setValue(!1)},a.prototype.removeDataSource=function(t){var e=this.m_dataSources.indexOf(t);if(-1===e)throw Error("source is not attached to scale");this.m_dataSources.splice(e,1),TradingView.isInherited(t.constructor,p)&&(this._hasSeries=!1),this.mainSource()||this.setAutoScale(!0),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache()},a.prototype.setAutoScale=function(t){this._properties.autoScale.setValue(t)},a.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint},a.prototype.startScale=function(t){this.isPercentage()||null===this.m_scaleStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=this.m_height-t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.marks=function(){return this._marksCache?this._marksCache:(this.m_markBuilder.rebuildTickMarks(),this._marksCache=this.m_markBuilder.marks(),this.onMarksChanged.fire(),this._marksCache)},a.prototype.scaleTo=function(t){var e,i;this.isPercentage()||(this._marksCache=null,null!==this.m_scaleStartPoint&&(this.setAutoScale(!1),e=this.m_priceRange.clone(),t=this.m_height-t,t<0&&(t=0),i=(this.m_scaleStartPoint+.2*(this.m_height-1))/(t+.2*(this.m_height-1)),i=Math.max(i,.1),this.m_priceRange=this.m_priceRangeSnapshot.clone(),this.m_priceRange.scaleAroundCenter(i),this.recalcLockedScale(e)))},a.prototype.recalcLockedScale=function(t){var e,i,n,s;if(this.mainSource()instanceof p&&this.mainSource().properties().lockScale.value()){if(e=this.mainSource().model().timeScale(),i=this.mainSource().data().boxSize,(void 0===i||isNaN(i))&&this.mainSource().fixBoxSize(),void 0===i||isNaN(i))return;this.properties().percentage.value()&&(n=this.mainSource().data().search(this.mainSource().getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],
i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),s=this.internalHeight()/this.priceRange().length()*i,s<.5||s>50?this.m_priceRange=t:(e.setBarSpacing(s),e._correctOffset()),this.mainSource().model().mainSeries().requestMoreData()}},a.prototype.endScale=function(){this.isPercentage()||null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.startScroll=function(t){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.scrollTo=function(t){var e,i,o;this._marksCache=null,this.isAutoScale()||null!==this.m_scrollStartPoint&&(e=this.priceRange().length()/(this.height()-1),i=t-this.m_scrollStartPoint,o=i*e,this.m_priceRange=this.m_priceRangeSnapshot.clone(),this.m_priceRange.shift(o))},a.prototype.endScroll=function(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.state=function(){var t={};return t.m_priceRange=this.priceRange()?this.priceRange().serialize():null,t.m_isAutoScale=this.isAutoScale(),t.m_isPercentage=this._properties.percentage.value(),t.m_isLog=this._properties.log.value(),t.m_height=this.m_height,t.m_topMargin=this.m_topMargin,t.m_bottomMargin=this.m_bottomMargin,t},a.prototype.restoreState=function(t){var e=t.m_priceRange;if(void 0===e)throw new TypeError("invalid state");if(void 0===t.m_isAutoScale)throw new TypeError("invalid state");void 0!==t.m_isPercentage&&this._properties.percentage.setValue(t.m_isPercentage),void 0!==t.m_isLog&&this._properties.log.setValue(t.m_isLog),this.m_priceRange=e?new o(e):null,void 0!==t.m_height&&(this.m_height=Math.max(0,t.m_height)),this.setAutoScale(t.m_isAutoScale),void 0!==t.m_topMargin&&(this.m_topMargin=t.m_topMargin),void 0!==t.m_bottomMargin&&(this.m_bottomMargin=t.m_bottomMargin),this._mainSource=void 0,this._scaleSeriesOnly=!1},a.prototype.mainSource=function(){var t,e;if(void 0!==this._mainSource)return this._mainSource;for(t=void 0,e=0;e<this.m_dataSources.length;e++){if(TradingView.isInherited(this.m_dataSources[e].constructor,p)){t=this.m_dataSources[e];break}!t&&TradingView.isInherited(this.m_dataSources[e].constructor,d)&&(t=this.m_dataSources[e])}return this._mainSource=t,this._mainSource||null},a.prototype.formatter=function(){return this._formatter||this.updateFormatter(),this._formatter},a.prototype.updateFormatter=function(){var t,e;this._marksCache=null,t=this.mainSource(),e=100,t&&(e=t.base()),this._formatter=null,this.properties().percentage.value()?this._formatter=new _:this._formatter=t?t.formatter():new u(100,1),this.m_markBuilder=new s(this,e,this._formatter),this.m_markBuilder.rebuildTickMarks()},a.prototype._recalculateSourcesForAutoscale=function(){var t,e;this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.scaleSeriesOnly.value()),t=this._scaleSeriesOnly&&this._hasSeries,e=function(e){
return!!(e.properties().visible.value()||e instanceof p)&&(t?TradingView.isInherited(e.constructor,p):TradingView.isInherited(e.constructor,d))},this._sourcesForAutoscale=this.m_dataSources.filter(e)},a.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},a.prototype.recalculatePriceRange=function(t){this._invalidatedForRange={visibleBars:t,isValid:!1}},a.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},a.prototype.recalculatePriceRangeImpl=function(){var t,e,i,n,s,r,a,l,h,c,d=this._invalidatedForRange.visibleBars;if(d){for(t=null,e=this.sourcesForAutoscale(),i=0,n=0,s=0;s<e.length;s++)r=e[s],r.properties().visible.value()&&(a=d.firstBar(),l=d.lastBar(),h=r.priceRange(a,l),null===t&&h?t=h:h&&(t=t.merge(h)),r.margins&&(c=r.margins(),i=Math.max(c[0],i),n=Math.max(c[1],n)));(Math.abs(n-this._studyBottomMargin)>.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=n,this._studyTopMargin=i,this._marksCache=null,this._internalHeightCache=null),t?(t.minValue()===t.maxValue()&&(t=new o(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new o(-.5,.5)),this._invalidatedForRange.isValid=!0}},a.prototype.sourcesToUpdateViews=function(){var t,e;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],TradingView.isInherited(e.constructor,c)&&!e.isActualSymbol()||this._sourcesToUpdateViews.push(e);return this._sourcesToUpdateViews},a.prototype.updatePaneViews=function(){var t,e=this.sourcesToUpdateViews();for(t=0;t<e.length;t++)e[t].updateAllViews()},a.prototype.priceRangeInPrice=function(){var t,e,i,o,n,s;return this.isEmpty()?null:this.isPercent()?(t=this.mainSource().model().timeScale().visibleBars(),e=this.mainSource().data().search(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT],i=this.priceRange().convertFromPercents(e),{from:i.minValue(),to:i.maxValue()}):(o=this.height(),n=this.coordinateToPrice(o-1),s=this.coordinateToPrice(0),{from:n,to:s})},t.exports=a}).call(e,i(15),i(107))},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i)}function s(t,e,i){o.call(this,t,e,i)}function r(t,e,i){o.call(this,t,e,i)}var a=i(104);inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),e?[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT]]:null)},inherit(n,o),n.prototype._mtpStudyId=function(){return"mtp_ew_main"},inherit(s,o),s.prototype._mtpStudyId=function(){return"mtp_ew_major"},inherit(r,o),r.prototype._mtpStudyId=function(){
return"mtp_ew_minor"},e.LineStudyMtpElliotWaveMinor=r,e.LineStudyMtpElliotWaveMajor=s,e.LineStudyMtpElliotWaveMain=n,e.LineStudyMtpElliotWave=o},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(36),s=n.parseRgb,r=n.rgbToBlackWhiteString;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return r(s(this._background))},o.prototype.coordinate=function(){return this._coordinate},t.exports=o},function(t,e){"use strict";function i(t){this._data=t}i.prototype.draw=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g;!1!==this._data.visible&&(t.font=e.font,i=e.paddingHorizontal,(o=e.widthCache.measureText(t,this._data.text))<=0||(n=o+2*i,s=Math.floor(this._data.coordinate-n/2)+.5,r=s,a=r+n,l=a,h=Math.round(this._data.coordinate+1),c=h,d=.5,p=d+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,u=p,_=d,f=_,m=f+e.borderSize+e.tickLength,g=p-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(s,d),t.lineTo(r,p),t.lineTo(a,u),t.lineTo(l,_),t.fill(),t.beginPath(),t.moveTo(h,f),t.lineTo(c,m),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,s+i,g)))},t.exports=i},function(t,e,i){"use strict";var o=i(216).TVLocalStorage;i(284),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(t){o.setItem(this.force_prefix+t,"true")},disableFeature:function(t){o.removeItem(this.force_prefix+t)}},TradingView.isFeatureEnabled=function(t){function e(e){return o.setItem(n+e,Math.random()<=t[e]),o.getItem(n+e)}function i(t){return-1===["black_friday","black_friday_popup","ios_app_info","symbol_search_server_highlight","address-autocomplete-google-key"].indexOf(t)&&-1===t.indexOf("-maintenance")}var n="featuretoggle.";return function(s){var r,a;return!(!r&&"local"!==window.environment||!i(s))||(!t[s]||-1!==t[s])&&(!!("true"===o.getItem(TradingView.FeatureToggle.force_prefix+s)||window.is_authenticated&&"undefined"!=typeof user&&user&&user.settings&&user.settings[TradingView.FeatureToggle.force_prefix+s])||!!t[s]&&(1===t[s]||(a=o.getItem(n+s),void 0===a||null===a?e(s):"true"===a)))}}(window.featureToggleState||{}),e.FeatureToggle=TradingView.FeatureToggle,e.isFeatureEnabled=TradingView.isFeatureEnabled},function(t,e,i){"use strict";function o(){}var n=i(43).Interval,s=i(72);o.isAvailable=function(t){var e,i=s.supportedResolutions.value(),o=!1;return o=void 0===i||-1!==i.indexOf(t),e=s.intraday.value(),e?o:n.isDWM(t)&&o},t.exports=o},function(t,e){"use strict";var i,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var t,e
return"mtp_ew_minor"},e.LineStudyMtpElliotWaveMinor=r,e.LineStudyMtpElliotWaveMajor=s,e.LineStudyMtpElliotWaveMain=n,e.LineStudyMtpElliotWave=o},function(t,e,i){"use strict";function o(){this._text="",this._background="#585858",this._coordinate=0}var n=i(37),s=n.parseRgb,r=n.rgbToBlackWhiteString;o.prototype.text=function(){return this._text},o.prototype.background=function(){return this._background},o.prototype.color=function(){return r(s(this._background))},o.prototype.coordinate=function(){return this._coordinate},t.exports=o},function(t,e){"use strict";function i(t){this._data=t}i.prototype.draw=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g;!1!==this._data.visible&&(t.font=e.font,i=e.paddingHorizontal,(o=e.widthCache.measureText(t,this._data.text))<=0||(n=o+2*i,s=Math.floor(this._data.coordinate-n/2)+.5,r=s,a=r+n,l=a,h=Math.round(this._data.coordinate+1),c=h,d=.5,p=d+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,u=p,_=d,f=_,m=f+e.borderSize+e.tickLength,g=p-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(s,d),t.lineTo(r,p),t.lineTo(a,u),t.lineTo(l,_),t.fill(),t.beginPath(),t.moveTo(h,f),t.lineTo(c,m),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,s+i,g)))},t.exports=i},function(t,e,i){"use strict";var o=i(216).TVLocalStorage;i(284),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(t){o.setItem(this.force_prefix+t,"true")},disableFeature:function(t){o.removeItem(this.force_prefix+t)}},TradingView.isFeatureEnabled=function(t){function e(e){return o.setItem(n+e,Math.random()<=t[e]),o.getItem(n+e)}function i(t){return-1===["black_friday","black_friday_popup","ios_app_info","symbol_search_server_highlight","address-autocomplete-google-key"].indexOf(t)&&-1===t.indexOf("-maintenance")}var n="featuretoggle.";return function(s){var r,a;return!(!r&&"local"!==window.environment||!i(s))||(!t[s]||-1!==t[s])&&(!!("true"===o.getItem(TradingView.FeatureToggle.force_prefix+s)||window.is_authenticated&&"undefined"!=typeof user&&user&&user.settings&&user.settings[TradingView.FeatureToggle.force_prefix+s])||!!t[s]&&(1===t[s]||(a=o.getItem(n+s),void 0===a||null===a?e(s):"true"===a)))}}(window.featureToggleState||{}),e.FeatureToggle=TradingView.FeatureToggle,e.isFeatureEnabled=TradingView.isFeatureEnabled},function(t,e,i){"use strict";function o(){}var n=i(36).Interval,s=i(72);o.isAvailable=function(t){var e,i=s.supportedResolutions.value(),o=!1;return o=void 0===i||-1!==i.indexOf(t),e=s.intraday.value(),e?o:n.isDWM(t)&&o},t.exports=o},function(t,e){"use strict";var i,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var t,e
;if(this.isAvailable)this.length=this.localStorage.length;else{t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(t){return this.isAvailable?this.localStorage.key(t):Object.keys(this.localStorage)[t]},o.prototype.getItem=function(t){return this.isAvailable?this.localStorage.getItem(t):this.localStorage[t]},o.prototype.setItem=function(t,e){this.isAvailable?this.localStorage.setItem(t,e):this.localStorage[t]=e,this._updateLength()},o.prototype.removeItem=function(t){this.isAvailable?this.localStorage.removeItem(t):delete this.localStorage[t],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},i=function(t){this.storage=t},i.prototype.getItem=function(t){return Promise.resolve(this.storage.getItem(t))},i.prototype.setItem=function(t,e){return Promise.resolve(this.storage.setItem(t,e))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new i(window.TVLocalStorage),t.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(17),i(28),e.lineToolsInfo={LineTool5PointsPattern:{icon:i(760),localizedName:$.t("XABCD Pattern")},LineToolABCD:{icon:i(761),localizedName:$.t("ABCD Pattern")},LineToolArc:{icon:i(762),localizedName:$.t("Arc")},LineToolArrow:{icon:i(763),localizedName:$.t("Arrow")},LineToolArrowMarkDown:{icon:i(764),localizedName:$.t("Arrow Mark Down")},LineToolArrowMarkLeft:{icon:i(765),localizedName:$.t("Arrow Mark Left")},LineToolArrowMarkRight:{icon:i(766),localizedName:$.t("Arrow Mark Right")},LineToolArrowMarkUp:{icon:i(767),localizedName:$.t("Arrow Mark Up")},LineToolBalloon:{icon:i(768),localizedName:$.t("Balloon")},LineToolBarsPattern:{icon:i(769),localizedName:$.t("Bars Pattern")},LineToolBezierCubic:{icon:i(770),localizedName:$.t("Double Curve")},LineToolBezierQuadro:{icon:i(771),localizedName:$.t("Curve")},LineToolBrush:{icon:i(772),localizedName:$.t("Brush")},LineToolCallout:{icon:i(773),localizedName:$.t("Callout")},LineToolCircleLines:{icon:i(774),localizedName:$.t("Cyclic Lines")},LineToolCypherPattern:{icon:i(775),localizedName:$.t("Cypher Pattern")},LineToolDateAndPriceRange:{icon:i(776),localizedName:$.t("Date and Price Range")},LineToolDateRange:{icon:i(777),localizedName:$.t("Date Range")},LineToolDisjointAngle:{icon:i(778),localizedName:$.t("Disjoint Angle")},LineToolElliottCorrection:{icon:i(779),localizedName:$.t("Elliott Correction Wave (ABC)")},LineToolElliottDoubleCombo:{icon:i(780),localizedName:$.t("Elliott Double Combo Wave (WXY)")},LineToolElliottImpulse:{icon:i(781),localizedName:$.t("Elliott Impulse Wave (12345)")},LineToolElliottTriangle:{icon:i(782),localizedName:$.t("Elliott Triangle Wave (ABCDE)")},LineToolElliottTripleCombo:{icon:i(783),localizedName:$.t("Elliott Triple Combo Wave (WXYXZ)")},LineToolEllipse:{icon:i(784),localizedName:$.t("Ellipse")},LineToolExtended:{icon:i(785),localizedName:$.t("Extended")},
LineToolFibChannel:{icon:i(786),localizedName:$.t("Fib Channel")},LineToolFibCircles:{icon:i(787),localizedName:$.t("Fib Circles")},LineToolFibRetracement:{icon:i(788),localizedName:$.t("Fib Retracement")},LineToolFibSpeedResistanceArcs:{icon:i(789),localizedName:$.t("Fib Speed Resistance Arcs")},LineToolFibSpeedResistanceFan:{icon:i(790),localizedName:$.t("Fib Speed Resistance Fan")},LineToolFibSpiral:{icon:i(791),localizedName:$.t("Fib Spiral")},LineToolFibTimeZone:{icon:i(792),localizedName:$.t("Fib Time Zone")},LineToolFibWedge:{icon:i(793),localizedName:$.t("Fib Wedge")},LineToolFlagMark:{icon:i(794),localizedName:$.t("Flag Mark")},LineToolFlatBottom:{icon:i(795),localizedName:$.t("Flat Top/Bottom")},LineToolGannComplex:{icon:i(796),localizedName:$.t("Gann Square")},LineToolGannFan:{icon:i(797),localizedName:$.t("Gann Fan")},LineToolGannSquare:{icon:i(798),localizedName:$.t("Gann Box")},LineToolGhostFeed:{icon:i(799),localizedName:$.t("Ghost Feed")},LineToolHeadAndShoulders:{icon:i(800),localizedName:$.t("Head & Shoulders")},LineToolHorzLine:{icon:i(801),localizedName:$.t("Horizontal Line")},LineToolHorzRay:{icon:i(802),localizedName:$.t("Horizontal Ray")},LineToolInsidePitchfork:{icon:i(803),localizedName:$.t("Inside Pitchfork")},LineToolNote:{icon:i(804),localizedName:$.t("Note")},LineToolNoteAbsolute:{icon:i(805),localizedName:$.t("Anchored Note")},LineToolParallelChannel:{icon:i(806),localizedName:$.t("Parallel Channel")},LineToolPitchfan:{icon:i(807),localizedName:$.t("Pitchfan")},LineToolPitchfork:{icon:i(808),localizedName:$.t("Pitchfork")},LineToolPolyline:{icon:i(809),localizedName:$.t("Polyline")},LineToolPrediction:{icon:i(810),localizedName:$.t("Forecast")},LineToolPriceLabel:{icon:i(811),localizedName:$.t("Price Label")},LineToolPriceRange:{icon:i(812),localizedName:$.t("Price Range")},LineToolProjection:{icon:i(813),localizedName:$.t("Projection")},LineToolRay:{icon:i(814),localizedName:$.t("Ray")},LineToolRectangle:{icon:i(815),localizedName:$.t("Rectangle")},LineToolRegressionTrend:{icon:i(816),localizedName:$.t("Regression Trend")},LineToolRiskRewardLong:{icon:i(817),localizedName:$.t("Long Position")},LineToolRiskRewardShort:{icon:i(818),localizedName:$.t("Short Position")},LineToolRotatedRectangle:{icon:i(819),localizedName:$.t("Rotated Rectangle")},LineToolSchiffPitchfork:{icon:i(820),localizedName:$.t("Modified Schiff Pitchfork")},LineToolSchiffPitchfork2:{icon:i(821),localizedName:$.t("Schiff Pitchfork")},LineToolSineLine:{icon:i(822),localizedName:$.t("Sine Line")},LineToolText:{icon:i(823),localizedName:$.t("Text")},LineToolTextAbsolute:{icon:i(824),localizedName:$.t("Anchored Text")},LineToolThreeDrivers:{icon:i(825),localizedName:$.t("Three Drives Pattern")},LineToolTimeCycles:{icon:i(826),localizedName:$.t("Time Cycles")},LineToolTrendAngle:{icon:i(827),localizedName:$.t("Trend Angle")},LineToolTrendBasedFibExtension:{icon:i(828),localizedName:$.t("Trend-Based Fib Extension")},LineToolTrendBasedFibTime:{icon:i(829),localizedName:$.t("Trend-Based Fib Time")},LineToolTrendLine:{
icon:i(830),localizedName:$.t("Trend Line")},LineToolTriangle:{icon:i(831),localizedName:$.t("Triangle")},LineToolTrianglePattern:{icon:i(832),localizedName:$.t("Triangle Pattern")},LineToolVertLine:{icon:i(833),localizedName:$.t("Vertical Line")},SyncDrawing:{icon:i(834),localizedName:$.t("Sync drawings to all charts")},arrow:{icon:i(837),localizedName:$.t("Arrow")},cursor:{icon:i(850),localizedName:$.t("Cross")},dot:{icon:i(851),localizedName:$.t("Dot")},drawginmode:{icon:i(853),localizedName:$.t("Stay in Drawing Mode")},eraser:{icon:i(854),localizedName:$.t("Eraser")},group:{icon:i(858),localizedName:$.t("Show Hidden Tools")},hideAllDrawings:{icon:i(861),localizedName:$.t("Hide All Drawing Tools")},lockAllDrawings:{icon:i(885),localizedName:$.t("Lock All Drawing Tools")},magnet:{icon:i(886),localizedName:$.t("Magnet Mode")},measure:{icon:i(887),localizedName:$.t("Measure (Shift + Click on the chart)")},removeAllDrawingTools:{icon:i(891),localizedName:$.t("Remove All Drawing Tools")},showObjectsTree:{icon:i(894),localizedName:$.t("Show Objects Tree")},zoom:{icon:i(902),localizedName:$.t("Zoom In")},"zoom-out":{icon:i(901),localizedName:$.t("Zoom Out")}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.layouts={s:{title:"1 chart",count:1,sizer:function(t,e,i,o){return{width:e.width-o-o,height:e.height-o-o,top:o,left:o}}}}},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),n=i(27),s=function(t){function e(e,i,o,n){var s=this;return i||(i=1),"forex"!==o&&"cfd"!==o||!n?(s=t.call(this,1)||this,s._isForex=!1):(s=t.call(this,n)||this,s._isForex=!0),s._pipPriceScale=e,s._pipMinMove=i,s._pipMinMove2=n,s}return o.__extends(e,t),e.prototype.format=function(e,i,o){var n=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===n&&(n=NaN),t.prototype.format.call(this,e*this._pipPriceScale/n,i,o)},e}(n.PriceFormatter),e.PipFormatter=s},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(26),n=i(35),s=function(){function t(t){this._numericFormatter=new o.NumericFormatter(t),this._fractionalValues=void 0!==t&&t>0}return t.prototype.format=function(t){if(!n.isNumber(t))return"---";var e="";return t<0&&(e="-",t=-t),t>=1e100?"N/A":((!this._fractionalValues||t>=995)&&(t=Math.round(t)),t<995?e+this._formatNumber(t):t<999995?e+this._formatNumber(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),e+this._formatNumber(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),e+this._formatNumber(t/1e9)+"B"))},t.prototype.parse=function(t){var e,i,o;return"---"===t?{error:"not a number",res:!1,value:NaN}:(e={K:1e3,M:1e6,B:1e9},i=t.slice(-1),e.hasOwnProperty(i)?(o=this._numericFormatter.parse(t.slice(0,-1)),n.isNumber(o)?{res:!0,value:o*e[i]}:{error:"not a number",res:!1,value:NaN}):(o=this._numericFormatter.parse(t),n.isNumber(o)?{res:!0,value:o}:{error:"not a number",res:!1,value:NaN}))},t.prototype._formatNumber=function(t){return this._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/,function(t,e){return e})},t}(),e.VolumeFormatter=s
@@ -333,8 +333,8 @@ o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:f
emit:function(){this.state==fe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),dt.VERSION="2.0.7",dt.defaults={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,preset:[[lt,{enable:!1}],[rt,{enable:!1},["rotate"]],[ht,{direction:Bt}],[st,{direction:Bt},["swipe"]],[ct],[ct,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ve=1,ye=2,pt.prototype={set:function(t){return ft(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ye:ve},recognize:function(t){var e,i,o,n,s=this.session;if(!s.stopped)for(this.touchAction.preventDefaults(t),i=this.recognizers,o=s.curRecognizer,(!o||o&&o.state&fe)&&(o=s.curRecognizer=null),n=0;n<i.length;)e=i[n],s.stopped===ye||o&&e!=o&&!e.canRecognizeWith(o)?e.reset():e.recognize(t),!o&&e.state&(pe|ue|_e)&&(o=s.curRecognizer=e),n++},get:function(t){var e,i;if(t instanceof tt)return t;for(e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(h(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){var e,i;return h(t,"remove",this)?this:(t=this.get(t),t&&(e=this.recognizers,-1!==(i=w(e,t))&&(e.splice(i,1),this.touchAction.update())),this)},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return c(b(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==a){var i=this.handlers;return c(b(t),function(t){e?i[t]&&i[t].splice(w(i[t],e),1):delete i[t]}),this}},emit:function(t,e){var i,o;if(this.options.domEvents&&_t(t,e),(i=this.handlers[t]&&this.handlers[t].slice())&&i.length)for(e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()},o=0;o<i.length;)i[o](e),o++},destroy:function(){this.element&&ut(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ft(dt,{INPUT_START:kt,INPUT_MOVE:It,INPUT_END:At,INPUT_CANCEL:Et,STATE_POSSIBLE:de,STATE_BEGAN:pe,STATE_CHANGED:ue,STATE_ENDED:_e,STATE_RECOGNIZED:fe,STATE_CANCELLED:me,STATE_FAILED:ge,DIRECTION_NONE:Mt,DIRECTION_LEFT:Dt,DIRECTION_RIGHT:Ot,DIRECTION_UP:$t,DIRECTION_DOWN:Vt,DIRECTION_HORIZONTAL:Bt,DIRECTION_VERTICAL:Rt,DIRECTION_ALL:Nt,Manager:pt,Input:L,TouchAction:Z,TouchInput:j,MouseInput:z,PointerEventInput:W,TouchMouseInput:Y,SingleTouchInput:H,Recognizer:tt,AttrRecognizer:nt,Tap:ct,Pan:st,Swipe:ht,Pinch:rt,Rotate:lt,Press:at,on:m,off:g,each:c,merge:gt,extend:mt,assign:ft,inherit:p,bindFn:u,prefixed:C}),be=a!==n?n:"undefined"!=typeof self?self:{},be.Hammer=dt,(o=function(){return dt}.call(e,i,e,t))!==a&&(t.exports=o)}(window,document)},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o
;Object.defineProperty(e,"__esModule",{value:!0}),o=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.KeyboardListener=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keydown";i(this,t),this._event=e}return o(t,[{key:"regHandlers",value:function(t){this._handlers=t}},{key:"watchOn",value:function(t){this._listener=this._regListener(),this._watchingEl=t,t.addEventListener(this._event,this._listener)}},{key:"stopWatching",value:function(){this._watchingEl.removeEventListener(this._event,this._listener)}},{key:"_regListener",value:function(){var t=this;return function(e){var i=e.which,o=t._getHandler(i);e.stopPropagation(),o(e)}}},{key:"_getHandler",value:function(t){var e=this._handlers[t],i=function(){},o=function(t){t.preventDefault(),e(t)};return e?o:i}}]),t}()},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SELECT:"select",AFTER_CLOSE_MENU:"afterCloseMenu",BEFORE_OPEN_MENU:"beforeOpenMenu"};e.events=i},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SELECT:"select"};e.events=i},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddCompareDialog=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(534),r=i(532),a=i(263),i(497),l=null,e.AddCompareDialog=function(){function t(e){o(this,t),this._chartWidgetCollection=e,this._$symbolSearchPopup=null,this._dialog=null,this._compareTab=new s.CompareTab(this._chartWidgetCollection,this),this._addSymbolTab=new r.AddSymbolTab(this._chartWidgetCollection,this)}return n(t,[{key:"show",value:function(){var t,e=this,i=[];return i.push({name:$.t("Compare"),page:this._compareTab.$tab.addClass("tv-compare-dialog__tab-page")}),i.push({name:$.t("Add Symbol"),page:this._addSymbolTab.$tab.addClass("tv-compare-dialog__tab-page")}),t=(0,a.createTabbedDialog)({tabs:i,width:400,tabStateSaveKey:"CompareAddDialog.tab",destroyOnClose:!0,withScroll:!1,addClass:"tv-compare-dialog",tabsScrollBoxAddClass:"tv-compare-dialog__scroll-box",tabAddClass:"tv-compare-dialog__tab",isClickOutFn:function(t){if(e._compareTab.isClickOnTab(t)||e._addSymbolTab.isClickOnTab(t))return!1}}),l&&l.close(),this._dialog=t.dialog,this._dialog.open(),l=this._dialog,this._dialog}},{key:"getZIndex",value:function(){return this._dialog.zIndex}}]),t}()},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){
if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolCheckbox=void 0,a=i(187),l=o(a),e.AddSymbolCheckbox=function(t){function e(t){n(this,e),t.checked=TVSettings.getBool("showAddSymbolDialog.checkboxState",!0);var i=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.$checkbox.change(function(){setTimeout(function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",i.checked)})}),i}return r(e,t),e}(l.default)},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){var i,o,n,s,h,u,_,f,m,g,v,y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(y=$.extend({},{title:$.t("Confirm Inputs"),callback:function(t){}},y),i=null,o=(0,r.createDialog)({title:y.title,contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"></div>',width:d,closeOnClickAtOtherDialogs:!0,destroyOnClose:!0,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',isClickOutFn:function(t){var e=i.symbolSearchPopup();if(e)return e[0]!==t.target&&!e[0].contains(t.target)&&void 0},actions:[{name:"apply",type:"primary",text:$.t("Apply"),key:13}]}),p=o,n=(0,l.merge)({},e.defaults.inputs),s=0;s<e.inputs.length;++s)h=e.inputs[s],h.confirm||delete n[h.id];u=new c.default({inputs:n}),_={metaInfo:function(){return e}},f=o.$content,o.open(),i=new a.StudyInputsPropertyPage(u,t.model(),_,!0,o.zIndex),m=i.widget(),f.append(m),Array.prototype.forEach.call(f.find("select"),function(t){var e=$(t),i="tv-select-container dialog";e.hasClass("tv-select-container-fontsize")&&(i+=" tv-select-container-fontsize"),e.selectbox({speed:100,classHolder:i})}),$('input[type="text"]',f).addClass("tv-text-input inset dialog"),$("input.ticker",f).TVTicker(),o.on("action:apply",function(){(0,y.callback)(u.state()),o.close()}),g=o.$content.innerWidth()-o.$content.width(),v=m.width()+g,v>d&&o.$el.css("max-width",v),f.find("input,select").first().focus()}function s(){return p}var r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.show=n,e.instance=s,r=i(71),a=i(87),l=i(35),h=i(24),c=o(h),i(126),d=450,p=null},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),
o&&t(e,o),e}}(),s=i(40),r=["alive","owner","body","width","height","fullscreen","detachable","visible","availWidth","availHeight"],a=["remove","negotiateWidth","negotiateHeight","requestFullscreen","exitFullscreen","detach","attach"],e.ResizerDetacherState=function(){function t(e){var i,n,a,l,h,c,d,p;o(this,t),this._internals={},this._ownersStack=[],i=this._internals,n=this,a=!0,l=!1,h=void 0;try{for(c=r[Symbol.iterator]();!(a=(d=c.next()).done);a=!0)p=d.value,i[p]=new s,n[p]=i[p].readonly()}catch(t){l=!0,h=t}finally{try{!a&&c.return&&c.return()}finally{if(l)throw h}}e&&this.pushOwner(e)}return n(t,[{key:"bridge",value:function(){return new l(this)}},{key:"pushOwner",value:function(t){var e,i,o,n,s,r,a;if(t.alive.value()){e=!0,i=!1,o=void 0;try{for(n=this._ownersStack[Symbol.iterator]();!(e=(s=n.next()).done);e=!0)r=s.value,this._unsubscribeOwner(r)}catch(t){i=!0,o=t}finally{try{!e&&n.return&&n.return()}finally{if(i)throw o}}a={owner:t},this._ownersStack.push(a),this._subscribeOwner(a)}}},{key:"detachToPopup",value:function(t){var e=i(259).createPopup,o=e(t);return!!o&&(this.pushOwner(o.allocate()),!0)}},{key:"_subscribeOwner",value:function(t){var e,i,o,n,s,a,l,h,c=this,d=t.owner;if(t.deathWatcher||(this._internals.alive.setValue(!0),t.deathWatcher=d.alive.spawn(),t.deathWatcher.subscribe(function(e){e||c._deadHandler(t)})),!t.subscriptions){t.subscriptions=[],e=function(t,e,i){var o,n;return t[i]?(o=t[i].spawn(),n=c._internals[i],o.subscribe(function(t){return n.setValue(t)},{callWithLast:!0}),o):null},this._internals.visible.setValue(!1),i=!0,o=!1,n=void 0;try{for(s=r[Symbol.iterator]();!(i=(a=s.next()).done);i=!0)"alive"!==(l=a.value)&&"owner"!==l&&(h=e(d,this._internals,l),h?t.subscriptions.push(h):this._internals[l].deleteValue())}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}}this._internals.owner.setValue(d)}},{key:"_unsubscribeOwner",value:function(t,e){var i,o,n,s,r,a;if(t.subscriptions){i=!0,o=!1,n=void 0;try{for(s=t.subscriptions[Symbol.iterator]();!(i=(r=s.next()).done);i=!0)a=r.value,a.unsubscribe()}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}t.subscriptions=null}e&&t.deathWatcher&&(t.deathWatcher.unsubscribe(),t.deathWatcher=null)}},{key:"_deadHandler",value:function(t){var e,i,o,n,s,a,l,h=0;if(t&&-1===(h=this._ownersStack.indexOf(t)))throw Error("cannot sanitize owner that is not in stack");for(e=this._ownersStack.length-1;e>=h;e--)this._unsubscribeOwner(this._ownersStack[e],!0);if(this._ownersStack.length=h,h>0)this._subscribeOwner(this._ownersStack[h-1]);else{i=!0,o=!1,n=void 0;try{for(s=r[Symbol.iterator]();!(i=(a=s.next()).done);i=!0)l=a.value,this._internals[l].deleteValue()}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}}}},{key:"destroy",value:function(){}}]),t}(),l=function t(e){var i,n,s,l,h,c,d;o(this,t),i=this,n=!0,s=!1,l=void 0;try{for(h=r[Symbol.iterator]();!(n=(c=h.next()).done);n=!0)"owner"!==(d=c.value)&&(i[d]=e[d])}catch(t){s=!0,l=t}finally{try{!n&&h.return&&h.return()}finally{if(s)throw l}}
a.forEach(function(t){i[t]=function(){var i=e.owner.value();i&&i[t]&&i[t].apply(i,arguments)}})},e.determineSize=function(t,e){var i,o,n,s,r,a,l=0,h=!0,c=!1,d=void 0;try{for(i=e[Symbol.iterator]();!(h=(o=i.next()).done)&&(n=o.value,s=n.min,r=n.max,t<s||r<s||(a=Math.min(t,r),l=Math.max(l,a),t!==l));h=!0);}catch(t){c=!0,d=t}finally{try{!h&&i.return&&i.return()}finally{if(c)throw d}}return l},e.processNegotiation=function(t){var e,i,o,n,s=[],r=[].concat(t);for(e=0;e<r.length;e++)i=r[e],o=void 0,n=void 0,isFinite(+i)?o=n=+i:(o=+i.min,n=+i.max),(o<0||isNaN(o))&&(o=0),isNaN(n)&&(n=1/0),o<=n&&n>0&&s.push({min:o,max:n});return s.sort(function(t,e){return t.min-e.min||t.max-e.max}),s},e.negotiationsAreEqual=function(t,e){if(t.length!==e.length)return!1;for(var i=t.length;i--;){if(t[i].min!==e[i].min)return!1;if(t[i].max!==e[i].max)return!1}}},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.createPopup=e.screenMetrics=e.Root=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(491),s=i(258),r=i(537),a=i(538),l=i(40),h=e.Root=function(){function t(e){o(this,t),this._width=new l,this._height=new l,this._window=e,this._window||(console&&console.warn&&console.warn("using default window"),this._window=window),this._initFullscreen()}return n(t,[{key:"allocate",value:function(t){var e,i,o,n=this;return this.free(),e=this._window.document,i=$("<div>",e).addClass("js-rootresizer__contents").css({position:"relative",width:"100%",height:"100%"}).prependTo(e.body),this._visibilityApi=new a.VisibilityApi(this._window.document),o={alive:new l(!0),body:new l(i),width:new l,height:new l,availWidth:new l,availHeight:new l,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:function(){o.alive.setValue(!1)},attach:function(){o.alive.setValue(!1),n._window.close()},requestFullscreen:function(){n._requestFullscreen()},exitFullscreen:function(){n._exitFullscreen()}},o.alive.subscribe(function(t){t||o!==n._area||n.free()}),this._area=o,this._resizeHandler=function(){var t=o.body.value(),e=t[0].clientWidth,i=t[0].clientHeight;o.availHeight.setValue(i),o.availWidth.setValue(e),o.height.setValue(i),o.width.setValue(e)},this._resizeHandler(),$(this._window).on("resize",this._resizeHandler),new s.ResizerDetacherState(o).bridge()}},{key:"free",value:function(){if(this._resizeHandler&&($(this._window).off("resize",this._resizeHandler),this._resizeHandler=null),this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=null),this._area){var t=this._area;this._area=null,t.alive.setValue(!1),t.body.value().remove()}}},{key:"_requestFullscreen",value:function(){this._fullscreenApi.enter()}},{key:"_exitFullscreen",value:function(){this._fullscreenApi.exit()}},{
o&&t(e,o),e}}(),s=i(41),r=["alive","owner","body","width","height","fullscreen","detachable","visible","availWidth","availHeight"],a=["remove","negotiateWidth","negotiateHeight","requestFullscreen","exitFullscreen","detach","attach"],e.ResizerDetacherState=function(){function t(e){var i,n,a,l,h,c,d,p;o(this,t),this._internals={},this._ownersStack=[],i=this._internals,n=this,a=!0,l=!1,h=void 0;try{for(c=r[Symbol.iterator]();!(a=(d=c.next()).done);a=!0)p=d.value,i[p]=new s,n[p]=i[p].readonly()}catch(t){l=!0,h=t}finally{try{!a&&c.return&&c.return()}finally{if(l)throw h}}e&&this.pushOwner(e)}return n(t,[{key:"bridge",value:function(){return new l(this)}},{key:"pushOwner",value:function(t){var e,i,o,n,s,r,a;if(t.alive.value()){e=!0,i=!1,o=void 0;try{for(n=this._ownersStack[Symbol.iterator]();!(e=(s=n.next()).done);e=!0)r=s.value,this._unsubscribeOwner(r)}catch(t){i=!0,o=t}finally{try{!e&&n.return&&n.return()}finally{if(i)throw o}}a={owner:t},this._ownersStack.push(a),this._subscribeOwner(a)}}},{key:"detachToPopup",value:function(t){var e=i(259).createPopup,o=e(t);return!!o&&(this.pushOwner(o.allocate()),!0)}},{key:"_subscribeOwner",value:function(t){var e,i,o,n,s,a,l,h,c=this,d=t.owner;if(t.deathWatcher||(this._internals.alive.setValue(!0),t.deathWatcher=d.alive.spawn(),t.deathWatcher.subscribe(function(e){e||c._deadHandler(t)})),!t.subscriptions){t.subscriptions=[],e=function(t,e,i){var o,n;return t[i]?(o=t[i].spawn(),n=c._internals[i],o.subscribe(function(t){return n.setValue(t)},{callWithLast:!0}),o):null},this._internals.visible.setValue(!1),i=!0,o=!1,n=void 0;try{for(s=r[Symbol.iterator]();!(i=(a=s.next()).done);i=!0)"alive"!==(l=a.value)&&"owner"!==l&&(h=e(d,this._internals,l),h?t.subscriptions.push(h):this._internals[l].deleteValue())}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}}this._internals.owner.setValue(d)}},{key:"_unsubscribeOwner",value:function(t,e){var i,o,n,s,r,a;if(t.subscriptions){i=!0,o=!1,n=void 0;try{for(s=t.subscriptions[Symbol.iterator]();!(i=(r=s.next()).done);i=!0)a=r.value,a.unsubscribe()}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}t.subscriptions=null}e&&t.deathWatcher&&(t.deathWatcher.unsubscribe(),t.deathWatcher=null)}},{key:"_deadHandler",value:function(t){var e,i,o,n,s,a,l,h=0;if(t&&-1===(h=this._ownersStack.indexOf(t)))throw Error("cannot sanitize owner that is not in stack");for(e=this._ownersStack.length-1;e>=h;e--)this._unsubscribeOwner(this._ownersStack[e],!0);if(this._ownersStack.length=h,h>0)this._subscribeOwner(this._ownersStack[h-1]);else{i=!0,o=!1,n=void 0;try{for(s=r[Symbol.iterator]();!(i=(a=s.next()).done);i=!0)l=a.value,this._internals[l].deleteValue()}catch(t){o=!0,n=t}finally{try{!i&&s.return&&s.return()}finally{if(o)throw n}}}}},{key:"destroy",value:function(){}}]),t}(),l=function t(e){var i,n,s,l,h,c,d;o(this,t),i=this,n=!0,s=!1,l=void 0;try{for(h=r[Symbol.iterator]();!(n=(c=h.next()).done);n=!0)"owner"!==(d=c.value)&&(i[d]=e[d])}catch(t){s=!0,l=t}finally{try{!n&&h.return&&h.return()}finally{if(s)throw l}}
a.forEach(function(t){i[t]=function(){var i=e.owner.value();i&&i[t]&&i[t].apply(i,arguments)}})},e.determineSize=function(t,e){var i,o,n,s,r,a,l=0,h=!0,c=!1,d=void 0;try{for(i=e[Symbol.iterator]();!(h=(o=i.next()).done)&&(n=o.value,s=n.min,r=n.max,t<s||r<s||(a=Math.min(t,r),l=Math.max(l,a),t!==l));h=!0);}catch(t){c=!0,d=t}finally{try{!h&&i.return&&i.return()}finally{if(c)throw d}}return l},e.processNegotiation=function(t){var e,i,o,n,s=[],r=[].concat(t);for(e=0;e<r.length;e++)i=r[e],o=void 0,n=void 0,isFinite(+i)?o=n=+i:(o=+i.min,n=+i.max),(o<0||isNaN(o))&&(o=0),isNaN(n)&&(n=1/0),o<=n&&n>0&&s.push({min:o,max:n});return s.sort(function(t,e){return t.min-e.min||t.max-e.max}),s},e.negotiationsAreEqual=function(t,e){if(t.length!==e.length)return!1;for(var i=t.length;i--;){if(t[i].min!==e[i].min)return!1;if(t[i].max!==e[i].max)return!1}}},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.createPopup=e.screenMetrics=e.Root=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(491),s=i(258),r=i(537),a=i(538),l=i(41),h=e.Root=function(){function t(e){o(this,t),this._width=new l,this._height=new l,this._window=e,this._window||(console&&console.warn&&console.warn("using default window"),this._window=window),this._initFullscreen()}return n(t,[{key:"allocate",value:function(t){var e,i,o,n=this;return this.free(),e=this._window.document,i=$("<div>",e).addClass("js-rootresizer__contents").css({position:"relative",width:"100%",height:"100%"}).prependTo(e.body),this._visibilityApi=new a.VisibilityApi(this._window.document),o={alive:new l(!0),body:new l(i),width:new l,height:new l,availWidth:new l,availHeight:new l,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:function(){o.alive.setValue(!1)},attach:function(){o.alive.setValue(!1),n._window.close()},requestFullscreen:function(){n._requestFullscreen()},exitFullscreen:function(){n._exitFullscreen()}},o.alive.subscribe(function(t){t||o!==n._area||n.free()}),this._area=o,this._resizeHandler=function(){var t=o.body.value(),e=t[0].clientWidth,i=t[0].clientHeight;o.availHeight.setValue(i),o.availWidth.setValue(e),o.height.setValue(i),o.width.setValue(e)},this._resizeHandler(),$(this._window).on("resize",this._resizeHandler),new s.ResizerDetacherState(o).bridge()}},{key:"free",value:function(){if(this._resizeHandler&&($(this._window).off("resize",this._resizeHandler),this._resizeHandler=null),this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=null),this._area){var t=this._area;this._area=null,t.alive.setValue(!1),t.body.value().remove()}}},{key:"_requestFullscreen",value:function(){this._fullscreenApi.enter()}},{key:"_exitFullscreen",value:function(){this._fullscreenApi.exit()}},{
key:"_initFullscreen",value:function(){var t=this,e=this._window.document;this._fullscreenApi=new r.FullscreenApi(e),this._fullscreenApi.isFullscreen.subscribe(function(i){i?(t._$exitFullscreenButton=$("<div>",e).addClass("tv-exit-fullscreen-button").text($.t("Exit Full Screen (ESC)")).on("click",function(e){e.preventDefault(),t._exitFullscreen()}).appendTo(e.body),t._onExitFullscreenEsc=function(e){27===e.keyCode&&(e.preventDefault(),t._exitFullscreen())},$(e).on("keyup",t._onExitFullscreenEsc)):(t._$exitFullscreenButton&&(t._$exitFullscreenButton.remove(),t._$exitFullscreenButton=null),t._onExitFullscreenEsc&&($(e).off("keyup",t._onExitFullscreenEsc),t._onExitFullscreenEsc=null)),t._resizeHandler&&t._resizeHandler()})}}]),t}(),c=e.screenMetrics=function(t){var e,i,o=$(t),n=o.offset(),s={left:+n.left,top:+n.top,width:o.width(),height:o.height()},r=o.prop("ownerDocument");return r&&(e=r.defaultView)?(i=e.innerWidth/$(r.documentElement).width(),isFinite(i)&&(s.left*=i,s.top*=i,s.width*=i,s.height*=i),s.left+=e.screenLeft||e.screenX||0,s.top+=e.screenTop||e.screenY||0,s):s},d=function(t,e){$(t).find("style, link").each(function(t,i){var o,n,s=i.tagName.toLowerCase();if("link"!==s||"stylesheet"===i.getAttribute("rel")){for(o=$("<"+s+">",e),n=0;n<i.attributes.length;n++)o.attr(i.attributes[n].nodeName,i.attributes[n].nodeValue);o.text(i.textContent),o.appendTo(e)}})},e.createPopup=function(){var t,e,i,o,n,s,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l="menubar=no,toolbar=no,location=no,personalbar=no,status=no",u={width:a.width,height:a.height,top:a.top,left:a.left};if(a.useElementMetrics){t=c(a.useElementMetrics);for(e in u)isFinite(u[e])||(u[e]=t[e])}for(i in u)null!=u[i]&&(l+=","+i+"="+u[i]);if(o=void 0,o=null!=a.name?a.name:"_blank",!(n=window.open("",o,l))||n.closed)return null;s=null;try{s=n.document,s.close()}catch(t){return null}return s.open(),s.write('<!DOCTYPE html>\n<html>\n<head>\n\t<meta http-equiv="X-UA-Compatible" content="IE=Edge" />\n</head>\n<body>\n</body>\n</html>'),s.close(),s.body.innerHTML="",null!=a.title&&(s.title=a.title+""),a.useStyles&&d(a.useStyles,s.head),$("<style>",s).text("html, body {min-width: 0 !important; max-width: none !important}").appendTo(s.head),r=new h(n),p(window,n,r),r},p=function(t,e,i){var o=function o(){t&&(t.removeEventListener("unload",o,!1),t=null),e&&(e.removeEventListener("unload",o,!1),e.close(),e=null),i&&(i.free(),i=null)};t.addEventListener("unload",o,!1),e.addEventListener("unload",o,!1)}},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){var i=new Date(t+e),o=Math.round(Math.abs(e)/6e4),n="UTC";return 0!==o&&(n+=e>0?"+":"-",n+=Math.floor(o/60),o%60&&(n+=":"+o%60)),i.getUTCFullYear()+"-"+("0"+(i.getUTCMonth()+1)).slice(-2)+"-"+("0"+i.getUTCDate()).slice(-2)+" "+("0"+i.getUTCHours()).slice(-2)+":"+("0"+i.getUTCMinutes()).slice(-2)+" ("+n+")"}function s(t){return"string"==typeof t&&0!==t.trim().length}function r(t){var e,i,o,n,r;if(!t||0===t.length)return!0
;for(e=0;e<t.length;e++){if(s(t[e])||t[e].id||s(t[e].title))return!1;if(t[e].lines)for(i=t[e].lines,o=i.length,n=0;n<o;n++)if(r=i[n],s(r)||s(r.line))return!1}return!0}function a(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.hasOwnProperty("text")?t.hasOwnProperty("color")&&i?e.append($("<span>",{style:"color: "+t.color}).text(t.text)):e.text(t.text):e.text(t)}function l(t,e){Array.isArray(t)&&2===t.length?$("<dl>").append(a(t[0],$("<dt>")),a(t[1],$("<dd>"),!0)).appendTo(e):t.hasOwnProperty("br")&&t.br?$("<br>").appendTo(e):$("<dl>").append(a(t,$("<dt>"))).appendTo(e)}function h(t,e){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof t)$("<h2>").text(t).appendTo(e);else if(t.hasOwnProperty("lines"))for(i=0;i<t.lines.length;i++)t.lines[i].hasOwnProperty("line")&&(0===i?t.lines[i].line.isEmpty||$("<h2>").text(t.lines[i].line).appendTo(e):l(t.lines[i].line,e));else t.hasOwnProperty("title")&&$("<h2>").text(t.title).appendTo(e),t.hasOwnProperty("actual")&&$("<dl>").append($("<dt>").text($.t("Actual")+": "),$("<dd>").text(t.actual||"—")).appendTo(e),t.hasOwnProperty("forecast")&&$("<dl>").append($("<dt>").text($.t("Forecast")+": "),$("<dd>").text(t.forecast||"—")).appendTo(e),t.hasOwnProperty("previous")&&$("<dl>").append($("<dt>").text($.t("Previous")+": "),$("<dd>").text(t.previous||"—")).appendTo(e),t.hasOwnProperty("timestamp")&&$("<dl>").append($("<dt>").text($.t("Date")+": "),$("<dd>").text(n(t.timestamp,o)||"—")).appendTo(e)}var c,d,p,u;Object.defineProperty(e,"__esModule",{value:!0}),e.Tooltip=void 0,c=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(512),d=-10,p=300,u=200,e.Tooltip=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.isPowerdByFx,n=void 0!==i&&i,s=e.direction,r=void 0===s?"top":s;o(this,t),this._isPowerdByFx=n,this._direction=r,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._$tooltip=$("<div>").addClass("tv-chart-events-source__tooltip").css({position:"absolute",width:"200px","margin-bottom":"top"===this._direction?d:0,opacity:0,"pointer-events":"none"}),this._$tooltipContent=$("<div>").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip),this._isPowerdByFx&&(this._$tooltipPoweredby=$("<div>").addClass("tv-chart-events-source__tooltip__poweredby").appendTo(this._$tooltip),this._$tooltipPoweredby.html(" "+$.t("powered by {0}").format('<img src="images/svg/daily-fx-logo-two-lines.svg" class="tv-chart-events-source__tooltip__poweredby__image">')))}return c(t,[{key:"show",value:function(){
var t,e,i,o,n,s,a,l,c,u,_,f,m,g,v,y,b,w,S,T=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},C=T.items,x=void 0===C?[]:C,P=T.x,L=void 0===P?0:P,k=T.y,I=void 0===k?0:k,A=T.wrapElement,E=void 0===A?null:A,M=T.timeOffset,D=void 0===M?"":M,O=T.leftBorderColor,V=void 0===O?null:O;if(E&&!r(x)){if(t=$(E).width(),e=$(E).height(),i=!1,o=!1,this._tooltipShown||(this._$tooltip.appendTo(E),this._tooltipShown=!0,i=!0,o=!0),L===this._tooltipX&&I===this._tooltipY||(i=!0),i&&(n=Math.max(Math.min(L-100,t-200),0),this._$tooltip.css({left:Math.round(n),bottom:Math.round(e-I+10)})),this._tooltipItems||(o=!0),!o)for(s=x.length;s--;)if(this._tooltipItems[s]!==x[s]){o=!0;break}if(o){if(a=void 0,x.length<=1)a=x;else{for(l={},c=x.length;c--;)u=x[c].importance,null==u&&(u=-1),l[u]||(l[u]=[]),l[u].push(x[c]);if(_=Object.keys(l).sort(function(t,e){return t-e}),_.length<=1)a=l[_[0]];else for(a=[],f=_.length;f--;)for(m=l[_[f]],g=m.length;g--;)a.push(m[g])}for(this._$tooltipContent.empty(),v=a.length;v--;)y=a[v],b="",y.hasOwnProperty("importance")?("string"==typeof y.importance&&("earnings"===y.importance?b="--importance-earnings":"splits"===y.importance?b="--importance-splits":"dividends"===y.importance&&(b="--importance-dividends")),0===y.importance?b="--importance-normal":y.importance>0&&(b="--importance-high")):V||(b="--importance-none"),w="tv-chart-events-source__tooltip__item",b&&(w+=" "+w+b),S=$("<div>").attr("class",w),V&&S.css("border-left-color",V),h(y,S,D),S.appendTo(this._$tooltipContent);this._tooltipItems=x}"bottom"===this._direction&&this._$tooltip.css({bottom:Math.round(e-I-this._$tooltipContent.height()+10)}),this._$tooltip.stop().animate({"margin-bottom":"top"===this._direction?0:d,opacity:1},p)}}},{key:"hide",value:function(){var t=this;this._tooltipShown&&this._$tooltip.stop().animate({"margin-bottom":"top"===this._direction?d:0,opacity:0},u,function(){t._$tooltip.detach(),t._tooltipShown=!1})}},{key:"isOpened",value:function(){return this._tooltipShown}}]),t}()},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownView=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(517),r=i(186),a=i(54),l=o(a),h=i(145),c=i(113),d=o(c),p=e.DropdownView=function(){function t(e){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.$el=e,this.$wrap=o.$wrap||e.find(".tv-dropdown-behavior__button"),this.$body=o.$body||e.find(".tv-dropdown-behavior__body"),this.notCloseWithCtrl=!!o.notCloseWithCtrl&&o.notCloseWithCtrl,this.closeWithEsc=void 0===o.closeWithEsc||o.closeWithEsc,
@@ -342,17 +342,17 @@ this.closeWithEsc&&this.$el.attr("tabIndex",0),(e.data("scroll")||o.scroll)&&(th
value:function(){this.$wrap.addClass("i-disabled"),this.disabled=!0}},{key:"adaptBody",value:function(){function t(){o.height("auto")}function e(t){var e="tv-dropdown-behavior__body--from_top",i="tv-dropdown-behavior__body--from_top-right",n="tv-dropdown-behavior__body--from_bottom",s="tv-dropdown-behavior__body--from_bottom-right",r=void 0,a=void 0;o.hasClass(e)&&"bottom"===t?(r=e,a=n):o.hasClass(i)&&"bottom"===t?(r=i,a=s):o.hasClass(n)&&"top"===t?(r=n,a=e):o.hasClass(s)&&"top"===t&&(r=s,a=i),r!==a&&o.removeClass(r).addClass(a)}var i=15,o=this.$body,n=this.$wrap.get(0).getBoundingClientRect(),s=window.innerHeight,r=this.$inScroll.outerHeight(!0),a=parseFloat(o.css("padding-top")),l=parseFloat(o.css("padding-bottom")),h=n.top+r+i<=s,c=r+i<=n.bottom,d=void 0;h?(d=0-a,t(),e("top")):c?(d=-r+l,t(),e("bottom")):(d=-n.top+i,s<=r&&o.height(s-2*i)),o.css("top",d)}}]),t}(),$.fn.tvDropdown=(0,r.createTvBlockWithInstance)("tv-dropdown",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new p(t,e)})},function(t,e,i){"use strict";function o(t){return"number"!=typeof t&&(t=TradingView.STUDY_COUNT_LIMIT),(0,n.createNoticeDialog)({title:$.t("Warning"),content:$.t("Studies limit exceeded: {0} studies per layout.<br>\nPlease, remove some studies.").format(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.createTooManyStudiesNotice=o;var n=i(138)},function(t,e,i){(function(t){"use strict";function o(e){var i,o,h,c,d,p,u,_,f,m,g;if(e=$.extend({},l,e),i=$(t.render(r,{tabs:e.tabs,customControls:e.customControls,customControlsAddClass:e.customControlsContainerAddClass},{additionalHeaderContent:e.additionalHeaderContent})),o=$(a),h=o,e.contentAddClass&&o.addClass(e.contentAddClass),!1!==e.withScroll&&(o=$('<div class="js-dialog__scroll-wrap tv-dialog__scroll-wrap">').append(h.addClass("tv-dialog__scroll-wrap-inner"))),c=$('<div class="tv-tabbed-dialog">').append(i).append(o),e.customControls&&i.find(".js-custom-controls").append(e.customControls),!0!==e.doNotCreatePages)for(d=0;d<e.tabs.length;++d)h.append($('<div class="tv-tabbed-dialog__tab-page">').append(e.tabs[d].page));return p=e.tabStateSaveKey,u=e.activeTab,_=e.tabsScrollBoxAddClass,f=e.tabAddClass,delete e.tabs,delete e.activeTab,delete e.customControls,delete e.tabStateSaveKey,delete e.customControlsContainerAddClass,delete e.tabsScrollBoxAddClass,delete e.tabAddClass,e.closeButtonAddClass="tv-tabbed-dialog__close",e.contentWrapTemplate=c,m=(0,s.createDialog)(e),g=new n.Tabs(i.find(".tv-tabs").get(0),h.get(0),{addLeftArrowsClass:"tv-tabbed-dialog__tabs-arrow-left",addRightArrowsClass:"tv-tabbed-dialog__tabs-arrow-right",addScrollBoxClass:_,tabClass:f,saveTab:p,activeTab:u}),m.on("afterOpen",function(){g.setActivePage(g.index(),!0,!0)}),{dialog:m,tabs:g}}var n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.createTabbedDialog=o,n=i(754),s=i(71),i(519),
r='<div class="tv-dialog__section tv-dialog__section--title tv-tabbed-dialog__header js-dialog__drag js-close-button-place"><div class="tv-tabs tv-tabbed-dialog__tabs js-dialog__drag">{{#tabs}}<div class="tv-tabs__tab">{{name}}</div>{{/tabs}}</div>{{#customControls}}<div class="js-custom-controls tv-tabbed-dialog__custom-controls {{#customControlsAddClass}}{{customControlsAddClass}}{{/customControlsAddClass}}"></div>{{/customControls}}<div class="tv-tabbed-dialog__bottom-border"></div></div>{{>additionalHeaderContent}}',a='<div class="tv-tabbed-dialog__pages-container"></div>',l={tabs:[]}}).call(e,i(30))},function(t,e){"use strict";function i(t,e){var i;return function(){clearTimeout(i),i=setTimeout(t.bind.apply(t,[this].concat(Array.prototype.slice.call(arguments))),e)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},,,,,,,,,,,,,,function(t,e,i){"use strict";function o(t,e){this.handler=t,this.customId=e,this.requestHook=null}function n(){}var s=i(35).declareClassAsPureInterface;TradingView.WEB_SOCKET_WAS_CONNECTED=!1,n.REBIND_STUDY_STANDALONE_TO_CHILD=1,n.REBIND_STUDY_CHILD_TO_STANDALONE=2,n.prototype.defaultWatchlistSymbols=function(){},n.prototype.availableTimeFrames=function(t,e){},n.prototype.defaultResolutions=function(){},n.prototype.supportedSymbolsTypes=function(){},n.prototype.supportedExchangesList=function(){},n.prototype.futuresRegex=function(){},n.prototype.quoteCreateSession=function(t){},n.prototype.quoteDeleteSession=function(t){},n.prototype.quoteSetFields=function(t,e){},n.prototype.quoteAddSymbols=function(t,e){},n.prototype.quoteRemoveSymbols=function(t,e){},n.prototype.quoteFastSymbols=function(t,e){},n.prototype.depthCreateSession=function(t,e,i){},n.prototype.depthDeleteSession=function(t){},n.prototype.depthSetSymbol=function(t,e){},n.prototype.depthClearSymbol=function(t){},n.prototype.depthSetScale=function(t,e){},n.prototype.chartCreateSession=function(t,e){},n.prototype.chartDeleteSession=function(t){},n.prototype.createSession=function(t,e){},n.prototype.removeSession=function(t){},n.prototype.connected=function(){},n.prototype._getHost=function(t){},n.prototype.connect=function(){},n.prototype.disconnect=function(){},n.prototype.switchTimezone=function(t,e){},n.prototype.resolveSymbol=function(t,e,i,o,n){},n.prototype.createSeries=function(t,e,i,o,n,s,r){},n.prototype.removeSeries=function(t,e,i){},n.prototype.modifySeries=function(t,e,i,o,n,s){},n.prototype.requestMoreData=function(t,e,i,o){},n.prototype.requestMetadata=function(t,e,i){},n.prototype.isCanCreateStudy=function(t,e){},n.prototype.createStudy=function(t,e,i,o,n,s,r){},n.prototype.rebindStudy=function(t,e,i,o,n,s,r,a){},n.prototype.removeStudy=function(t,e,i){},n.prototype.modifyStudy=function(t,e,i,o,n){},n.prototype.createPointset=function(t,e,i,o,n,s,r){},n.prototype.modifyPointset=function(t,e,i,o,n){},n.prototype.removePointset=function(t,e,i){},n.prototype.requestMoreTickmarks=function(t,e,i,o){},n.prototype.requestFirstBarTime=function(t,e,i,o){},
n.prototype._invokeHandler=function(t,e){},n.prototype._sendRequest=function(t,e){},n.prototype._onMessage=function(t){},n.prototype._convertTimescaleResponse=function(t){},n.prototype._dispathNotification=function(t){},n.prototype._invokeNotificationHandler=function(t,e,i){},n.prototype._notifySessions=function(t){},n.prototype.unpack=function(t){},n.prototype.reconnectTimeout=function(t){},n.prototype.searchSymbols=function(t,e,i,o,n,s,r){},n.prototype.serverTimeOffset=function(){},n.prototype._getPort=function(t){},n.prototype.getMarks=function(t,e,i,o,n){},n.prototype.getTimescaleMarks=function(t,e,i,o,n){},s(n,"ChartApiInterface"),t.exports.HandlerInfo=o,t.exports.ChartApiInterface=n},function(t,e,i){"use strict";var o=i(34),n=i(35).parseJSONorNot,s=function(){var t,e,i,s,r={};return r.initialize=function(o,n,r,a){t=o,e=n,i=r,s=a},r.updateUser=function(t){e=t},r.getCharts=function(o,r){return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);"ok"!==i.status&&console.warn("Charts list request failed: "+i.message),e=i.data.map(function(t){return{id:t.id,name:t.name,image_url:t.id,modified_iso:t.timestamp,short_symbol:t.symbol,interval:t.resolution}}),o(e)}).fail(r)},r.removeChart=function(o,r){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Chart delete request failed: "+e.message),r()})},r.saveChart=function(o,r,a,l,h,c,d){var p=h.id.value(),u="{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e));void 0!==p&&(u+="&chart="+encodeURIComponent(p)),$.ajax({url:u,data:{name:o,content:JSON.stringify(l),symbol:r,resolution:a},type:"POST",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return console.warn("Chart save request failed: "+e.message),void d();c(e.id)}).fail(function(){d()})},r.getChartContent=function(o,r,a){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o.id)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);if("ok"!==i.status)return void console.warn("Chart load request failed: "+i.message);e=JSON.parse(i.data.content),e.uid=o.id,r(e)}).fail(function(){a&&a()})},r.loadChart=function(t){r.getChartContent(t,function(t){o.emit("chart_load_requested",t)},function(){console.warn("Error loading chart")})},r.removeStudyTemplate=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Chart delete request failed: "+e.message),r()})},r.getStudyTemplateContent=function(o,r){$.ajax({
url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"GET",crossDomain:!0}).done(function(t){r(n(t).data)})},r.saveStudyTemplate=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"POST",crossDomain:!0,data:{name:o.name,content:o.content}}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Template save request failed: "+e.message),r({error:"ok"===e.status?"":e.status})})},r._templatesCache=null,r.getStudyTemplatesList=function(o){if(r._templatesCache)return void o(r._templatesCache);r._templatesCache=[],$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e,i;if(null!==r._templatesCache){if(e=n(t),"ok"!==e.status)return void console.warn("Templates list request failed: "+e.message);i=e.data.map(function(t){return{is_default:!1,name:t.name}}),r._templatesCache=i,o(i)}})},r.invalidateStudyTemplatesList=function(){r._templatesCache=null},r}();t.exports=s},function(t,e,i){(function(e){"use strict";var o=i(58),n=i(43).Interval,s=i(15),r=function(t,e){this._server=t,this._session=e,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new s,this._lastBarTimes={}};r.prototype.lastBarTime=function(t){return this._lastBarTimes[t]},r.prototype._userTimezone=function(){return this._timezone},r.prototype.setTimezone=function(t){this._timezone="exchange"===t?"exchange":e.get_timezone(t),this._timezoneId=t},r.prototype.timezone=function(){return this._timezoneId},r.prototype.setResolution=function(t){this._isDWM=n.isDWM(t),this._resolution=t},r.prototype.onRequestMetadata=function(t,e){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,t,e]})},r.prototype.onSymbolResolved=function(t,e){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,t,e]})},r.prototype.onSymbolError=function(t,e){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,t,e]})},r.prototype.onStudyError=function(t,e){this._server.receiveLocalResponse({method:"study_error",params:[this._session,t,e]})},r.prototype.onSeriesLoading=function(t,e){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,t,e]})},r.prototype.onSeriesCompleted=function(t,e,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,t,i,e]}),this.seriesCompleted.fire(t)},r.prototype.onSeriesError=function(t,e){this._server.receiveLocalResponse({method:"series_error",params:[this._session,t,e]})},r.prototype.onSeriesClearData=function(t,e){var i={};i[t]={series:[],turnaround:e},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[]}]})},r.prototype.onStudyCompleted=function(t,e){
this._server.receiveLocalResponse({method:"study_completed",params:[this._session,t,e]})},r.prototype.onStudyLoading=function(t,e){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,t,e]})},r.prototype._calcMarksTime=function(t,i,n,s,r){var a,l,h,c,d,p=e.get_timezone(i),u=this;if(this._isDWM)for(d=new o.Session,d.init(p,n),c=0;c<t.length;c++)h=t[c],a=s(h),l=e.utc_to_cal(p,1e3*a),l=d.spec.correctTradingDay(l,p),e.set_hms(l,0,0,0,0),t[c]=r(h,parseInt(l.valueOf()/1e3));else for(c=0;c<t.length;c++)t[c]=r(t[c],u.timeInTimezone(s(t[c]),p))},r.prototype.onTickmarksUpdated=function(t,e,i,o){var s,r,a,l,h,c,d;if(n.isEqual(o,this._resolution)){for(s=e.slice(0),this._calcMarksTime(s,i.timezone,i.session,function(t){return t},function(t,e){return e}),r=[],a=[],h=0;h<s.length;++h)c=s[h],r.push([this._spanByTime(c,l),c,t+h]),a.push(c),l=c;d={method:"tickmark_update",params:[this._session,{index:t,zoffset:0,changes:a,marks:r}]},this._server.receiveLocalResponse(d)}},r.prototype.onTimescaleUpdate=function(t,e,i,o,n,s){var r,a,l,h,c,d,p,u,_=s&&s.slice(0);for(this._lastBarTimes[t]=_?_&&_[_.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,o.timezone,o.session,function(t){return t.value[0]},function(t,e){return t.exTime=e,t}),_&&this._calcMarksTime(_,o.timezone,o.session,function(t){return t},function(t,e){return{markTime:e,time:t}}),r={},r[t]={series:i,turnaround:e},a=[],l=[],c=i.map(function(t){return{markTime:t.exTime,time:t.value[0]}}),_&&(c=c.concat(_)),d=0;d<c.length;++d)p=c[d].markTime,a.push([this._spanByTime(p,h),p,n+d]),l.push(c[d].time),h=p;u={method:"timescale_update",params:[this._session,r,{index:n,zoffset:0,changes:l,marks:a}]},this._server.receiveLocalResponse(u)},r.prototype.onSeriesTimeframeUpdate=function(t,e,i,o,n){var s={method:"series_timeframe",params:[this._session,t,e,i,o,n]};this._server.receiveLocalResponse(s)},r.prototype.onPointsetDataUpdate=function(t,e,i,o){this._onDataUpdate(t,e,i,void 0,o,1)},r.prototype.onDataUpdate=function(t,e,i,o,n){this._onDataUpdate(t,e,i,o,n,0)},r.prototype._onDataUpdate=function(t,e,i,o,n,s){var r,a={},l=o?JSON.stringify({offsets:o}):"";a[t]={s:i,ns:{d:l,indexes:[]},turnaround:e},r={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(r)},r.prototype.onQuotesData=function(t){this._server.receiveLocalResponse({method:"quote_symbol_data",params:t})},r.prototype.onDepthData=function(t){this._server.receiveLocalResponse({method:"dd",params:t})},r.prototype.onDepthUpdate=function(t){this._server.receiveLocalResponse({method:"dpu",params:t})},r.prototype.onProjectionUpdate=function(t,e,i,o){var n,s=i.data,r=s[s.length-1],a={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:r?r[4]:i.price,bars:s.map(function(t,e){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],factor:t[6],additionalPrice:t[6]}})}},l={};l[t]={s:o||[],ns:{d:JSON.stringify(a),indexes:s.map(function(t,e){return i.barsetSize+(t[0]||0)})},turnaround:e},n={method:"data_update",params:[this._session,l]},
this._server.receiveLocalResponse(n)},r.prototype.timeInTimezone=function(t,i){return"exchange"===this._userTimezone()?parseInt(e.utc_to_cal(i,1e3*t).valueOf()/1e3):parseInt(e.utc_to_cal(this._userTimezone(),1e3*t).valueOf()/1e3)},r.prototype._spanByTime=function(t,e){function i(t){return 60*t*60*1e3}function o(t){return 60*t*1e3}function n(t){return 1e3*t}var s,r,a,l=[{divisor:1,span:20},{divisor:n(1),span:19},{divisor:o(5),span:21},{divisor:o(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!e)return 20;if(s=new Date(1e3*e),r=new Date(1e3*t),r.getYear()!==s.getYear())return 70;if(r.getUTCMonth()!==s.getUTCMonth())return 60;if(r.getUTCDate()!==s.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(s/l[a].divisor)!==Math.floor(r/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],t.exports=r}).call(e,i(57))},function(t,e,i){(function(e){"use strict";var o=i(81).PlotType,n=i(25),s=function(){function t(t){e.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+t)}function s(t,e,i,o){t.defaults.inputs[e]=o,t.inputs[i].defval=o}function r(t,e){t.defaults.precision=e}function a(e,i,o,n){var s,r,a=o[1];if("color"===a){if(s=c(e,i),r=o.length>2?parseInt(o[2]):NaN,null==s&&!isNaN(r)&&r>0)return void t("Plot `{1}` of `{0}` does not have color #{2}".format(e.description,o[0],r));0==r||isNaN(r)?(e.defaults.styles[i].color=n,null!=s&&(s.colors[0].color=n)):s.colors[r].color=n}else{if(!e.defaults.styles[i].hasOwnProperty(a))return void t("Plot `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],a));"plottype"===a&&(n=y[n]),e.defaults.styles[i][a]=n}}function l(e,i,o,n){var s=o[1];if(!e.defaults.bands[i].hasOwnProperty(s))return void t("Band `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));"plottype"===s&&(n=y[n]),e.defaults.bands[i][s]=n}function h(e,i,o,n){var s=o[1];if(!e.defaults.filledAreasStyle[i].hasOwnProperty(s))return void t("Area `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));e.defaults.filledAreasStyle[i][s]=n}function c(t,e){for(var i in t.plots)if("colorer"===t.plots[i].type&&t.plots[i].target===e)return t.defaults.palettes[t.plots[i].palette];return null}function d(t){var e,i,o=JSServer.studyLibrary;for(e=0;e<o.length;++e)if(i=o[e].metainfo,i.description.toLowerCase()===t.toLowerCase()||i.shortDescription.toLowerCase()===t.toLowerCase())return i;return null}function p(t,e){for(var i=0;i<t.inputs.length;++i)if(t.inputs[i].name.toLowerCase()===e.toLowerCase())return{id:t.inputs[i].id,index:i};return null}function u(t,e){for(var i in t.styles)if(t.styles[i].title.toLowerCase()===e.toLowerCase())return i;return null}function _(t,e){for(var i in t.filledAreas)if(t.filledAreas[i].title.toLowerCase()===e.toLowerCase())return t.filledAreas[i].id;return null}function f(t,e){if(!t.bands)return null;for(var i in t.bands)if(t.bands[i].name.toLowerCase()===e.toLowerCase())return i;return null}var m,g,v={"volume.transparency":"!transparency",
"upper limit":"UpperLimit","lower limit":"LowerLimit"},y={};if(Object.keys(o).forEach(function(t){y[t.toLowerCase()]=o[t]}),m={},m.setMetainfoProperty=function(e,i,o){var n,c,d,m,g,y,b,w,S,T,C;if(i=v[i]||i,n=i.split("."),c=n[0],0===c.indexOf("!"))return void(e[c.slice(1)]=o);d=c.split(":"),c=d[0],c=v[c]||c,m=null,g=null,y=null,b=null,w="options"===c,S="precision"===c&&e.defaults&&e.defaults.precision,T=2===d.length?d[1]:null,"plot"!==T&&T||(m=u(e,c)),"band"!==T&&T||(g=f(e,c)),"area"!==T&&T||(y=_(e,c)),"input"!==T&&T||(b=p(e,c)),C=!!m+!!g+!!b+!!w+!!y+!!S,0===C?t("Study `{0}` has no plot or input `{1}`".format(e.description,c)):C>1?t("Study `{0}` ambiguous identifier `{1}`".format(e.description,c)):m?a(e,m,n,o):b?s(e,b.id,b.index,o):g?l(e,g,n,o):y?h(e,y,n,o):S?r(e,o):e[n[1]]=o},m.setProperty=function(e,i){var o=e.split(".")[0],n=d(o);if(!n)return void t("Study `{0}` not found".format(o));m.setMetainfoProperty(n,e.substring(o.length+1),i)},m.applyDefaultsToFactoryDefaults=function(t){var e={};t.forEach(function(t){var i=t.split(".")[0],o=d(i);o&&(e[o.id]=o)}),Object.keys(e).forEach(function(t){var i=e[t];n.createDefaultsForStudy(i)})},i(141),"undefined"!=typeof __initialMetainfoOverrides&&__initialMetainfoOverrides)for(g in __initialMetainfoOverrides)m.setProperty(g,__initialMetainfoOverrides[g]);return m}();t.exports=s}).call(e,i(3))},function(t,e,i){"use strict";function o(t,e){this._chartApi=t,this.generateSessionId(),this._sessionDisabled=!1,this._disableStatistics=!!e}var n=i(60);i(12).getLogger("ChartSession");o.prototype.destroy=function(){this._sessionDisabled||this.stopSession()},o.prototype.generateSessionId=function(){this._sessionid="cs_"+n.randomHash()},o.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},o.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled},o.prototype.disconnected=function(){var t=this;this.restartSession(),Object.keys(this).forEach(function(e){/^(s|st|symbol_)\d+$/.test(e)&&delete t[e]})},o.prototype.initSession=function(){return this._chartApi.createSession(this._sessionid,this)},o.prototype.stopSession=function(){return this._chartApi.removeSession(this._sessionid)},o.prototype.restartSession=function(){this.stopSession(),this.generateSessionId(),this.initSession()},o.prototype.setHandler=function(t){this._globalHandler=t},o.prototype.sessionId=function(){return this._sessionid},o.prototype.connect=function(t){return this._globalHandler=t,this.initSession(),this._chartApi.connect()},o.prototype.disconnect=function(){return this._chartApi.disconnect()},o.prototype.switchTimezone=function(t){return this._chartApi.switchTimezone(this._sessionid,t)},o.prototype.resolveSymbol=function(t,e,i){return this._chartApi.resolveSymbol(this._sessionid,t,e,i)},o.prototype.createSeries=function(t,e,i,o,n,s){return this._chartApi.createSeries(this._sessionid,t,e,i,o,n,s)},o.prototype.removeSeries=function(t,e){return this._chartApi.removeSeries(this._sessionid,t,e)},o.prototype.modifySeries=function(t,e,i,o,n){
return this._chartApi.modifySeries(this._sessionid,t,e,i,o,n)},o.prototype.requestMoreData=function(t,e,i){return this._chartApi.requestMoreData(this._sessionid,t,e,i)},o.prototype.requestMetadata=function(t,e){this._chartApi.requestMetadata(this._sessionid,t,e)},o.prototype.isCanCreateStudy=function(t,e){return this._chartApi.isCanCreateStudy(t,e)},o.prototype.createStudy=function(t,e,i,o,n,s,r){return this._chartApi.createStudy(this._sessionid,t,e,i,o,n,s,r)},o.prototype.rebindStudy=function(t,e,i,o,n,s,r){return this._chartApi.rebindStudy(this._sessionid,t,e,i,o,n,s,r)},o.prototype.removeStudy=function(t,e,i){return this._chartApi.removeStudy(this._sessionid,t,e,i)},o.prototype.modifyStudy=function(t,e,i,o){return this._chartApi.modifyStudy(this._sessionid,t,e,i,o)},o.prototype.createPointset=function(t,e,i,o,n,s){return this._chartApi.createPointset(this._sessionid,t,e,i,o,n,s)},o.prototype.modifyPointset=function(t,e,i,o){return this._chartApi.modifyPointset(this._sessionid,t,e,i,o)},o.prototype.removePointset=function(t,e){return this._chartApi.removePointset(this._sessionid,t,e)},o.prototype.requestMoreTickmarks=function(t,e,i){return this._chartApi.requestMoreTickmarks(this._sessionid,t,e,i)},o.prototype.requestFirstBarTime=function(t,e,i){return this._chartApi.requestFirstBarTime(this._sessionid,t,e,i)},o.prototype.setVisibleTimeRange=function(t,e,i,o){return this._chartApi.setVisibleTimeRange(t,this._sessionid,e,i,o)},o.prototype.onMessage=function(t){switch(t.method){case"connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case"disconnected":this.disconnected()}this._globalHandler&&this._globalHandler(t)},o.prototype.disable=function(){this._sessionDisabled=!0},o.prototype.chartApi=function(){return this._chartApi},t.exports=o},function(t,e){"use strict";t.exports=function(t,e){var i=document.body,o=i[t];return o||(o=document.createElement("img"),o.src=e,i[t]=o),o}},function(t,e,i){(function(t){"use strict";var e=window.TradingView=window.TradingView||{};window.PineAddons={},e.className=function(t){for(var i in this)if(e[i]===t)return i;return null},e.isOnFeaturePage=/on-features-page=1/i.test(window.location.search),e.wrapUrl=function(e){return t.enabled("charting_library_base")&&(e=e.replace("","")),e},e.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),o=/Opera Mini/i.test(navigator.userAgent),n=t||e||i||o;return{Android:function(){return t},BlackBerry:function(){return e},iOS:function(){return i},Opera:function(){return o},any:function(){return n}}}(),e.supportTouch=function(){return Modernizr.touch||e.isMobile.any()},e.onWidget=function(){
url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"GET",crossDomain:!0}).done(function(t){r(n(t).data)})},r.saveStudyTemplate=function(o,r){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"POST",crossDomain:!0,data:{name:o.name,content:o.content}}).done(function(t){var e=n(t);"ok"!==e.status&&console.warn("Template save request failed: "+e.message),r({error:"ok"===e.status?"":e.status})})},r._templatesCache=null,r.getStudyTemplatesList=function(o){if(r._templatesCache)return void o(r._templatesCache);r._templatesCache=[],$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e,i;if(null!==r._templatesCache){if(e=n(t),"ok"!==e.status)return void console.warn("Templates list request failed: "+e.message);i=e.data.map(function(t){return{is_default:!1,name:t.name}}),r._templatesCache=i,o(i)}})},r.invalidateStudyTemplatesList=function(){r._templatesCache=null},r}();t.exports=s},function(t,e,i){(function(e){"use strict";var o=i(58),n=i(36).Interval,s=i(15),r=i(3),a=function(t,e){this._server=t,this._session=e,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new s,this._lastBarTimes={}};a.prototype.lastBarTime=function(t){return this._lastBarTimes[t]},a.prototype._userTimezone=function(){return this._timezone},a.prototype.setTimezone=function(t){this._timezone="exchange"===t?"exchange":e.get_timezone(t),this._timezoneId=t},a.prototype.timezone=function(){return this._timezoneId},a.prototype.setResolution=function(t){this._isDWM=n.isDWM(t),this._resolution=t},a.prototype.onRequestMetadata=function(t,e){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,t,e]})},a.prototype.onSymbolResolved=function(t,e){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,t,e]})},a.prototype.onSymbolError=function(t,e){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,t,e]})},a.prototype.onStudyError=function(t,e){this._server.receiveLocalResponse({method:"study_error",params:[this._session,t,e]})},a.prototype.onSeriesLoading=function(t,e){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,t,e]})},a.prototype.onSeriesCompleted=function(t,e,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,t,i,e]}),this.seriesCompleted.fire(t)},a.prototype.onSeriesError=function(t,e){this._server.receiveLocalResponse({method:"series_error",params:[this._session,t,e]})},a.prototype.onSeriesClearData=function(t,e){var i={};i[t]={series:[],turnaround:e},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[]}]})},a.prototype.onStudyCompleted=function(t,e){
this._server.receiveLocalResponse({method:"study_completed",params:[this._session,t,e]})},a.prototype.onStudyLoading=function(t,e){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,t,e]})},a.prototype._calcMarksTime=function(t,i,n,s,a){var l,h,c,d,p,u=e.get_timezone(i),_=this;if(this._isDWM&&!r.enabled("disable_resolution_rebuild"))for(p=new o.Session,p.init(u,n),d=0;d<t.length;d++)c=t[d],l=s(c),h=e.utc_to_cal(u,1e3*l),h=p.spec.correctTradingDay(h,u),e.set_hms(h,0,0,0,0),t[d]=a(c,parseInt(h.valueOf()/1e3));else for(d=0;d<t.length;d++)t[d]=a(t[d],_.timeInTimezone(s(t[d]),u))},a.prototype.onTickmarksUpdated=function(t,e,i,o){var s,r,a,l,h,c,d;if(n.isEqual(o,this._resolution)){for(s=e.slice(0),this._calcMarksTime(s,i.timezone,i.session,function(t){return t},function(t,e){return e}),r=[],a=[],h=0;h<s.length;++h)c=s[h],r.push([this._spanByTime(c,l),c,t+h]),a.push(c),l=c;d={method:"tickmark_update",params:[this._session,{index:t,zoffset:0,changes:a,marks:r}]},this._server.receiveLocalResponse(d)}},a.prototype.onTimescaleUpdate=function(t,e,i,o,n,s){var r,a,l,h,c,d,p,u,_=s&&s.slice(0);for(this._lastBarTimes[t]=_?_&&_[_.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,o.timezone,o.session,function(t){return t.value[0]},function(t,e){return t.exTime=e,t}),_&&this._calcMarksTime(_,o.timezone,o.session,function(t){return t},function(t,e){return{markTime:e,time:t}}),r={},r[t]={series:i,turnaround:e},a=[],l=[],c=i.map(function(t){return{markTime:t.exTime,time:t.value[0]}}),_&&(c=c.concat(_)),d=0;d<c.length;++d)p=c[d].markTime,a.push([this._spanByTime(p,h),p,n+d]),l.push(c[d].time),h=p;u={method:"timescale_update",params:[this._session,r,{index:n,zoffset:0,changes:l,marks:a}]},this._server.receiveLocalResponse(u)},a.prototype.onSeriesTimeframeUpdate=function(t,e,i,o,n){var s={method:"series_timeframe",params:[this._session,t,e,i,o,n]};this._server.receiveLocalResponse(s)},a.prototype.onPointsetDataUpdate=function(t,e,i,o){this._onDataUpdate(t,e,i,void 0,o,1)},a.prototype.onDataUpdate=function(t,e,i,o,n){this._onDataUpdate(t,e,i,o,n,0)},a.prototype._onDataUpdate=function(t,e,i,o,n,s){var r,a={},l=o?JSON.stringify({offsets:o}):"";a[t]={s:i,ns:{d:l,indexes:[]},turnaround:e},r={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(r)},a.prototype.onQuotesData=function(t){this._server.receiveLocalResponse({method:"quote_symbol_data",params:t})},a.prototype.onDepthData=function(t){this._server.receiveLocalResponse({method:"dd",params:t})},a.prototype.onDepthUpdate=function(t){this._server.receiveLocalResponse({method:"dpu",params:t})},a.prototype.onProjectionUpdate=function(t,e,i,o){var n,s=i.data,r=s[s.length-1],a={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:r?r[4]:i.price,bars:s.map(function(t,e){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],factor:t[6],additionalPrice:t[6]}})}},l={};l[t]={s:o||[],ns:{d:JSON.stringify(a),indexes:s.map(function(t,e){return i.barsetSize+(t[0]||0)})},turnaround:e},n={method:"data_update",
params:[this._session,l]},this._server.receiveLocalResponse(n)},a.prototype.timeInTimezone=function(t,i){return"exchange"===this._userTimezone()?parseInt(e.utc_to_cal(i,1e3*t).valueOf()/1e3):parseInt(e.utc_to_cal(this._userTimezone(),1e3*t).valueOf()/1e3)},a.prototype._spanByTime=function(t,e){function i(t){return 60*t*60*1e3}function o(t){return 60*t*1e3}function n(t){return 1e3*t}var s,r,a,l=[{divisor:1,span:20},{divisor:n(1),span:19},{divisor:o(5),span:21},{divisor:o(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!e)return 20;if(s=new Date(1e3*e),r=new Date(1e3*t),r.getYear()!==s.getYear())return 70;if(r.getUTCMonth()!==s.getUTCMonth())return 60;if(r.getUTCDate()!==s.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(s/l[a].divisor)!==Math.floor(r/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],t.exports=a}).call(e,i(57))},function(t,e,i){(function(e){"use strict";var o=i(81).PlotType,n=i(25),s=function(){function t(t){e.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+t)}function s(t,e,i,o){t.defaults.inputs[e]=o,t.inputs[i].defval=o}function r(t,e){t.defaults.precision=e}function a(e,i,o,n){var s,r,a=o[1];if("color"===a){if(s=c(e,i),r=o.length>2?parseInt(o[2]):NaN,null==s&&!isNaN(r)&&r>0)return void t("Plot `{1}` of `{0}` does not have color #{2}".format(e.description,o[0],r));0==r||isNaN(r)?(e.defaults.styles[i].color=n,null!=s&&(s.colors[0].color=n)):s.colors[r].color=n}else{if(!e.defaults.styles[i].hasOwnProperty(a))return void t("Plot `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],a));"plottype"===a&&(n=y[n]),e.defaults.styles[i][a]=n}}function l(e,i,o,n){var s=o[1];if(!e.defaults.bands[i].hasOwnProperty(s))return void t("Band `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));"plottype"===s&&(n=y[n]),e.defaults.bands[i][s]=n}function h(e,i,o,n){var s=o[1];if(!e.defaults.filledAreasStyle[i].hasOwnProperty(s))return void t("Area `{1}` of `{0}` does not have property `{2}`".format(e.description,o[0],s));e.defaults.filledAreasStyle[i][s]=n}function c(t,e){for(var i in t.plots)if("colorer"===t.plots[i].type&&t.plots[i].target===e)return t.defaults.palettes[t.plots[i].palette];return null}function d(t){var e,i,o=JSServer.studyLibrary;for(e=0;e<o.length;++e)if(i=o[e].metainfo,i.description.toLowerCase()===t.toLowerCase()||i.shortDescription.toLowerCase()===t.toLowerCase())return i;return null}function p(t,e){for(var i=0;i<t.inputs.length;++i)if(t.inputs[i].name.toLowerCase()===e.toLowerCase())return{id:t.inputs[i].id,index:i};return null}function u(t,e){for(var i in t.styles)if(t.styles[i].title.toLowerCase()===e.toLowerCase())return i;return null}function _(t,e){for(var i in t.filledAreas)if(t.filledAreas[i].title.toLowerCase()===e.toLowerCase())return t.filledAreas[i].id;return null}function f(t,e){if(!t.bands)return null;for(var i in t.bands)if(t.bands[i].name.toLowerCase()===e.toLowerCase())return i;return null}var m,g,v={
"volume.transparency":"!transparency","upper limit":"UpperLimit","lower limit":"LowerLimit"},y={};if(Object.keys(o).forEach(function(t){y[t.toLowerCase()]=o[t]}),m={},m.setMetainfoProperty=function(e,i,o){var n,c,d,m,g,y,b,w,S,T,C;if(i=v[i]||i,n=i.split("."),c=n[0],0===c.indexOf("!"))return void(e[c.slice(1)]=o);d=c.split(":"),c=d[0],c=v[c]||c,m=null,g=null,y=null,b=null,w="options"===c,S="precision"===c&&e.defaults&&e.defaults.precision,T=2===d.length?d[1]:null,"plot"!==T&&T||(m=u(e,c)),"band"!==T&&T||(g=f(e,c)),"area"!==T&&T||(y=_(e,c)),"input"!==T&&T||(b=p(e,c)),C=!!m+!!g+!!b+!!w+!!y+!!S,0===C?t("Study `{0}` has no plot or input `{1}`".format(e.description,c)):C>1?t("Study `{0}` ambiguous identifier `{1}`".format(e.description,c)):m?a(e,m,n,o):b?s(e,b.id,b.index,o):g?l(e,g,n,o):y?h(e,y,n,o):S?r(e,o):e[n[1]]=o},m.setProperty=function(e,i){var o=e.split(".")[0],n=d(o);if(!n)return void t("Study `{0}` not found".format(o));m.setMetainfoProperty(n,e.substring(o.length+1),i)},m.applyDefaultsToFactoryDefaults=function(t){var e={};t.forEach(function(t){var i=t.split(".")[0],o=d(i);o&&(e[o.id]=o)}),Object.keys(e).forEach(function(t){var i=e[t];n.createDefaultsForStudy(i)})},i(141),"undefined"!=typeof __initialMetainfoOverrides&&__initialMetainfoOverrides)for(g in __initialMetainfoOverrides)m.setProperty(g,__initialMetainfoOverrides[g]);return m}();t.exports=s}).call(e,i(3))},function(t,e,i){"use strict";function o(t,e){this._chartApi=t,this.generateSessionId(),this._sessionDisabled=!1,this._disableStatistics=!!e}var n=i(60);i(12).getLogger("ChartSession");o.prototype.destroy=function(){this._sessionDisabled||this.stopSession()},o.prototype.generateSessionId=function(){this._sessionid="cs_"+n.randomHash()},o.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},o.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled},o.prototype.disconnected=function(){var t=this;this.restartSession(),Object.keys(this).forEach(function(e){/^(s|st|symbol_)\d+$/.test(e)&&delete t[e]})},o.prototype.initSession=function(){return this._chartApi.createSession(this._sessionid,this)},o.prototype.stopSession=function(){return this._chartApi.removeSession(this._sessionid)},o.prototype.restartSession=function(){this.stopSession(),this.generateSessionId(),this.initSession()},o.prototype.setHandler=function(t){this._globalHandler=t},o.prototype.sessionId=function(){return this._sessionid},o.prototype.connect=function(t){return this._globalHandler=t,this.initSession(),this._chartApi.connect()},o.prototype.disconnect=function(){return this._chartApi.disconnect()},o.prototype.switchTimezone=function(t){return this._chartApi.switchTimezone(this._sessionid,t)},o.prototype.resolveSymbol=function(t,e,i){return this._chartApi.resolveSymbol(this._sessionid,t,e,i)},o.prototype.createSeries=function(t,e,i,o,n,s){return this._chartApi.createSeries(this._sessionid,t,e,i,o,n,s)},o.prototype.removeSeries=function(t,e){return this._chartApi.removeSeries(this._sessionid,t,e)},
o.prototype.modifySeries=function(t,e,i,o,n){return this._chartApi.modifySeries(this._sessionid,t,e,i,o,n)},o.prototype.requestMoreData=function(t,e,i){return this._chartApi.requestMoreData(this._sessionid,t,e,i)},o.prototype.requestMetadata=function(t,e){this._chartApi.requestMetadata(this._sessionid,t,e)},o.prototype.isCanCreateStudy=function(t,e){return this._chartApi.isCanCreateStudy(t,e)},o.prototype.createStudy=function(t,e,i,o,n,s,r){return this._chartApi.createStudy(this._sessionid,t,e,i,o,n,s,r)},o.prototype.rebindStudy=function(t,e,i,o,n,s,r){return this._chartApi.rebindStudy(this._sessionid,t,e,i,o,n,s,r)},o.prototype.removeStudy=function(t,e,i){return this._chartApi.removeStudy(this._sessionid,t,e,i)},o.prototype.modifyStudy=function(t,e,i,o){return this._chartApi.modifyStudy(this._sessionid,t,e,i,o)},o.prototype.createPointset=function(t,e,i,o,n,s){return this._chartApi.createPointset(this._sessionid,t,e,i,o,n,s)},o.prototype.modifyPointset=function(t,e,i,o){return this._chartApi.modifyPointset(this._sessionid,t,e,i,o)},o.prototype.removePointset=function(t,e){return this._chartApi.removePointset(this._sessionid,t,e)},o.prototype.requestMoreTickmarks=function(t,e,i){return this._chartApi.requestMoreTickmarks(this._sessionid,t,e,i)},o.prototype.requestFirstBarTime=function(t,e,i){return this._chartApi.requestFirstBarTime(this._sessionid,t,e,i)},o.prototype.setVisibleTimeRange=function(t,e,i,o){return this._chartApi.setVisibleTimeRange(t,this._sessionid,e,i,o)},o.prototype.onMessage=function(t){switch(t.method){case"connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case"disconnected":this.disconnected()}this._globalHandler&&this._globalHandler(t)},o.prototype.disable=function(){this._sessionDisabled=!0},o.prototype.chartApi=function(){return this._chartApi},t.exports=o},function(t,e){"use strict";t.exports=function(t,e){var i=document.body,o=i[t];return o||(o=document.createElement("img"),o.src=e,i[t]=o),o}},function(t,e,i){(function(t){"use strict";var e=window.TradingView=window.TradingView||{};window.PineAddons={},e.className=function(t){for(var i in this)if(e[i]===t)return i;return null},e.isOnFeaturePage=/on-features-page=1/i.test(window.location.search),e.wrapUrl=function(e){return t.enabled("charting_library_base")&&(e=e.replace("","")),e},e.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),o=/Opera Mini/i.test(navigator.userAgent),n=t||e||i||o;return{Android:function(){return t},BlackBerry:function(){return e},iOS:function(){return i},Opera:function(){return o},any:function(){return n}}}(),e.supportTouch=function(){return Modernizr.touch||e.isMobile.any()},e.onWidget=function(){
var t,e,i=["^widgetembed/?$","^cmewidgetembed/?$","^([0-9a-zA-Z-]+)/widgetembed/?$","^([0-9a-zA-Z-]+)/widgetstatic/?$","^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$","^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$","^embed(-static)?/([0-9a-zA-Z]{8})/?$","^widgetpopup/?$","^extension/?$","^chatwidgetembed/?$","^ideaswidgetembed/?$","^ideas-widget/?$","^view-idea-widget/([0-9a-zA-Z]{8})/?$","^user-info-widget/?$","^user-info-widget-get/(.+?)?/?$","^embed-quotes-provider/?$","^idea-popup/?$","^hotlistswidgetembed/?$","^marketoverviewwidgetembed/?$","^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$","^eventswidgetembed/?$","^tickerswidgetembed/?$"],o=window.location.pathname.replace(/^\//,"");for(e=i.length-1;e>=0;e--)if(t=RegExp(i[e]),t.test(o))return!0;return!1},e.onOrder=function(){return"/order/"===window.location.pathname}}).call(e,i(3))},function(t,e,i){(function(e){"use strict";var o=i(161).futuresRoots,n=function(){function t(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t}function i(t){return t.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function n(){}function s(t){this.value=t}function r(){}function a(){}function l(){}function h(){}function c(){}function d(){}function p(){}function u(){}function _(t){this.value=t}function f(t){this.value=t}function m(t){this.value=t}function g(){_.apply(this,arguments)}function v(){f.apply(this,arguments)}function y(t,e){var i,o,n,r,a,l,h,c,d=[];t:for(;i=z.exec(t);){for(o=W.length;o--;)if(i[o+1]){W[o].ctor&&(n=new W[o].ctor(i[o+1]),n._offset=i.index,d.push(n));continue t}r=new m(i[0]),r._offset=i.index,d.push(r)}if(e&&e.recover)for(o=d.length;o--;)l=d[o],l instanceof f||l instanceof _?(void 0!==a&&(h=new _(""),c=d.splice(o,a-o+1,h),h.value=c.map(function(t){return t.value}).join("")),a=o):l instanceof s||(a=void 0);return d}function b(t){var i,o,n,h,c,d,p,u,g,v;if(e.enabled("charting_library_base"))return{currentState:"var"};for(i="init",o="var",n="operator",h=i,c={warnings:[],errors:[],isEmpty:!0},d=[],p=0;p<t.length;p++)if(!((u=t[p])instanceof s))if(delete c.isEmpty,u.isIncomplete&&(g={status:"incomplete",reason:"incomplete_token",offset:u._offset,token:u},u.incompleteSuggest&&(g.recover={append:u.incompleteSuggest()}),c.warnings.push(g),p!==t.length-1))g.status="error";else if(u instanceof _||u instanceof f){if(h===o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}h=o}else if(u instanceof l){if(h!==o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}h=n}else if(u instanceof r){if(h===o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}d.push(u),h=i}else if(u instanceof a){if(h!==o){c.errors.push({status:"error",reason:"unexpected_token",offset:u._offset,token:u});continue}v=d.pop(),v||c.errors.push({status:"error",reason:"unbalanced_brace",offset:u._offset,token:u,recover:{prepend:new r}}),h=o}else u instanceof m&&c.errors.push({status:"error",reason:"unparsed_entity",offset:u._offset,token:u});for(c.braceBalance=d.length,
h!==o&&c.warnings.push({status:"incomplete"}),v=null;d.length;)u=d.pop(),g={status:"incomplete",reason:"unbalanced_brace",offset:u._offset,token:u},h===o&&(g.recover={append:new a}),c.warnings.push(g);return c.currentState=h,0===c.warnings.length&&delete c.warnings,0===c.errors.length&&delete c.errors,c}function w(t){var e,i=[];for(e=0;e<t.length;e++)t[e]instanceof s||i.push(t[e]);return i}function S(t){var e,i,o,n,s,h,c;for(t=w(t),e=[],i=[],n=0;n<t.length;n++)s=t[n],s instanceof l?i.length&&i[i.length-1].minPrecedence>s.precedence&&(i[i.length-1].minPrecedence=s.precedence):s instanceof r?i.push(o={minPrecedence:1/0,openBraceIndex:n}):s instanceof a&&(o=i.pop(),h=t[o.openBraceIndex-1],(c=t[n+1])instanceof l&&!(c.precedence<=o.minPrecedence)||!(!(h instanceof l)||h.precedence<o.minPrecedence||h.precedence===o.minPrecedence&&h.commutative)||(e.unshift(o.openBraceIndex),e.push(n),i.length&&i[i.length-1].minPrecedence>o.minPrecedence&&(i[i.length-1].minPrecedence=o.minPrecedence)));for(n=e.length;n--;)t.splice(e[n],1);return t}function T(t){for(var e=0;e<t.length;e++)t[e].parse&&t[e].parse();return t}function C(t){var e=x(t);return S(e?e:[new f("1"),new p,new r].concat(t).concat(new a))}function x(t){var e,i,o,n=0,h=1,c=2,d=3,u=n,_=0;for(i=0;i<t.length;i++)if(!((o=t[i])instanceof s))switch(u){case n:if(!(o instanceof f&&1==+o.value))return!1;u=h;break;case h:if(!(u===h&&o instanceof p))return!1;u=c,e=i+1;break;case c:if(o instanceof r)u=d,_=1;else if(o instanceof l)return!1;break;case d:o instanceof r?_++:o instanceof a&&--_<=0&&(u=c)}return t.slice(e)}function P(t){return new _(t).ticker()}function L(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return t=y(t),t.filter(function(t){return t instanceof _}).map(function(t){return t.exchange()}).filter(function(t){return t})}function k(t){return t=L(t),1!==t.length?null:t[0]}function I(t,e){return t=L(t),t.some(function(t){return!!~e.indexOf((t||"").toUpperCase())})}function A(t){return I(t,["BATS"])}function E(t){return(t=k(t))&&-1!==t.toUpperCase().indexOf("_EOD")}function M(t){return I(t,["CHXEUR"])}function D(t){return I(t,["CHXJPY"])}function O(t){return I(t,["MOEX_DLY","LSE_DLY","LSIN_DLY","BSE_DLY","NSE_DLY","CME_DL","CME_MINI_DL","CBOT_DL","CBOT_MINI_DL","COMEX_DL","COMEX_MINI_DL","NYMEX_DL","NYMEX_MINI_DL","ASX_DLY","BME_DLY","NZX_DLY","NAG_DLY","BMFBOVESPA_DLY","TSE_DLY","TFX_DLY","BCBA_DLY","OTC_DLY","FSE_DLY","SSE_DLY","BIST_DLY","TOCOM_DLY","SIX_DLY","EURONEXT_DLY","BMV_DLY","TSX_DLY","TSXV_DLY","HKEX_DLY","TWSE_DLY"])}function $(t,e){return!!(t=k(t))&&t.substr(0,e.length)===e}function V(t){if("string"!=typeof t)throw new TypeError("expression must be a string");var e=S(w(y(t)));return e.forEach(function(t){t instanceof _&&t.exchange(null)}),R(e)}function B(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return R(S(w(y(t))))}function R(t){return t.join("")}var N,F,z,W=[{pattern:"(",ctor:r},{pattern:")",ctor:a},{pattern:"+",ctor:h},{pattern:"-",ctor:c},{pattern:"*",ctor:d},{pattern:"/",ctor:p},{
pattern:"^",ctor:u},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:v},{pattern:e.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:g},{pattern:/[\0-\x20\s]+/,ctor:s}];return n.prototype.toString=function(){return this.value},t(s,n),t(r,n),r.prototype.value="(",t(a,n),a.prototype.value=")",t(l,n),t(h,l),h.prototype.value="+",h.prototype.precedence=0,h.prototype.commutative=!0,t(c,l),c.prototype.value="-",c.prototype.precedence=0,c.prototype.commutative=!1,t(d,l),d.prototype.value="*",d.prototype.precedence=1,d.prototype.commutative=!0,t(p,l),p.prototype.value="/",p.prototype.precedence=1,p.prototype.commutative=!1,t(u,l),u.prototype.value="^",u.prototype.precedence=2,u.prototype.commutative=!1,N=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,F=/[\+\-\/\*]/,t(_,n),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var t=F.test(this._ticker)?"'":"";return t+(this._exchange?this._exchange+":":"")+this._ticker+t}return this.value},_.prototype.parse=function(){var t=N.exec(this.value);t[1]&&(this._exchange=t[1]),this._ticker=t[2]},_.prototype.parseAsFutures=function(){var t,e,i;if(o)for(this.hasOwnProperty("_ticker")||this.parse(),t=function(t){return o.some(function(e){return e.t===t})},e=2;e>=1;--e)if(i=this._ticker.slice(0,e),t(i)){this._root=i,this._contract=this._ticker.slice(e);break}},_.prototype.exchange=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===t||void 0===t?delete this._exchange:this._exchange=t+""},_.prototype.ticker=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===t||void 0===t?delete this._ticker:this._ticker=t+"",delete this._root,delete this._contract},_.prototype.root=function(t){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._root:(this._root=t+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(t){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._contract:(this._contract=t+"",this._root&&(this._ticker=this._root+this._contract))},t(f,n),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},t(g,_),g.prototype.isIncomplete=!0,g.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},t(v,f),v.prototype.isIncomplete=!0,z=RegExp(W.map(function(t){return"("+("string"==typeof t.pattern?i(t.pattern):t.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:y,validate:b,
factorOutBraces:S,normalizeTokens:T,flip:C,hasBatsSymbols:A,hasEodSymbols:E,hasChxeurSymbols:M,hasChxjpySymbols:D,hasFreeDelaySymbols:O,getExchange:k,isExchange:$,SymbolToken:_,IncompleteSymbolToken:g,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:r,CloseBraceToken:a,ticker:P,shortName:V,normalize:B}}();t.exports=n}).call(e,i(3))},,function(t,e){"use strict";!function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();var i=t.originalEvent.changedTouches[0],o=document.createEvent("MouseEvents");o.initMouseEvent(e,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(o)}}if(t.support.touch="ontouchend"in document,t.support.touch){var i,o=t.ui.mouse.prototype,n=o._mouseInit,s=o._mouseDestroy;o._touchStart=function(t){var o=this;!i&&o._mouseCapture(t.originalEvent.changedTouches[0])&&(i=!0,o._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},o._touchMove=function(t){i&&(this._touchMoved=!0,e(t,"mousemove"))},o._touchEnd=function(t){i&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),i=!1)},o._mouseInit=function(){var e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)},o._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),s.call(e)}}}(jQuery)},function(t,e){"use strict";t.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(t,e,i){"use strict";function o(t){var e,i=[],n=t.m_items;for(e=0;e<n.length;e++)n[e]._menu&&(i.push(n[e]._menu),i=i.concat(o(n[e]._menu)));return i}function n(t,e,i){var o,n;this.options={},this._parentMenuItem=i,$.extend(this.options,e),this.options.class&&(this.options.attributes.class=this.options.class),this.jqMenu=null,this.m_wrapper=null,this.m_items=[];for(o in t)n=t[o],this.addItem(n)}var s=i(288),r=i(47).ActionPlaceholder,a=i(600),l=a.Item,h=a.ItemPlaceholder,c=i(143),d=i(144);n.prototype.addItem=function(t){var e;return e=t instanceof r?new h(t,this):new l(t,this),this.m_items.push(e),e},n.renderItem=function(t,e){t.append(e.render(t))},n.prototype.closeOtherSubmenus=function(t){for(var e=0;e<this.m_items.length;++e)this.m_items[e].highlight(!1),this.m_items[e]._menu&&(this.m_items[e]._menu.destroy(),this.m_items[e]._menu=null)},n.prototype.isShown=function(){return null!==this.jqMenu},n.prototype.render=function(){var t,e,i,o=this.getAttributes();if(this._parentMenuItem){t=$("<table>"),this.jqMenu=t,t.attr("cellspacing","0"),t.attr("cellpadding","0"),t.addClass("context-menu"),t.addClass("submenu");for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}else{t=d.create(s.MENU_TAG,o),this.jqMenu=t;for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}return this.jqMenu},
n.prototype.getAttributes=function(){var t={},e=["context-menu"];return this.options.attributes&&this.options.attributes.class&&e.push(this.options.attributes.class),t.cellspacing=0,t.cellpadding=0,t.class=e.join(),t},n.prototype.deploy=function(t,e){var i=this.wrapper();return this.jqMenu=i.append(this.render()),e?($(e).data("submenu",this.jqMenu),$(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",e),this.jqMenu.data("parent-item",t.currentTarget)):$(document.body).append(this.jqMenu),c.unbindContextMenu(this.jqMenu),this._setCoords(t),this.jqMenu},n.prototype.show=function(t,e){this.deploy(t,e).show()},n.prototype.hide=function(){this.isShown()&&this.destroy()},n.prototype.destroy=function(){$.each(this.m_items,function(t,e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},n.prototype._setCoords=function(t){var e,i,o,n,s,r=5,a=this.jqMenu,l=$(this.jqMenu.data("parent-item")),h={width:$(window).width(),height:Math.min($(window).height(),$("body").height())},c={top:$(document).scrollTop(),left:$(document).scrollLeft()};for(this.jqMenu.css({maxWidth:h.width-2*r,maxHeight:h.height-2*r}),e={width:a.outerWidth(),height:a.outerHeight()},l.size()?(o=l.offset(),i={top:o.top-1,left:o.left+l.outerWidth()}):i={top:t.pageY,left:t.pageX},this.jqMenu.offset(i),n={},n.top=Math.min(i.top,h.height+c.top-e.height-r),i.left+e.width+r>h.width||this.options.reverse?n.left=i.left+c.left-e.width:n.left=i.left,s=t.target;s&&s!==document;s=s.parentNode)if("fixed"===$(s).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(n)},n.prototype._wrapper=function(){var t=this,e=s.WRAPPER_ATTRIBUTES;return this._parentMenuItem?this.m_wrapper=d.create(s.WRAPPER_TAG,e):(this.m_wrapper=c.createPopup(e,void 0,{mouseDownOutsideEvent:function(e){var i=$();$.each(o(t),function(){i=i.add(this.m_wrapper)}),$(e.target).parents().andSelf().is(i)||t.hide()}}),this.m_wrapper.addClass("topmenu")),this.m_wrapper},n.prototype.wrapper=function(t){return this.m_wrapper||this._wrapper()},t.exports=n},function(t,e,i){"use strict";var o=i(42);t.exports[o.STYLE_AREA]=i(836),t.exports[o.STYLE_BARS]=i(839),t.exports[o.STYLE_CANDLES]=i(846),t.exports[o.STYLE_HEIKEN_ASHI]=i(859),t.exports[o.STYLE_HOLLOW_CANDLES]=i(862),t.exports[o.STYLE_LINE]=i(881)},function(t,e,i){(function(e,o){"use strict";function n(t){var n=i(603);this._options=$.extend({interval:1},t||{}),this._e=$("<div>").addClass("intervals-container favored-list-container"),this._quick=$("<div>").addClass("quick").appendTo(this._e),this._quicked={},this._main=$('<span class="apply-common-tooltip">').text(this.shortLabel(this._options.interval)).attr("title",this.fullLabel(this._options.interval)).appendTo(this._quick),this._main.data("interval",this._options.interval),e.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton(),this._mainSub=$("<span>").addClass("submenu").attr("title",$.t("Time Interval")).append($("<i>")).appendTo(this._e),
t&&"string"==typeof t.submenuBtnAddClass&&this._mainSub.addClass(t.submenuBtnAddClass),this._quick.on("click",this._selectInterval.bind(this)),this._mainSub.on("click",this._selectMenu.bind(this)),this._menu=new n(this,this._mainSub,this._options),this.onResize=new o,r.intraday.subscribe(this._fullUpdate.bind(this)),r.supportedResolutions.subscribe(this._fullUpdate.bind(this)),t.interval&&r.interval.setValue(t.interval),r.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0}),l.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this)),this._fullUpdate()}var s=i(43).Interval,r=i(72),a=i(164).translatedIntervalString,l=i(128).TVXWindowEvents;n.prototype.forceUpdate=function(){this._fullUpdate(!0)},n.prototype._fullUpdate=function(t){this._setupIntervals(t),this._setupQuicks(t),this.reactivateInterval(),this._resize()},n.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)},n.prototype.isDefaultInterval=function(t){return t in ChartApiInstance.defaultResolutions()},n.getIntervals=function(){return TradingView.clone(ChartApiInstance.defaultResolutions())},n.prototype._setupIntervals=function(){this._intervals=n.getIntervals()},n.sortIntervals=function(t){Array.isArray(t)||(t=Object.keys(t));var e=function(t){var e=new s(t);return e.kind()!==s.MINUTES?{S:1/60,D:1440,W:10080,M:43200}[e.letter()]*e.multiplier():e.multiplier()};return t.sort(function(t,i){return e(t)-e(i)})},n.prototype.getSortedIntervals=function(){return n.sortIntervals(this._intervals)},n.prototype.setUpStarredItemsList=function(t){var e,i={};for(e=0;e<t.length;++e)i[t[e]]=!0;this._setupQuicks(!1,i)},n.prototype._setupQuicks=function(t,i){this._options.notShowQuicks&&!i||(i=i||{},e.enabled("star_some_intervals_by_default")&&(i={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",i,t),this._quicked=this._removeCustomIntervalQuicks(this._quicked)),this._addQuicked(this._quicked)},n.prototype._removeCustomIntervalQuicks=function(t){var e={};return Object.keys(t).forEach(function(i){this.isDefaultInterval(i)&&(e[i]=t[i])},this),e},n.prototype.element=function(){return this._e},n.prototype.mainButton=function(){return this._main},n.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)},n.prototype.postfix=function(t,e){if(e){var i=" ";switch(t){case"D":i+=$.t("day",{plural:"days",count:e});break;case"W":i+=$.t("week",{plural:"weeks",count:e});break;case"M":i+=$.t("month",{plural:"months",count:e});break;case"S":i+=$.t("second",{plural:"seconds",count:e});break;case"m":i+=$.t("minute",{plural:"minutes",count:e});break;case"h":i+=$.t("hour",{plural:"hours",count:e})}return i}switch(t){case"m":return"";case"h":return $.t("h",{context:"interval_short"});case"D":return $.t("D",{context:"interval_short"});case"W":return $.t("W",{context:"interval_short"});case"M":return $.t("M",{context:"interval_short"});default:return t.toUpperCase()}},n.prototype.readable=function(t,e,i){function o(t){return t>=60&&!(t%60)}var n,r;if(t=t,n="m",e=e,r=new s(t),
n.prototype.getAttributes=function(){var t={},e=["context-menu"];return this.options.attributes&&this.options.attributes.class&&e.push(this.options.attributes.class),t.cellspacing=0,t.cellpadding=0,t.class=e.join(),t},n.prototype.deploy=function(t,e){var i=this.wrapper();return this.jqMenu=i.append(this.render()),e?($(e).data("submenu",this.jqMenu),$(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",e),this.jqMenu.data("parent-item",t.currentTarget)):$(document.body).append(this.jqMenu),c.unbindContextMenu(this.jqMenu),this._setCoords(t),this.jqMenu},n.prototype.show=function(t,e){this.deploy(t,e).show()},n.prototype.hide=function(){this.isShown()&&this.destroy()},n.prototype.destroy=function(){$.each(this.m_items,function(t,e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},n.prototype._setCoords=function(t){var e,i,o,n,s,r=5,a=this.jqMenu,l=$(this.jqMenu.data("parent-item")),h={width:$(window).width(),height:Math.min($(window).height(),$("body").height())},c={top:$(document).scrollTop(),left:$(document).scrollLeft()};for(this.jqMenu.css({maxWidth:h.width-2*r,maxHeight:h.height-2*r}),e={width:a.outerWidth(),height:a.outerHeight()},l.size()?(o=l.offset(),i={top:o.top-1,left:o.left+l.outerWidth()}):i={top:t.pageY,left:t.pageX},this.jqMenu.offset(i),n={},n.top=Math.min(i.top,h.height+c.top-e.height-r),i.left+e.width+r>h.width||this.options.reverse?n.left=i.left+c.left-e.width:n.left=i.left,s=t.target;s&&s!==document;s=s.parentNode)if("fixed"===$(s).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(n)},n.prototype._wrapper=function(){var t=this,e=s.WRAPPER_ATTRIBUTES;return this._parentMenuItem?this.m_wrapper=d.create(s.WRAPPER_TAG,e):(this.m_wrapper=c.createPopup(e,void 0,{mouseDownOutsideEvent:function(e){var i=$();$.each(o(t),function(){i=i.add(this.m_wrapper)}),$(e.target).parents().andSelf().is(i)||t.hide()}}),this.m_wrapper.addClass("topmenu")),this.m_wrapper},n.prototype.wrapper=function(t){return this.m_wrapper||this._wrapper()},t.exports=n},function(t,e,i){"use strict";var o=i(43);t.exports[o.STYLE_AREA]=i(836),t.exports[o.STYLE_BARS]=i(839),t.exports[o.STYLE_CANDLES]=i(846),t.exports[o.STYLE_HEIKEN_ASHI]=i(859),t.exports[o.STYLE_HOLLOW_CANDLES]=i(862),t.exports[o.STYLE_LINE]=i(881)},function(t,e,i){(function(e,o){"use strict";function n(t){var n=i(603);this._options=$.extend({interval:1},t||{}),this._e=$("<div>").addClass("intervals-container favored-list-container"),this._quick=$("<div>").addClass("quick").appendTo(this._e),this._quicked={},this._main=$('<span class="apply-common-tooltip">').text(this.shortLabel(this._options.interval)).attr("title",this.fullLabel(this._options.interval)).appendTo(this._quick),this._main.data("interval",this._options.interval),e.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton(),this._mainSub=$("<span>").addClass("submenu").attr("title",$.t("Time Interval")).append($("<i>")).appendTo(this._e),
t&&"string"==typeof t.submenuBtnAddClass&&this._mainSub.addClass(t.submenuBtnAddClass),this._quick.on("click",this._selectInterval.bind(this)),this._mainSub.on("click",this._selectMenu.bind(this)),this._menu=new n(this,this._mainSub,this._options),this.onResize=new o,r.intraday.subscribe(this._fullUpdate.bind(this)),r.supportedResolutions.subscribe(this._fullUpdate.bind(this)),t.interval&&r.interval.setValue(t.interval),r.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0}),l.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this)),this._fullUpdate()}var s=i(36).Interval,r=i(72),a=i(164).translatedIntervalString,l=i(128).TVXWindowEvents;n.prototype.forceUpdate=function(){this._fullUpdate(!0)},n.prototype._fullUpdate=function(t){this._setupIntervals(t),this._setupQuicks(t),this.reactivateInterval(),this._resize()},n.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)},n.prototype.isDefaultInterval=function(t){return t in ChartApiInstance.defaultResolutions()},n.getIntervals=function(){return TradingView.clone(ChartApiInstance.defaultResolutions())},n.prototype._setupIntervals=function(){this._intervals=n.getIntervals()},n.sortIntervals=function(t){Array.isArray(t)||(t=Object.keys(t));var e=function(t){var e=new s(t);return e.kind()!==s.MINUTES?{S:1/60,D:1440,W:10080,M:43200}[e.letter()]*e.multiplier():e.multiplier()};return t.sort(function(t,i){return e(t)-e(i)})},n.prototype.getSortedIntervals=function(){return n.sortIntervals(this._intervals)},n.prototype.setUpStarredItemsList=function(t){var e,i={};for(e=0;e<t.length;++e)i[t[e]]=!0;this._setupQuicks(!1,i)},n.prototype._setupQuicks=function(t,i){this._options.notShowQuicks&&!i||(i=i||{},e.enabled("star_some_intervals_by_default")&&(i={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",i,t),this._quicked=this._removeCustomIntervalQuicks(this._quicked)),this._addQuicked(this._quicked)},n.prototype._removeCustomIntervalQuicks=function(t){var e={};return Object.keys(t).forEach(function(i){this.isDefaultInterval(i)&&(e[i]=t[i])},this),e},n.prototype.element=function(){return this._e},n.prototype.mainButton=function(){return this._main},n.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)},n.prototype.postfix=function(t,e){if(e){var i=" ";switch(t){case"D":i+=$.t("day",{plural:"days",count:e});break;case"W":i+=$.t("week",{plural:"weeks",count:e});break;case"M":i+=$.t("month",{plural:"months",count:e});break;case"S":i+=$.t("second",{plural:"seconds",count:e});break;case"m":i+=$.t("minute",{plural:"minutes",count:e});break;case"h":i+=$.t("hour",{plural:"hours",count:e})}return i}switch(t){case"m":return"";case"h":return $.t("h",{context:"interval_short"});case"D":return $.t("D",{context:"interval_short"});case"W":return $.t("W",{context:"interval_short"});case"M":return $.t("M",{context:"interval_short"});default:return t.toUpperCase()}},n.prototype.readable=function(t,e,i){function o(t){return t>=60&&!(t%60)}var n,r;if(t=t,n="m",e=e,r=new s(t),
!r.isValid())throw new TypeError("Wrong interval value: "+t);return r.kind()!==s.MINUTES&&(n=r.letter()),t=r.multiplier(),r.kind()===s.MINUTES&&o(t)&&(t=~~(t/60),n="h"),e=e?t:null,""+(t=i&&1===t&&r.isDWM()?"":t)+this.postfix(n,e)},n.prototype.shortLabel=function(t){return a(this.readable(t,!1))},n.prototype.fullLabel=function(t){return this.readable(t,!0)},n.prototype._addQuicked=function(t){var e,o,s,r,a,l,h,c;for(t=n.sortIntervals(t),e=this._quicks(),o=$(),s=!1,e.size()>t.length&&(e.slice(t.length).remove(),s=!0),r=i(215),a=0;a<t.length;a++)l=t[a],h=e.eq(a),c=!1,h.size()?h.data("interval")!==l&&(c=!0):(h=$('<span class="apply-common-tooltip">'),o=o.add(h),c=!0),c&&(h.data("interval",l).attr("title",this.fullLabel(l)).text(this.shortLabel(l)),s=!0),h.toggleClass("selected",l===this.getInterval()).toggleClass("disabled",!r.isAvailable(l));this._main.before(o),s&&this._resize()},n.prototype._resize=function(){this.onResize.fire()},n.prototype.addQuick=function(t){this._quicked[t]=!0,this._addQuicked(this._quicked),this.saveSettings(),this.reactivateInterval()},n.prototype._quickWithInterval=function(t){var e=null;return this._quicks().each(function(i,o){if(o=$(o),t===o.data("interval"))return e=o,!1}),e},n.prototype.inQuick=function(t){return null!=this._quickWithInterval(t)},n.prototype.removeQuick=function(t){this._quickWithInterval(t)&&(this._quickWithInterval(t).remove(),this._resize(),delete this._quicked[t],this.saveSettings(),this.reactivateInterval())},n.prototype.toggleQuick=function(t){var e=this.inQuick(t);return e?this.removeQuick(t):this.addQuick(t),!e},n.prototype.hasQuicks=function(){return!!this._quicks().length},n.prototype.deactivate=function(t){this._quick.find("span").removeClass("selected")},n.prototype.activateInterval=function(t){this.deactivate(),this.inQuick(t)?this._quickWithInterval(t).addClass("selected"):(this.hasQuicks()&&this._main.addClass("selected"),this._main.data("interval")!==t&&(this._main.text(this.shortLabel(t)),this._main.attr("title",this.fullLabel(t)),this._main.data("interval",t),this._resize()))},n.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())},n.prototype.getInterval=function(){return r.interval.value()},n.prototype.setInterval=function(t){r.interval.setValue(""+t)},n.prototype._selectInterval=function(t){var e=$(t.target),i=e.data("interval");this.hasQuicks()||this.getInterval()!==i?e.hasClass("disabled")||this.setInterval(i):this._selectMenu()},n.prototype._selectMenu=function(t){this._mainSub.hasClass("active")?this._menu.close():this._menu.open(this.getSortedIntervals())},n.prototype._setIntervalDialogButton=function(){var t=i(190);this._intervalDialogButton=$("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title",$.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function(){var e=new t({callback:function(t){r.interval.setValue(t)}}).show(),i=$(this);i.addClass("active"),e.on("destroy",function(){i.removeClass("active")})})},n.prototype.addInterval=function(t){},
n.prototype.removeInterval=function(t){},n.prototype.saveIntervals=function(){},n.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)},n.prototype.saveSettings=function(){this.saveQuicked(),this.saveIntervals(),l.emit("intervalwidget-change")},t.exports=n}).call(e,i(3),i(15))},function(t,e,i){"use strict";function o(t,e,i){l.call(this,t,e),this._linetool=i,this.prepareLayout()}function n(t,e,i){s.call(this,t,e,i),this.prepareLayout()}var s=i(10),r=i(64),a=i(5),l=a.PropertyPage,h=a.SliderBinder,c=i(46).createTransparencyEditor;inherit(o,r),o.prototype.prepareLayout=function(){var t,e,o,n,s,a,l=i(76),h=$('<table class="property-page" cellspacing="0" cellpadding="0">'),c=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":l.TAB_NAME_INPUTS,"layout-tab-priority":l.TAB_PRIORITY_INPUTS});this._table=h.add(c),r.prototype.prepareLayoutForTable.call(this,h),t=$("<tr>").appendTo(c),$("<td>").append($.t("Avg HL in minticks")).appendTo(t),e=$("<td>").appendTo(t),o=$("<input type='text'>").addClass("ticker").appendTo(e),t=$("<tr>").appendTo(c),$("<td>").append($.t("Variance")).appendTo(t),n=$("<td>").appendTo(t),s=$("<input type='text'>").addClass("ticker").appendTo(n),a=this._linetool.properties(),this.bindInteger(o,a.averageHL,$.t("Change Average HL value"),1,5e4),this.bindInteger(s,a.variance,$.t("Change Variance value"),1,100),this.loadData()},o.prototype.widget=function(){return this._table},inherit(n,s),n.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,l,d,p;this._widget=$("<div>"),t=$("<table cellspacing=4>").appendTo(this._widget),e=this.createColorPicker(),i=this.createColorPicker(),o=this.createColorPicker(),n=this.createColorPicker(),s=this.createColorPicker(),r=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(n).add(s)),a=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(o)),l=this.addLabeledRow(t,$.t("Candles")),$("<td>").prependTo(l),$("<td>").append(e).appendTo(l),$("<td>").append(i).appendTo(l),l=this.addLabeledRow(t,$.t("Borders"),r),$("<td>").append(r).prependTo(l),$("<td>").append(n).appendTo(l),$("<td>").append(s).appendTo(l),$("<td>").appendTo(l),l=this.addLabeledRow(t,$.t("Wick"),a),$("<td>").append(a).prependTo(l),$("<td>").append(o).appendTo(l),$("<td>").appendTo(l),t=$("<table>").appendTo(this._widget),l=$("<tr>").appendTo(t),$("<td colspan='2'>").append($.t("Transparency")).appendTo(l),d=c(),$("<td colspan='2'>").append(d).appendTo(l),p=this._linetool.properties(),this.bindColor(e,p.candleStyle.upColor,"Change Candle Up Color"),this.bindColor(i,p.candleStyle.downColor,"Change Candle Down Color"),this.bindBoolean(a,p.candleStyle.drawWick,"Change Candle Wick Visibility"),this.bindColor(o,p.candleStyle.wickColor,"Change Candle Wick Color"),this.bindBoolean(r,p.candleStyle.drawBorder,"Change Candle Border Visibility"),this.bindColor(n,p.candleStyle.borderUpColor,"Change Candle Up Border Color"),this.bindColor(s,p.candleStyle.borderDownColor,"Change Candle Down Border Color"),
this.bindControl(new h(d,p.transparency,!0,this.model(),"Change Guest Feed Transparency"))},n.prototype.widget=function(){return this._widget},e.LineToolGhostFeedInputsPropertyPage=o,e.LineToolGhostFeedStylesPropertyPage=n},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e,i),this.prepareLayout()}function n(t,e,i){r.call(this,t,e,i)}var s=i(10),r=i(64),a=i(5),l=a.BooleanBinder,h=a.SimpleComboBinder,c=a.SimpleStringBinder,d=a.ColorBinding,p=a.SliderBinder,u=i(19).createLineStyleEditor,_=i(13).createLineWidthEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,r,a,f,m,g,v,y,b;this._res=$("<div>"),this._table=$('<table class="property-page" cellspacing="0" cellpadding="2" style="width:100%"></table>').appendTo(this._res),t=_(),e=u(),i=this.createColorPicker(),o=this.addLabeledRow(this._table,"Line"),$("<td>").append(i).appendTo(o),$("<td>").append(t).appendTo(o),$('<td colspan="3">').append(e.render().css("display","block")).appendTo(o),n=$("<input type='checkbox' class='visibility-switch'>"),o=$("<tr>").appendTo(this._table),$('<td colspan="3">').append($("<label>").append(n).append($.t("Show Price"))).prependTo(o),s=$("<input type='checkbox'>"),o=$("<tr>").appendTo(this._table),$('<td colspan="3">').append($("<label>").append(s).append($.t("Show Text"))).prependTo(o),o=this.addLabeledRow(this._table,"Text:"),r=this.createColorPicker(),a=this.createFontSizeEditor(),f=this.createFontEditor(),m=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),g=$('<span class="_tv-button _tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),$("<td>").append(r).appendTo(o),$("<td>").append(f).appendTo(o),$("<td>").append(a).appendTo(o),$("<td>").append(m).appendTo(o),$("<td>").append(g).appendTo(o),o=$("<tr>").appendTo(this._table),$("<td colspan='2'>").append($.t("Text Alignment:")).appendTo(o),v=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),y=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>").data("selectbox-css",{display:"block"}),$("<td>").append(v).appendTo(o),$("<td colspan='3'>").append(y).appendTo(o),b=$("<textarea rows='7' cols='60'>").css("width","100%"),o=$("<tr>").appendTo(this._table),$("<td colspan='7'>").append(b).appendTo(o),this.bindControl(new l(s,this._linetool.properties().showLabel,!0,this.model(),"Change Horz Line Text Visibility")),this.bindControl(new h(v,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment")),this.bindControl(new h(y,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment")),this.bindControl(new c(b,this._linetool.properties().text,null,!0,this.model(),"Change Text")),
@@ -411,7 +411,7 @@ o.prototype.setQuantityBackgroundColor=function(t){return d.setColorToProperties
return d.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},o.prototype.setCloseButtonIconColor=function(t){return d.setColorToProperties(t,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onReverse=function(t,e){return e?this.isFunction(e)&&(this._onReverseData=t,this._onReverseCallback=e):this.isFunction(t)&&(this._onReverseCallback=t),this},o.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},o.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},o.prototype.onClose=function(t,e){return e?this.isFunction(e)&&(this._onCloseData=t,this._onCloseCallback=e):this.isFunction(t)&&(this._onCloseCallback=t),this},o.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._onCloseCallback.call(this,this._onCloseData)},o.prototype.isOnCloseCallbackPresent=function(){return this.isFunction(this._onCloseCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},TradingView.PositionRenderer=function(t,e,i){this._data=t,this._cache=e,this._adapter=i},TradingView.PositionRenderer.prototype._height=function(){return Math.max(20,1+Math.max(d.fontHeight(this._adapter.getBodyFont()),d.fontHeight(this._adapter.getQuantityFont())))},TradingView.PositionRenderer.prototype._bodyWidth=function(t){var e,i;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getBodyFont(),e=10,i=t.measureText(this._adapter.getText()).width,t.restore(),Math.round(e+i))},TradingView.PositionRenderer.prototype._getQuantity=function(){return _(this._adapter.getQuantity()," ")},TradingView.PositionRenderer.prototype._quantityWidth=function(t){var e,i;return 0===this._getQuantity().length?0:(t.save(),t.font=this._adapter.getQuantityFont(),e=10,i=t.measureText(this._getQuantity()).width,t.restore(),Math.round(Math.max(this._height(),e+i)))},TradingView.PositionRenderer.prototype._reverseButtonWidth=function(){
return this._adapter.isOnReverseCallbackPresent()?this._height():0},TradingView.PositionRenderer.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0},TradingView.PositionRenderer.prototype._drawLines=function(t,e,i,o,n){t.save(),t.strokeStyle=this._adapter.getLineColor(),t.lineStyle=this._adapter.getLineStyle(),t.lineWidth=this._adapter.getLineWidth(),CanvasEx.drawLine(t,i,o,n,o),this._adapter.getExtendLeft()&&CanvasEx.drawLine(t,0,o,e,o),t.restore()},TradingView.PositionRenderer.prototype._drawBody=function(t,e,i){var o,n;t.strokeStyle=this._adapter.getBodyBorderColor(),t.fillStyle=this._adapter.getBodyBackgroundColor(),o=this._bodyWidth(t),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n)},TradingView.PositionRenderer.prototype._drawBodyText=function(t,e,i){var o,n;t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getBodyFont(),t.fillStyle=this._adapter.getBodyTextColor(),o=e+this._bodyWidth(t)/2,n=i+this._height()/2,t.fillText(this._adapter.getText(),o,n),t.restore()},TradingView.PositionRenderer.prototype._drawQuantity=function(t,e,i){var o,n;t.strokeStyle=this._adapter.getQuantityBorderColor(),t.fillStyle=this._adapter.getQuantityBackgroundColor(),o=this._quantityWidth(t),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n)},TradingView.PositionRenderer.prototype._drawQuantityText=function(t,e,i){var o,n;t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getQuantityFont(),t.fillStyle=this._adapter.getQuantityTextColor(),o=e+this._quantityWidth(t)/2,n=i+this._height()/2,t.fillText(this._getQuantity(),o,n),t.restore()},TradingView.PositionRenderer.prototype._drawReverseButton=function(t,e,i){var o,n,s,r,a,l,h;t.save(),t.strokeStyle=this._adapter.getReverseButtonBorderColor(),t.fillStyle=this._adapter.getReverseButtonBackgroundColor(),o=this._reverseButtonWidth(),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n),t.strokeStyle=this._adapter.getReverseButtonIconColor(),s=function(t,e){CanvasEx.drawLine(t,0,0,0,e),CanvasEx.drawLine(t,-1,1,1,1),CanvasEx.drawLine(t,-2,2,2,2)},r=6,a=10,l=e+Math.round((this._reverseButtonWidth()-r)/2),h=i+5,t.save(),t.translate(l,h),s(t,a),t.translate(r,a),t.rotate(Math.PI),s(t,a),t.restore(),this._adapter._blocked&&(t.fillStyle="rgba(140, 140, 140, 0.75)",t.fillRect(e+.5,i+.5,o-1,n-1)),t.restore()},TradingView.PositionRenderer.prototype._drawCloseButton=function(t,e,i){var o,n,s,r,a,l,h;t.save(),t.strokeStyle=this._adapter.getCloseButtonBorderColor(),t.fillStyle=this._adapter.getCloseButtonBackgroundColor(),o=this._closeButtonWidth(),n=this._height(),t.fillRect(e+.5,i+.5,o-1,n-1),t.strokeRect(e,i,o,n),s=e+o,r=i+n,t.strokeStyle=this._adapter.getCloseButtonIconColor(),a=8,l=(this._closeButtonWidth()-a)/2,h=(this._height()-a)/2,CanvasEx.drawPoly(t,[{x:e+l,y:i+h},{x:s-l,y:r-h}],!0),CanvasEx.drawPoly(t,[{x:s-l,y:i+h},{x:e+l,y:r-h}],!0),this._adapter._blocked&&(t.fillStyle="rgba(140, 140, 140, 0.75)",t.fillRect(e+.5,i+.5,o-1,n-1)),
t.restore()},TradingView.PositionRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;!this._data.points||this._data.points.length<1||(e=this._data.width,i=this._bodyWidth(t),o=this._quantityWidth(t),n=this._reverseButtonWidth(t),s=i+o+n+this._closeButtonWidth(),r=e-s,a=Math.max(this._adapter.getLineLength()/100*e,1),l=Math.round(e-Math.min(r,a)),h=l-s,c=Math.round(this._data.points[0].y),d=Math.round(c-(this._height()+1)/2),this._cache.bodyRight=h+i,this._cache.quantityRight=this._cache.bodyRight+o,this._cache.reverseButtonRight=this._cache.quantityRight+n,this._cache.top=d,this._cache.bottom=d+this._height(),this._cache.left=h,this._cache.right=l,this._drawLines(t,h,l,c,e),0!==i&&(this._drawBody(t,h,d),this._drawBodyText(t,h,d)),0!==o&&(this._drawQuantity(t,this._cache.bodyRight,d),this._drawQuantityText(t,this._cache.bodyRight,d)),0!==n&&this._drawReverseButton(t,this._cache.quantityRight,d),0!==this._closeButtonWidth()&&this._drawCloseButton(t,this._cache.reverseButtonRight,d))},TradingView.PositionRenderer.prototype.hitTest=function(t){return 0===this._data.points.length?null:t.y<this._cache.top||t.y>this._cache.bottom||t.x<this._cache.left||this._cache.right<t.x?null:this._adapter._blocked?new p(p.CUSTOM,{}):t.x>=this._cache.bodyRight&&t.x<this._cache.quantityRight&&this._adapter._onModifyCallback?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:$.t("Edit Position"),rect:{x:this._cache.bodyRight,y:this._cache.top,w:this._cache.quantityRight-this._cache.bodyRight,h:this._cache.bottom-this._cache.top}}}):t.x>=this._cache.quantityRight&&t.x<this._cache.reverseButtonRight?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:$.t("Reverse Position"),rect:{x:this._cache.quantityRight,y:this._cache.top,w:this._cache.reverseButtonRight-this._cache.quantityRight,h:this._cache.bottom-this._cache.top}}}):t.x>=this._cache.reverseButtonRight&&t.x<this._cache.right?new p(p.CUSTOM,{mouseDownHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:$.t("Close Position"),rect:{x:this._cache.reverseButtonRight,y:this._cache.top,w:this._cache.right-this._cache.reverseButtonRight,h:this._cache.bottom-this._cache.top}}}):new p(p.REGULAR,{mouseDownHandler:function(){}})},inherit(n,c),n.prototype._updateImpl=function(){c.prototype._updateImpl.call(this),this._background=this._linetool.properties().lineColor.value()},inherit(s,h),s.prototype.renderer=function(){var t={points:this._points,width:this._model.timeScale().width()};return new TradingView.PositionRenderer(t,this._rendererCache,this._source._adapter)},inherit(r,a),r.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},r.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},r.skipMagnetting=!0,r.prototype.title=function(){return"Position"},r.prototype.createPriceAxisView=function(t){return this._priceAxisView=new n(this,t),this._priceAxisView},
r.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.paneViews.call(this,t):null},r.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.priceAxisViews.call(this,t,i):null},r.prototype.hasContextMenu=function(){return!0},r.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},t.exports=r}).call(e,i(3))},function(t,e,i){"use strict";function o(t){this._data=t,this._targetFontSize1=11,this._targetFontSize2=11,this._targetFontSize3=14,this._font="Arial",this._sourceFontSize1=12,this._sourceFontSize2=10}function n(t,e){h.call(this,t,e),this._clockWhite=_("prediction-clock-white",TradingView.wrapUrl("images/prediction-clock-white.png")),this._clockBlack=_("prediction-clock-black",TradingView.wrapUrl("images/prediction-clock-black.png")),this._successIcon=_("prediction-success-white",TradingView.wrapUrl("images/prediction-success-white.png")),this._failureIcon=_("prediction-failure-white",TradingView.wrapUrl("images/prediction-failure-white.png")),this._percentageFormatter=new g,this._invalidated=!0}function s(t,e){this._constructor="LineToolPrediction";var i=e||new m("linetoolprediction");i.merge({status:s.ALERT_STATUS_WAITING}),c.call(this,t,new n(this,t),i)}var r=i(36),a=r.parseRgb,l=r.rgbToBlackWhiteString,h=i(9),c=i(1).LineDataSource,d=i(43).Interval,p=i(8),u=i(6),_=i(283),f=i(2),m=i(7).DefaultProperty,g=i(70).PercentageFormatter,v=i(162).DateFormatter,y=i(122).TimeFormatter,b=i(123).TimeSpanFormatter,w=i(14);o.prototype.drawBalloon=function(t,e,i,o,n,s){var r,a,l=6,h=5,c=5,d=s||20,p=3;return t.beginPath(),"down"===n?(r=new f.Point(e.x-d,e.y-l-c-o),t.moveTo(r.x+p,r.y),t.lineTo(r.x+i-p,r.y),t.arcTo(r.x+i,r.y,r.x+i,r.y+p,p),t.lineTo(r.x+i,r.y+o-p),t.arcTo(r.x+i,r.y+o,r.x+i-p,r.y+o,p),t.lineTo(r.x+d+h,r.y+o),t.lineTo(r.x+d,r.y+o+c),t.lineTo(r.x+d-h,r.y+o),t.lineTo(r.x+p,r.y+o),t.arcTo(r.x,r.y+o,r.x,r.y+o-p,p),t.lineTo(r.x,r.y+p),t.arcTo(r.x,r.y,r.x+p,r.y,p),r):(a=new f.Point(e.x-d,e.y+l+c+o),t.moveTo(a.x+p,a.y),t.lineTo(a.x+i-p,a.y),t.arcTo(a.x+i,a.y,a.x+i,a.y-p,p),t.lineTo(a.x+i,a.y-o+p),t.arcTo(a.x+i,a.y-o,a.x+i-p,a.y-o,p),t.lineTo(a.x+d+h,a.y-o),t.lineTo(a.x+d,a.y-o-c),t.lineTo(a.x+d-h,a.y-o),t.lineTo(a.x+p,a.y-o),t.arcTo(a.x,a.y-o,a.x,a.y-o+p,p),t.lineTo(a.x,a.y-p),t.arcTo(a.x,a.y,a.x+p,a.y,p),new f.Point(a.x,a.y-o))},o.prototype.drawTargetLabel=function(t){var e,i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,S,T,C,x=this._data.points[1];if(t.save(),t.translate(.5,.5),t.font="normal "+this._targetFontSize3+"px "+this._font,e=1.5*this._targetFontSize1+1.5*this._targetFontSize2+3,i=t.measureText(this._data.targetLine1).width,o=t.measureText(this._data.targetLine2).width,t.font="normal "+this._targetFontSize2+"px "+this._font,n=t.measureText(this._data.targetLine3).width,
r.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.paneViews.call(this,t):null},r.prototype.priceAxisViews=function(t,i){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?l.prototype.priceAxisViews.call(this,t,i):null},r.prototype.hasContextMenu=function(){return!0},r.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},t.exports=r}).call(e,i(3))},function(t,e,i){"use strict";function o(t){this._data=t,this._targetFontSize1=11,this._targetFontSize2=11,this._targetFontSize3=14,this._font="Arial",this._sourceFontSize1=12,this._sourceFontSize2=10}function n(t,e){h.call(this,t,e),this._clockWhite=_("prediction-clock-white",TradingView.wrapUrl("images/prediction-clock-white.png")),this._clockBlack=_("prediction-clock-black",TradingView.wrapUrl("images/prediction-clock-black.png")),this._successIcon=_("prediction-success-white",TradingView.wrapUrl("images/prediction-success-white.png")),this._failureIcon=_("prediction-failure-white",TradingView.wrapUrl("images/prediction-failure-white.png")),this._percentageFormatter=new g,this._invalidated=!0}function s(t,e){this._constructor="LineToolPrediction";var i=e||new m("linetoolprediction");i.merge({status:s.ALERT_STATUS_WAITING}),c.call(this,t,new n(this,t),i)}var r=i(37),a=r.parseRgb,l=r.rgbToBlackWhiteString,h=i(9),c=i(1).LineDataSource,d=i(36).Interval,p=i(8),u=i(6),_=i(283),f=i(2),m=i(7).DefaultProperty,g=i(70).PercentageFormatter,v=i(162).DateFormatter,y=i(122).TimeFormatter,b=i(123).TimeSpanFormatter,w=i(14);o.prototype.drawBalloon=function(t,e,i,o,n,s){var r,a,l=6,h=5,c=5,d=s||20,p=3;return t.beginPath(),"down"===n?(r=new f.Point(e.x-d,e.y-l-c-o),t.moveTo(r.x+p,r.y),t.lineTo(r.x+i-p,r.y),t.arcTo(r.x+i,r.y,r.x+i,r.y+p,p),t.lineTo(r.x+i,r.y+o-p),t.arcTo(r.x+i,r.y+o,r.x+i-p,r.y+o,p),t.lineTo(r.x+d+h,r.y+o),t.lineTo(r.x+d,r.y+o+c),t.lineTo(r.x+d-h,r.y+o),t.lineTo(r.x+p,r.y+o),t.arcTo(r.x,r.y+o,r.x,r.y+o-p,p),t.lineTo(r.x,r.y+p),t.arcTo(r.x,r.y,r.x+p,r.y,p),r):(a=new f.Point(e.x-d,e.y+l+c+o),t.moveTo(a.x+p,a.y),t.lineTo(a.x+i-p,a.y),t.arcTo(a.x+i,a.y,a.x+i,a.y-p,p),t.lineTo(a.x+i,a.y-o+p),t.arcTo(a.x+i,a.y-o,a.x+i-p,a.y-o,p),t.lineTo(a.x+d+h,a.y-o),t.lineTo(a.x+d,a.y-o-c),t.lineTo(a.x+d-h,a.y-o),t.lineTo(a.x+p,a.y-o),t.arcTo(a.x,a.y-o,a.x,a.y-o+p,p),t.lineTo(a.x,a.y-p),t.arcTo(a.x,a.y,a.x+p,a.y,p),new f.Point(a.x,a.y-o))},o.prototype.drawTargetLabel=function(t){var e,i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,S,T,C,x=this._data.points[1];if(t.save(),t.translate(.5,.5),t.font="normal "+this._targetFontSize3+"px "+this._font,e=1.5*this._targetFontSize1+1.5*this._targetFontSize2+3,i=t.measureText(this._data.targetLine1).width,o=t.measureText(this._data.targetLine2).width,t.font="normal "+this._targetFontSize2+"px "+this._font,n=t.measureText(this._data.targetLine3).width,
r=t.measureText(this._data.targetLine4).width,a=Math.max(i+o,n+r+10)+20,l="up"===this._data.direction?"down":"up",h=x.x+a-t.canvas.width+5,h=Math.max(20,Math.min(a-15,h)),c=this.drawBalloon(t,x,a,e,l,h),t.save(),t.fillStyle=w.generateColor(this._data.targetBackColor,this._data.transparency),t.fill(),t.restore(),t.save(),t.lineWidth=2,t.strokeStyle=w.generateColor(this._data.targetStrokeColor,this._data.transparency),t.stroke(),t.restore(),d=3,t.beginPath(),t.arc(x.x,x.y,d,0,2*Math.PI,!1),t.fillStyle=this._data.centersColor,t.fill(),t.textAlign="left",p=6,u=4,t.fillStyle=this._data.targetTextColor,t.font="normal "+this._targetFontSize3+"px "+this._font,t.fillText(this._data.targetLine1,c.x+p,c.y+this._targetFontSize1+u),_=13,f=5,t.fillText(this._data.targetLine2,c.x+p+i+f,c.y+this._targetFontSize1+u),t.font="normal "+this._targetFontSize2+"px "+this._font,m=c.y+this._targetFontSize1+2*u+this._targetFontSize2,t.fillText(this._data.targetLine3,c.x+p,m),t.drawImage(this._data.clockWhite,c.x+p+n+6,m-this._targetFontSize2+3),t.fillText(this._data.targetLine4,c.x+p+n+_+5,m),!this._data.status)return void t.restore();switch(g=this._targetFontSize1+4,t.font="bold "+this._targetFontSize1+"px "+this._font,this._data.status){case s.ALERT_STATUS_SUCCESS:v=$.t("SUCCESS"),y=w.generateColor(this._data.successBackground,this._data.transparency),b=this._data.successTextColor,S=this._data.successIcon;break;case s.ALERT_STATUS_FAILURE:v=$.t("FAILURE"),y=w.generateColor(this._data.failureBackground,this._data.transparency),b=this._data.failureTextColor,S=this._data.failureIcon}T=t.measureText(v).width,C=Math.round((a-T)/2),t.fillStyle=y,"up"===this._data.direction?(t.roundRect(c.x-1,c.y-g-2,a+2,g,5),t.fill(),t.fillStyle=b,t.fillText(v,c.x+C,c.y-5),t.drawImage(S,c.x+C-13,c.y-14)):(t.roundRect(c.x-1,c.y+e+3,a+2,g,5),t.fill(),t.fillStyle=b,t.fillText(v,c.x+C,c.y+e+g-1),t.drawImage(S,c.x+C-13,c.y+e+5)),t.restore()},o.prototype.drawStartLabel=function(t){var e,i,o,n,s,r,a,l,h;t.save(),t.translate(.5,.5),t.font="normal "+this._sourceFontSize1+"px "+this._font,e=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,i=t.measureText(this._data.sourceLine1).width,t.font="normal "+this._fontsize2+"px "+this._font,o=t.measureText(this._data.sourceLine2).width,n=Math.max(i,o)-5,s=this._data.points[0],r=this.drawBalloon(t,s,n,e,this._data.direction),t.fillStyle=w.generateColor(this._data.sourceBackColor,this._data.transparency),t.fill(),t.lineWidth=2,t.strokeStyle=w.generateColor(this._data.sourceStrokeColor,this._data.transparency),t.stroke(),a=3,t.beginPath(),t.arc(s.x,s.y,a,0,2*Math.PI,!1),t.fillStyle=this._data.centersColor,t.fill(),t.textAlign="left",l=3,h=2,t.fillStyle=this._data.sourceTextColor,t.font="normal "+this._sourceFontSize1+"px "+this._font,t.fillText(this._data.sourceLine1,r.x+l,r.y+this._sourceFontSize1+h),t.font="normal "+this._sourceFontSize2+"px "+this._font,t.fillText(this._data.sourceLine2,r.x+l,r.y+this._sourceFontSize1+2*h+this._sourceFontSize2),t.restore()},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u,_
;if(!(this._data.points.length<2)){if(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.points[0],i=this._data.points[1],o=i.substract(e),Math.abs(o.x)<1||Math.abs(o.y)<1?(t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.stroke()):(t.save(),t.beginPath(),t.translate(e.x,e.y),t.scale(1,o.y/o.x),t.moveTo(0,0),t.arcTo(o.x,0,o.x,o.x,Math.abs(o.x)),t.lineTo(o.x,o.x),t.restore(),t.stroke()),this.drawTargetLabel(t),this.drawStartLabel(t),n=Math.max(8,4*this._data.linewidth),t.fillStyle=this._data.color,s=o.y<0?1:-1,Math.abs(o.x)<1||Math.abs(o.y)<1)r=Math.atan(o.x/o.y);else{if(a=Math.abs(o.x),l=Math.abs(o.y),h=0,c=Math.PI/2,d=(h+c)/2,o.length()>n)for(;;){if(p=a*Math.sin(d),u=l*(1-Math.cos(d)),_=Math.sqrt((p-a)*(p-a)+(u-l)*(u-l)),Math.abs(_-n)<1)break;_>n?h=d:c=d,d=(h+c)/2}r=Math.atan((a-p)/(l-u)),o.x*o.y<0&&(r=-r)}t.save(),t.beginPath(),t.translate(i.x,i.y),t.rotate(-r),t.moveTo(0,0),t.lineTo(-n/2,s*n),t.lineTo(n/2,s*n),t.lineTo(0,0),t.restore(),t.fill()}},o.prototype.targetLabelHitTest=function(t){var e,i,o,n,s,r,a,l,h,c=this._data.points[1],d=1.5*this._targetFontSize1+1.5*this._targetFontSize2,u=this._targetFontSize1*this._data.targetLine1.length,_=this._targetFontSize1*this._data.targetLine2.length,f=this._targetFontSize2*this._data.targetLine3.length,m=this._targetFontSize2*this._data.targetLine4.length;return this._data.status&&(d+=1.5*this._targetFontSize1),e=Math.max(u+_,f+m)-20,i=20,o=5,n="up"===this._data.direction?-1:1,s=c.x-i,r=c.y+o*n,a=c.y+(o+d)*n,l=Math.min(r,a),h=Math.max(r,a),t.x>=s&&t.x<=s+e&&t.y>=l&&t.y<=h?new p(p.MOVEPOINT):null},o.prototype.sourceLabelHitTest=function(t){var e=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,i=this._sourceFontSize1*this._data.sourceLine1.length,o=this._sourceFontSize2*this._data.sourceLine2.length,n=Math.max(i,o),s=this._data.points[0],r=20,a=5,l="up"===this._data.direction?1:-1,h=s.x-r,c=s.y+a*l,d=s.y+(a+e)*l,u=Math.min(c,d),_=Math.max(c,d);return t.x>=h&&t.x<=h+n&&t.y>=u&&t.y<=_?new p(p.MOVEPOINT):null},o.prototype.hitTest=function(t){var e,i,o,n,s,r,a,l;return this._data.points.length<2?null:(e=this._data.points[0],i=this._data.points[1],o=i.substract(e),o=i.substract(e),n=t.substract(e),s=Math.abs(o.x),r=Math.abs(o.y),a=f.sign(o.y)*(r-r*Math.sqrt(1-n.x*n.x/(s*s))),l=3,Math.abs(a-n.y)<l?new p(p.MOVEPOINT):this.targetLabelHitTest(t)||this.sourceLabelHitTest(t))},inherit(n,h),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t={},t.points=this._points,t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.targetLine1=this._targetLine1,t.targetLine2=this._targetLine2,t.targetLine3=this._targetLine3,t.targetLine4=this._targetLine4,t.status=this._source.properties().status.value(),t.transparency=this._source.properties().transparency.value(),t.targetBackColor=this._source.properties().targetBackColor.value(),t.targetStrokeColor=this._source.properties().targetStrokeColor.value(),
t.targetTextColor=this._source.properties().targetTextColor.value(),t.sourceBackColor=this._source.properties().sourceBackColor.value(),t.sourceStrokeColor=this._source.properties().sourceStrokeColor.value(),t.sourceTextColor=this._source.properties().sourceTextColor.value(),t.successBackground=this._source.properties().successBackground.value(),t.successTextColor=this._source.properties().successTextColor.value(),t.failureBackground=this._source.properties().failureBackground.value(),t.failureTextColor=this._source.properties().failureTextColor.value(),t.intermediateBackColor=this._source.properties().intermediateBackColor.value(),t.intermediateTextColor=this._source.properties().intermediateTextColor.value(),t.sourceLine1=this._sourceLine1,t.sourceLine2=this._sourceLine2,t.direction=this._direction,t.clockWhite=this._clockWhite,t.clockBlack=this._clockBlack,t.successIcon=this._successIcon,t.failureIcon=this._failureIcon,t.finished=this._finished,t.centersColor=l(a(this._model._properties.paneProperties.background.value())),this.isAnchorsRequired()?(e=new u,e.append(new o(t)),this.addAnchors(e),e):new o(t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l,c,p,u,_;h.prototype.update.call(this),this._targetLine1="",this._targetLine2="",this._targetLine3="",this._targetLine4="",this._source.points().length<2||this._source.priceScale()&&(t=this._source.points()[1],e=this._source.points()[0],this._targetLine3=this._source.priceScale().formatter().format(t.price),i=t.price-e.price,o=i<0?"-":"+",this._targetLine1=this._source.priceScale().formatter().format(Math.abs(i)),n=Math.abs(Math.round(i/e.price*1e4)/100),this._targetLine1=o+this._targetLine1+" ("+o+this._percentageFormatter.format(n)+")",r=this._model.timeScale().indexToUserTime(e.index),a=this._model.timeScale().indexToUserTime(t.index),l=e.time&&t.time,l&&(r=TradingView.isString(e.time)?new Date(Date.parse(e.time)):e.time,a=TradingView.isString(t.time)?new Date(Date.parse(t.time)):t.time),c=this._model.mainSeries().isDWM(),p=d.kind(this._model.mainSeries().interval())===d.SECONDS,a&&r&&(this._targetLine4=(new v).format(a),c||(this._targetLine4=this._targetLine4+" "+new y(p?"%h:%m:%s":"%h:%m").format(a)),u=(a.valueOf()-r.valueOf())/1e3,this._targetLine2=$.t("in",{context:"dates"})+" "+(new b).format(u)),this._sourceLine1=this._source.priceScale().formatter().format(e.price),this._sourceLine2="",_=this._model.timeScale().indexToUserTime(e.index),_&&(this._sourceLine2=(new v).format(_),c||(this._sourceLine2=this._sourceLine2+" "+new y(p?"%h:%m:%s":"%h:%m").format(_))),this._direction=this._source.direction()===s.DIRECTION_UP?"up":"down",this._finished=this._model.lineBeingCreated()!==this._source&&this._model.lineBeingEdited()!==this._source&&this._model.sourceBeingMoved()!==this._source)},s.ALERT_STATUS_WAITING=0,s.ALERT_STATUS_SUCCESS=1,s.ALERT_STATUS_FAILURE=2,s.DIRECTION_UP=1,s.DIRECTION_DOWN=2,inherit(s,c),s.prototype.status=function(){return this._properties.status.value()},
@@ -432,16 +432,16 @@ o.prototype._correctPoints=function(t){var e,i,o,n,s,r;if(t&&(void 0===t.indexes
return this.m_bars},o.prototype.nsBars=function(){return this.m_nsBars},o.prototype.size=function(){return this.m_nsBars._end-this.m_nsBars._start+(this.m_bars._end-this.m_bars._start)},o.prototype.each=function(t){var e;for(e=this.m_bars._start;e<this.m_bars._end&&!t(this.m_bars._indexAt(e),this.m_bars._valueAt(e));++e);for(e=this.m_nsBars._start;e<this.m_nsBars._end&&!t(this.m_nsBars._indexAt(e),this.m_nsBars._valueAt(e));++e);},o.prototype.clear=function(){this.m_bars=new n(["time","open","high","low","close","adt","style"]),this.m_nsBars=new n(["time","open","high","low","close","adt","style"]),this.lastProjectionPrice=void 0},o.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars._items[0]:this.m_bars._items[0]},o.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},o.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars._items[this.m_bars._end-1]:this.m_nsBars._items[this.m_nsBars._end-1]},o.prototype.search=function(t,e){return this.nsBars().isEmpty()?this.bars().search(t,e):this.bars().isEmpty()?this.nsBars().search(t,e):this.nsBars().firstTimeIndex()<=t?this.nsBars().search(t,e):this.bars().search(t,e)},o.prototype.valueAt=function(t){var e=this.search(t);if(e)return e.value},o.prototype.firstBar=function(){var t,e,i;return this.m_model.timeScale().isEmpty()?null:(t=this.m_model.timeScale().visibleBars(),e=t.firstBar(),i=this.search(e,TradingView.SEARCH_NEAREST_RIGHT),i?i.value:null)},o.prototype.firstValue=function(){var t=this.firstBar();return t?t[TradingView.CLOSE_PLOT]:null},o.prototype.calculateATR=function(){var t,e,i,o=[];for(t=this.m_bars.lastIndex();t>=this.m_bars.firstIndex();t--)e=this.m_bars._valueAt(t),o.push(e[TradingView.HIGH_PLOT]-e[TradingView.LOW_PLOT]);return i=0===o.length?0:o.reduce(function(t,e){return t+e},0)/o.length,i*=this.m_series.base()},o.prototype.timeToBarIndex=function(t,e){var i,o;if(null===t)return s.logDebug("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"),0;if(e===TradingView.SEARCH_FROM_RIGHT){for(i=this.m_bars.lastIndex();i>=this.m_bars.firstIndex();i--)if(o=this.m_bars._valueAt(i),t>=o[TradingView.TIME_PLOT])return i;for(i=this.m_nsBars.lastIndex();i>=this.m_nsBars.firstIndex();i--)if(o=this.m_nsBars._valueAt(i),t>=o[TradingView.TIME_PLOT])return i;return this.m_bars.firstIndex()}if(e===TradingView.SEARCH_FROM_LEFT){for(i=this.m_bars.firstIndex();i<=this.m_bars.lastIndex();i++)if(o=this.m_bars._valueAt(i),t<=o[TradingView.TIME_PLOT])return i;for(i=this.m_nsBars.firstIndex();i<=this.m_nsBars.lastIndex();i++)if(o=this.m_nsBars._valueAt(i),t<=o[TradingView.TIME_PLOT])return i;return this.m_bars.lastIndex()}return s.logDebug("SeriesData.timeToBarIndex: Incorrect options value"),0},t.exports=o},function(t,e,i){"use strict";function o(t,e){this.m_series=t,this.m_model=e,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=S.enabled("source_selection_markers")}function n(t,e){o.call(this,t,e)}function s(t,e){o.call(this,t,e)}function r(t,e){o.call(this,t,e)}
function a(t,e){o.call(this,t,e)}function l(t,e,i){this.m_series=t,this.m_priceSource=e,this.m_model=i,this.m_items=[],this._barGetter={open:function(t){return t[TradingView.OPEN_PLOT]},high:function(t){return t[TradingView.HIGH_PLOT]},low:function(t){return t[TradingView.LOW_PLOT]},close:function(t){return t[TradingView.CLOSE_PLOT]},hl2:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2},hlc3:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/3},ohlc4:function(t){return(t[TradingView.OPEN_PLOT]+t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/4}}[this.m_priceSource]}function h(t,e,i){l.call(this,t,e,i),this._invaidated=!0}function c(t,e,i){l.call(this,t,e,i),this._invaidated=!0}var d=i(2),p=i(68).SelectionRenderer,u=i(8),_=i(59),f=_.PaneRendererBars,m=_.PaneRendererLine,g=_.PaneRendererArea,v=_.PaneRendererCandles,y=i(6),b=i(344),w=i(14),S=i(3);o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,p,_,f,m,g=this;if(this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars(),!t.isEmpty()&&0!==this.m_series.bars().size())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT);e<=i&&void 0===this.m_series.bars().valueAt(e);e++);if(!(e>i)&&(t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),s=n.properties().percentage.value(),r=this.m_series.barColorer(),a={},t.each(function(t,e){var i,n;void 0!==e[TradingView.OPEN_PLOT]&&void 0!==e[TradingView.HIGH_PLOT]&&void 0!==e[TradingView.LOW_PLOT]&&void 0!==e[TradingView.CLOSE_PLOT]&&(void 0===o&&(o=e[TradingView.CLOSE_PLOT]),i={},i.time=Math.round(t),s?(i.open=100*(e[TradingView.OPEN_PLOT]-o)/o,i.high=100*(e[TradingView.HIGH_PLOT]-o)/o,i.low=100*(e[TradingView.LOW_PLOT]-o)/o,i.close=100*(e[TradingView.CLOSE_PLOT]-o)/o):(i.open=e[TradingView.OPEN_PLOT],i.high=e[TradingView.HIGH_PLOT],i.low=e[TradingView.LOW_PLOT],i.close=e[TradingView.CLOSE_PLOT]),a.value=e,n=e[TradingView.STYLE_PLOT]?e[TradingView.STYLE_PLOT]:r.barStyle(t,!1,a),e[TradingView.STYLE_PLOT]=n,a.previousValue=e,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,g.m_bars.push(i))},this),n.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_series===this.m_model.selectedSource()))for(l=b(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=u.REGULAR,h=0;h<l.length;h++)c=l[h],(p=this.m_series.bars().valueAt(c))&&(_=.5*(p[TradingView.OPEN_PLOT]+p[TradingView.CLOSE_PLOT]),n.properties().percentage.value()&&(_=100*(_-o)/o),f=this.m_model.timeScale().indexToCoordinate(c),m=this.m_series.priceScale().priceToCoordinate(_),this._selectionData.points.push(new d.Point(f,m)))}},o.prototype.items=function(){return this.m_bars},o.prototype.dump=function(){var t={}
;return t.bars=this.m_bars,t},inherit(n,o),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new y,e.append(new f(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new p(this._selectionData)),e},inherit(s,o),s.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().candleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().candleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().candleStyle.borderColor.value(),t.wickColor=this.m_series.properties().candleStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new p(this._selectionData)),e},inherit(r,o),r.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().haStyle.drawWick.value(),t.drawBorder=this.m_series.properties().haStyle.drawBorder.value(),t.borderColor=this.m_series.properties().haStyle.borderColor.value(),t.wickColor=this.m_series.properties().haStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new p(this._selectionData)),e},inherit(a,o),a.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),t.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),e=new y,e.append(new v(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new p(this._selectionData)),e},l.prototype.update=function(){var t,e,i,o,n,s,r,a,l,h,c,p,_,f,m,g,v;if(this.m_items=[],!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars(),!t.isEmpty()&&0!==this.m_series.bars().size())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),t=this.m_series.bars().range(e,i),o=this,s=o.m_series.priceScale(),r={color:this.m_series.properties().lineStyle.color.value()},a=s.properties().percentage.value(),l=t._start;l<t._end;++l)h=t._indexAt(l),c=t._valueAt(l),void 0!==(p=this._barGetter(c))&&null!==p&&(void 0===n&&(n=p),a&&(p=100*(p-n)/n),_=new d.Point(h,p),_.style=r,o.m_items.push(_))
;if(s.pointsArrayToCoordinates(o.m_items),o.m_model.timeScale().indexesToCoordinates(o.m_items),this.m_series===this.m_model.selectedSource())for(f=b(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=u.REGULAR,l=0;l<f.length;l++)h=f[l],m=this.m_series.data().valueAt(h),p=this._barGetter(m),s.properties().percentage.value()&&(p=100*(p-n)/n),g=this.m_model.timeScale().indexToCoordinate(h),v=this.m_series.priceScale().priceToCoordinate(p),this._selectionData.points.push(new d.Point(g,v))}},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t=this.m_series.properties().lineStyle,e={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:t.color.value(),lineStyle:t.linestyle.value(),withMarkers:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:t.linewidth.value(),simpleMode:!0},i=new m(e),this.m_series===this.m_model.selectedSource()?(o=new y,o.append(i),this._isMarkersEnabled&&o.append(new p(this._selectionData))):o=i,o},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var t,e,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t={},t.simpleMode=!1,t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.lineColor=this.m_series.properties().areaStyle.linecolor.value(),t.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),t.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),e=this.m_series.properties().areaStyle.transparency.value(),t.isSeries=!0,t.color1=w.generateColor(this.m_series.properties().areaStyle.color1.value(),e),t.color2=w.generateColor(this.m_series.properties().areaStyle.color2.value(),e),t.bottom=this.m_series.priceScale().height(),i=new y,i.append(new g(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new p(this._selectionData)),i},e.SeriesBarsPaneView=n,e.SeriesCandlesPaneView=s,e.SeriesHollowCandlesPaneView=a,e.SeriesLinePaneView=h,e.SeriesAreaPaneView=c,e.SeriesHeikenAshiPaneView=r},function(t,e,i){(function(e){"use strict";function o(t,e){this._series=t,this._model=e,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invalidated=!0,this._rendererData={text:"",coordinate:null,color:"#FFF",background:"#000",visible:!1,secondLine:null}}var n=i(66),s=i(67),r=i(43).Interval;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(t){var i,o,n,s,r=this._rendererData;r.visible=!1,r.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._series.lastValueData(null,e.enabled("price_scale_always_last_bar_value")),
;if(s.pointsArrayToCoordinates(o.m_items),o.m_model.timeScale().indexesToCoordinates(o.m_items),this.m_series===this.m_model.selectedSource())for(f=b(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=u.REGULAR,l=0;l<f.length;l++)h=f[l],m=this.m_series.data().valueAt(h),p=this._barGetter(m),s.properties().percentage.value()&&(p=100*(p-n)/n),g=this.m_model.timeScale().indexToCoordinate(h),v=this.m_series.priceScale().priceToCoordinate(p),this._selectionData.points.push(new d.Point(g,v))}},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t=this.m_series.properties().lineStyle,e={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:t.color.value(),lineStyle:t.linestyle.value(),withMarkers:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:t.linewidth.value(),simpleMode:!0},i=new m(e),this.m_series===this.m_model.selectedSource()?(o=new y,o.append(i),this._isMarkersEnabled&&o.append(new p(this._selectionData))):o=i,o},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var t,e,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t={},t.simpleMode=!1,t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.lineColor=this.m_series.properties().areaStyle.linecolor.value(),t.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),t.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),e=this.m_series.properties().areaStyle.transparency.value(),t.isSeries=!0,t.color1=w.generateColor(this.m_series.properties().areaStyle.color1.value(),e),t.color2=w.generateColor(this.m_series.properties().areaStyle.color2.value(),e),t.bottom=this.m_series.priceScale().height(),i=new y,i.append(new g(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new p(this._selectionData)),i},e.SeriesBarsPaneView=n,e.SeriesCandlesPaneView=s,e.SeriesHollowCandlesPaneView=a,e.SeriesLinePaneView=h,e.SeriesAreaPaneView=c,e.SeriesHeikenAshiPaneView=r},function(t,e,i){(function(e){"use strict";function o(t,e){this._series=t,this._model=e,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invalidated=!0,this._rendererData={text:"",coordinate:null,color:"#FFF",background:"#000",visible:!1,secondLine:null}}var n=i(66),s=i(67),r=i(36).Interval;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(t){var i,o,n,s,r=this._rendererData;r.visible=!1,r.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._series.lastValueData(null,e.enabled("price_scale_always_last_bar_value")),
!i.noData&&i.text&&(this._series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI&&this._series.properties().haStyle.showRealLastPrice.value()&&(o=this._series.lastValueData(TradingView.CLOSE_PLOT,!1).index,n=this._series.lastValueData(TradingView.CLOSE_PLOT,!0).index,o===n)||(r.visible=!0,r.text=i.text,i.color!==this._background&&(this._background=i.color,r.color=this.color(),r.background=this._background),r.coordinate=i.coordinate,this._floatCoordinate=i.floatCoordinate,this._coordinate=i.coordinate,r.secondLine=null,e.enabled("countdown")&&this._series.properties().showCountdown.value()&&(s=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_HEIKEN_ASHI],-1!==s.indexOf(this._series.properties().style.value())&&(r.secondLine=this._countdownInfo())))))},o.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),n.prototype.coordinate.call(this)},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new s(this._rendererData)),this._renderer},o.prototype.dump=function(){return{text:this._rendererData.text,coordinate:this._rendererData.coordinate,color:this._rendererData.color,background:this._rendererData.background,visible:this._rendererData.visible}},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._rendererData.text},o.prototype._countdownInfo=function(){var t,e,i,o,n,s,a,l,h,c,d=null;return this._series.isDWM()?d:(t=1e3*this._series.data().bars().last().value[0],e=1e3*this._series.serverTimeOffset(),i=r.parse(this._series.interval()),o=i.kind()===r.SECONDS?i.multiplier():60*i.multiplier(),n=t.valueOf()+1e3*o,s=(new Date).valueOf()+e,a=Math.round((n-s)/1e3),a>0&&(a=Math.min(a,o),l="",a>=3600&&(l=Math.floor(a/3600)+":"),a%=3600,h=("0"+Math.floor(a/60)).right(2),a%=60,c=("0"+Math.floor(a)).right(2),d=l+h+":"+c),d)},t.exports=o}).call(e,i(3))},function(t,e){"use strict";function i(t){this._props=t,this._text="",this._size="12px",this._bold=!1}i.prototype.text=function(){return this._text},i.prototype.setText=function(t){this._text=t},i.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#444"},i.prototype.bold=function(){return this._bold},i.prototype.size=function(){return this._size},t.exports=i},function(t,e,i){"use strict";function o(t,e,i,o){this._symbolLabelView=new s(t,this,"compare","symbol","showSymbolLabels"),TradingView.Study.call(this,t,e,i,o);var n=this;this._properties.minTick.listeners().subscribe(null,function(){n._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){n._model.invalidate(new r(r.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}var n=i(154).DataVendorStudyDataWindowView,s=i(158),r=i(21),a=i(27).PriceFormatter;inherit(o,TradingView.Study),
o.prototype.createPlotLabels=function(t){},o.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},o.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new n(this,this._model)),TradingView.Study.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},o.prototype._createFormatter=function(){var t,e,i,o,n,s=this.properties().inputs.symbol.value(),r=this._resolvedSymbols?this._resolvedSymbols[s]:null;"default"===this.properties().minTick.value()?this._formatter=new a(r?r.pricescale:100,r?r.minmov:1,!!r&&r.fractional):(t=this.properties().minTick.value(),e=isNumber(t)?["100","1","false"]:t.split(","),i=parseInt(e[0]),o=parseInt(e[1]),n="true"===e[2],this._formatter=new a(i,o,n)),this.priceScale()&&this.priceScale().updateFormatter()},o.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},o.prototype.title=function(t){var e,i=this.properties().inputs.symbol.value(),o=this._resolvedSymbols?this._resolvedSymbols[i]:null;return o?(e=o.name,o.exchange&&0!==o.exchange.length&&(e+=", "+o.exchange)):e=i,e.toUpperCase()},o.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},o.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},o.prototype.tags=function(){var t=this.symbol();return t?[t]:[]},t.exports=o},function(t,e,i){"use strict";function o(t){this._studyId=t,this._maxToVers=s.ZERO,this._maxFromVers=s.ZERO,this._migrs=[]}var n=i(80),s=i(732).Version,r=i(12).getLogger("Chart.StudyMigration");o.prototype.addMigration=function(t,e,i){var o=s.parse(t),n=s.parse(e);o.isGreater(this._maxFromVers)&&(this._maxFromVers=o),n.isGreater(this._maxToVers)&&(this._maxToVers=n),this._migrs.push({fromVers:o,toVers:n,rules:i})},o.prototype.updateInputs=function(t,e){var i,o,n;if(!e)return e;for(i=TradingView.clone(e),o=t;o.isLess(this._maxToVers);){if(n=this._findMigration(o),i=this._applyMigration(i,n),!o.isLess(n.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");o=n.toVers,r.logDebug("Applied migration rule to study: "+this._studyId+" from vers: "+n.fromVers+" to vers: "+n.toVers)}return i},o.prototype._findMigration=function(t){var e,i,o=-1,n=this._maxFromVers;for(e=0;e<this._migrs.length;e++)i=this._migrs[e],i.fromVers.isLess(t)||i.fromVers.isLessOrEqual(n)&&(n=i.fromVers,o=e);if(o<0)throw Error("Could not find matching migration for study: "+this._studyId+" vers: "+t);return this._migrs[o]},o.prototype._applyMigration=function(t,e){var i,o,n,s=t;for(i=0;i<e.rules.length;i++)o=e.rules[i],n=this._getApplyRuleFun(o.type),s=n(s,o);return s},o.prototype._getApplyRuleFun=function(t){if("inputRemoved"===t)return o._applyInputRemovedRule;if("inputChangedType"===t)return o._applyInputChangedTypeRule
;throw Error("Unknown migration rule type: "+t)},o._applyInputRemovedRule=function(t,e){var i,o,s,r;if(!(e.inputId in t))return t;if(!(i=n.findInputKeyById(t,e.inputId)))return t;delete t[i],delete t[e.inputId],o={},s=0;for(r in t)isNumber(parseInt(r,10))?(o[s]=t[r],s++):o[r]=t[r];return o},o._applyInputChangedTypeRule=function(t,e){var i=n.getInputKeyById(t,e.inputId);if("resetToDefVal"!==e.action)throw Error("Unknown action "+e.action+" for rule with type "+e.type);return t[e.inputId]=e.defVal,t[i].defval=e.defVal,t[i].type=e.inputType,t},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[new a.Point(0,0)]}function n(t,e){this._source=t,this._model=e,this._invalidated=!0,this._text="",this._coordinate=0,this._background="black",this._color="white"}function s(t,e){b.call(this),this._study=t,this._model=e,this._items.push(new w("Open","")),this._items.push(new w("High","")),this._items.push(new w("Low","")),this._items.push(new w("Close","")),this._invalidated=!0,this.update()}function r(t,e,i,o){this._symbolLabelView=new C(t,this,"close","symbol","showSymbolLabels"),h.call(this,t,e,i,o),this._formatter=null,this._paneView=null;var n=this;this.properties().minTick.listeners().subscribe(null,function(){n._createFormatter(),n.updateAllViews(),n._model.invalidate(new L(L.FULL_UPDATE))})}var a=i(2),l=i(42),h=i(31).Study,c=i(66),d=i(67),p=i(346),u=p.SeriesAreaPaneView,_=p.SeriesLinePaneView,f=p.SeriesHollowCandlesPaneView,m=p.SeriesCandlesPaneView,g=p.SeriesBarsPaneView,v=i(156),y=i(146),b=y.DataWindowView,w=y.DataWindowItem,S=i(196).SeriesBarColorer,T=i(89).HorzLineRenderer,C=i(158),x=i(8),P=i(198),L=i(21),k=i(27).PriceFormatter;o.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var t=this._source.lastValueData("close",!0);t.noData||(this._visible=!0,this._points=[new a.Point(0,t.coordinate)],this._color=t.color)}},o.prototype.renderer=function(){var t={};return t.points=this._points,t.color=this._color,t.linewidth=1,t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=x.REGULAR,t.visible=this._visible,new T(t)},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),c.prototype.coordinate.call(this)},n.prototype._updateImpl=function(){this._visible=!1,this._text="";var t=this._source.lastValueData("close",!1);t.noData||(this._text=t.text,this._floatCoordinate=t.floatCoordinate,this._coordinate=t.coordinate,this._background=t.color,this._visible=!0)},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,visible:this._visible};return new d(t)},inherit(s,b),s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d,p;if(this._header=this._study.title(),!this._model.timeScale().isEmpty()&&0!==this._study.data().length){if(i=!1,
;throw Error("Unknown migration rule type: "+t)},o._applyInputRemovedRule=function(t,e){var i,o,s,r;if(!(e.inputId in t))return t;if(!(i=n.findInputKeyById(t,e.inputId)))return t;delete t[i],delete t[e.inputId],o={},s=0;for(r in t)isNumber(parseInt(r,10))?(o[s]=t[r],s++):o[r]=t[r];return o},o._applyInputChangedTypeRule=function(t,e){var i=n.getInputKeyById(t,e.inputId);if("resetToDefVal"!==e.action)throw Error("Unknown action "+e.action+" for rule with type "+e.type);return t[e.inputId]=e.defVal,t[i].defval=e.defVal,t[i].type=e.inputType,t},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[new a.Point(0,0)]}function n(t,e){this._source=t,this._model=e,this._invalidated=!0,this._text="",this._coordinate=0,this._background="black",this._color="white"}function s(t,e){b.call(this),this._study=t,this._model=e,this._items.push(new w("Open","")),this._items.push(new w("High","")),this._items.push(new w("Low","")),this._items.push(new w("Close","")),this._invalidated=!0,this.update()}function r(t,e,i,o){this._symbolLabelView=new C(t,this,"close","symbol","showSymbolLabels"),h.call(this,t,e,i,o),this._formatter=null,this._paneView=null;var n=this;this.properties().minTick.listeners().subscribe(null,function(){n._createFormatter(),n.updateAllViews(),n._model.invalidate(new L(L.FULL_UPDATE))})}var a=i(2),l=i(43),h=i(31).Study,c=i(66),d=i(67),p=i(346),u=p.SeriesAreaPaneView,_=p.SeriesLinePaneView,f=p.SeriesHollowCandlesPaneView,m=p.SeriesCandlesPaneView,g=p.SeriesBarsPaneView,v=i(156),y=i(146),b=y.DataWindowView,w=y.DataWindowItem,S=i(196).SeriesBarColorer,T=i(89).HorzLineRenderer,C=i(158),x=i(8),P=i(198),L=i(21),k=i(27).PriceFormatter;o.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var t=this._source.lastValueData("close",!0);t.noData||(this._visible=!0,this._points=[new a.Point(0,t.coordinate)],this._color=t.color)}},o.prototype.renderer=function(){var t={};return t.points=this._points,t.color=this._color,t.linewidth=1,t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.hitTestResult=x.REGULAR,t.visible=this._visible,new T(t)},inherit(n,c),n.prototype.update=function(){this._invalidated=!0},n.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),c.prototype.coordinate.call(this)},n.prototype._updateImpl=function(){this._visible=!1,this._text="";var t=this._source.lastValueData("close",!1);t.noData||(this._text=t.text,this._floatCoordinate=t.floatCoordinate,this._coordinate=t.coordinate,this._background=t.color,this._visible=!0)},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,visible:this._visible};return new d(t)},inherit(s,b),s.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,h,c,d,p;if(this._header=this._study.title(),!this._model.timeScale().isEmpty()&&0!==this._study.data().length){if(i=!1,
this._study.properties().style.value()===l.STYLE_BARS?(t=this._study.properties().barStyle.upColor.value(),e=this._study.properties().barStyle.downColor.value(),i=this._study.properties().barStyle.barColorsOnPrevClose.value()):this._study.properties().style.value()===l.STYLE_CANDLES?(t=this._study.properties().candleStyle.upColor.value(),e=this._study.properties().candleStyle.downColor.value(),i=this._study.properties().candleStyle.barColorsOnPrevClose.value()):this._study.properties().style.value()===l.STYLE_HOLLOW_CANDLES?(t=this._study.properties().hollowCandleStyle.upColor.value(),e=this._study.properties().hollowCandleStyle.downColor.value(),i=!0):this._study.properties().style.value()===l.STYLE_LINE?t=e=this._study.properties().lineStyle.color.value():this._study.properties().style.value()===l.STYLE_AREA&&(t=e=this._study.properties().areaStyle.linecolor.value()),o=this._study.series(),n=this._model.crossHairSource().appliedIndex(),void 0!==(s=o.nearestIndex(n,TradingView.SEARCH_NEAREST_LEFT))){if(!((r=this._study.data().valueAt(s))&&r[TradingView.OPEN_PLOT]&&r[TradingView.HIGH_PLOT]&&r[TradingView.LOW_PLOT]&&r[TradingView.CLOSE_PLOT]))return;for(a=this._study.formatter(),this._items[0].setValue(a.format(r[TradingView.OPEN_PLOT])),this._items[1].setValue(a.format(r[TradingView.HIGH_PLOT])),this._items[2].setValue(a.format(r[TradingView.LOW_PLOT])),this._items[3].setValue(a.format(r[TradingView.CLOSE_PLOT])),i&&s>=1?(c=this._study.data().valueAt(s-1),h=c[TradingView.CLOSE_PLOT]<=r[TradingView.CLOSE_PLOT]?t:e):h=r[TradingView.OPEN_PLOT]<=r[TradingView.CLOSE_PLOT]?t:e,d=0;d<4;d++)this._items[d].setColor(h)}p=P(this._study.symbolInfo()),this._additional=p?"(Data Provided by "+p+")":void 0}},s.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},s.prototype.update=function(){this._invalidated=!0},s.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},inherit(r,h),r.prototype.createPlotLabels=function(t){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},r.prototype.lastValueData=function(t,e){var i,o,n=h.prototype.lastValueData.call(this,"close",e);if(n.noData)return n;switch(i=this.properties(),o=n.item,i.style.value()){case l.STYLE_BARS:n.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.barStyle.upColor.value():i.barStyle.downColor.value();break;case l.STYLE_CANDLES:case l.STYLE_HOLLOW_CANDLES:n.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.candleStyle.upColor.value():i.candleStyle.downColor.value();break;case l.STYLE_LINE:n.color=i.lineStyle.color.value();break;case l.STYLE_AREA:n.color=i.areaStyle.color1.value()}return n},r.prototype.createViews=function(){this._priceAxisViews=[],
this._priceAxisViewsBase=[new n(this,this._model)],this._paneViews=[];var t=null;switch(this._properties.style.value()){case l.STYLE_BARS:t=new g(this,this._model);break;case l.STYLE_CANDLES:t=new m(this,this._model);break;case l.STYLE_HOLLOW_CANDLES:t=new f(this,this._model);break;case l.STYLE_LINE:t=new _(this,this._properties.lineStyle.priceSource.value(),this._model);break;case l.STYLE_AREA:t=new u(this,this._properties.areaStyle.priceSource.value(),this._model)}t&&this._paneViews.push(t),this._paneViews.push(new o(this,this._model)),this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new s(this,this._model)),this._statusView||(this._statusView=new v(this)),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new S(this)},r.prototype.start=function(t){this._formatter=null,h.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var t,e,i,o,n,s,r;"default"===this.properties().minTick.value()?(t=this.properties().inputs.symbol.value(),e=this._resolvedSymbols[t],this._formatter=new k(e?e.pricescale:100,e?e.minmov:1,!!e&&e.fractional)):(i=this.properties().minTick.value(),o=isNumber(i)?["100","1","false"]:i.split(","),n=parseInt(o[0]),s=parseInt(o[1]),r="true"===o[2],this._formatter=new k(n,s,r)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._changeInputs=function(){h.prototype._changeInputs.call(this,this.inputs()),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[e];return i?(t=i.name,i.exchange&&0!==i.exchange.length&&(t+=", "+i.exchange)):t=e,t.toUpperCase()},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(t){return this.bars().valueAt(t)[TradingView.OPEN_PLOT]},r.prototype.high=function(t){return this.bars().valueAt(t)[TradingView.HIGH_PLOT]},r.prototype.low=function(t){return this.bars().valueAt(t)[TradingView.LOW_PLOT]},r.prototype.close=function(t){return this.bars().valueAt(t)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},r.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},r.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var t=[],e=this.symbolInfo();return e?t.push(e.name):this._properties.inputs.symbol.value()&&t.push(this._properties.inputs.symbol.value()),t},e.OverlayDataWindowView=s,e.study_Overlay=r},function(t,e,i){"use strict"
;function o(t,e,i){this._study=t,this._model=e,this._plotIndex=i,this._text="",this._coordinate=0,this._background="black",this._color="white",this._invalidated=!0,this._cache=new n}var n=i(159),s=i(66),r=i(67);inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){this._visible=!1,this._text="";var t=this._study.lastValueData(this._plotIndex);t.noData||(this._visible=!0,this._text=t.text,this._coordinate=t.coordinate,this._floatCoordinate=t.floatCoordinate,this._background!==t.color&&(this._background=t.color,this._color=this.color()))},o.prototype.coordinate=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),s.prototype.coordinate.call(this)},o.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,visible:this._visible};return new r(t,this._cache)},o.prototype.text=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),s.prototype.text.call(this)},t.exports=o},function(t,e,i){"use strict";for(var o={StudyStrategy:i(354),StatusView:i(156),StudyLineDataSource:i(78).StudyLineDataSource,StudyLineDataSourcePaneView:i(78).StudyLineDataSourcePaneView,StudyVersioning:i(80),StudyMigration:i(350),study_Overlay:i(351).study_Overlay,study_Compare:i(349),study_ScriptWithDataOffset:i(705),StudyPaneView:i(79).StudyPaneView,StudyBackgroundPaneView:i(79).StudyBackgroundPaneView,StudyPlotShapesPaneView:i(79).StudyPlotShapesPaneView,StudyPlotCharsPaneView:i(79).StudyPlotCharsPaneView,StudyPlotArrowsPaneView:i(79).StudyPlotArrowsPaneView,StudyPlotCandlesPaneView:i(79).StudyPlotCandlesPaneView,StudyStrategyOrdersPaneView:i(355),StudyPriceAxisView:i(352),StudyDataWindowView:i(154).StudyDataWindowView,DataVendorStudyDataWindowView:i(154).DataVendorStudyDataWindowView,LineStudyMtpAnalysis:i(702),LineStudyMtpDecisionPoint:i(703),LineStudyMtpRiskReward:i(704),LineStudyMtpElliotWaveMain:i(211).LineStudyMtpElliotWaveMain,LineStudyMtpElliotWaveMajor:i(211).LineStudyMtpElliotWaveMajor,LineStudyMtpElliotWaveMinor:i(211).LineStudyMtpElliotWaveMinor,LineStudyMtpDownWave1OrA:i(49).LineStudyMtpDownWave1OrA,LineStudyMtpDownWave2OrB:i(49).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(49).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(49).LineStudyMtpDownWave4,LineStudyMtpDownWave5:i(49).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(49).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(49).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(49).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(49).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(49).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(49).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(49).LineStudyMtpUpWaveC},n=Object.keys(o),s=n.length;s--;)TradingView[n[s]]=o[n[s]];t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o,s){n.call(this,t,i,o,s),this._barsIndexes=[],this._reportDataBuffer=null,this._reportData=null,this.watchedData=new e,this.model().addStrategySource(this)}
var n=i(31).Study,s=i(355);inherit(o,n),o.prototype.stop=function(){if(n.prototype.stop.call(this),this._avoidRemoveStrategySource)return void delete this._avoidRemoveStrategySource;this.model().removeStrategySource(this)},o.prototype.start=function(){this.model().addStrategySource(this),n.prototype.start.call(this)},o.prototype.processHibernate=function(){this._studyId&&!this.isVisible()&&(this._avoidRemoveStrategySource=!0),n.prototype.processHibernate.call(this)},o.prototype.onData=function(t){var e=this;n.prototype.onData.call(this,t).then(function(){var i,o,n,s;t.method&&"data_update"===t.method&&(i=t.params&&t.params.nonseries&&t.params.nonseries.d,o=i&&i.data&&i.data.report,o?(i.isUpdate&&e._reportDataBuffer&&(o=$.extend(e._reportDataBuffer,o)),e._reportDataBuffer=e._reportData=$.extend(e._reportDataBuffer||{},o)):(n=$.extend({},t),n.params.nonseries.d.data={report:e._reportDataBuffer},t=n),"nochange"!==(s=t.params&&t.params.nonseries&&t.params.nonseries.indexes)&&s instanceof Array&&s.length&&e._collateBarsIndexes(s)),e.watchedData.setValue(t)})},o.prototype._collateBarsIndexes=function(t){var e,i;if(Array.isArray(t)&&(e=this._reportData&&this._reportData.filledOrders)&&e.length)for(this._barsIndexes.length=0,i=0;i<e.length;i++)this._barsIndexes[i]=t[e[i].tm]},o.prototype.reportData=function(){return this._reportData},o.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders},o.prototype.barsIndexes=function(){return this._barsIndexes},o.prototype.clearData=function(){n.prototype.clearData.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems()},o.prototype.restoreData=function(t){n.prototype.restoreData.apply(this,arguments),this.model().addStrategySource(this),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",params:{nonseries:{d:{data:{report:this._reportData}}}}})),t.activeState&&(this._activeState=!0)},o.prototype.activeState=function(){return this._activeState},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()},o.prototype.createViews=function(){n.prototype.createViews.call(this),this._strategyOrdersPaneView=new s(this,this._series,this._model)},o.prototype.state=function(t){var e=n.prototype.state.apply(this,arguments);return t&&this._reportData&&this._barsIndexes&&(e.data||(e.data={}),e.data.reportData=this._reportData,e.data.barsIndexes=this._barsIndexes,e.data.activeState=this.model().activeStrategySource().value()===this),e},t.exports=o}).call(e,i(40))},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._series=e,this._model=i,this._invalidated=!0,this._orderArrow={vMargin:o.DEFAULT_ORDER_ARROW_VMARGIN,width:o.DEFAULT_ORDER_ARROW_WIDTH,height:o.DEFAULT_ORDER_ARROW_HEIGHT},this._exitLineWidth=o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH,this._priceArrow={width:o.DEFAULT_PRICE_ARROW_WIDTH,height:o.DEFAULT_PRICE_ARROW_HEIGHT},this._text={
var n=i(31).Study,s=i(355);inherit(o,n),o.prototype.stop=function(){if(n.prototype.stop.call(this),this._avoidRemoveStrategySource)return void delete this._avoidRemoveStrategySource;this.model().removeStrategySource(this)},o.prototype.start=function(){this.model().addStrategySource(this),n.prototype.start.call(this)},o.prototype.processHibernate=function(){this._studyId&&!this.isVisible()&&(this._avoidRemoveStrategySource=!0),n.prototype.processHibernate.call(this)},o.prototype.onData=function(t){var e=this;n.prototype.onData.call(this,t).then(function(){var i,o,n,s;t.method&&"data_update"===t.method&&(i=t.params&&t.params.nonseries&&t.params.nonseries.d,o=i&&i.data&&i.data.report,o?(i.isUpdate&&e._reportDataBuffer&&(o=$.extend(e._reportDataBuffer,o)),e._reportDataBuffer=e._reportData=$.extend(e._reportDataBuffer||{},o)):(n=$.extend({},t),n.params.nonseries.d.data={report:e._reportDataBuffer},t=n),"nochange"!==(s=t.params&&t.params.nonseries&&t.params.nonseries.indexes)&&s instanceof Array&&s.length&&e._collateBarsIndexes(s)),e.watchedData.setValue(t)})},o.prototype._collateBarsIndexes=function(t){var e,i;if(Array.isArray(t)&&(e=this._reportData&&this._reportData.filledOrders)&&e.length)for(this._barsIndexes.length=0,i=0;i<e.length;i++)this._barsIndexes[i]=t[e[i].tm]},o.prototype.reportData=function(){return this._reportData},o.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders},o.prototype.barsIndexes=function(){return this._barsIndexes},o.prototype.clearData=function(){n.prototype.clearData.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems()},o.prototype.restoreData=function(t){n.prototype.restoreData.apply(this,arguments),this.model().addStrategySource(this),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",params:{nonseries:{d:{data:{report:this._reportData}}}}})),t.activeState&&(this._activeState=!0)},o.prototype.activeState=function(){return this._activeState},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()},o.prototype.createViews=function(){n.prototype.createViews.call(this),this._strategyOrdersPaneView=new s(this,this._series,this._model)},o.prototype.state=function(t){var e=n.prototype.state.apply(this,arguments);return t&&this._reportData&&this._barsIndexes&&(e.data||(e.data={}),e.data.reportData=this._reportData,e.data.barsIndexes=this._barsIndexes,e.data.activeState=this.model().activeStrategySource().value()===this),e},t.exports=o}).call(e,i(41))},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._series=e,this._model=i,this._invalidated=!0,this._orderArrow={vMargin:o.DEFAULT_ORDER_ARROW_VMARGIN,width:o.DEFAULT_ORDER_ARROW_WIDTH,height:o.DEFAULT_ORDER_ARROW_HEIGHT},this._exitLineWidth=o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH,this._priceArrow={width:o.DEFAULT_PRICE_ARROW_WIDTH,height:o.DEFAULT_PRICE_ARROW_HEIGHT},this._text={
vMargin:o.DEFAULT_TEXT_VMARGIN,font:o.DEFAULT_FONT,fontSize:o.DEFAULT_FONT_SIZE},this._checkHideTextIfBarSpacingLT=o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT,this._textIsVisible=!0,this._colors={entryBuy:o.DEFAULT_ENTRY_BUY_COLOR,entrySell:o.DEFAULT_ENTRY_SELL_COLOR,exit:o.DEFAULT_EXIT_COLOR},this._items={entryBuy:[],entrySell:[],exit:[]},this._textWidths={},this._study.properties().strategy.orders.subscribe(this,this.update)}var n=i(2),s=i(59).PaneRendererStudyStrategyOrders,r=i(6);o.DEFAULT_ORDER_ARROW_VMARGIN=7,o.DEFAULT_ORDER_ARROW_WIDTH=9,o.DEFAULT_ORDER_ARROW_HEIGHT=11,o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH=2,o.DEFAULT_PRICE_ARROW_WIDTH=5,o.DEFAULT_PRICE_ARROW_HEIGHT=9,o.DEFAULT_TEXT_VMARGIN=2,o.DEFAULT_FONT="Arial",o.DEFAULT_FONT_SIZE=10,o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT=10,o.DEFAULT_ENTRY_BUY_COLOR="#008fff",o.DEFAULT_ENTRY_SELL_COLOR="#f00",o.DEFAULT_EXIT_COLOR="#cc47ed",o.prototype._updateImpl=function(){var t,e,i,o,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P;if(this.clearItems(),(t=this._study.ordersData())&&t.length&&(e=this._model.timeScale(),i=this._series.priceScale(),!(!e||!i||e&&e.isEmpty()||i&&i.isEmpty()||(o=e.visibleBars().clone(),o.isEmpty())))){for(s=this._study.barsIndexes(),r=this._series.nearestIndex(o.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),a=this._series.nearestIndex(o.lastBar(),TradingView.SEARCH_NEAREST_LEFT),l=r,h=[],c=[];l<=a;l++)for(d=-1;-1!==(d=s.indexOf(l,d+1));)(p=t[d])&&(h.push(p),c.push(l));for(u=this._study.properties(),_=u.strategy.orders.showLabels.value(),f=u.strategy.orders.showQty.value(),m=_||f,m&&e.barSpacing()<this._checkHideTextIfBarSpacingLT&&this._orderArrow.width*h.length*2>e.width()&&(m=!1),g=m&&this._text.fontSize+this._text.vMargin||0,v=g&&g*(_+f),y=0,b={upper:[],lower:[]};y<h.length;y++)p=h[y],d=c[y],w=e.indexToCoordinate(d,!0),S=i.priceToCoordinate(this._series[p.b?"low":"high"](d),!0),T=p.b?"lower":"upper",C="number"==typeof b[T][d]&&b[T][d]||0,S+=p.b?C:-C,"number"!=typeof b[T][d]&&(b[T][d]=0),b[T][d]+=(p.e?0:this._exitLineWidth)+this._orderArrow.vMargin+this._orderArrow.height+v,x=i.priceToCoordinate(p.p,!0),P=p.e?!p.b&&p.e?"entrySell":"entryBuy":"exit",this._items[P].push({orderPoint:new n.Point(w,S),pricePoint:new n.Point(w,x),label:_&&(p.c||p.id||"Untitled")||null,qty:f&&(p.b?"+":"-")+~~p.q||null,pos:T});this._textLabelIsVisible=_,this._textQtyIsVisible=f,this._textIsVisible=m}},o.prototype.update=function(){this._invalidated=!0},o.prototype.clearItems=function(){this._items.entryBuy.length=this._items.entrySell.length=this._items.exit.length=0},o.prototype.renderer=function(){var t,e,i,o=this._study.properties();if(o.visible.value()&&o.strategy.orders.visible.value()&&(t=this._series.priceScale(),(this._invalidated||t&&t.isScaled())&&(this._updateImpl(),this._invalidated=!1),this._items.entryBuy.length||this._items.entrySell.length||this._items.exit.length)){e=new r;for(i in this._items)this._items[i].length&&e.append(new s({items:this._items[i],color:this._colors[i],orderArrow:this._orderArrow,exitLineWidth:"exit"===i&&this._exitLineWidth||0,
priceArrow:this._priceArrow,text:this._textIsVisible&&this._text||null},this._textWidths));return e}},t.exports=o},function(t,e,i){"use strict";function o(t){return t+"("+new Date(1e3*t).toUTCString()+")"}function n(t){var e,i,o,n;return t+="",e=t.slice(0),i=!1,o=e[e.length-1],-1==="DWM".indexOf(o)&&"S"!==o&&(i=!0,o=""),n=parseInt(i?e:e.length>1?e.slice(0,e.length-1):1),{resolution:o,interval:n}}var s,r=i(58),a=i(57),l=i(43).Interval,h=!1,c=null,d=0,p=function(t,e){this._session=new r.Session,this._session.init(t.timezone,t.session),this._symbolInfo=t,this._resolution=e,this._extrapolatedData=[],this._modelId=d++,this._valid=!!t.timezone&&!!t.session,h&&console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId,this._resolution,t.session,t.timezone))};p.prototype.uniqueId=function(){return this._modelId},p.prototype.isValid=function(){return this._valid},p.prototype._barBuilder=function(){if(!this._builderCache){var t=n(this._resolution);this._builderCache=r.newBarBuilder(t.resolution,t.interval,this._session,this._session)}return this._builderCache},p.prototype.distance=function(t,e){var i,n,s,a,l;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||1e3*e>n)&&(s=500,a=r.extrapolateBarsFrontToTime(this._barBuilder(),n||1e3*t,1e3*e,s),this._extrapolatedData=this._extrapolatedData.concat(a)),(n=this._extrapolatedData[this._extrapolatedData.length-1])<1e3*e?{success:!1}:(l=this._extrapolatedData.indexOf(1e3*e),-1!==l?(h&&console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),o(e),l)),{success:!0,result:l}):{success:!1})):{success:!1}},p.prototype.projectTime=function(t,e){var i,n,s,a;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||e>=this._extrapolatedData.length)&&(s=r.extrapolateBarsFrontByCount(this._barBuilder(),n||1e3*t,e-this._extrapolatedData.length+1),this._extrapolatedData=this._extrapolatedData.concat(s)),e<this._extrapolatedData.length?(a=this._extrapolatedData[e]/1e3,h&&console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),e,o(a))),a):t):t},s=function(t,e){this._source=t,this._target=e,this._isSessionTheSame=t._symbolInfo.timezone===e._symbolInfo.timezone&&t._symbolInfo.session===e._symbolInfo.session,this._isResolutionTheSame=t._resolution===e._resolution,this._shouldCorrectTradingDay=l.isDWM(t._resolution)&&!this._isSessionTheSame,this._cache={},null===c&&(c=new r.Session,c.init("UTC","24x7"))},s.prototype._sourceTargetBuilder=function(){var t,e;return this._sourceTargetBuilderCache||(t=n(this._target._resolution),e=this._isSessionTheSame?this._target._session:c,
priceArrow:this._priceArrow,text:this._textIsVisible&&this._text||null},this._textWidths));return e}},t.exports=o},function(t,e,i){"use strict";function o(t){return t+"("+new Date(1e3*t).toUTCString()+")"}function n(t){var e,i,o,n;return t+="",e=t.slice(0),i=!1,o=e[e.length-1],-1==="DWM".indexOf(o)&&"S"!==o&&(i=!0,o=""),n=parseInt(i?e:e.length>1?e.slice(0,e.length-1):1),{resolution:o,interval:n}}var s,r=i(58),a=i(57),l=i(36).Interval,h=!1,c=null,d=0,p=function(t,e){this._session=new r.Session,this._session.init(t.timezone,t.session),this._symbolInfo=t,this._resolution=e,this._extrapolatedData=[],this._modelId=d++,this._valid=!!t.timezone&&!!t.session,h&&console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId,this._resolution,t.session,t.timezone))};p.prototype.uniqueId=function(){return this._modelId},p.prototype.isValid=function(){return this._valid},p.prototype._barBuilder=function(){if(!this._builderCache){var t=n(this._resolution);this._builderCache=r.newBarBuilder(t.resolution,t.interval,this._session,this._session)}return this._builderCache},p.prototype.distance=function(t,e){var i,n,s,a,l;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||1e3*e>n)&&(s=500,a=r.extrapolateBarsFrontToTime(this._barBuilder(),n||1e3*t,1e3*e,s),this._extrapolatedData=this._extrapolatedData.concat(a)),(n=this._extrapolatedData[this._extrapolatedData.length-1])<1e3*e?{success:!1}:(l=this._extrapolatedData.indexOf(1e3*e),-1!==l?(h&&console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),o(e),l)),{success:!0,result:l}):{success:!1})):{success:!1}},p.prototype.projectTime=function(t,e){var i,n,s,a;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||e>=this._extrapolatedData.length)&&(s=r.extrapolateBarsFrontByCount(this._barBuilder(),n||1e3*t,e-this._extrapolatedData.length+1),this._extrapolatedData=this._extrapolatedData.concat(s)),e<this._extrapolatedData.length?(a=this._extrapolatedData[e]/1e3,h&&console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),e,o(a))),a):t):t},s=function(t,e){this._source=t,this._target=e,this._isSessionTheSame=t._symbolInfo.timezone===e._symbolInfo.timezone&&t._symbolInfo.session===e._symbolInfo.session,this._isResolutionTheSame=t._resolution===e._resolution,this._shouldCorrectTradingDay=l.isDWM(t._resolution)&&!this._isSessionTheSame,this._cache={},null===c&&(c=new r.Session,c.init("UTC","24x7"))},s.prototype._sourceTargetBuilder=function(){var t,e;return this._sourceTargetBuilderCache||(t=n(this._target._resolution),e=this._isSessionTheSame?this._target._session:c,
this._sourceTargetBuilderCache=r.newBarBuilder(t.resolution,t.interval,this._target._session,e)),this._sourceTargetBuilderCache},s.prototype.sourceTimeToTargetTime=function(t){var e,i,n,s,r,l;return this._isSessionTheSame&&this._isResolutionTheSame?t:isNumber(t)&&this._source.isValid()&&this._target.isValid()?(e=this._cache[t],e||(i=1e3*t,this._shouldCorrectTradingDay&&(n=a.utc_to_cal(this._source._session.timezone,i),n=this._source._session.spec.correctTradingDay(n,this._source._session.timezone),s=new Date(n),a.set_hms(s,0,0,0,0),i=s.valueOf()),r=this._sourceTargetBuilder(),r.moveTo(i),l=r.indexOfBar(i),e=r.startOfBar(Math.max(0,l))/1e3,this._cache[t]=e),h&&console.log('Model "{0}" "{1}" sourceTime "{2}" => model "{3}" "{4}" targetTime "{5}"'.format(this._source.uniqueId(),this._source._resolution,o(t),this._target.uniqueId(),this._target._resolution,o(e))),e):t},t.exports.SyncPoint=s,t.exports.SyncModel=p},function(t,e,i){(function(t){TradingView.cleanButAmpersand=function(t,e){var i=e?["&amp;"]:["&"];return TradingView.clean(t,e,i)},TradingView.strip_tags=function(t){return t&&t.replace?t.replace(/(<([^>]+)>)/gi,""):t},TradingView.encodeSpread=function(t){return encodeURIComponent(t)},TradingView.clean=function(t,e,i){var o,n,s,r=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"],["'","&#39;"]],a=t;if(!t||!t.replace)return a;for(o=0;o<r.length;o++)n=r[o][0],s=r[o][1],i&&i.indexOf&&-1!==i.indexOf(e?s:n)||(a=e?a.replace(RegExp(s,"g"),n):a.replace(RegExp(n,"g"),s));return a},void 0!==t&&t&&t.exports&&(t.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand})}).call(e,i(50)(t))},function(t,e){"use strict";!function(t){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var e=function(e){var i=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/i}(document.createElement("canvas").getContext("2d"));e<=1||(t.hidpiCanvasRatio=e,function(t){var i,o=function(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},n={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4]};t.drawImagePatchedSource=t.drawImage,i=t.drawImage,t.drawImagePatchedSourceAndDest=function(t){var o,n=Array.prototype.slice.call(arguments);for(o=1;o<n.length;++o)n[o]&&(n[o]*=e);return n.length>5&&("width"in t&&(n[3]=Math.min(t.width,Math.max(1,n[3]))),"height"in t&&(n[4]=Math.min(t.height,Math.max(1,n[4])))),i.apply(this,n)},o(n,function(i,o){var n=t[o];t[o]=function(){var t,o;if("all"===i)for(o=[],t=arguments.length;0<t--;)o[t]=arguments[t]*e;else for(o=Array.prototype.slice.call(arguments),t=i.length;0<t--;)o[i[t]]&&(o[i[t]]=o[i[t]]*e);return n.apply(this,o)}}),t.drawImage=function(t){
return function(){return arguments[0]instanceof HTMLCanvasElement?t.drawImagePatchedSourceAndDest.apply(this,arguments):t.drawImagePatchedSource.apply(this,arguments)}}(t),t.fillText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.fillText),t.strokeText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.strokeText)}(CanvasRenderingContext2D.prototype),function(t){t.getContext=function(t){return function(i){var o=t.call(this,i);return"2d"===i&&this.width!==Math.floor(parseInt(this.style.width)*e)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=e,this.height*=e),o}}(t.getContext)}(HTMLCanvasElement.prototype))}}(window)},,,function(t,e,i){(function(t,o,n){"use strict";function s(e){this._chartWidgetCollection=e,this._chartAboutToBeSavedDelegate=new t,this._chartSavedDelegate=new t}function r(t,e,i,o){var s,r,a;o=o||{},s={wl:o.wl,images:JSON.stringify(t.images()),previews:o.previews,onWidget:o.onWidget},r=t.activeChartWidget.value().widgetCustomer(),r&&(s.customer=r),s.timezone=t.activeChartWidget.value()._properties.timezone.value(),window.urlParams&&window.urlParams.locale&&(s.language=urlParams.locale),a=n.enabled("charting_library_base")?o.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/",$.post(a,s,function(t){t?e(t):i()}).fail(function(){i()})}var a=i(116);s.prototype.chartAboutToBeSaved=function(){return this._chartAboutToBeSavedDelegate},s.prototype.chartSaved=function(){return this._chartSavedDelegate},s.prototype.whenReadyToSave=function(t){var e,i,o=this._chartWidgetCollection,n=o.activeChartWidget.value(),s=n.model().mainSeries();s.symbolInfo()&&!s.hasDelayedSymbolIntervalChange()?t():(e=null,i=null,e=function(){s.onSymbolError().unsubscribe(null,i,!0),t()},i=function(){s.onSymbolResolved().unsubscribe(null,e,!0)},s.onSymbolResolved().subscribe(null,e,!0),s.onSymbolError().subscribe(null,i,!0))},s.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)},s.prototype._fillAsyncInfo=function(t,e,i){function o(e){t.content=JSON.stringify($.extend(!0,s,e)),n.resolve(t)}var n,s=JSON.parse(t.content),r=this._chartWidgetCollection;return e||(i=!0),n=$.Deferred(),i?r.asyncState(!!e).then(o):r.activeChartWidget.value().asyncState(!!e).then(o),n.promise()},s.prototype._fillSavingInfo=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(t||(e=!0),o={publish_request_id:Math.random().toString(36).substring(2)},n=this._chartWidgetCollection,s=n.activeChartWidget.value(),r=n.metaInfo,a=s.model().mainSeries(),l=a.properties(),h=a.symbolInfo(),!a||!r||!h)throw new ReferenceError("Missed required data")
;for(r.id.value()&&(o.id=r.id.value()),o.name=r.name.value()||"",o.description=r.description.value()||"",o.resolution=a.properties().interval.value(),o.symbol_type=h.type||"",o.exchange=h.exchange||"",o.listed_exchange=h.listed_exchange||"",a.isSpread()?(c=h.legs[0],d=h.base_name[0],d=d.split(":")[1],o.symbol=c,o.short_name=d,o.expression=h.full_name):(p=h.ticker||l.symbol.value(),u=l.shortName.value(),o.symbol=p,o.short_name=u),_=[],f=0,m=h.legs.length;f<m;f++)_.push({symbol:h.legs[f],pro_symbol:h.base_name[f]});return o.legs=JSON.stringify(_),o.content=e?JSON.stringify(n.state(!!t,i)):JSON.stringify(s.state(!!t,i)),t&&(o.image=JSON.stringify(n.images({onlyActiveChart:!e}))),o.is_realtime=t?"0":"1",o},s.prototype.publishChart=function(t){},s.prototype.onPublish=function(t,e){function i(i){var n,s,r,l,h,c,d;a.publishInProgress=!1,n=i.responseText,"ok:"===n.substr(0,3)?(s=!1,e.savePrivacySetting&&(s=!t.is_public,TVSettings.setValue("publishchart.private",s)),kmRecord("Chart","{0} Published".format(void 0===t.script_type?"Chart":"Script"),{is_private:s}),r=n.substr(3),l=JSON.parse(r),a._chartWidgetCollection.metaInfo.id.value()||a._chartWidgetCollection.metaInfo.id.setValue(l.id),e.closeForm&&e.closeForm(),a._lastPublishUrl=l.publishUrl,a.hWnd&&(h=l.publishUrl,e.ideaUrl&&(h=o.render(e.ideaUrl,{idea:l.idea})),a.hWnd.location=h)):(e.showError&&((413===i.status||/^[\d\s]*request.+large/i.test(n.trim()))&&(c="support@tradingview.com",n=$.t("This chart layout has a lot of objects and can't be published! Please report to {0} for further&nbsp;details.").format('<a href="mailto:'+c+'">'+c+"</a>")),d={html:!0},e.showError(n||$.t("Error occured while publishing"),d)),a.hWnd&&(a.hWnd.close(),a.hWnd=null))}var n,s,r,a=this;a.publishInProgress||(n=a._fillSavingInfo(!0,e&&e.publishAllLayout,!0),a._fillAsyncInfo(n,!0,e&&e.publishAllLayout).then(function(e){var o=t.scriptPublication;new Promise(function(e,i){o?ScriptLib.publishNew(o.scriptSource,o.scriptProtection).done(function(i){delete t.scriptPublication,o.scriptProtection===TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH&&PinePerm.add(window.user.username,i.pineId),e(i.publishedstudyscript_id)}).fail(function(){i()}):e()}).then(function(o){o&&(t.publishedstudyscript_id=o),$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},e,t),complete:i})})}),a.publishInProgress=!0,e.onWidget&&!e.ideaUrl||""!==t.name&&""!==t.description&&t.description.length<=4e3&&t.name.length<=64&&($.cookie("publish_request_id",n.publish_request_id,{path:"/"}),s="/loading/",e.ideaUrl&&(r=urlParams.createUrlParams({ideaUrl:e.ideaUrl}),s="/loading?"+r),a.hWnd=window.open(s,"_blank")))},s._saveChart=function(t,e,i,o,n){var s=i,r=o;return s=function(t){e.id.value()||(e.id.setValue(t),e.uid.setValue(t)),"function"==typeof i&&i()},a.saveChart(t.name,t.short_name,t.resolution,t,e,s,r)},s.prototype.saveChartSilently=function(t,e,i,o){var n=this._chartWidgetCollection.metaInfo,r=this._fillSavingInfo(e);if(o=o||{},o.chartName&&(r.name=o.chartName),
@@ -450,7 +450,7 @@ className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute
this._labelMap=e.labelMap,this._showTooltip=e.showTooltip,this._classSuffix=e.classSuffix,this._quoteSessionGUID=n.guid(),!0===e.short&&this.enableShortMode(),e.data&&this._updateValue(e.data),e.quoteSession&&t.assignQuoteSession(e.quoteSession),t._quoteSession&&e.symbol&&this._subscribe(e.symbol)},t.prototype._clearClasses=function(){var t=this;Object.values(this._classMap).map(function(e){t._el.classList.remove(""+e),t._el.classList.remove(""+e+t._classSuffix)})},t.prototype._render=function(){this._renderClasses(),this._renderTooltip(),this._renderLabel()},t.prototype._renderLabel=function(){this._el.textContent=this.getLabel()},t.prototype._renderClasses=function(){this._clearClasses(),this._el.classList.add(this._componentClass),this._el.classList.add(""+this._componentClass+this._classSuffix);var t=this._classMap[this.getValue()];void 0!==t?(this._el.classList.add(""+t+this._classSuffix),this._el.classList.add(t)):void 0!==this.getValue()&&s.logWarn("no className for status "+this.getValue())},t.prototype._renderTooltip=function(){this._el.classList.add("apply-common-tooltip"),this._el.setAttribute("title",this._showTooltip?this.getTooltipText():""),$(this._el).trigger("common-tooltip-update")},t.prototype._updateValue=function(t,e){var i=this._getValueFromData(t);(e||i!==this.getValue())&&(this._value=i)},t.prototype._getQuoteSessionId=function(){return this._quoteSessionPrefix+"."+this._quoteSessionGUID},t.prototype._subscribe=function(e,i){i&&i.target!==this._el||!this._subscribed&&t._quoteSession&&(t._quoteSession.subscribe(this._getQuoteSessionId(),e,this.update.bind(this)),this._el.removeEventListener("DOMNodeInserted",this._subscribe.bind(this,e)),this._el.addEventListener("DOMNodeRemoved",this._unsubscribe.bind(this,e),!1),this._subscribed=!0)},t.prototype._unsubscribe=function(e,i){i&&i.target!==this._el||this._subscribed&&t._quoteSession&&(t._quoteSession.unsubscribe(this._getQuoteSessionId(),e),this._el.removeEventListener("DOMNodeRemoved",this._unsubscribe.bind(this,e)),this._el.addEventListener("DOMNodeInserted",this._subscribe.bind(this,e),!1),this._subscribed=!1)},t}(),e.AbstractIndicator=r,window.AbstractIndicator=r},function(t,e){"use strict";function i(t,e){return t<e}function o(t,e,i,o,n){var s,r,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),s=n-o;0<s;)r=s>>1,a=o+r,i(t[a],e)?(o=a+1,s-=r+1):s=r;return o}function n(t,e,n,s){return void 0===n&&(n=0),void 0===s&&(s=t.length),o(t,e,i,n,s)}function s(t,e,i,o,n){var s,r,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),s=n-o;0<s;)r=s>>1,a=o+r,i(e,t[a])?s=r:(o=a+1,s-=r+1);return o}function r(t,e,o,n){return void 0===o&&(o=0),void 0===n&&(n=t.length),s(t,e,i,o,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.lowerbound=o,e.lowerbound_int=n,e.upperbound=s,e.upperbound_int=r},function(t,e,i){"use strict";function o(t,e,i,o,n,s,r,a){function l(t,e,i,o,n,s){var r=0;return t<i?r|=1:t>n&&(r|=2),e<o?r|=4:e>s&&(r|=8),r}for(var h,c,d,p=l(t,e,n,s,r,a),u=l(i,o,n,s,r,a),_=!1,f=0;;){if(f>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(f++,
!(p|u)){_=!0;break}if(p&u)break;h=p||u,c=void 0,d=void 0,8&h?(c=t+(i-t)*(a-e)/(o-e),d=a):4&h?(c=t+(i-t)*(s-e)/(o-e),d=s):2&h?(d=e+(o-e)*(r-t)/(i-t),c=r):(d=e+(o-e)*(n-t)/(i-t),c=n),h===p?(t=c,e=d,p=l(t,e,n,s,r,a)):(i=c,o=d,u=l(i,o,n,s,r,a))}return _?[t,e,i,o]:null}function n(t,e,i,n){var r=o(t.x,t.y,e.x,e.y,0,0,i,n);return null!=r?[new s.Point(r[0],r[1]),new s.Point(r[2],r[3])]:null}Object.defineProperty(e,"__esModule",{value:!0});var s=i(2);e.clipSegmentToViewport=n},function(t,e,i){"use strict";function o(t){return"."+t.replace("+","")}function n(t,e){var i=o(t);a.unbind("keydown"+i).bind("keydown"+i,t,function(t){$(t.target).is("input[type=password]")||e.apply(null,Array.prototype.slice.call(arguments))}),r[t]=e}function s(t){a.unbind("keydown"+o(t)),delete r[t]}var r,a;Object.defineProperty(e,"__esModule",{value:!0}),i(17),r={},a=$(document),e.bind=n,e.unbind=s},function(t,e,i){"use strict";var o,n,s,r,a,l,h,c;Object.defineProperty(e,"__esModule",{value:!0}),i(17),i(28),o=i(69),n=i(128),s=i(63),r=i(357),a=i(15),l=i(165),h=i(129),c=function(){function t(t,e,i){return void 0===i&&(i={}),this._container=$('<div class="favored-list-container">'),this._quickContainer=$('<div class="quick">').appendTo(this._container),this._onChange=new a,this._onSelect=new a,this._onResize=new a,this._onOpen=new a,this._active=null,this._data=[],this._list=[],this._quicks=[],this._options=i=i,this._name=t,i.addClass&&this._container.addClass(i.addClass),this._submenu=$('<span class="submenu">'+(this._options.submenuHtml||"")+"<i></i></span>").appendTo(this._container),i.tooltip&&(this._submenu.attr("title",i.tooltip),i.addTooltipClass&&this._submenu.addClass(i.addTooltipClass)),this._load(e),s.bindPopupMenu(this._container,null,{addClass:"narrow favored-list "+(i.popupAddClass||""),direction:"down",event:"popup-menu",popupSpacing:i.popupSpacing,reverse:!0,svg:null==i.svg||i.svg}),this._submenu.on("click",this.openMenu.bind(this)),n.TVXWindowEvents.on(t+"-change",this._onChangeInAnotherTab.bind(this)),this}return t.prototype.element=function(){return this._container},t.prototype.onChange=function(){return this._onChange},t.prototype.onSelect=function(){return this._onSelect},t.prototype.onResize=function(){return this._onResize},t.prototype.onOpen=function(){return this._onOpen},t.prototype.setValue=function(t){var e=this._getItemByValue(t);this._setActive(e)},t.prototype.value=function(){return this._active?this._active.data.value:void 0},t.prototype.removeById=function(t){var e=this,i=this._data.filter(function(e){return!e.separator&&e.id!==t});this._list.forEach(function(i){i.data.id===t&&e._toggleFavorite(i,!1)}),this.reload(i)},t.prototype.reload=function(t){this._quickContainer.empty(),this._load(t)},t.prototype.openMenu=function(){this._submenu.parent().hasClass("active")||this._onOpen.fire(),this._submenu.trigger("popup-menu",[this._data])},t.prototype._onChangeInAnotherTab=function(){this.reload(this._data)},t.prototype._load=function(t){var e=this
;this._options.showJustDefaultQuicks?this._quicks=this._options.defaultFavorites||[]:this._options.notShowQuicks?this._quicks=[]:this._quicks=o.getJSON(this._name+".quicks",this._options.defaultFavorites||[]),this._list=[],t.filter(function(t){return!t.separator}).forEach(function(t,i){var o,n={data:t,drop:function(){n.data.drop&&n.data.drop()},favorite_button:null,index:i,isFavorite:function(){return e._quicks.indexOf(t.id)>-1},markFavorite:function(){n.toQuickButton&&n.toQuickButton.attr("title",$.t("Remove from favorites")).addClass("quicked")},svg:t.svg&&$(t.svg).clone(),toQuickButton:e._options.notShowQuicks?null:$('<span class="to-quick">').append($(l).attr({height:16,width:16})),toggleFavorite:function(t,i){var o=void 0!==t?t:!n.isFavorite();o?n.markFavorite():n.unmarkFavorite(),e._toggleFavorite(n,o,i)},unmarkFavorite:function(){n.toQuickButton&&n.toQuickButton.attr("title",$.t("Add to favorites")).removeClass("quicked")}};n.data.toQuickButtonStyle&&n.toQuickButton&&n.toQuickButton.css(n.data.toQuickButtonStyle),e._list.push(n),t.action=e._change.bind(e,n),t.active=e._options.notShowActive?function(){return!1}:function(){return!(!e._active||n!==e._active)},t.buttons=[],e._options.notShowQuicks||t.buttons.push({el:n.toQuickButton,handler:function(t){n.toggleFavorite(),t.preventDefault(),t.stopPropagation()}}),n.data.drop&&(o=$("<span>").addClass("delete").attr("title",$.t("Delete")).html(h),e._options.notShowQuicks&&o.css("right","7px"),t.buttons.push({el:o,handler:function(t){n.drop(),t.stopPropagation()}})),n.toggleFavorite(n.isFavorite(),!0)}),this._data=t,this._options.notShowActive||this._addActive(this._list[0]),this._onResize.fire()},t.prototype._toggleFavorite=function(t,e,i){if(!this._options.notShowQuicks||this._options.showJustDefaultQuicks){if(e){t.favorite_button=this._createButton(t);var o=this._lastFavoriteButton(t);o?t.favorite_button.insertAfter(o.favorite_button):t.favorite_button.prependTo(this._quickContainer)}else i||this._removeButton(t);i||(e?-1===this._quicks.indexOf(t.data.id)&&this._quicks.push(t.data.id):this._quicks.indexOf(t.data.id)>-1&&this._quicks.splice(this._quicks.indexOf(t.data.id),1),this._saveFavorite(),this._markActive(),this._onResize.fire())}},t.prototype._lastFavoriteButton=function(t){for(var e=t.index-1;e>=0;e--)if(this._list[e]&&this._list[e].favorite_button)return this._list[e];return null},t.prototype._saveFavorite=function(){this._options.notShowQuicks||(o.setJSON(this._name+".quicks",this._quicks),n.TVXWindowEvents.emit(this._name+"-change"))},t.prototype._createButton=function(t){var e=this,i=t.data.favoriteButton,o=$("<span>").data("item",t);return i.addClass&&o.addClass(i.addClass),i.title&&o.prop("title",r.clean(i.title+"",!0)),t.svg&&$(t.svg).clone().appendTo(o),o.on("click",function(i){e._change(t),0===e._quicks.length&&e.openMenu(),i.preventDefault()}),o},t.prototype._removeButton=function(t){t.favorite_button&&(t.favorite_button.remove(),t.favorite_button=null)},t.prototype._markActive=function(t){var e,i,o=this;this._options.notShowActive||(e=null,
this._active&&(t=this._active,t.isFavorite()?(i=this._quickContainer.find(".just_active"),this._btnToggleActiveView(i,!1)):(e=this._addActive(t),0!==this._quicks.length&&this._btnToggleActiveView(e,!0))),this._list.forEach(function(e){t!==e||0===o._quicks.length?o._btnToggleActiveView(e.favorite_button,!1):e.favorite_button&&o._btnToggleActiveView(t.favorite_button,!0)}),e&&e.hasClass("selected")?this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active"))},t.prototype._btnToggleActiveView=function(t,e){t&&(e?t.addClass("selected"):t.removeClass("selected"))},t.prototype._addActive=function(t){return this._quickContainer.find(".just_active").remove(),this._createButton(t).appendTo(this._quickContainer).addClass("just_active")},t.prototype._setActive=function(t){return this._active!==t&&(this._active=t,this._markActive(),!0)},t.prototype._change=function(t){this._onSelect.fire(t.data.id),this._setActive(t)&&this._onChange.fire(t.data.id)},t.prototype._getItemByValue=function(t){for(var e in this._list)if(this._list[e].data.id===t)return this._list[e];throw Error("undefined value "+t+" in FavoredList")},t}(),e.FavoredList=c},function(t,e,i){"use strict";var o,n,s,r,a,l,h,c,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(17),i(286),i(105),n=i(251),s=i(54),r=i(69),a=i(15),l=i(40),h=i(379),c='<div class="tv-floating-toolbar i-closed i-hidden">'+(Modernizr.touch?'<div class="tv-floating-toolbar__drag-ext js-drag"></div>':"")+'<div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">'+h+'</div><div class="tv-floating-toolbar__content js-content"></div></div></div>',i(500),d=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new l(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new a,t._toolbars.push(this),this._options=e,this._widget=o(c).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML=""},t.prototype.isVisible=function(){return this._visibility.value()},t.prototype.visibility=function(){return this._visibility.readonly()},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),
this._active&&(t=this._active,t.isFavorite()?(i=this._quickContainer.find(".just_active"),this._btnToggleActiveView(i,!1)):(e=this._addActive(t),0!==this._quicks.length&&this._btnToggleActiveView(e,!0))),this._list.forEach(function(e){t!==e||0===o._quicks.length?o._btnToggleActiveView(e.favorite_button,!1):e.favorite_button&&o._btnToggleActiveView(t.favorite_button,!0)}),e&&e.hasClass("selected")?this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active"))},t.prototype._btnToggleActiveView=function(t,e){t&&(e?t.addClass("selected"):t.removeClass("selected"))},t.prototype._addActive=function(t){return this._quickContainer.find(".just_active").remove(),this._createButton(t).appendTo(this._quickContainer).addClass("just_active")},t.prototype._setActive=function(t){return this._active!==t&&(this._active=t,this._markActive(),!0)},t.prototype._change=function(t){this._onSelect.fire(t.data.id),this._setActive(t)&&this._onChange.fire(t.data.id)},t.prototype._getItemByValue=function(t){for(var e in this._list)if(this._list[e].data.id===t)return this._list[e];throw Error("undefined value "+t+" in FavoredList")},t}(),e.FavoredList=c},function(t,e,i){"use strict";var o,n,s,r,a,l,h,c,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(17),i(286),i(105),n=i(251),s=i(54),r=i(69),a=i(15),l=i(41),h=i(379),c='<div class="tv-floating-toolbar i-closed i-hidden">'+(Modernizr.touch?'<div class="tv-floating-toolbar__drag-ext js-drag"></div>':"")+'<div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">'+h+'</div><div class="tv-floating-toolbar__content js-content"></div></div></div>',i(500),d=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new l(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new a,t._toolbars.push(this),this._options=e,this._widget=o(c).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML=""},t.prototype.isVisible=function(){return this._visibility.value()},t.prototype.visibility=function(){return this._visibility.readonly()},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),
this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(function(){t.isVisible()&&t._widget.classList.remove("i-closed")})):this._widget.classList.remove("i-closed"),this._onWindowResize())},t.prototype.hide=function(t){var e,i,o=this;void 0===t&&(t=!1),this.isVisible()&&(e=this._widget.classList.contains("i-closed"),this._widget.classList.add("i-closed"),this._visibility.setValue(!1),t||e?(this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")):(i=setTimeout(function(){o._setHiddingTimeout(null),o._widget.classList.add("i-hidden")},this.hideDuration()),this._setHiddingTimeout(i)),window.removeEventListener("resize",this._windowResizeListener))},t.prototype.raise=function(){t._toolbars.length+t._startZIndex!==this._zIndex()&&(t._toolbars.splice(t._toolbars.indexOf(this),1),t._toolbars.push(this),t._updateAllZIndexes())},t.prototype.hideDuration=function(){return.75*s.dur},t.prototype.addWidget=function(t,e){var i,o,n;if(void 0===e&&(e={}),i=this.widgetsCount(),void 0===e.index&&(e.index=i),e.index<0||e.index>i)throw Error("Index must be in [0, "+i+"]");o=document.createElement("div"),o.className="tv-floating-toolbar__widget js-widget",o.appendChild(t),n=e.index===i?null:this._content.childNodes.item(e.index),this._content.insertBefore(o,n),this._onWindowResize()},t.prototype.removeWidget=function(t){var e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())},t.prototype.widgetsCount=function(){return this._content.childNodes.length},t.prototype.showWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")},t.prototype.hideWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")},t.prototype.removeWidgets=function(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()},t.prototype.onWidgetsReordered=function(){return this._reorderedDelegate},t.prototype.onContextMenu=function(t){var e,i=this;Modernizr.touch?(e=new n(this._widget),e.get("press").set({time:500}),e.on("press",function(e){i._preventWidgetTouchEndEvent(),t(e.srcEvent)})):this._widget.addEventListener("contextmenu",t)},t.prototype._determineCurrentLayoutVertical=function(t){var e=this._isVertical?t.height:t.width;return window.innerWidth<e},t.prototype._getWidget=function(){return this._widget},t.prototype._findWrapperForWidget=function(t){var e,i,o=this._content.getElementsByClassName("js-widget");for(e=0;e<o.length;++e)if(i=o.item(e),i.contains(t))return i;return null},t.prototype._onVerticalChanged=function(t,e){},t.prototype._setHiddingTimeout=function(t){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId),this._hiddingTimeoutId=t},t.prototype._preventWidgetTouchEndEvent=function(){var t=this,e=function(i){i.preventDefault(),t._widget.removeEventListener("touchend",e)};this._widget.addEventListener("touchend",e)},t.prototype._updateLayoutType=function(){this._widget.classList.toggle("i-vertical",this._isVertical)},
t.prototype._onWindowResize=function(){var t,e;"auto"===(this._options.layout||"auto")&&(t=this._isVertical,e=this._getCorrectedWidgetRect(),this._isVertical=this._determineCurrentLayoutVertical(e),this._updateLayoutType(),t!==this._isVertical&&this._onVerticalChanged(this._isVertical,t)),this._checkPosition()},t.prototype._checkPosition=function(){var t=this._getCorrectedWidgetRect(),e={left:t.left,top:t.top};this._correctPosition(e),t.left===e.left&&t.top===e.top||(this._widget.style.left=e.left+"px",this._widget.style.top=e.top+"px")},t.prototype._correctPosition=function(t){var e=this._getCorrectedWidgetRect();t.left+e.width>window.innerWidth&&(t.left=Math.max(0,window.innerWidth-e.width)),t.top+e.height>window.innerHeight&&(t.top=Math.max(0,window.innerHeight-e.height)),t.left=Math.max(0,t.left),t.top=Math.max(0,t.top)},t.prototype._setZIndex=function(t){this._widget.style.zIndex=t+""},t.prototype._zIndex=function(){return+this._widget.style.zIndex},t.prototype._loadPosition=function(){var t=r.getJSON(this._options.positionSettingsKey,this._options.defaultPosition);this._widget.style.left=Math.round(t.left)+"px",this._widget.style.top=Math.round(t.top)+"px",this._onWindowResize()},t.prototype._savePosition=function(){var t=this._widget.getBoundingClientRect();r.setJSON(this._options.positionSettingsKey,{left:t.left,top:t.top})},t.prototype._init=function(){this._loadPosition(),o(this._widget).draggable({containment:"window",drag:this._onDragEvent.bind(this),handle:".js-drag",stop:this._savePosition.bind(this)}),this._options.allowSortable&&this._initSortable(),this._widget.addEventListener(Modernizr.touch?"touchstart":"mousedown",this.raise.bind(this))},t.prototype._onDragEvent=function(t,e){this._correctPosition(e.position)},t.prototype._initSortable=function(){var t=this,e=-1;o(this._content).sortable({start:function(t,i){e=i.item.index()},stop:function(i,o){var n=o.item.index();e!==n&&t._reorderedDelegate.fire(e,n)},tolerance:"point"})},t.prototype._getCorrectedWidgetRect=function(){var t,e,i,o,n=this._widget.getBoundingClientRect();return this._widget.classList.contains("i-closed")?(t=.925,e=1/t-1,i=n.width*e,o=n.height*e,{bottom:n.bottom+o/2,height:n.height+o,left:n.left-i/2,right:n.right+i/2,top:n.top-o/2,width:n.width+i}):n},t._updateAllZIndexes=function(){t._toolbars.forEach(function(e,i){e._setZIndex(t._startZIndex+i)})},t}(),d._startZIndex=20,d._toolbars=[],e.FloatingToolbar=d},function(t,e,i){"use strict";function o(){var t=$("<select />");return $('<option value="'+n.PlotType.Line+'">'+$.t("Line")+"</option>").appendTo(t),$('<option value="'+n.PlotType.Line_with_breaks+'">'+$.t("Line With Breaks")+"</option>").appendTo(t),$('<option value="'+n.PlotType.Histogram+'">'+$.t("Histogram")+"</option>").appendTo(t),$('<option value="'+n.PlotType.Cross+'">'+$.t("Cross",{context:"chart_type"})+"</option>").appendTo(t),$('<option value="'+n.PlotType.Area+'">'+$.t("Area")+"</option>").appendTo(t),$('<option value="'+n.PlotType.Area_with_breaks+'">'+$.t("Area With Breaks")+"</option>").appendTo(t),
$('<option value="'+n.PlotType.Columns+'">'+$.t("Columns")+"</option>").appendTo(t),$('<option value="'+n.PlotType.Circles+'">'+$.t("Circles")+"</option>").appendTo(t),t}Object.defineProperty(e,"__esModule",{value:!0}),i(17),i(28);var n=i(81);e.createPlotEditor=o},function(t,e,i){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(t){var e,i,n,r=$(l);return t.addClass&&r.addClass(t.addClass),t.withoutControls&&r.addClass("tv-search-row--without-controls"),e=r.find(".js-input-control"),i=r.find(".js-reset-button"),t.placeholder&&e.attr("placeholder",t.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new s,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:r,$input:e,inputChangedDelegate:n}}var s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),s=i(15),r=i(904),a=i(908),i(511),l='<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">'+r+'</span><span class="tv-search-row__search-icon">'+a+"</span></div>",e.createSearchControl=n},function(t,e){"use strict";function i(t,e){void 0===e&&(e="&nbsp;");var i=(t+"").split(".");return i[0].replace(/\B(?=(\d{3})+(?!\d))/g,e)+(i[1]?"."+i[1]:"")}Object.defineProperty(e,"__esModule",{value:!0}),e.splitThousands=i},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(15),n=i(69),function(t){function e(e){return t.favorites.indexOf(e)}function i(){t.favorites=[],n.getJSON("chart.favoriteDrawings",[]).forEach(function(e){t.favorites.push(e.tool||e)}),t.favoritesSynced.fire()}function s(){n.setJSON("chart.favoriteDrawings",t.favorites)}t.favorites=[],t.favoritesSynced=new o,t.favoriteIndex=e,t.saveFavorites=s,i(),n.onSync.subscribe(null,i)}(s||(s={})),function(t){function e(){return s.favorites.slice()}function i(){return s.favorites.length}function n(t){return t<0||t>=i()?"":s.favorites[t]}function r(e){return!l(e)&&(s.favorites.push(e),s.saveFavorites(),t.favoriteAdded.fire(e),!0)}function a(e){var i=s.favoriteIndex(e);return-1!==i&&(s.favorites.splice(i,1),s.saveFavorites(),t.favoriteRemoved.fire(e),!0)}function l(t){return-1!==s.favoriteIndex(t)}function h(e,o){if(o<0||o>=i())return!1;var n=s.favoriteIndex(e);return-1!==n&&o!==n&&(s.favorites.splice(n,1),s.favorites.splice(o,0,e),s.saveFavorites(),t.favoriteMoved.fire(e,n,o),!0)}t.favoriteAdded=new o,t.favoriteRemoved=new o,t.favoriteMoved=new o,t.favoritesSynced=s.favoritesSynced,t.favorites=e,t.favoritesCount=i,t.favorite=n,t.addFavorite=r,t.removeFavorite=a,t.isFavorite=l,t.moveFavorite=h}(e.LinetoolsFavoritesStore||(e.LinetoolsFavoritesStore={}))},function(t,e,i){"use strict";var o,n,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),n=i(124),s=function(t){function e(e){var i=t.call(this,e,!1)||this;return i._subcommands=[],i}return o.__extends(e,t),e.prototype.addCommand=function(t){this._subcommands.push(t)},
@@ -461,12 +461,12 @@ var s,r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.Menu=void
;function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolTab=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(77),a=o(r),l=i(256),i(250),i(496),h='\n\t<div class="tv-add-symbol-tab">\n\t\t<input type="text" class="tv-control-input js-add-symbol-tab-input" placeholder="'+$.t("Symbol")+'" autocomplete="off">\n\t\t<div class="tv-add-symbol-tab__add-symbol-overlay js-add-symbol-tab-checkbox"></div>\n\t</div>',e.AddSymbolTab=function(){function t(e,i){n(this,t),this._chartWidgetCollection=e,this._dialog=i,this._$popup=null,this.init()}return s(t,[{key:"init",value:function(){var t=this;this.$tab=$(h),this._$input=this.$tab.find(".js-add-symbol-tab-input"),this._checkbox=new l.AddSymbolCheckbox({labelRight:$.t("Overlay the main chart"),labelAddClass:"tv-add-symbol-tab__checkbox-label",boxAddClass:"tv-add-symbol-tab__checkbox-box"}),this.$tab.find(".js-add-symbol-tab-checkbox").append(this._checkbox.$el),a.default.bindToInput(this._$input,{callback:function(e){var i=t._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t._checkbox.checked)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),t}()},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function a(t,e,i){var o,n=2*H,s=document.createElement("canvas");return s.width=e*n,s.height=i*n,s.style.width=e+"px",s.style.height=i+"px",o=s.getContext("2d"),o.setTransform(n,0,0,n,0,0),o.drawImage(t,0,0,e,i),s}function l(t,e){return function(){i.e(3,function(){q=i(535),t.call(e)})}}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V,B,R,N,F,z,W,H,U,j,q,Y,G;Object.defineProperty(e,"__esModule",{value:!0}),e.Branding=void 0,h=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),d=i(3),p=n(d),u=i(2),_=n(u),f=i(8),m=o(f),g=i(264),v=o(g),y=i(54),b=i(14),w="tvLogoBlack",S="tvLogoWhite",c={},r(c,w,i(912)),r(c,S,i(913)),T=c,
C="images/widget-embed-logo/",x="site_branding",P="widget_branding",L="widget_referral_branding",k="widget_custom_branding",I="widget_custom_no_powered_branding",A="fundamental_branding",E="fundamental_custom_branding",M="fundamental_custom_no_powered_branding",D="library_branding",O="library_custom_branding",V="library_custom_no_powered_branding",B=.2,R=$(window),N=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,F=function(){var t,e=window.navigator.userAgent,i=e.indexOf("MSIE ");return i>0?parseInt(e.substring(i+5,e.indexOf(".",i)),10):e.indexOf("Trident/")>0&&(t=e.indexOf("rv:"),parseInt(e.substring(t+3,e.indexOf(".",t)),10))}(),z=window.urlParams||{},W=window.initData||{},H=window.hidpiCanvasRatio||1,U=!0,j=null,q=null,Y=function(){function t(e){var i=e.layout,o=void 0===i?x:i,n=e.symbol,r=void 0===n?"":n,a=e.model,h=e.onReadyCallback;s(this,t),this._model=a,this._logo=null,this._logoReady=!1,this._showLogo=!1,this._logoWidth=28,this._logoHeight=19,this.show=!0,this.width=100,this.height=20,this._layout=o,this._symbol=r,this._strokeColor=y.color.black255,this._fillСolor=y.color.brand,this._colorOldBlue=y.color.brandDown,this._colorOldGray=y.color.black30,this._strokeOpacity=.6,this._strokeWidth=2,this._fontSize=14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=h,this._upscaleRatio=2,this._strokeCanv=null,this._fillCanv=null,F&&(this._init=l(this._init,this)),this._init()}return h(t,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var t=(0,b.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,t>B?(this._strokeColor=y.color.black255,this._strokeWidth=2.5,this._loadLogo(S)):(this._strokeColor=y.color.black0,this._strokeWidth=3,this._loadLogo(w))}},{key:"_loadLogo",value:function(t){var e=this;this._showLogo&&(this._logo=new Image,this._logo.src=F?q.fallbackImages[t]:"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(T[t]),this._logo.addEventListener("load",function(){N&&(e._logo=a(e._logo,e._logoWidth,e._logoHeight)),e._logoReady=!0,"function"==typeof e._onReadyCallback&&e._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case P:case L:case k:case A:case E:case O:case D:this.show=!0;break;case x:case I:case M:case V:this.show=!1}switch(this._layout){case P:this._txt=$.t("{0} chart by TradingView").format(this._symbol);break;case A:this._txt=$.t("{0} financials by TradingView").format(this._symbol);break;case L:this._txt=$.t("More features on tradingview.com");break;case k:case E:this._txt=$.t("powered by ");break;case D:this._showLogo=!0,this._txt=$.t("charts by TradingView");break;case O:this._txt=$.t("powered by TradingView")}}},{key:"_drawTextStroke",value:function(t){var e,i
;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),e=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=e.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*H,e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.strokeStyle=this._strokeColor,e.lineWidth=this._strokeWidth*this._upscaleRatio*H,e.lineJoin="round",e.strokeText(this._txt,i,i),N&&(e.lineWidth=this._strokeWidth*this._upscaleRatio*H/2,e.strokeText(this._txt,i+1.5,i),e.strokeText(this._txt,i-1.5,i))),t.save(),t.globalAlpha=this._strokeOpacity,t.scale(1/H,1/H),t.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio,this._strokeCanv.height/this._upscaleRatio),t.restore()}},{key:"_drawTextFill",value:function(t){var e,i;this._fillCanv||(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),this._fillCanv.width=(this._textWidth+2*i)*H,e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillСolor,e.fillText(this._txt,i,i)),t.save(),t.scale(1/H,1/H),t.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio,this._fillCanv.height/this._upscaleRatio),t.restore()}},{key:"draw",value:function(t){var e,i;this._layout===k||this._layout===E?(e='12px "Trebuchet MS", Tahoma, Arial, sans-serif',t.font=e,i=t.measureText(this._txt).width,this.width=i+t.measureText("TradingView").width,t.save(),t.globalAlpha=.7,t.fillStyle=this._colorOldGray,t.fillText(this._txt,0,12),t.fillStyle=this._colorOldBlue,t.fillText("TradingView",i,12),t.restore()):this._showLogo&&this._logoReady?(t.drawImage(this._logo,-2,N?-2:-.5,this._logoWidth,this._logoHeight),t.save(),t.translate(this._logoWidth,0),this._drawTextStroke(t),this._drawTextFill(t),t.restore(),this.width=this._logoWidth+this._strokeCanv.width/this._upscaleRatio/H):(t.save(),t.translate(0,N?4:0),this._drawTextStroke(t),this._drawTextFill(t),t.restore(),this.width=this._strokeCanv.width/this._upscaleRatio/H)}}]),t}(),G=function(){function t(e){var i=e.layout,o=void 0===i?x:i,n=e.src,r=e.onReadyCallback;s(this,t),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=o,this._src=n,this._onReadyCallback=r,F&&(this._init=l(this._init,this)),this._init()}return h(t,[{key:"_init",value:function(){var t,e,i=this;this._checkLayout(),this.show&&(t=this._src.match(/(\w+)\.svg/),F&&t&&2===t.length?(e=t[1],this._img.src=q.fallbackImages[e],this._img.addEventListener("load",function(){var t=q.logoSizes;e in t?(i.width=t[e].width,i.height=t[e].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),
i.height=Math.round(i._img.height),N&&(i._img=a(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case k:case I:case E:case M:case O:case V:this.show=!0;break;case x:case P:case L:case A:case D:this.show=!1}}},{key:"draw",value:function(t){this._ready&&t.drawImage(this._img,0,0,this.width,this.height)}}]),t}(),e.Branding=function(){function t(e){var i,o=this;s(this,t),this._model=e,this._mainSeries=this._model.mainSeries(),this._paneHeight=0,this._left=13,this._bottom=12,this._layout=x,this._needToShow=!0,this._customLogoSrc="",this._checkLayout(),this._layout!==k&&this._layout!==E||(this._left=8,this._bottom=5),i=(0,v.default)(function(){U=!!o._needToShow&&(o._layout!==x||R.innerWidth()>=768)},200),i(),R.on("resize",i),this._model.isSnapshot()?this._init():this._mainSeries.onSymbolResolved().subscribe(this,this._init)}return h(t,[{key:"_init",value:function(){var t=this,e=this._mainSeries.symbolInfo()||{};this._poweredBy=new Y({layout:this._layout,symbol:e.name,model:this._model,onReadyCallback:function(){return t._model.fullUpdate()}}),this._customLogo=new G({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return t._model.fullUpdate()}})}},{key:"_checkLayout",value:function(){var t,e,i;p.enabled("widget")?(t=W.logo||{},e=p.enabled("fundamental_widget"),this._needToShow=!(W.whitelabel||z.whitelabel||t.whitelabel),t.image?(this._customLogoSrc=C+t.image,t.no_powered_by?this._layout=e?M:I:this._layout=e?E:k):z.referral_id||z.no_referral_id?this._layout=L:this._layout=e?A:P):p.enabled("charting_library")||p.enabled("amp_terminal")||p.enabled("cqg_terminal")||p.enabled("trading_terminal")?(i=JSON.parse(z.logo)||{},i.image?(this._customLogoSrc=i.image,this._needToShow=p.enabled("widget_logo"),p.enabled("link_to_tradingview")?this._layout=O:this._layout=V):(this._layout=D,this._needToShow=p.enabled("widget_logo"))):this._layout=x}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(t){var e=this;return!U||p.enabled("logo_without_link")?null:this._poweredBy&&this._layout!==x&&this._layout!==I&&this._layout!==M&&_.pointInRect(t,new _.Point(this._left,this._paneHeight-this._poweredBy.height-this._bottom),new _.Point(this._left+this._poweredBy.width,this._paneHeight-this._bottom))?new m.default(m.default.CUSTOM,{mouseUpHandler:function(){window.open(e.tvUrl(),"_blank").opener=null}}):null}},{key:"tvUrl",value:function(){var t,e="https://www.tradingview.com/";if(this._layout===D||this._layout===O){switch(t=void 0,!0){case p.enabled("charting_library"):t="library";break;case p.enabled("trading_terminal"):case p.enabled("amp_terminal"):case p.enabled("cqg_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",
i.height=Math.round(i._img.height),N&&(i._img=a(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case k:case I:case E:case M:case O:case V:this.show=!0;break;case x:case P:case L:case A:case D:this.show=!1}}},{key:"draw",value:function(t){this._ready&&t.drawImage(this._img,0,0,this.width,this.height)}}]),t}(),e.Branding=function(){function t(e){var i,o=this;s(this,t),this._model=e,this._mainSeries=this._model.mainSeries(),this._paneHeight=0,this._left=13,this._bottom=12,this._layout=x,this._needToShow=!0,this._customLogoSrc="",this._checkLayout(),this._layout!==k&&this._layout!==E||(this._left=8,this._bottom=5),i=function(){U=!!o._needToShow&&(o._layout!==x||R.innerWidth()>=768)},i(),R.on("resize",(0,v.default)(i,200)),this._model.isSnapshot()?this._init():this._mainSeries.onSymbolResolved().subscribe(this,this._init)}return h(t,[{key:"_init",value:function(){var t=this,e=this._mainSeries.symbolInfo()||{};this._poweredBy=new Y({layout:this._layout,symbol:e.name,model:this._model,onReadyCallback:function(){return t._model.fullUpdate()}}),this._customLogo=new G({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return t._model.fullUpdate()}})}},{key:"_checkLayout",value:function(){var t,e,i;p.enabled("widget")?(t=W.logo||{},e=p.enabled("fundamental_widget"),this._needToShow=!(W.whitelabel||z.whitelabel||t.whitelabel),t.image?(this._customLogoSrc=C+t.image,t.no_powered_by?this._layout=e?M:I:this._layout=e?E:k):z.referral_id||z.no_referral_id?this._layout=L:this._layout=e?A:P):p.enabled("charting_library")||p.enabled("amp_terminal")||p.enabled("cqg_terminal")||p.enabled("trading_terminal")?(i=JSON.parse(z.logo)||{},i.image?(this._customLogoSrc=i.image,this._needToShow=p.enabled("widget_logo"),p.enabled("link_to_tradingview")?this._layout=O:this._layout=V):(this._layout=D,this._needToShow=p.enabled("widget_logo"))):this._layout=x}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(t){var e=this;return!U||p.enabled("logo_without_link")?null:this._poweredBy&&this._layout!==x&&this._layout!==I&&this._layout!==M&&_.pointInRect(t,new _.Point(this._left,this._paneHeight-this._poweredBy.height-this._bottom),new _.Point(this._left+this._poweredBy.width,this._paneHeight-this._bottom))?new m.default(m.default.CUSTOM,{mouseUpHandler:function(){window.open(e.tvUrl(),"_blank").opener=null}}):null}},{key:"tvUrl",value:function(){var t,e="https://www.tradingview.com/";if(this._layout===D||this._layout===O){switch(t=void 0,!0){case p.enabled("charting_library"):t="library";break;case p.enabled("trading_terminal"):case p.enabled("amp_terminal"):case p.enabled("cqg_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",
e+="utm_source="+window.location.origin+"&utm_medium=library"+(t?"&utm_campaign="+t:"")}return e}},{key:"draw",value:function(t){if(U){var e=0;this._poweredBy&&this._poweredBy.show&&(e=this._poweredBy.height,t.save(),t.translate(this._left,this._paneHeight-this._bottom-this._poweredBy.height),this._poweredBy.draw(t),t.restore()),this._customLogo&&this._customLogo.show&&(t.save(),t.translate(this._left,this._paneHeight-this._bottom-e-this._customLogo.height),this._customLogo.draw(t),t.restore())}}},{key:"renderer",value:function(){return this._paneHeight=j.height(),{draw:this.draw.bind(this)}}},{key:"paneViews",value:function(t){var e=p.enabled("move_logo_to_main_pane");return e&&t.isMainPane()||!e&&t.isLast()||t.isMaximized()?(j=t,[{renderer:this.renderer.bind(this)}]):[]}}]),t}()},function(t,e,i){(function(t,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,a,l,h,c,d,p;Object.defineProperty(e,"__esModule",{value:!0}),e.CompareTab=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(77),l=n(a),h=i(33),i(250),i(249),i(498),c='\n\t<div class="tv-compare-tab">\n\t\t<input type="text" class="tv-control-input js-compare-tab-input" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">\n\t</div>',d='<div class="tv-compare-tab__predefines js-compare-tab-predefines"></div>',p='\n\t<div class="tv-compare-tab__predefine-cell">\n\t\t<label for="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox">\n\t\t\t\t<input class="tv-control-checkbox__input js-predefine-checkbox" type="checkbox" id="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox__box tv-compare-tab__checkbox-box">'+i(382)+'</span>\n\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t</span>\n\t\t\t<span class="tv-control-checkbox__label tv-compare-tab__checkbox-label">{{label}}</span>\n\t\t</label>\n\t</div>',e.CompareTab=function(){function e(t,i){s(this,e),this._chartWidgetCollection=t,this._dialog=i,this._$popup=null,this._predefines={},this._symbolAlias={},this.init()}return r(e,[{key:"addCompareSymbol",value:function(t,e,i){var o,n,s,r,a,l,c=this._chartWidgetCollection.activeChartWidget.value();if(c&&(o=c.model())){for(n=o.mainSeries().interval(),s=o.studiesMetaData(),r=void 0,a=0;a<s.length;a++)"Compare@tv-basicstudies"===s[a].id&&(r=s[a]);return l={exchange:i,inputs:{symbol:t,resolution:n}},(0,h.trackEvent)("GUI","Add Compare"),o.insertStudy(r,l)}}},{key:"removeCompareSymbol",value:function(t){var e,i=this,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.model())&&e.dataSources().forEach(function(o){if(o._metaInfo&&"Compare@tv-basicstudies"===o._metaInfo.id){var n=o.properties().inputs.symbol.value();(n===t||i._symbolAlias[n]&&i._symbolAlias[n]===t)&&e.removeSource(o)}})}},{key:"init",
value:function(){var e,i,o,n=this,s=this._chartWidgetCollection.activeChartWidget.value();s&&(e=s.model())&&(i=e.dataSources(),this.$tab=$(c),this._initSymbolSearch(),t.enabled("charting_library_base")||(this._createPredefinesList(),o=this.$tab.find(".js-compare-tab-predefines"),o.find(".js-predefine-checkbox").attr("checked",!1),Object.keys(this._predefines).forEach(function(t){var e=n._symbolToId(t),s=o.find("#"+e);i.forEach(function(e){if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var i=e.properties().inputs.symbol.value();(i===t||n._symbolAlias[i]&&n._symbolAlias[i]===t)&&s.attr("checked",!0)}})})))}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),l.default.bindToInput(this._$input,{callback:function(e){return t.addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){if($(e).is(":checked")){i.addCompareSymbol(t.data.symbol)||$(e).attr("checked",!1)}else i.removeCompareSymbol(t.data.symbol)})}var e=this,i=this,n=$(d);Object.keys(this._predefines).forEach(function(i){var s=$(o.render(p,{symbolId:e._symbolToId(i),label:e._predefines[i]}));s.find(".js-predefine-checkbox").change({symbol:i},t),s.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}()}).call(e,i(3),i(30))},,function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a;Object.defineProperty(e,"__esModule",{value:!0}),e.ChartPage=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(258),r=i(40),a=i(3),e.ChartPage=function(){function t(e,i){var n=this;if(o(this,t),this._$body=$(e.body.value()),0===this._$body.size())throw Error("bridge.body.value() must be an element or not empty jQuery object");this._availableAreas=["left","dompanel","right","top","footer","bottom","center"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._visible=e.visible,this._width.subscribe(function(){return n.recalculate()}),this._height.subscribe(function(){return n.recalculate()}),this._bridge.visible.subscribe(function(){return n._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return n._onParentFullscreenChange()}),this.recalculate()}return n(t,[{key:"_updateVisibility",value:function(){var t,e,i,o=!!this._bridge.visible.value();for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],
value:function(){var e,i,o,n=this,s=this._chartWidgetCollection.activeChartWidget.value();s&&(e=s.model())&&(i=e.dataSources(),this.$tab=$(c),this._initSymbolSearch(),t.enabled("charting_library_base")||(this._createPredefinesList(),o=this.$tab.find(".js-compare-tab-predefines"),o.find(".js-predefine-checkbox").attr("checked",!1),Object.keys(this._predefines).forEach(function(t){var e=n._symbolToId(t),s=o.find("#"+e);i.forEach(function(e){if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var i=e.properties().inputs.symbol.value();(i===t||n._symbolAlias[i]&&n._symbolAlias[i]===t)&&s.attr("checked",!0)}})})))}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),l.default.bindToInput(this._$input,{callback:function(e){return t.addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){if($(e).is(":checked")){i.addCompareSymbol(t.data.symbol)||$(e).attr("checked",!1)}else i.removeCompareSymbol(t.data.symbol)})}var e=this,i=this,n=$(d);Object.keys(this._predefines).forEach(function(i){var s=$(o.render(p,{symbolId:e._symbolToId(i),label:e._predefines[i]}));s.find(".js-predefine-checkbox").change({symbol:i},t),s.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}()}).call(e,i(3),i(30))},,function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r,a;Object.defineProperty(e,"__esModule",{value:!0}),e.ChartPage=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(258),r=i(41),a=i(3),e.ChartPage=function(){function t(e,i){var n=this;if(o(this,t),this._$body=$(e.body.value()),0===this._$body.size())throw Error("bridge.body.value() must be an element or not empty jQuery object");this._availableAreas=["left","dompanel","right","top","footer","bottom","center"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._visible=e.visible,this._width.subscribe(function(){return n.recalculate()}),this._height.subscribe(function(){return n.recalculate()}),this._bridge.visible.subscribe(function(){return n._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return n._onParentFullscreenChange()}),this.recalculate()}return n(t,[{key:"_updateVisibility",value:function(){var t,e,i,o=!!this._bridge.visible.value();for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],
(i=this._areas[e])&&(o&&this._affectsLayout(e)?i.visible.setValue(!0):i.visible.setValue(!1))}},{key:"_onParentFullscreenChange",value:function(){this._bridge.fullscreen.value()||(this._fullscreenArea=null,this._updateFullscreen())}},{key:"_updateFullscreen",value:function(){var t,e,i,o=!!this._fullscreenArea;for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],(i=this._areas[e])&&(e!==this._fullscreenArea?i.body.value().toggleClass("js-hidden",o):i.fullscreen.setValue(o));this._updateVisibility(),this.recalculate()}},{key:"_createDOM",value:function(t){var e=$("<div>").addClass("layout__area--"+t).css("position","absolute");return"bottom"===t?e.css("bottom",0):e.css("top",0),"right"===t||"dompanel"===t?e.css("right",0):e.css("left",0),e}},{key:"allocate",value:function(t){var e,i,o=this,n=t&&t.areaName;if(-1===this._availableAreas.indexOf(n))throw Error("unknown options.areaName");return this.free(n),e=this._createDOM(n),i={canNegotiate:{width:"left"===n||"right"===n||"dompanel"===n,height:"top"===n||"bottom"===n||"footer"===n},negotiations:{width:[],height:[]},remove:function(){for(var t in o._areas)o._areas[t]===i&&o.free(t)},negotiateWidth:function(t){i.canNegotiate.width&&(t=(0,s.processNegotiation)(t),(0,s.negotiationsAreEqual)(i.negotiations.width,t)||(i.negotiations.width=t,o.recalculate()))},negotiateHeight:function(t){i.canNegotiate.height&&(t=(0,s.processNegotiation)(t),(0,s.negotiationsAreEqual)(i.negotiations.height,t)||(i.negotiations.height=t,o.recalculate()))},requestFullscreen:function(){o._fullscreenArea||("right"!==n&&"center"!==n||(o._fullscreenArea=n),"center"===n&&o._bridge.requestFullscreen(),o._updateFullscreen())},exitFullscreen:function(){n===o._fullscreenArea&&(o._fullscreenArea=null,"center"===n&&o._bridge.exitFullscreen(),o._updateFullscreen())},detach:function(t){var e=t.title;i.rdState.detachToPopup({title:e,useElementMetrics:i.body.value(),useStyles:i.body.value().prop("ownerDocument")})},width:new r,height:new r,availWidth:new r,availHeight:new r,alive:new r(!0),body:new r(e),detachable:new r(!0),visible:new r(!0),fullscreen:new r(!0)},i.rdState=new s.ResizerDetacherState(i),this._areas[n]=i,i.rdState.owner.subscribe(function(t){var e,s,r,a=i.body.value();if(t!==i)a.empty().detach();else{for(e=null,s=o._availableAreas.indexOf(n);s--;)if(r=o._availableAreas[s],o._affectsLayout(r)){e=o._areas[r].body.value();break}e?a.insertAfter(e):a.appendTo(o._$body)}o.recalculate()},{callWithLast:!0}),i.rdState.bridge()}},{key:"free",value:function(t){var e=this._areas[t];e&&(this._areas[t]=null,$(e.body.value()).remove(),e.alive.setValue(!1))}},{key:"_affectsLayout",value:function(t){var e,i=this._areas[t];return!!i&&(i.rdState.owner.value()===i&&((!this._fullscreenArea||this._fullscreenArea===t)&&!((this._width.value()<=567||this._height.value()<=450)&&(e=["center","top"],a.enabled("keep_left_toolbar_visible_on_small_screens")&&e.push("left"),!e.includes(t)))))}},{key:"recalculate",value:function(){var t,e,i,o,n,r,a,l,h,c,d,p,u,_,f,m,g={};for(this._recalcSingleRunToken=g,t={
width:this._width.value(),height:this._height.value()},e=0;e<this._availableAreas.length;e++)if(i=this._availableAreas[e],o=this._areas[i],this._affectsLayout(i)){for("center"===i?(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),r=0,this._affectsLayout("top")&&(r+=this._areas.top.height.value()),o.body.value().css({left:n,top:r})):"top"!==i&&"bottom"!==i&&"footer"!==i||(a=0,this._affectsLayout("left")&&(a+=this._areas.left.width.value()),o.body.value().css({left:a})),l=void 0,l=o.canNegotiate.width&&!o.canNegotiate.height?["height","width"]:["width","height"],h=0;h<2;h++){if(c=l[h],d=void 0,p=t[c],this._fullscreenArea===i)d=p;else{if("bottom"===i&&"height"===c&&(p-=5),"right"!==i&&"dompanel"!==i||"width"!==c||(p-=300),"width"===c?o.availWidth.setValue(p):"height"===c&&o.availHeight.setValue(p),g!==this._recalcSingleRunToken)return;o.canNegotiate[c]?(d=(0,s.determineSize)(p,o.negotiations[c]),t[c]-=d):d=p}if(o.body.value().css(c,d),o[c].setValue(d),g!==this._recalcSingleRunToken)return}o.body.value().toggleClass("js-hidden",!1)}else o&&o.body.value().toggleClass("js-hidden",!0);this._affectsLayout("footer")&&(u=this._areas.footer,_=this._height.value()-u.height.value(),this._affectsLayout("bottom")&&(_-=this._areas.bottom.height.value()),u.body.value().css({top:_})),this._affectsLayout("dompanel")&&(f=this._areas.dompanel,m=0,this._affectsLayout("right")&&(m+=this._areas.right.width.value()),f.body.value().css({right:m}))}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(40),r=function(t,e){var i,o,n=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(i=0;i<n.length;i++)if((o=n[i])in t){e.setValue(!!t[o]);break}},e.FullscreenApi=function(){function t(e){var i,n,a=this;if(o(this,t),this._document=e,this.isFullscreen=new s,r(e,this.isFullscreen),e.addEventListener)for(i=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],n=0;n<i.length;n++)e.addEventListener(i[n],function(t){r(e,a.isFullscreen)},!1)}return n(t,[{key:"enter",value:function(){var t,e,i=this._document,o=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];for(t=0;t<o.length;t++)if(e=o[t],"function"==typeof i.documentElement[e]){i.documentElement[e]();break}this.isFullscreen.setValue(!0)}},{key:"exit",value:function(){var t,e,i=this._document,o=["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"];for(t=0;t<o.length;t++)if(e=o[t],"function"==typeof i[e]){i[e]();break}this.isFullscreen.setValue(!1)}}]),t}()},function(t,e,i){"use strict";function o(t,e){
if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n;Object.defineProperty(e,"__esModule",{value:!0}),n=i(40),e.VisibilityApi=function t(e){var i,s,r,a,l,h,c,d=this;for(o(this,t),this.isVisible=new n(!0),i=null,s=void 0,r=null,a=["","moz","ms","webkit"],l=0;l<a.length;l++)h=a[l],(c=h?h+"Hidden":"hidden")in e&&(i=c,s=h+"visibilitychange");i&&(r=function(){d.isVisible.setValue(!e[i])},r(),e.addEventListener&&e.addEventListener(s,r,!1)),this.destroy=function(){r&&(e.removeEventListener(s,r,!1),r=null)}}},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonLoader=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(186),a=i(54),l=o(a),$.fn.tvButtonLoader=(0,r.createTvBlockWithInstance)("tv-button-loader",function(t,e){return new h(t,e)}),h=e.ButtonLoader=function(){function t(e,i){n(this,t),this.$btn=$(e).addClass("tv-button--loader"),0===this.$btn.find(".tv-button__loader").length&&this.$btn.html('<span class="tv-button__text">'+this.$btn.html()+'</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'),this.loading=this.$btn.hasClass("i-loading")}return s(t,[{key:"_start",value:function(){var t=this;this.starting=!0,this.$btn.addClass("i-start-load"),this.$btn.trigger("tv-button-loader:start"),setTimeout(function(){t.loading=!0,t.starting=!1,t._startPromise=!1,t.$btn.addClass("i-loading"),t.$btn.removeClass("i-start-load"),t._stopPromise&&t._stop()},2*l.dur)}},{key:"start",value:function(){this.starting||(this.stopping?this._startPromise=!0:this._start())}},{key:"_stop",value:function(){var t=this;this.stopping=!0,this.$btn.addClass("i-stop-load"),this.$btn.trigger("tv-button-loader:stop"),setTimeout(function(){t.loading=!1,t.stopping=!1,t._stopPromise=!1,t.$btn.removeClass("i-loading i-start-load i-stop-load"),t._startPromise&&t._start()},l.dur)}},{key:"stop",value:function(){this.stopping||(this.starting?this._stopPromise=!0:this._stop())}},{key:"toggle",value:function(){this.loading?this.stop():this.start()}},{key:"contentHtml",value:function(t){return t?(this.$btn.find(".tv-button__text").html(t),t):this.$btn.find(".tv-button__text").html()}},{key:"contentNojQuery",value:function(){return this.$btn.get(0)}},{key:"disable",value:function(){this.stop(),this.$btn.addClass("i-disabled")}},{key:"enable",value:function(){this.$btn.removeClass("i-disabled")}}]),t}()},function(t,e,i){"use strict";function o(t,e,i,o){var r=(0,n.createConfirmDialog)({type:"modal",
width:this._width.value(),height:this._height.value()},e=0;e<this._availableAreas.length;e++)if(i=this._availableAreas[e],o=this._areas[i],this._affectsLayout(i)){for("center"===i?(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),r=0,this._affectsLayout("top")&&(r+=this._areas.top.height.value()),o.body.value().css({left:n,top:r})):"top"!==i&&"bottom"!==i&&"footer"!==i||(a=0,this._affectsLayout("left")&&(a+=this._areas.left.width.value()),o.body.value().css({left:a})),l=void 0,l=o.canNegotiate.width&&!o.canNegotiate.height?["height","width"]:["width","height"],h=0;h<2;h++){if(c=l[h],d=void 0,p=t[c],this._fullscreenArea===i)d=p;else{if("bottom"===i&&"height"===c&&(p-=5),"right"!==i&&"dompanel"!==i||"width"!==c||(p-=300),"width"===c?o.availWidth.setValue(p):"height"===c&&o.availHeight.setValue(p),g!==this._recalcSingleRunToken)return;o.canNegotiate[c]?(d=(0,s.determineSize)(p,o.negotiations[c]),t[c]-=d):d=p}if(o.body.value().css(c,d),o[c].setValue(d),g!==this._recalcSingleRunToken)return}o.body.value().toggleClass("js-hidden",!1)}else o&&o.body.value().toggleClass("js-hidden",!0);this._affectsLayout("footer")&&(u=this._areas.footer,_=this._height.value()-u.height.value(),this._affectsLayout("bottom")&&(_-=this._areas.bottom.height.value()),u.body.value().css({top:_})),this._affectsLayout("dompanel")&&(f=this._areas.dompanel,m=0,this._affectsLayout("right")&&(m+=this._areas.right.width.value()),f.body.value().css({right:m}))}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(41),r=function(t,e){var i,o,n=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(i=0;i<n.length;i++)if((o=n[i])in t){e.setValue(!!t[o]);break}},e.FullscreenApi=function(){function t(e){var i,n,a=this;if(o(this,t),this._document=e,this.isFullscreen=new s,r(e,this.isFullscreen),e.addEventListener)for(i=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],n=0;n<i.length;n++)e.addEventListener(i[n],function(t){r(e,a.isFullscreen)},!1)}return n(t,[{key:"enter",value:function(){var t,e,i=this._document,o=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];for(t=0;t<o.length;t++)if(e=o[t],"function"==typeof i.documentElement[e]){i.documentElement[e]();break}this.isFullscreen.setValue(!0)}},{key:"exit",value:function(){var t,e,i=this._document,o=["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"];for(t=0;t<o.length;t++)if(e=o[t],"function"==typeof i[e]){i[e]();break}this.isFullscreen.setValue(!1)}}]),t}()},function(t,e,i){"use strict";function o(t,e){
if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n;Object.defineProperty(e,"__esModule",{value:!0}),n=i(41),e.VisibilityApi=function t(e){var i,s,r,a,l,h,c,d=this;for(o(this,t),this.isVisible=new n(!0),i=null,s=void 0,r=null,a=["","moz","ms","webkit"],l=0;l<a.length;l++)h=a[l],(c=h?h+"Hidden":"hidden")in e&&(i=c,s=h+"visibilitychange");i&&(r=function(){d.isVisible.setValue(!e[i])},r(),e.addEventListener&&e.addEventListener(s,r,!1)),this.destroy=function(){r&&(e.removeEventListener(s,r,!1),r=null)}}},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,r,a,l,h;Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonLoader=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(186),a=i(54),l=o(a),$.fn.tvButtonLoader=(0,r.createTvBlockWithInstance)("tv-button-loader",function(t,e){return new h(t,e)}),h=e.ButtonLoader=function(){function t(e,i){n(this,t),this.$btn=$(e).addClass("tv-button--loader"),0===this.$btn.find(".tv-button__loader").length&&this.$btn.html('<span class="tv-button__text">'+this.$btn.html()+'</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'),this.loading=this.$btn.hasClass("i-loading")}return s(t,[{key:"_start",value:function(){var t=this;this.starting=!0,this.$btn.addClass("i-start-load"),this.$btn.trigger("tv-button-loader:start"),setTimeout(function(){t.loading=!0,t.starting=!1,t._startPromise=!1,t.$btn.addClass("i-loading"),t.$btn.removeClass("i-start-load"),t._stopPromise&&t._stop()},2*l.dur)}},{key:"start",value:function(){this.starting||(this.stopping?this._startPromise=!0:this._start())}},{key:"_stop",value:function(){var t=this;this.stopping=!0,this.$btn.addClass("i-stop-load"),this.$btn.trigger("tv-button-loader:stop"),setTimeout(function(){t.loading=!1,t.stopping=!1,t._stopPromise=!1,t.$btn.removeClass("i-loading i-start-load i-stop-load"),t._startPromise&&t._start()},l.dur)}},{key:"stop",value:function(){this.stopping||(this.starting?this._stopPromise=!0:this._stop())}},{key:"toggle",value:function(){this.loading?this.stop():this.start()}},{key:"contentHtml",value:function(t){return t?(this.$btn.find(".tv-button__text").html(t),t):this.$btn.find(".tv-button__text").html()}},{key:"contentNojQuery",value:function(){return this.$btn.get(0)}},{key:"disable",value:function(){this.stop(),this.$btn.addClass("i-disabled")}},{key:"enable",value:function(){this.$btn.removeClass("i-disabled")}}]),t}()},function(t,e,i){"use strict";function o(t,e,i,o){var r=(0,n.createConfirmDialog)({type:"modal",
content:$.t("Do you really want to delete Chart Layout '{0}' ?").format(t),addClass:"delete-chart-dialog"}),a=function(){var t=o;o=null,t&&t()};r.on("action:yes",function(){o=null,s.removeChart(e,i),r.close()}),r.on("action:no",a),r.on("afterClose",a),r.open()}var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.deleteChart=o,n=i(93),s=i(116)},function(t,e,i){"use strict";function o(t){var e=0;!0===t&&(ChartApiInstance.disconnect(),e=500),setTimeout(ChartApiInstance.connect.bind(ChartApiInstance),e)}function n(t,e,i,n){l||(l=(0,r.createDialog)({width:n||600,closeOnOutsideClick:!1,destroyOnClose:!0,type:"modal",contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text tv-text--position-outside"></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',title:t,content:e,actions:[{name:"reconnect",type:"primary",text:$.t("Reconnect")},{name:"report",type:"primary",text:$.t("Report a data issue")}]}).on("action:reconnect",function(t){t.close(),o(i)}).on("action:report",function(t){t.close(),runOrSignIn(function(){},{source:"Report data issue from disconnect dialog"})}).on("destroy",function(){l=null}).open())}function s(){(0,a.trackEvent)("System","Critical Error"),n($.t("Oops, something went wrong"),$.t("Please report the issue or click Reconnect."),!0,500)}var r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.showCriticalErrorMessage=s,r=i(71),a=i(33),l=null},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CustomEvent=function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.bubbles,n=void 0!==o&&o,s=i.cancelable,r=void 0!==s&&s,a=i.detail,l=void 0===a?null:a;try{return new window.CustomEvent(t,{bubbles:n,cancelable:r,detail:l})}catch(i){return e=document.createEvent("CustomEvent"),e.initCustomEvent(t,n,r,l),e}}},function(t,e,i){(function(t,o,n){"use strict";function s(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(){m.forEach(function(t){return t.close()})}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T;Object.defineProperty(e,"__esModule",{value:!0}),e.TVDialogAbstract=void 0,h=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},c=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.closeAllDialogs=l,d=i(54),p=r(d),i(539),u=i(187),_=s(u),i(522),i(514),f=0,m=[],g=void 0,v=110,y=$(document),b={closeOnEsc:!0,closeButton:!0,focusFirstControl:!0,closeOnOutsideClick:!0,
closeButtonAddClass:"",focusClass:"i-focused",template:'<div class="tv-dialog">',errorTemplate:'<div class="tv-dialog__error i-slided{{# errorMod }} tv-dialog__error--{{ errorMod }}{{/ errorMod }}">{{{ error }}}</div>',titleTemplate:'<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag"><div class="js-title-text tv-dialog__title">{{{ title }}}</div></div>',contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border">',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',closeButtonTemplate:'<div class="tv-dialog__close js-dialog__close">'+i(129)+"</div>",helpButtonTemplate:'<a href="{{{ link }}}" target="_blank" class="tv-dialog__help apply-common-tooltip" title="{{{ title }}}"></a>',helpActionsMod:"tv-dialog__section--actions_with-help"},w={default:"tv-button tv-button--default",primary:"tv-button tv-button--primary",success:"tv-button tv-button--success",danger:"tv-button tv-button--danger",warning:"tv-button tv-button--warning",link:"tv-button tv-button--link",checkbox:"tv-control-checkbox tv-control-checkbox--in-actions","default-ghost":"tv-button tv-button--default_ghost","primary-ghost":"tv-button tv-button--primary_ghost","success-ghost":"tv-button tv-button--success_ghost","danger-ghost":"tv-button tv-button--danger_ghost","warning-ghost":"tv-button tv-button--warning_ghost"},S={_default:'<div data-name="{{ name }}" class="js-dialog__action-click {{ class }}">{{ text }}</div>',"submit-success":'<button type="submit" class="tv-button tv-button--success">{{ text }}</button>'},$(function(){b.$wrap=$(document.all&&!document.querySelector?"html":"body")}),T=function(){function e(){var i,s,r,l,c=this,d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(a(this,e),t.extend(this,o),this.id=f++,this.loadingActions=[],this.disabledActions=[],this.firstFocusControl=null,this.options=h({},b,d),this.$el=$(n.render(this.options.template,{title:this.options.title,closeButton:this.options.closeButton})),this.$el.addClass("js-dialog"),this.el=this.$el[0],this.options.addClass&&this.$el.addClass(this.options.addClass),this.options.width&&this.$el.css({width:"100%","max-width":this.options.width}),this.options.title&&(this.$title=$(n.render(this.options.titleTemplate,{title:this.options.title})).appendTo(this.$el)),this.$content=$(this.options.contentWrapTemplate).appendTo(this.$el),this.$contentIn=this.$content;this.$contentIn.length;)this.$contentIn=this.$contentIn.children();if(this.$contentIn=this.$contentIn.end(),this.options.content&&this.renderContent(this.options.content),(this.options.actions||this.options.help)&&(this.$content.hasClass("tv-dialog__section")&&this.$content.addClass("tv-dialog__section--no-padding_bottom"),this.$actions=$(this.options.actionsWrapTemplate).appendTo(this.$el)),this.options.actions)for(this.actions={},this.$el.on("click",".js-dialog__action-click",function(t){c.actionDispatcher($(t.currentTarget).data("name"))}),i=function(t){var e,i,o,s,r,a,l=c.options.actions[t]
;l.type||(l.type="default"),l.class||(l.class=w[l.type]?w[l.type]:w.default),"checkbox"===l.type?(e=new _.default({labelRight:l.text,name:l.name,checked:l.checked}),c.actions[l.name]=e.$el.appendTo(c.$actions),c.actions[l.name].on("change",function(t){setTimeout(function(){return TVSettings.setValue("publish.showIntroText",!e.checked)},0)})):c.actions[l.name]=$(n.render(l.template?l.template:S[l.type]||S._default,l,l)).appendTo(c.$actions),l.method&&"function"==typeof c[l.method]&&c.on("action:"+l.name,c[l.method].bind(c)),l.addClass&&c.actions[l.name].addClass(l.addClass),l.key&&(i=void 0,"string"==typeof l.key&&l.key.split("+").length>1?(o=[],s=l.key.split("+"),i=function(t){o=[]},r=function(t){var e=""+t.keyCode;-1!==s.indexOf(e)&&o.indexOf(e)&&o.push(e),c.focused&&o.length===s.length&&(o=[],c.actionDispatcher(l.name))},c.on("afterOpen",function(){y.on("keydown",r),y.on("keyup",i)}),c.on("beforeClose",function(){y.off("keydown",r),y.off("keyup",i)})):(a=$.isArray(l.key)?l.key:[l.key],i=function(t){c.focused&&-1!==a.indexOf(t.keyCode)&&c.actionDispatcher(l.name)},c.on("afterOpen",function(){return y.on("keyup",i)}),c.on("beforeClose",function(){return y.off("keyup",i)})))},s=this.options.actions.length-1;s>=0;s--)i(s);this.options.help&&$(n.render(this.options.helpButtonTemplate,this.options.help)).prependTo(this.$actions.addClass(this.options.helpActionsMod)),this.options.closeButton&&(r=$(this.options.closeButtonTemplate),r.addClass(this.options.closeButtonAddClass||""),l=this.$el,1===this.$el.find(".js-close-button-place").length&&(l=this.$el.find(".js-close-button-place")),r.appendTo(l)),this.setZIndex(v+m.length),d.errorMod&&(this.errorMod=d.errorMod),this.on("afterOpen",function(){c.options.focusFirstControl&&!Modernizr.touch&&(c.firstFocusControl||c.$el.find('input:not([type="hidden"]), textarea').first()).focus()}),this.$el.on("click",".js-dialog__close",this.close.bind(this)),this.$el.on("mousedown touchstart",this.focus.bind(this)),m.push(this)}return c(e,[{key:"renderContent",value:function(t){return this.$contentIn.html("function"==typeof t?t(this):t),this}},{key:"setZIndex",value:function(t){return this.zIndex=t,this.trigger("change:zIndex",this),this}},{key:"toTop",value:function(){for(var t=m.length-1;t>=0;t--)m[t].zIndex>this.zIndex&&m[t].setZIndex(m[t].zIndex-1);return this.setZIndex(v+m.length),this}},{key:"isEventOut",value:function(t){var e,i,o;return this.options.isClickOutFn&&void 0!==(e=this.options.isClickOutFn(t))?e:(i=!0,o=$(t.target),o.get(0)!==this.$el.get(0)&&($(">*",this.$el).each(function(){o.get(0)===$(this).get(0)&&(i=!1),0===o.closest("HTML",$(this).get(0)).length&&(i=!1)}),i))}},{key:"focus",value:function(){var t=this;g!==this&&(g&&g.unfocus(),this.focused=!0,g=this,this.$el.addClass(this.options.focusClass),this.trigger("focus",this),setTimeout(function(){y.on("mousedown.tv-dialog-unfocus-"+t.id,function(e){t.isEventOut(e)&&(t.unfocus(),y.off("mousedown.tv-dialog-unfocus-"+t.id))})},20))}},{key:"unfocus",value:function(){this.focused=!1,g===this&&(g=void 0),
@@ -491,11 +491,11 @@ h._studyEngine.purgeEndOfDataFlags(t,e),h._studyEngine.purgeRangeExtensionData(t
return-1!==e.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),e=e.filter(function(t){return!!t})),this._studyEngine.quoteAddSymbols(t,e)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(t,e){return this._studyEngine.quoteRemoveSymbols(t,e)},JSServer.ChartApi.prototype.quoteFastSymbols=function(t,e){return this._studyEngine.quoteFastSymbols(t,e)},JSServer.ChartApi.prototype.quoteHibernateAll=function(t){return this._studyEngine.quoteHibernateAll(t)},JSServer.ChartApi.prototype.depthCreateSession=function(t){return this._studyEngine.depthCreateSession(t)},JSServer.ChartApi.prototype.depthDeleteSession=function(t){return this._studyEngine.depthDeleteSession(t)},JSServer.ChartApi.prototype.depthSetSymbol=function(t,e){return this._studyEngine.depthSetSymbol(t,e)},JSServer.ChartApi.prototype.depthClearSymbol=function(t){},JSServer.ChartApi.prototype.depthSetScale=function(t,e){},JSServer.ChartApi.prototype.createStudiesAccessController=function(t,e,i){return new this.StudiesAccessController(this._studyEngine,t&&JSON.parse(t)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(t,e){this._studyEngine=t,this._studiesAccess=e},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(t){var e,i,o=null;for(e=0;e<this._studiesAccess.tools.length;++e)if(i=this._studiesAccess.tools[e],i.name===t||i===t){o=i;break}return o},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(t){var e=this._findTool(t.description);return"black"===this._studiesAccess.type?!e||e.grayed:!!e},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(t){var e=this._findTool(t);return e&&e.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(t,e,i){return this._studyEngine.alignTimePoint(t,e,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},d(JSServer.ChartApi,"JSServer.ChartApi",h,"ChartApiInterface"),t.exports=JSServer.ChartApi},function(t,e,i){"use strict";var o=function(){function t(t,e,i){return t+","+e+","+i}function e(e,i,o){delete n[t(e,i,o)]}function o(e,i,o){function r(t){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?n[t]=new a(TradingView.ChartapiMessagerInstances[e],l.pureResolution):n[t]=new a(null,l.pureResolution),n[t]}var l=s.Symbol.parsePeriod(o),h=t(e,i,l.pureResolution);return n[h]?n[h]:r(h)}var n={},s=i(56),r=i(58),a=function(t,e,i){this._chartApiMessager=t,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=e,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(t,e){this._lastRealBarTime=t;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars)
;this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(e,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1e3))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(t,e,i){var o,n;return 0===e?t:!this.ready()||t<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().getPointTimeUTC(t,e,i)):(o=0===this._extrapolatedBarsCache.length||t===this._lastRealBarTime/1e3,n=o?-1:this.indexOfBar(t,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,n+e+1),this._extrapolatedBarsCache[n+e])},a.prototype.findDistanceInBars=function(t,e,i){return t===e?0:(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().indexOfBar(e,i))},a.prototype.indexOfBar=function(t,e){this._ensureExtrapolatedToTime(e,1e3*t);var i=r.lower_bound(this._extrapolatedBarsCache,t,function(t,e){return t>e?1:t<e?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(t,e){var i,o,n;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=e(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,t,this._resolution));for(o=0;o<i.length;++o)i[o]=i[o]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,n=i.slice(0),n.sort(),o=0;o<n.length-1;++o)n[o]===n[o+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*n[o]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,t,this._resolution)},a.prototype.onTickmarksNeeded=function(t,e){if(this.ready())this.ensureExtrapolatedToBar(t,e);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(t,e)})}},a.prototype.ensureExtrapolatedToBar=function(t,e){var i=this;return this._requestedAmountOfBars=e,this._extrapolateData(t,function(o){return i._extrapolatedBarsCache.length>=e||!i._shouldExtrapolateMore()?null:r.extrapolateBarsFrontByCount(i.newBarBuilder(t),o,e)})},a.prototype._ensureExtrapolatedToTime=function(t,e){var i=this;return this._extrapolateData(t,function(o){var n,s;return o>=e||!i._shouldExtrapolateMore()?null:(n=2e3,s=r.extrapolateBarsFrontToTime(i.newBarBuilder(t),o,e,n),s[s.length-1]<e&&console.warn("Extrapolation error: not enough data created"),s)})},a.prototype.newBarBuilder=function(t){var e=s.Symbol.newSession(t.timezone,t.session);return s.Symbol.newBarBuilder(this._resolution,e)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(t,e){(null===this._lastRealBarIndex||this._lastRealBarIndex===t&&this._lastRealBarTime!==e)&&(this._extrapolatedBarsCache=[]),
this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==t&&(this._lastRealBarIndex>t?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==e&&this._extrapolatedBarsCache.shift(t-this._lastRealBarIndex)),this._lastRealBarIndex=t,this._lastRealBarTime=e;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:e,storage:o}}();t.exports=o},function(t,e){"use strict";var i=function(){function t(t){return t.is_price_study}function e(t,e){var i,o=e.slice(0).toLowerCase();if(t){for(i=0;i<t.length;++i)if(t[i].description.toLowerCase()===o||t[i].shortDescription.toLowerCase()===o)return t[i];throw Error("Can't find metainfo for `"+e+"`")}throw Error("There is no studies metainfo at all")}function i(t){return t.inputs.map(function(t){return{id:t.id,type:t.type,name:t.name}})}function o(o,n){var s,a,l,h,c,d,p,u,_;if(!Array.isArray(o))return s=e(n.model().studiesMetaData(),o),{id:s.id,overlay:t(s)};for(a=o.slice(0),l=a[0],s=e(n.model().studiesMetaData(),l),h=t(s),c=i(s),p=a.splice(1),u=0;u<p.length;++u)d||(d={}),_=r[c[u].type]||r.string,d[c[u].id]=_(p[u]);return{id:s.id,name:l,overlay:h,inputs:d}}function n(t,o,n){function s(t){return t.name.toLowerCase()===a}var r,a,l,h=e(n.model().studiesMetaData(),t),c=i(h),d={};for(r in o)a=r.toLowerCase(),l=c.filter(s),0!==l.length?(l=l[0],d[l.id]=o[r]):console.warn("Uknown input `"+r+"` of `"+t+"`");return{id:h.id,name:t,inputs:d}}var s={},r={bool:function(t){return!!t},integer:function(t){return parseInt(t)},float:function(t){return parseFloat(t)},string:function(t){return t}};return s.getStudyRecordFromArray=function(t,e){return e=e||chartWidget,o(t,e)},s.getStudyRecordFromObject=function(t,e,i){return i=i||chartWidget,n(t,e,i)},s}();t.exports=i},function(t,e,i){"use strict";var o=i(3);window.onload=function(){function t(){var t=0;return JSON.parse(urlParams.logo).image&&(t="C",o.enabled("link_to_tradingview")||(t="D")),t}function e(){try{return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(t){return!1}}location.hostname.indexOf(".")>=0&&!e()&&setTimeout(function(){try{var e=t();window.ga&&0!==e&&ga("send","event","s",e)}catch(t){}},3e4)}},function(t,e,i){(function(e){"use strict";var o=i(58),n={},s=function(t,i,s){function r(){var t={};t.symbolname=_,t.status="ok",t.values={},t.values.current_session=p,n[_]=p,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([t]))}function a(t,i,n){var s=e.get_timezone(i);h=(new o.Session).init(s,t),c=n,m=setTimeout(l,6e4),l(),r()}function l(){var t,e;if(h){if(c)return void(p="out_of_session");t=o.isTradingNow(new Date,h),e=t?"market":"out_of_session",e!==p&&(p=e,r())}}var h,c,d={},p=n[s]||"out_of_session",u=!1,_=s,f=i,m=null;return t.resolveSymbol(s,function(t){u||a(t.session,t.timezone,t.expired)},function(){}),d.stop=function(){u=!0,m&&clearTimeout(m)},d.marketStatus=function(){return p},d};t.exports=s}).call(e,i(57))},function(t,e,i){
(function(e){"use strict";var o=i(730).HeikenAshi,n=function(){function t(t){this.host=t,this.cache={}}function n(t){var e=t.indexOf(",");return-1===e?t:t.slice(0,e)}function s(t,e,i,o,n){return n+t+e+i+(r(o)?"_":"")}function r(t){return t.has_empty_bars||t.force_session_rebuild}function a(t){if(0!==t.indexOf("="))return{symbol:t};var e;try{e=JSON.parse(t.slice(1))}catch(e){return{symbol:t}}return e.type&&(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?e.builder=new o:console.error("unknown builder type: "+e.type)),"string"!=typeof e.symbol&&(e.session=e.symbol.session||e.session,e.symbol=e.symbol.symbol),e}function l(e){t.instance=new t(e),p.setupFeed(t.instance)}var h,c,d,p=i(56),u=i(58),_=p.Symbol,f=p.StudyEngine,m=p.BarBuilder,g=p.BarSet;return t.prototype.getCache=function(t){return this.cache[t]},t.prototype.putCache=function(t,e){this.cache[t]=e},t.prototype.subscribe=function(t,e,i,o,n,r,a,l){var h=s(t,e,i,r,a),c=this.getCache(h);return c||(c=this.createItem(t,e,i,r,l),this.putCache(h,c)),c.listeners.addListener(o,n),{key:h,listener:o}},t.prototype.unsubscribe=function(t){var e=this.getCache(t.key);e&&e.listeners.removeListener(t.listener)},t.prototype.removeUnused=function(){var t,e,i,o,n,s=[];for(t in this.cache)this.cache[t]&&(e=this.cache[t],0===e.listeners.listenersCount()&&s.push(t));if(0!==s.length){for(i=0;i<s.length;i++)o=s[i],n=this.cache[o],this.cache[o]=null,n.stop();this.removeUnused()}},t.prototype.rebuildFrom=function(t,e,i){var o,n,s,r,a=_.parsePeriod(t),l=_.parsePeriod(e);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(o=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(n=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===n.indexOf(o)){for(s=n.length-1;s>=0;s--)if(r=+n[s],o%r==0)return r+(a.isSeconds?"S":"");return""}return o+(a.isSeconds?"S":"")},t.prototype.createItem=function(t,e,i,o,s){var l,p,u,_,f,g,v=new d,y=a(t);return y.builder?new c(v,y.symbol,e,i,y.builder,o,s):(l=n(e),p=this.rebuildFrom(l,n(i),o),u=r(o),l!==p||u?(_=o.has_empty_bars,f=$.extend({},o),u&&(f.has_empty_bars=!1,f.force_session_rebuild=!1),new c(v,y.symbol,e,p,new m(e,_),f,s)):(g=y.session&&"extended"!==y.session,new h(v,y.symbol,e,i,g,this.host,o,s)))},h=function(t,e,i,o,s,r,a,l){this.listeners=t,this.host=r;var h=this;this.host.resolve(e,function(t){s&&t.regular_session&&(t.session=t.regular_session);var r=h.calculateFromTo(t,o||i,e,l);h.subs=h.host.subscribe(t,n(i),r,function(t){h.listeners.fire(t)},function(t){h.listeners.onError(t)})},function(t){h.listeners.onError(t)})},h.prototype._createDWMAligner=function(t,i){var o=e.get_timezone(i.timezone),n=new u.Session;return n.init(o,i.session),_.newBarBuilder(t,n,n)},h.prototype.stop=function(){
this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(t,i,o,n){var s,r,a,l,h,c,d,p,f=_.parsePeriod(i),m=(new Date).valueOf(),g=t.expired?e.cal_to_utc(e.get_timezone(t.timezone),new Date(1e3*t.expiration_date))||m:m;return""===f.resolution?(r=f.interval,a="D"):"S"===f.resolution?(r=10*f.interval,a=""):(l="D"===f.resolution?1:"W"===f.resolution?5:30,r=12*l*f.interval,a="M"),f.range?(r=f.range.interval,a=f.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,a,r))&&(r=h.intervalBack||r,a=void 0===h.resolutionBack?a:h.resolutionBack),c=t.sessionString||t.session,s=u.alignPeriodsBack(c,a,r,1,g),n&&n.getRangeExtensionTime&&(d=n.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),n&&n.getRangeExtensionCount&&(p=n.getRangeExtensionCount())>0&&(s=u.alignPeriodsBack(c,f.resolution,f.interval,p,s)),{from:s,to:g+6e4}},c=function(t,e,i,o,n,s,r){if(this.listeners=t,this.isRecalculated=!1,""===o)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=s;var a=this;this.engine=new f({tickerid:e,period:o,periodBase:i,body:n,symbolInfo:s,rangeExtension:r,recalc:function(t,e){a._recalc(e)},out:function(t,e){a._out(t,e)},nonseriesOut:function(t,e){a._nonseriesOut(t,e)},setNoMoreData:function(){a.barset&&(a.barset.endOfData=!0)},onErrorCallback:function(t){a.listeners.onError(t)}})},c.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},c.prototype._recalc=function(t){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new g(this.symbolInfo)),t&&(this.barset.nextTime=t.nextTime,this.barset.endOfData=t.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},c.prototype._nonseriesOut=function(t,e){var i=Object.assign({},e);i.nonseries=!0,i.data=e.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},c.prototype._out=function(t,e){var i,o,n,s,r,a,l,h=e[0];if(!isNaN(h)){if(i={time:h,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],updatetime:e[6]},o=e[7],this.barset||(this.barset=new g(t.info)),(n=e[8])instanceof Array)for(s=0;s<n.length;s++)r=e[9],a=n[s],l={time:a,open:r,high:r,low:r,close:r,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,o),this.barset.isBarClosed=o,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){return this.listeners.reduce(function(t,e){return t+(e?1:0)},0)},d.prototype.addListener=function(t,e){this.listeners.push({dataListener:t,onErrorCallback:e}),this.barset&&t(this.barset),this.errorMsg&&e(this.errorMsg)},d.prototype.removeListener=function(t){var e,i=this.listeners.filter(function(e){return e.dataListener===t});0!==i.length&&(e=this.listeners.indexOf(i[0]),delete this.listeners[e])},d.prototype.onError=function(t){
var e,i,o,n;for(this.errorMsg=t||"unspecified error",e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.onErrorCallback&&n.onErrorCallback(t)},d.prototype.fire=function(t,e){var i,o,n,s;for(e||(this.barset=t),i=this.listeners,o=i.length,n=0;n<o;n++)(s=i[n])&&s.dataListener(t)},{setupFeed:l,parseSymbol:a,unsubscribeUnused:function(){t.instance.removeUnused()}}}();t.exports=n}).call(e,i(57))},function(t,e,i){"use strict";var o=i(56);i(141),JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(1),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=o.Std[e(0)](this._context),r=this._context.new_var(s),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{},high:{},low:{},close:{}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=this._context.new_var(o.Std.open(this._context)),r=this._context.new_var(o.Std.high(this._context)),a=this._context.new_var(o.Std.low(this._context)),l=this._context.new_var(o.Std.close(this._context)),this._context.select_sym(0),[s.adopt(n,i,0),r.adopt(n,i,0),a.adopt(n,i,0),l.adopt(n,i,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#FF0000",width:1,style:0},1:{
color:"#008000",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)?0:1},this.f_1=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,s,r,a,l,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.volume(this._context),s=this.f_0(o.Std.open(this._context),o.Std.close(this._context)),r=o.Std.volume(this._context),a=this._context.new_var(r),l=o.Std.sma(a,this._input(1),this._context),h=this.f_1(i,l),[n,s,h]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=i/100,r=n/2,a=o.Std.zigzag(s,r,this._context),l=o.Std.zigzagbars(s,r,this._context),h=a,c=l,[h,c]}}}])},function(t,e,i){(function(e){"use strict";var o=i(58),n=i(43).Interval,s=function(){function t(t,e){return t}function s(t,e){var i=m.get_timezone(t.timezone),n=new o.Session;return n.init(i,t.session),f.Symbol.newBarBuilder(e,n,n)}function r(e,i,o,n,s,r){var a,l,h,c,d=t(i,o);for(u.hasOwnProperty(d)||(u[d]=[]),a=[],l=0;l<n.length;++l)n[l][1]<0&&(n[l][1]=0),0!==n[l][1]?(h=s.getPointTimeUTC(n[l][0],n[l][1],r),a.push(h)):n[l][0]&&a.push(n[l][0]);c={guid:e,points:a},u[d].push(c)}function a(t){var e,i,o;for(e in u)for(i=u[e],o=0;o<i.length;++o)if(i[o].guid===t)return void i.splice(o,1)}function l(t,e,i,o,n){var s,r,a,l=[];for(s=0;s<t.points.length;++s){if(r=t.points[s],null===(a=c(e,r,i,o,n)))return null;l.push({index:s,value:[a,r]})}return l}function h(e,i,o,n,s,r){var a,h,c,d,p=t(e,i);if(u.hasOwnProperty(p))for(a=u[p].length,h=0;h<a;++h)c=u[p][h],null!==(d=l(c,o,n,s,i))&&r(c.guid,d)}function c(t,e,i,n,r){var a,l;return 1e3*(e=s(n,r).alignTimeIfPossible(1e3*e)/1e3)<t[0].value[0]?-p(n,r,e,t[0].value[0]/1e3,i):(a=o.lower_bound(t,1e3*e,function(t,e){return t.value[0]>e?1:t.value[0]<e?-1:0
}))>=0&&e<t[t.length-1].value[0]?(t[a].value[0]/1e3!==e&&0!==a&&a--,t[a].index):(l=i.indexOfBar(e,n),-1===l?null:l)}function d(t,e,i,o,s){function r(t,e){var i=new Date(1e3*t),o=new Date(1e3*e),n=12*(o.getFullYear()-i.getFullYear());return n-=i.getMonth()+1,n+=o.getMonth(),n<=0?0:n}var a,l,h,c,d,p,u,_,f,g,v,y,b,w,S;if(e.kind()===n.MONTHS)a=r(o,s)/e.multiplier();else if(e.kind()===n.WEEKS)l=Math.ceil((s-o)/604800),a=Math.ceil(l/e.multiplier());else{if(h=m.utc_to_cal(i.timezone,+new Date(1e3*o)),c=m.utc_to_cal(i.timezone,+new Date(1e3*s)),(d=(s-o)/86400)>4*(7-i.spec.weekEndsCount()))u=d/7,p=u*(7-i.spec.weekEndsCount());else{for(_=0,f={},g=h;g.valueOf()<=c.valueOf();g=m.add_days_considering_dst(i.timezone,g,1))v=m.get_day_of_week(g),void 0===f[v]&&(f[v]=i.spec.isWeekEnd(v)),f[v]&&_++;p=d-_}if(e.kind()===n.DAYS)a=Math.ceil(p/e.multiplier());else{if(y=e.kind()===n.HOURS?60*e.multiplier()*60:e.kind()===n.SECONDS?e.multiplier():60*e.multiplier(),d<1&&(b=i.spec.findSession(m.get_day_of_week(h),m.get_minutes_from_midnight(h)),w=i.spec.findSession(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),b===w))return Math.ceil((s-o)/y);v=i.spec.entries[0]._dayOfWeek,S=60*i.spec.entries.reduce(function(t,e){return t+(e._dayOfWeek===v?e._length:0)},0),a=Math.ceil(p*S/y)}}return a}function p(t,e,i,r,a){var l,h,c=new n(e),p=m.get_timezone(t.timezone),u=new o.Session;return u.init(p,t.session),l=s(t,e),i=l.alignTimeIfPossible(1e3*i)/1e3,r=l.alignTimeIfPossible(1e3*r)/1e3,i>=r?0:(h=d(t,c,u,i,r),h>=1e3?h:a.findDistanceInBars(i,r,t))}var u={},_="undefined"!=typeof window?window:e,f=i(56),m=_.PineJsCalendar?_.PineJsCalendar:i(57);return{createPointset:r,removePointset:a,broadcastPointsetsUpdates:h,tests:{approxBarsInterval:d,indexOfTime:c}}}();t.exports=s}).call(e,function(){return this}())},function(t,e,i){(function(e,o){"use strict";function n(t,i){var o=e.get_timezone(i.timezone),n=new p.Session;return n.init(o,i.session),l.Symbol.newBarBuilder(t,n,n)}var s,r,a=i(576),l=i(56),h=i(577),c=i(573),d=i(579),p=i(58),u=i(43).Interval,_=i(34);i(141),i(280),s=i(728).DatafeedRequestsCachedProcessor,r=function(t){function e(t,e){return!o.enabled("disable_resolution_rebuild")&&u.isDWM(t)?n(t,e):null}function i(t,e,i){return function(o){var s,r;o&&o.count()&&(s=n(e,t),r=1e3*p.getCurrentUTCTime(),s.moveTo(r),s.indexOfBar(r)>=0&&o.setLastBarClosed(!1)),i(o)}}function r(t,e,o,n,s){return p._cachedDatafeed.subscribe(t,e,o,i(t,e,n),s)}function a(t){return p._cachedDatafeed.unsubscribe(t)}function l(t,e,i){p.resolveSymbol(t,e,i)}var p=this;this._studiesCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=c,this._externalDatafeed=t,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,p._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),p._datafeedConfiguration=p._adoptConfigurationData(window.configurationData),p._fireEvent("configuration_received"),
(function(e){"use strict";var o=i(730).HeikenAshi,n=i(36).Interval,s=function(){function t(t){this.host=t,this.cache={}}function s(t){var e=t.indexOf(",");return-1===e?t:t.slice(0,e)}function r(t,e,i,o,n){return n+t+e+i+(a(o)?"_":"")}function a(t){return t.has_empty_bars||t.force_session_rebuild}function l(t){if(0!==t.indexOf("="))return{symbol:t};var e;try{e=JSON.parse(t.slice(1))}catch(e){return{symbol:t}}return e.type&&(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?e.builder=new o:console.error("unknown builder type: "+e.type)),"string"!=typeof e.symbol&&(e.session=e.symbol.session||e.session,e.symbol=e.symbol.symbol),e}function h(e){t.instance=new t(e),u.setupFeed(t.instance)}var c,d,p,u=i(56),_=i(58),f=u.Symbol,m=u.StudyEngine,g=u.BarBuilder,v=u.BarSet;return t.prototype.getCache=function(t){return this.cache[t]},t.prototype.putCache=function(t,e){this.cache[t]=e},t.prototype.subscribe=function(t,e,i,o,n,s,a,l){var h=r(t,e,i,s,a),c=this.getCache(h);return c||(c=this.createItem(t,e,i,s,l),this.putCache(h,c)),c.listeners.addListener(o,n),{key:h,listener:o}},t.prototype.unsubscribe=function(t){var e=this.getCache(t.key);e&&e.listeners.removeListener(t.listener)},t.prototype.removeUnused=function(){var t,e,i,o,n,s=[];for(t in this.cache)this.cache[t]&&(e=this.cache[t],0===e.listeners.listenersCount()&&s.push(t));if(0!==s.length){for(i=0;i<s.length;i++)o=s[i],n=this.cache[o],this.cache[o]=null,n.stop();this.removeUnused()}},t.prototype.rebuildFrom=function(t,e,i){var o,n,s,r,a=f.parsePeriod(t),l=f.parsePeriod(e);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(o=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(n=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===n.indexOf(o)){for(s=n.length-1;s>=0;s--)if(r=+n[s],o%r==0)return r+(a.isSeconds?"S":"");return""}return o+(a.isSeconds?"S":"")},t.prototype.createItem=function(t,e,i,o,r){var h,u,_,f,m,v,y=new p,b=l(t);return b.builder?new d(y,b.symbol,e,i,b.builder,o,r):(h=s(e),u=this.rebuildFrom(h,s(i),o),_=a(o),!n.isEqual(h,u)||_?(f=o.has_empty_bars,m=$.extend({},o),_&&(m.has_empty_bars=!1,m.force_session_rebuild=!1),new d(y,b.symbol,e,u,new g(e,f),m,r)):(v=b.session&&"extended"!==b.session,new c(y,b.symbol,e,i,v,this.host,o,r)))},c=function(t,e,i,o,n,r,a,l){this.listeners=t,this.host=r;var h=this;this.host.resolve(e,function(t){n&&t.regular_session&&(t.session=t.regular_session);var r=h.calculateFromTo(t,o||i,e,l);h.subs=h.host.subscribe(t,s(i),r,function(t){h.listeners.fire(t)},function(t){h.listeners.onError(t)})},function(t){h.listeners.onError(t)})},c.prototype._createDWMAligner=function(t,i){var o=e.get_timezone(i.timezone),n=new _.Session;return n.init(o,i.session),f.newBarBuilder(t,n,n)},
c.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},c.prototype.calculateFromTo=function(t,i,o,n){var s,r,a,l,h,c,d,p,u=f.parsePeriod(i),m=(new Date).valueOf(),g=t.expired?e.cal_to_utc(e.get_timezone(t.timezone),new Date(1e3*t.expiration_date))||m:m;return""===u.resolution?(r=u.interval,a="D"):"S"===u.resolution?(r=10*u.interval,a=""):(l="D"===u.resolution?1:"W"===u.resolution?5:30,r=12*l*u.interval,a="M"),u.range?(r=u.range.interval,a=u.range.resolution):this.host.calculateHistoryDepth&&(h=this.host.calculateHistoryDepth(i,a,r))&&(r=h.intervalBack||r,a=void 0===h.resolutionBack?a:h.resolutionBack),c=t.sessionString||t.session,s=_.alignPeriodsBack(c,a,r,1,g),n&&n.getRangeExtensionTime&&(d=n.getRangeExtensionTime())&&(s=Math.min(1e3*d,s)),n&&n.getRangeExtensionCount&&(p=n.getRangeExtensionCount())>0&&(s=_.alignPeriodsBack(c,u.resolution,u.interval,p,s)),{from:s,to:g+6e4}},d=function(t,e,i,o,n,s,r){if(this.listeners=t,this.isRecalculated=!1,""===o)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=s;var a=this;this.engine=new m({tickerid:e,period:o,periodBase:i,body:n,symbolInfo:s,rangeExtension:r,recalc:function(t,e){a._recalc(e)},out:function(t,e){a._out(t,e)},nonseriesOut:function(t,e){a._nonseriesOut(t,e)},setNoMoreData:function(){a.barset&&(a.barset.endOfData=!0)},onErrorCallback:function(t){a.listeners.onError(t)}})},d.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},d.prototype._recalc=function(t){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new v(this.symbolInfo)),t&&(this.barset.nextTime=t.nextTime,this.barset.endOfData=t.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},d.prototype._nonseriesOut=function(t,e){var i=Object.assign({},e);i.nonseries=!0,i.data=e.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},d.prototype._out=function(t,e){var i,o,n,s,r,a,l,h=e[0];if(!isNaN(h)){if(i={time:h,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],updatetime:e[6]},o=e[7],this.barset||(this.barset=new v(t.info)),(n=e[8])instanceof Array)for(s=0;s<n.length;s++)r=e[9],a=n[s],l={time:a,open:r,high:r,low:r,close:r,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,o),this.barset.isBarClosed=o,this.isRecalculated&&this.listeners.fire(this.barset)}},p=function(){this.listeners=[]},p.prototype.listenersCount=function(){return this.listeners.reduce(function(t,e){return t+(e?1:0)},0)},p.prototype.addListener=function(t,e){this.listeners.push({dataListener:t,onErrorCallback:e}),this.barset&&t(this.barset),this.errorMsg&&e(this.errorMsg)},p.prototype.removeListener=function(t){var e,i=this.listeners.filter(function(e){return e.dataListener===t});0!==i.length&&(e=this.listeners.indexOf(i[0]),delete this.listeners[e])},
p.prototype.onError=function(t){var e,i,o,n;for(this.errorMsg=t||"unspecified error",e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.onErrorCallback&&n.onErrorCallback(t)},p.prototype.fire=function(t,e){var i,o,n,s;for(e||(this.barset=t),i=this.listeners,o=i.length,n=0;n<o;n++)(s=i[n])&&s.dataListener(t)},{setupFeed:h,parseSymbol:l,unsubscribeUnused:function(){t.instance.removeUnused()}}}();t.exports=s}).call(e,i(57))},function(t,e,i){"use strict";var o=i(56);i(141),JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(1),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=o.Std[e(0)](this._context),r=this._context.new_var(s),this._context.select_sym(0),a=r.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{},high:{},low:{},close:{}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,s,r,a,l;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),s=this._context.new_var(o.Std.open(this._context)),r=this._context.new_var(o.Std.high(this._context)),a=this._context.new_var(o.Std.low(this._context)),l=this._context.new_var(o.Std.close(this._context)),this._context.select_sym(0),[s.adopt(n,i,0),r.adopt(n,i,0),a.adopt(n,i,0),l.adopt(n,i,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{
color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)?0:1},this.f_1=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,s,r,a,l,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.volume(this._context),s=this.f_0(o.Std.open(this._context),o.Std.close(this._context)),r=o.Std.volume(this._context),a=this._context.new_var(r),l=o.Std.sma(a,this._input(1),this._context),h=this.f_1(i,l),[n,s,h]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(t,e){var i,n,s,r,a,l,h,c;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),s=i/100,r=n/2,a=o.Std.zigzag(s,r,this._context),l=o.Std.zigzagbars(s,r,this._context),h=a,c=l,[h,c]}}}])},function(t,e,i){(function(e){"use strict";var o=i(58),n=i(36).Interval,s=function(){function t(t,e){return t}function s(t,e){var i=m.get_timezone(t.timezone),n=new o.Session;return n.init(i,t.session),f.Symbol.newBarBuilder(e,n,n)}function r(e,i,o,n,s,r){var a,l,h,c,d=t(i,o);for(u.hasOwnProperty(d)||(u[d]=[]),a=[],l=0;l<n.length;++l)n[l][1]<0&&(n[l][1]=0),0!==n[l][1]?(h=s.getPointTimeUTC(n[l][0],n[l][1],r),a.push(h)):n[l][0]&&a.push(n[l][0]);c={guid:e,points:a},u[d].push(c)}function a(t){var e,i,o;for(e in u)for(i=u[e],o=0;o<i.length;++o)if(i[o].guid===t)return void i.splice(o,1)}function l(t,e,i,o,n){var s,r,a,l=[];for(s=0;s<t.points.length;++s){if(r=t.points[s],null===(a=c(e,r,i,o,n)))return null;l.push({index:s,value:[a,r]})}return l}function h(e,i,o,n,s,r){var a,h,c,d,p=t(e,i);if(u.hasOwnProperty(p))for(a=u[p].length,h=0;h<a;++h)c=u[p][h],null!==(d=l(c,o,n,s,i))&&r(c.guid,d)}function c(t,e,i,n,r){var a,l;return 1e3*(e=s(n,r).alignTimeIfPossible(1e3*e)/1e3)<t[0].value[0]?-p(n,r,e,t[0].value[0]/1e3,i):(a=o.lower_bound(t,1e3*e,function(t,e){return t.value[0]>e?1:t.value[0]<e?-1:0
}))>=0&&e<t[t.length-1].value[0]?(t[a].value[0]/1e3!==e&&0!==a&&a--,t[a].index):(l=i.indexOfBar(e,n),-1===l?null:l)}function d(t,e,i,o,s){function r(t,e){var i=new Date(1e3*t),o=new Date(1e3*e),n=12*(o.getFullYear()-i.getFullYear());return n-=i.getMonth()+1,n+=o.getMonth(),n<=0?0:n}var a,l,h,c,d,p,u,_,f,g,v,y,b,w,S;if(e.kind()===n.MONTHS)a=r(o,s)/e.multiplier();else if(e.kind()===n.WEEKS)l=Math.ceil((s-o)/604800),a=Math.ceil(l/e.multiplier());else{if(h=m.utc_to_cal(i.timezone,+new Date(1e3*o)),c=m.utc_to_cal(i.timezone,+new Date(1e3*s)),(d=(s-o)/86400)>4*(7-i.spec.weekEndsCount()))u=d/7,p=u*(7-i.spec.weekEndsCount());else{for(_=0,f={},g=h;g.valueOf()<=c.valueOf();g=m.add_days_considering_dst(i.timezone,g,1))v=m.get_day_of_week(g),void 0===f[v]&&(f[v]=i.spec.isWeekEnd(v)),f[v]&&_++;p=d-_}if(e.kind()===n.DAYS)a=Math.ceil(p/e.multiplier());else{if(y=e.kind()===n.HOURS?60*e.multiplier()*60:e.kind()===n.SECONDS?e.multiplier():60*e.multiplier(),d<1&&(b=i.spec.findSession(m.get_day_of_week(h),m.get_minutes_from_midnight(h)),w=i.spec.findSession(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),b===w))return Math.ceil((s-o)/y);v=i.spec.entries[0]._dayOfWeek,S=60*i.spec.entries.reduce(function(t,e){return t+(e._dayOfWeek===v?e._length:0)},0),a=Math.ceil(p*S/y)}}return a}function p(t,e,i,r,a){var l,h,c=new n(e),p=m.get_timezone(t.timezone),u=new o.Session;return u.init(p,t.session),l=s(t,e),i=l.alignTimeIfPossible(1e3*i)/1e3,r=l.alignTimeIfPossible(1e3*r)/1e3,i>=r?0:(h=d(t,c,u,i,r),h>=1e3?h:a.findDistanceInBars(i,r,t))}var u={},_="undefined"!=typeof window?window:e,f=i(56),m=_.PineJsCalendar?_.PineJsCalendar:i(57);return{createPointset:r,removePointset:a,broadcastPointsetsUpdates:h,tests:{approxBarsInterval:d,indexOfTime:c}}}();t.exports=s}).call(e,function(){return this}())},function(t,e,i){(function(e,o){"use strict";function n(t,i){var o=e.get_timezone(i.timezone),n=new p.Session;return n.init(o,i.session),l.Symbol.newBarBuilder(t,n,n)}var s,r,a=i(576),l=i(56),h=i(577),c=i(573),d=i(579),p=i(58),u=i(36).Interval,_=i(34);i(141),i(280),s=i(728).DatafeedRequestsCachedProcessor,r=function(t){function e(t,e){return!o.enabled("disable_resolution_rebuild")&&u.isDWM(t)?n(t,e):null}function i(t,e,i){return function(o){var s,r;o&&o.count()&&(s=n(e,t),r=1e3*p.getCurrentUTCTime(),s.moveTo(r),s.indexOfBar(r)>=0&&o.setLastBarClosed(!1)),i(o)}}function r(t,e,o,n,s){return p._cachedDatafeed.subscribe(t,e,o,i(t,e,n),s)}function a(t){return p._cachedDatafeed.unsubscribe(t)}function l(t,e,i){p.resolveSymbol(t,e,i)}var p=this;this._studiesCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=c,this._externalDatafeed=t,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,p._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),p._datafeedConfiguration=p._adoptConfigurationData(window.configurationData),p._fireEvent("configuration_received"),
p._externalDatafeed.getServerTime&&p._externalDatafeed.getServerTime(function(t){p._serverTimeOffset=t-(new Date).valueOf()/1e3}),this._pointsetsManager=d,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._createDWMAligner=e,this._cachedDatafeed=new s(t,e),this._extendedRange=function(t){return p._rangeExtensionData[t]&&p._rangeExtensionData[t].summary},this._extendedTime=function(t){return p._rangeExtensionData[t]&&p._rangeExtensionData[t].time},h.setupFeed({resolve:l,subscribe:r,unsubscribe:a,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},r.prototype._barsCoefficients=function(t,e){if(0!==t.indexOf("="))return{};var i=t+e;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},r.prototype.destroy=function(){this._externalDatafeed=null},r.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},r.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},r.prototype._logMessage=function(t){o.enabled("charting_library_debug_mode")&&console.log(t)},r.prototype._extendRange=function(t,e){this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),void 0===this._rangeExtensionData[t].summary&&(this._rangeExtensionData[t].summary=0),this._rangeExtensionData[t].summary+=e},r.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},r.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t)){for(o=this._callbacks[t],n=0;n<o.length;++n)o[n](e);i||(this._callbacks[t]=[])}},r.prototype._adoptConfigurationData=function(t){var e,i,o,n=TradingView.merge({},t),s=n.supported_resolutions;if(!s||0===s.length)return n.supported_resolutions=void 0,n;for(e={},i=0;i<s.length;i++){if(o=s[i],e.hasOwnProperty(o))throw Error("Duplicating resolution `"+o+"`");e[o]=1}return n.supported_resolutions=e,n},r.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},r.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},r.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},r.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},r.prototype._findStudyObject=function(t){var e=t.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===t||i.metainfo.shortDescription===e});if(0===i.length)throw Error("Study `"+t+"` not found");return i[0]},r.prototype.getMarks=function(t,e,i,o,n){function s(t){function e(e,i){return isArray(t[e])?t[e][i]:t[e]}var i,o;if(isArray(t))return t;for(i=[],o=0;o<t.id.length;++o)i.push({id:e("id",o),time:e("time",o),color:e("color",o),text:e("text",o),label:e("label",o),labelFontColor:e("labelFontColor",o),minSize:e("minSize",o)});return i}var r,a={red:6,green:5,blue:4,
yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(t,e,i,function(e){var i,l,h=s(e).map(function(t){return t.time=parseInt(t.time),t});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(h))),i=r._createDWMAligner(n,t),l=h.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t.direction=a[t.color],t.onClicked=function(){_.emit("onMarkClick",t.id)},t.label=!!t.label&&t.label[0],t}),o(l)},n))},r.prototype.getTimescaleMarks=function(t,e,i,o,n){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString()));var s=this;this._externalDatafeed.getTimescaleMarks(t,e,i,function(e){var i,r;s._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(e))),i=s._createDWMAligner(n,t),r=e.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t}),o(r)},n)}},r.prototype._computeStudy=function(t,e,i,o,n,s,r,a,h,c){function d(t,e){switch(t.type){case"projection":return c(t,e);default:return console.warn("Unexpected non-series output type: "+t.type)}}function p(t,e,i){var o,n,s,r,l=t.time,h="number"==typeof e?[e]:e;for(o=0;o<h.length;++o)n=h[o],n&&"object"==typeof n&&(m["plot_"+o]=n.offset,n=n.value,g++),"number"==typeof n&&isNaN(n)&&(n=void 0),h[o]=n;s=f.length-1,r=s<0||l>f[s].value[0],r?f.push({index:f.length,value:[l].concat(h)}):f[s].value=[l].concat(h),u||a([f[f.length-1]],r,f.length,m,i)}var u=!0,_=this._computeStudyCounter++,f=[],m={},g=0,v=!1,y=this,b=function(a){var c;if(l.Symbol.parsePeriod(o).isIntraday&&!a.has_intraday)return void h("Unsupported resolution");if(c=new l.StudyEngine({tickerid:i,symbolInfo:a,period:o,body:e,sessionId:t,onErrorCallback:h,rangeExtension:{getRangeExtensionCount:y._extendedRange.bind(this,t),getRangeExtensionTime:y._extendedTime.bind(this,t)},input:function(t){return s[t]},out:function(t,e){p(t,e,a)},nonseriesOut:function(t){d(t,a)},setNoMoreData:function(){v=!0},recalc:function(t,e){u=!1,f.endOfData=v,r(f,g>0?m:void 0,a,e)}}),!y._studiesCache[t]||!y._studiesCache[t][n])throw Error("This should never happen");y._studiesCache[t][n].engine=c},w=function(t){h(t)},S=function(){return y._studiesCache[t]&&y._studiesCache[t][n]&&y._studiesCache[t][n].activeResolve===_};y._studiesCache[t][n].activeResolve=_,this.resolveSymbol(i,function(){S()&&b.apply(y,arguments)},function(){S()&&w.apply(y,arguments)})},r.prototype._createStudy=function(t,e,i,o,n,s,a){function l(t){var e,i,s;if(Array.isArray(t))return t;for(e=[],i=h._studiesCache[o][n].metainfo.inputs,
s=0;s<i.length;s++)e[s]=t[i[s].id];return e}var h=this;a=l(a),TradingView.ChartapiMessagerInstances[o].onStudyLoading(n,s),h._computeStudy(o,i,t,e,n,a,function(i,r,a){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,s,h._convertBarsTimeToUnix(i),r,a,h._extendedRange(t,e)),TradingView.ChartapiMessagerInstances[o].onStudyCompleted(n,s)},function(i,r,a,l,c){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,s,h._convertBarsTimeToUnix(i),l,c,h._extendedRange(t,e))},function(t){TradingView.ChartapiMessagerInstances[o].onStudyError(n,t)},r.prototype._updateProjectionData.bind(this,o,n,s))},r.prototype.purgeEndOfDataFlags=function(t,e){for(var i in this._studiesCache[t])e&&e!==i||(this._studiesCache[t][i].firstBarTime=null)},r.prototype.stopSources=function(t){var e,i;for(e in this._studiesCache[t])(i=this._studiesCache[t][e])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);h.unsubscribeUnused()},r.prototype.recreateSources=function(t,e,i,o){var n,s;this.stopSources(i);for(n in this._studiesCache[i])(s=this._studiesCache[i][n])&&(s.symbol=t,s.resolution=e,"series"===s.type&&this.createSeries(t,e,i,n,s.turnaround,o));for(n in this._studiesCache[i])(s=this._studiesCache[i][n])&&"study"===s.type&&this._createStudy(t,e,s.studyObject,i,n,s.turnaround,s.inputs)},r.prototype.removeStudy=function(t,e){this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].engine&&(this._studiesCache[t][e].engine.stop(),h.unsubscribeUnused()),this._studiesCache[t][e]=null},r.prototype.removeSeries=function(t,e){this.removeStudy(t,e)},r.prototype.recomputeStudy=function(t,e,i,o){var n=this._studiesCache[i][t];if(!n)throw Error("This should never happen");n.inputs=e,n.turnaround=o,n.engine&&n.engine.stop(),this._createStudy(n.symbol,n.resolution,n.studyObject,i,t,o,e)},r.prototype._convertBarsTimeToUnix=function(t){var e,i,o=[];for(e=0;e<t.length;++e)i={index:t[e].index,value:[].concat(t[e].value)},i.value[0]/=1e3,o.push(i);return o.endOfData=t.endOfData,o},r.prototype.createStudy=function(t,e,i,o,n,s,r){var a=this._findStudyObject(s),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][o]={studyObject:l,symbol:t,resolution:e,guid:o,type:"study",inputs:r,metainfo:a.metainfo,turnaround:n},this._createStudy(t,e,l,i,o,n,r)},r.prototype.purgeRangeExtensionData=function(t){t?this._rangeExtensionData[t]={summary:0}:this._rangeExtensionData={}},r.prototype.ensureExtendedTo=function(t,e,i){var o,n=this._studiesCache[e][t];if(!n)throw Error("This should never happen");this.purgeRangeExtensionData(e),this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),this._rangeExtensionData[e].time=i,o=this,setTimeout(function(){o.recreateSources(n.symbol,n.resolution,e,!0)},0)},r.prototype.extendSeriesRange=function(t,e,i){var o,n,s,r,a=this._studiesCache[e][t];if(!a)throw Error("This should never happen");if(this._isEndOfData(e,t,a.turnaround))return o=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t,a.turnaround,o)
@@ -541,8 +541,8 @@ time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1
i.mouseup(r),e.down.call(o,t,n)})}),this}}(jQuery)},function(t,e){"use strict";!function(t,e,i){"$:nomunge";function o(o,n){function s(e){t(r).each(function(){var i=t(this);this===e.target||i.has(e.target).length||i.triggerHandler(n,[e.target])})}n=n||o+i;var r=t(),a=o+"."+n+"-special-event";t.event.special[n]={setup:function(){r=r.add(this),delete r.prevObject,1===r.length&&t(e).bind(a,s)},teardown:function(){r=r.not(this),delete r.prevObject,0===r.length&&t(e).unbind(a)},add:function(t){var e=t.handler;t.handler=function(t,i){t.target=i,e.apply(this,arguments)}}}}t.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(t){o(t)}),o("focusin","focus"+i),o("focusout","blur"+i),Modernizr.touch&&(o("touchstart","mousedown"+i),o("touchmove","mousemove"+i),o("touchend","mouseup"+i)),t.addOutsideEvent=o}(jQuery,document,"outside")},function(t,e){"use strict";!function(t){t.fn.selectable=function(e){return this.each(function(){var i=t(this);i.css("user-select",e?"text":"none"),i.css("-moz-user-select",e?"text":"-moz-none"),i.css("-webkit-user-select",e?"auto":"none"),(t.browser.msie||t.browser.opera)&&i.attr("unselectable",e?"off":"on")})}}(jQuery)},function(t,e,i){(function(e){"use strict";function o(){}var n=i(255).AddCompareDialog,s=i(34),r=i(140),a=i(12).getLogger("Chart.ChartHeaderWidget");TradingView.SYMBOL_SEARCH_MAX_LENGTH=100,o.prototype._createBarsGroup=function(t){var e=this.createGroup("bars-style",{single:!0});return t._style_list.element().appendTo(e),e},o.prototype._createPropertiesGroup=function(t,o){var n,s=this.createGroup("properties",{single:!0});return this._onWidget&&!e.enabled("header_settings")||(n=$("<span>").addClass("button iconed properties apply-common-tooltip").append($(i(889)).attr({width:17,height:17})).appendTo(s),n.on(t,function(t){t.pageX=n.offset().left,t.pageY=n.offset().top+n.height()+15,TVSettings.getValue("properties_dialog.active_tab.chart")||TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),o.activeChartWidget.value().showChartProperties({_lastEvent:t}).then(function(t){n.addClass("active"),t.on("destroy",function(){n.removeClass("active")})})}),n.attr("title",$.t("Chart Properties"))),s},o.prototype._createCompareGroup=function(t,e,o){var s=this.createGroup("compare",{single:!0}),r=$('<a class="button toggle-caption compare apply-common-tooltip">').append($(i(848))).append($('<span class="caption">'+$.t("Compare")+"</span>")).appendTo(s);return this._compareButton=r,this._compareButton.on(o,function(t){var i,o;t.preventDefault(),i=new n(e),o=i.show(),r.addClass("active"),o.on("destroy",function(){r.removeClass("active")})}),this._compareButton.attr("title",$.t("Compare or Add Symbol")),s},o.prototype._createIndicatorsGroup=function(t,o){var n,a=this.createGroup("indicators",{single:!0,showInNarrowView:!0})
;return this._indicatorsButton=$('<a class="button toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append($(i(863))).append($('<span class="caption">'+$.t("Indicators")+"</span>")).appendTo(a),n="\n/",e.enabled("charting_library_base")||e.enabled("widget")?this._indicatorsButton.attr("title",$.t("Indicators")+n):this._indicatorsButton.attr("title",$.t("Indicators, Fundamentals, Economy and Add-ons")+n),this._indicatorsButton.on(t,function(t){t.preventDefault(),window.studyMarket.isVisible()?window.studyMarket.hide():(window.studyMarket.show(),s.emit("indicators_dialog"))}),r.registerListener("IndicatorsHotkey",function(t){if(47===t.which&&$(t.target).is("body")&&!window.studyMarket.isVisible())return window.studyMarket.show(),window.studyMarket.selectSearchPage(),t.preventDefault(),t.stopPropagation(),!0}),window.studyMarket.visibilityChanged.subscribe(this,function(t){this._indicatorsButton.toggleClass("active",t)}),!TradingView.onWidget()&&e.enabled("study_templates")&&studyTemplates.appendMenuButtonTo(a),a},o.prototype.createGroup=function(t,e){e=e||{};var i=$("<div>").addClass("group");return e.right&&i.addClass("right"),e.single&&i.addClass("space-single"),t&&i.addClass("header-group-"+t),i},o.prototype.bindToModel=function(){var t=this._chartWidget.model();this._model=t},o.prototype.backButton=function(){return this._backButton},o.prototype.saveLoadWidget=function(){return this._saveLoad||a.logWarn("No save-load widget created in footer")},o.prototype.styleIconPosition=function(t){return"-%1px 0".replace("%1",19*~~t)},o.styleIconPosition=o.prototype.styleIconPosition,t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t){function o(){if(!t.favoriteChartTypes)return[];var e={Bars:u.STYLE_BARS,Candles:u.STYLE_CANDLES,Line:u.STYLE_LINE,Area:u.STYLE_AREA,"Heiken Ashi":u.STYLE_HEIKEN_ASHI,"Hollow Candles":u.STYLE_HOLLOW_CANDLES};return t.favoriteChartTypes.map(function(t){return e[t]})}var a,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D;t=t||{},a=this._chartWidgetCollection=t.chartWidgetCollection,f=this._chartWidget=a.activeChartWidget.value(),m=this._onWidget=f.onWidget(),g=this,v=Modernizr.touch?"touchstart":"click",this._onResizeRequested=!1,this._resizerBridge=t.resizerBridge,this._$root=$(t.resizerBridge.body.value()),this._$root.addClass("header-chart-panel").html('<div class="header-chart-panel-sizer"><div class="header-chart-panel-content"><div class="right"></div><div class="left"></div></div></div>'),this._$sizer=this._$root.find(".header-chart-panel-sizer"),this._$content=this._$root.find(".header-chart-panel-content"),this._$left=this._$root.find(".left"),this._$right=this._$root.find(".right"),this._itemsVisibility=t.itemsVisibility,a.readOnly()||(e.enabled("header_symbol_search")&&(y=this.createGroup("symbol-search").appendTo(this._$left),b=$('<div class="symbol-edit-widget no-last"></div>').appendTo(y),w=$('<div class="symbol-edit-wrap">').appendTo(b),S=null,
!e.enabled("charting_library_base")&&d.canShowSpreadActions()&&(T=$('<div class="symbol-edit-buttonswrap">').appendTo(w),S=$('<div class="spread-actions">').appendTo(T).on("mousedown",function(t){t.preventDefault()})),C=$('<div class="symbol-edit-inputspacer">').appendTo(w),x=$('<input type="text" class="symbol-edit" maxlenght="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'">').appendTo(C),d.bindToInput(x,{syncWithChartWidget:!0,spreadActions:S}),function(){var t=!1;x.on("focus",function(){t=!0,w.addClass("expanded")}),x.on("blur",function(){t=!1,setTimeout(function(){t||w.removeClass("expanded")},40)})}()),e.enabled("header_resolutions")&&(y=this.createGroup("intervals",{single:!0,showInNarrowView:!0}).appendTo(this._$left),P={onWidget:m,submenuBtnAddClass:"apply-common-tooltip"},t.interval_options&&$.extend(P,t.interval_options),e.enabled("items_favoriting")||$.extend(P,{notShowQuicks:!0,popupSpacing:1}),TradingView.isOnFeaturePage&&$.extend(P,{notShowQuicks:!0}),this._interval=new l(P),loginStateChange.subscribe(this,function(){window.is_authenticated&&this._interval.forceUpdate()}),e.enabled("charting_library_base")&&ChartApiInstance.on("configuration_received",function(){g._interval.forceUpdate()}),this._interval.element().addClass("no-first").appendTo(y),this._interval.onResize.subscribe(this,this._onInternalResize),t.favoriteIntervals&&this._interval.setUpStarredItemsList(t.favoriteIntervals)),e.enabled("header_chart_type")&&(L=[{id:u.STYLE_BARS,title:$.t("Bars")},{id:u.STYLE_CANDLES,title:$.t("Candles")},{id:u.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:u.STYLE_HEIKEN_ASHI,title:$.t("Heikin Ashi")},{id:u.STYLE_LINE,title:$.t("Line")},{id:u.STYLE_AREA,title:$.t("Area")}],k=o()||[1,4,5,6],TradingView.isOnFeaturePage&&!e.enabled("charting_library_base")&&(k=[]),m?k=[1,3]:e.enabled("collapsible_header")&&this._createMinimizeButton(t.headerChartPanel),this._style_list=new p("StyleWidget",L.map(function(t){return{id:t.id,title:t.title,svg:$(_[t.id]).attr({width:26,height:26}),favoriteButton:{title:t.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:k,addClass:"chart-style-widget",popupAddClass:"chart-style-popup",notShowQuicks:!e.enabled("items_favoriting"),showJustDefaultQuicks:k&&k.length&&e.enabled("predefined_items_only_may_be_starred"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"}),a.activeChartStyle.subscribe(function(t){g._style_list.setValue(t)},{callWithLast:!0}),g._style_list.onChange().subscribe(this,function(t){a.activeChartStyle.setValue(t)}),g._style_list.onResize().subscribe(this,this._onInternalResize)),window.studyMarket=new h(a,window.user,{onWidget:m,fundamentalsOnly:t.fundamentalsOnly}),this._createLayout(t,g,v),this._resizerBridge.width.subscribe(this._onInternalResize.bind(this))),!this._chartWidget.readOnly()&&e.enabled("header_undo_redo")&&(this._undoRedo=new n(this._$left,this._chartWidget)),e.enabled("header_screenshot")&&(I="Alt+S",A=this.createGroup("screenshot",{single:!0}).appendTo(this._$right),
E=$('<a class="button getimage"></a>').append($(i(896)).attr({class:"icon"})).addClass("apply-common-tooltip").attr("title",$.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots simply click the button and copy the link of the picture.")+"\n"+I).appendTo(A),A.click(function(t){if(!e.enabled("show_dialog_on_snapshot_ready")){if(E.hasClass("process"))return;E.addClass("process"),c.subscribe("onScreenshotReady",function(t){E.removeClass("process")},null,!0)}f.actions().takeScreenshot.callbacks().fire(),t.preventDefault()})),e.enabled("header_saveload")&&(M=e.enabled("header_saveload_to_the_right")?this._$right:this._$left,y=this.createGroup("save-load",{single:!0,showInNarrowView:!0}).appendTo(M),D=$("<div>").addClass("save-load-buttons").appendTo(y),this._saveLoad=new r(D,a,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(this,this._onInternalResize),TradingView.isOnFeaturePage&&this._saveLoad.hideTitle()),e.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none"),f.withModel(this,s.prototype.bindToModel),this._resizerBridge.availWidth.subscribe(this._onAvailSizeChange.bind(this)),this._resizerBridge.availHeight.subscribe(this._onAvailSizeChange.bind(this)),this._onAvailSizeChange(),this._onInternalResize()}var n=i(671),s=i(594),r=i(660),a=i(602),l=i(291),h=i(664),c=i(34),d=i(77),p=i(367).FavoredList,u=i(42),_=i(290);inherit(o,s),o.prototype.saveLoadWidget=function(){return this._saveLoad},o.prototype._onAvailSizeChange=function(){var t=this._resizerBridge.availWidth.value()<=520||this._resizerBridge.availHeight.value()<=250;!!this._compactMode!==t&&(this._compactMode=t,this._$root.toggleClass("header-chart-panel--compact",t),this._onInternalResize())},o.prototype.addButton=function(t,e){(e?this._$left:this._$right).append(t),this._onInternalResize()},o.prototype._createUndoRedoGroup=function(){return this._undoRedo=new n(this._$left,this._chartWidget),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"),this.createGroup("undo-redo",{single:!0}).append(this._undoRedo.element())},o.prototype._createFullscreenGroup=function(){this._fullscreen=new a(this._chartWidgetCollection);var t=this.createGroup("fullscreen",{single:!0});return this._fullscreen.element().addClass("apply-common-tooltip").appendTo(t),t},o.prototype._createLayout=function(t,i,o){var n=[];e.enabled("header_chart_type")&&n.push(this._createBarsGroup(i)),e.enabled("header_settings")&&e.enabled("show_chart_property_page")&&n.push(this._createPropertiesGroup(o,t.chartWidgetCollection)),e.enabled("header_indicators")&&n.push(this._createIndicatorsGroup(o)),e.enabled("header_compare")&&n.push(this._createCompareGroup(i,t.chartWidgetCollection,o)),e.enabled("header_undo_redo")&&!this._chartWidget.readOnly()&&n.push(this._createUndoRedoGroup()),e.enabled("header_fullscreen_button")&&n.push(this._createFullscreenGroup()),n.forEach(function(t){t.appendTo(this._$left)},this)},
o.prototype._onInternalResize=function(){if(this.hidden)return void this._resizerBridge.negotiateHeight(0);this._onResizeRequested||(this._onResizeRequested=!0,this._resizerBridge.visible.when(function(){var t,i;this._onResizeRequested=!1,e.enabled("caption_buttons_text_if_possible")&&(t=this._$left,i=t.children(".group"),t.addClass("captions"),i.size()>1&&i.last().offset().top>i.first().offset().top+5&&t.removeClass("captions")),this._$content.find("svg").pixelSnap(),this._resizerBridge.negotiateHeight({min:0,max:this._$content.height()})}.bind(this)))},o.prototype._setupCaptionButtons=function(){this._domeButton&&this._domeButton.onResize.subscribe(this,this._onInternalResize),window.studyTemplates&&studyTemplates.onFavoriteListResize.subscribe(this,this._onInternalResize)},o.prototype._createMinimizeButton=function(){var t=this,e=$("<span>",this._$root).addClass("tv-close-panel top").appendTo(this._$root).on("click",function(i){i.isDefaultPrevented()||(t.hidden=!t.hidden,e.toggleClass("top",!t.hidden),e.toggleClass("bottom",t.hidden),i.preventDefault(),c.emit("toggle_header",!t.hidden),t._onInternalResize())})},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t,e,i){var o,n,s=e.m_model.properties();a.call(this,s,e),o=this._series=e.mainSeries(),this._chart=e.m_model,this._model=e,this._source=i,this._property=s,this._seriesProperty=o.properties(),this._scaleProperty=o.m_priceScale.properties(),this._mainAxisProperty=o.properties().priceAxisProperties,n=null,$.each(e.m_model.panes(),function(t,e){$.each(e.dataSources(),function(t,i){if(i===o)return n=e,!1})}),this._pane=n,this.prepareLayout(),this._themes=[]}var n=i(301),s=(i(53).UndoHistory,i(76)),r=i(5),a=r.PropertyPage,l=r.GreateTransformer,h=r.LessTransformer,c=r.ToIntTransformer,d=r.SimpleStringBinder,p=r.BooleanBinder,u=r.SliderBinder,_=r.ColorBinding,f=r.SimpleComboBinder,m=r.DisabledBinder,g=r.CheckboxWVBinding,v=i(42),y=i(21),b=i(32).addColorPicker,w=i(19).createLineStyleEditor,S=i(13).createLineWidthEditor,T=i(63).bindPopupMenu,C=i(7).DefaultProperty,x=i(161).availableTimezones,P=i(298),L=i(93).createConfirmDialog,k=i(12).getLogger("Chart.PropertyPage");inherit(o,a),inherit(o,n),o.prototype.setScalesOpenTab=function(){this.scalesTab&&this.scalesTab.data("layout-tab-open",s.TAB_OPEN_OVERRIDE)},o.prototype.setTmzOpenTab=function(){this.tmzSessTable&&this.tmzSessTable.data("layout-tab-open",s.TAB_OPEN_OVERRIDE)},o.prototype.prepareLayout=function(){var t,i,o,n,s,r,a,b,T,C,L,k,I,A,E,M,D,O,V,B,R,N,F,z,W,H,U,j,q,Y,G,K,X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut,_t,ft,mt,gt,vt,yt,bt,wt,St,Tt,Ct,xt,Pt,Lt,kt,It,At,Et,Mt,Dt,Ot,$t,Vt,Bt,Rt,Nt,Ft,zt,Wt,Ht,Ut,jt,qt,Yt,Gt,Kt,Xt,Zt,Jt,Qt,te,ee,ie,oe,ne,se,re,ae,le,he,ce,de,pe,ue,_e,fe,me,ge,ve,ye,be,we,Se,Te,Ce,xe,Pe,Le,ke,Ie,Ae=this;if(e.enabled("chart_property_page_style")&&(t=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),i=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),
E=$('<a class="button getimage"></a>').append($(i(896)).attr({class:"icon"})).addClass("apply-common-tooltip").attr("title",$.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots simply click the button and copy the link of the picture.")+"\n"+I).appendTo(A),A.click(function(t){if(!e.enabled("show_dialog_on_snapshot_ready")){if(E.hasClass("process"))return;E.addClass("process"),c.subscribe("onScreenshotReady",function(t){E.removeClass("process")},null,!0)}f.actions().takeScreenshot.callbacks().fire(),t.preventDefault()})),e.enabled("header_saveload")&&(M=e.enabled("header_saveload_to_the_right")?this._$right:this._$left,y=this.createGroup("save-load",{single:!0,showInNarrowView:!0}).appendTo(M),D=$("<div>").addClass("save-load-buttons").appendTo(y),this._saveLoad=new r(D,a,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(this,this._onInternalResize),TradingView.isOnFeaturePage&&this._saveLoad.hideTitle()),e.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none"),f.withModel(this,s.prototype.bindToModel),this._resizerBridge.availWidth.subscribe(this._onAvailSizeChange.bind(this)),this._resizerBridge.availHeight.subscribe(this._onAvailSizeChange.bind(this)),this._onAvailSizeChange(),this._onInternalResize()}var n=i(671),s=i(594),r=i(660),a=i(602),l=i(291),h=i(664),c=i(34),d=i(77),p=i(367).FavoredList,u=i(43),_=i(290);inherit(o,s),o.prototype.saveLoadWidget=function(){return this._saveLoad},o.prototype._onAvailSizeChange=function(){var t=this._resizerBridge.availWidth.value()<=520||this._resizerBridge.availHeight.value()<=250;!!this._compactMode!==t&&(this._compactMode=t,this._$root.toggleClass("header-chart-panel--compact",t),this._onInternalResize())},o.prototype.addButton=function(t,e){(e?this._$left:this._$right).append(t),this._onInternalResize()},o.prototype._createUndoRedoGroup=function(){return this._undoRedo=new n(this._$left,this._chartWidget),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"),this.createGroup("undo-redo",{single:!0}).append(this._undoRedo.element())},o.prototype._createFullscreenGroup=function(){this._fullscreen=new a(this._chartWidgetCollection);var t=this.createGroup("fullscreen",{single:!0});return this._fullscreen.element().addClass("apply-common-tooltip").appendTo(t),t},o.prototype._createLayout=function(t,i,o){var n=[];e.enabled("header_chart_type")&&n.push(this._createBarsGroup(i)),e.enabled("header_settings")&&e.enabled("show_chart_property_page")&&n.push(this._createPropertiesGroup(o,t.chartWidgetCollection)),e.enabled("header_indicators")&&n.push(this._createIndicatorsGroup(o)),e.enabled("header_compare")&&n.push(this._createCompareGroup(i,t.chartWidgetCollection,o)),e.enabled("header_undo_redo")&&!this._chartWidget.readOnly()&&n.push(this._createUndoRedoGroup()),e.enabled("header_fullscreen_button")&&n.push(this._createFullscreenGroup()),n.forEach(function(t){t.appendTo(this._$left)},this)},
o.prototype._onInternalResize=function(){if(this.hidden)return void this._resizerBridge.negotiateHeight(0);this._onResizeRequested||(this._onResizeRequested=!0,this._resizerBridge.visible.when(function(){var t,i;this._onResizeRequested=!1,e.enabled("caption_buttons_text_if_possible")&&(t=this._$left,i=t.children(".group"),t.addClass("captions"),i.size()>1&&i.last().offset().top>i.first().offset().top+5&&t.removeClass("captions")),this._$content.find("svg").pixelSnap(),this._resizerBridge.negotiateHeight({min:0,max:this._$content.height()})}.bind(this)))},o.prototype._setupCaptionButtons=function(){this._domeButton&&this._domeButton.onResize.subscribe(this,this._onInternalResize),window.studyTemplates&&studyTemplates.onFavoriteListResize.subscribe(this,this._onInternalResize)},o.prototype._createMinimizeButton=function(){var t=this,e=$("<span>",this._$root).addClass("tv-close-panel top").appendTo(this._$root).on("click",function(i){i.isDefaultPrevented()||(t.hidden=!t.hidden,e.toggleClass("top",!t.hidden),e.toggleClass("bottom",t.hidden),i.preventDefault(),c.emit("toggle_header",!t.hidden),t._onInternalResize())})},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t,e,i){var o,n,s=e.m_model.properties();a.call(this,s,e),o=this._series=e.mainSeries(),this._chart=e.m_model,this._model=e,this._source=i,this._property=s,this._seriesProperty=o.properties(),this._scaleProperty=o.m_priceScale.properties(),this._mainAxisProperty=o.properties().priceAxisProperties,n=null,$.each(e.m_model.panes(),function(t,e){$.each(e.dataSources(),function(t,i){if(i===o)return n=e,!1})}),this._pane=n,this.prepareLayout(),this._themes=[]}var n=i(301),s=(i(53).UndoHistory,i(76)),r=i(5),a=r.PropertyPage,l=r.GreateTransformer,h=r.LessTransformer,c=r.ToIntTransformer,d=r.SimpleStringBinder,p=r.BooleanBinder,u=r.SliderBinder,_=r.ColorBinding,f=r.SimpleComboBinder,m=r.DisabledBinder,g=r.CheckboxWVBinding,v=i(43),y=i(21),b=i(32).addColorPicker,w=i(19).createLineStyleEditor,S=i(13).createLineWidthEditor,T=i(63).bindPopupMenu,C=i(7).DefaultProperty,x=i(161).availableTimezones,P=i(298),L=i(93).createConfirmDialog,k=i(12).getLogger("Chart.PropertyPage");inherit(o,a),inherit(o,n),o.prototype.setScalesOpenTab=function(){this.scalesTab&&this.scalesTab.data("layout-tab-open",s.TAB_OPEN_OVERRIDE)},o.prototype.setTmzOpenTab=function(){this.tmzSessTable&&this.tmzSessTable.data("layout-tab-open",s.TAB_OPEN_OVERRIDE)},o.prototype.prepareLayout=function(){var t,i,o,n,s,r,a,b,T,C,L,k,I,A,E,M,D,O,V,B,R,N,F,z,W,H,U,j,q,Y,G,K,X,Z,J,Q,tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut,_t,ft,mt,gt,vt,yt,bt,wt,St,Tt,Ct,xt,Pt,Lt,kt,It,At,Et,Mt,Dt,Ot,$t,Vt,Bt,Rt,Nt,Ft,zt,Wt,Ht,Ut,jt,qt,Yt,Gt,Kt,Xt,Zt,Jt,Qt,te,ee,ie,oe,ne,se,re,ae,le,he,ce,de,pe,ue,_e,fe,me,ge,ve,ye,be,we,Se,Te,Ce,xe,Pe,Le,ke,Ie,Ae=this;if(e.enabled("chart_property_page_style")&&(t=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),i=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),
o=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),this._prepareSeriesStyleLayout(t,i,o,this._seriesProperty),this._hasSeriesStyleLayout=!0,r=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),E=$('<input type="checkbox">'),M=this.addLabeledRow(r,$.t("Price Line"),E),$("<td>").append(E).prependTo(M),this.bindControl(new p(E,this._seriesProperty.showPriceLine,!0,this.model(),"Change Price Price Line")),D=S(),$("<td>").append(D).appendTo(M),this.bindControl(new u(D,this._seriesProperty.priceLineWidth,!0,this.model(),"Change Price Line Width")),a=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),O=this.createSeriesMinTickEditor(),V=$("<tr>"),V.appendTo(a),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(V),$("<td>").append(O).appendTo(V),this.bindControl(new f(O,this._seriesProperty.minTick,null,!0,this.model(),"Change MinTick")),b=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),this._pane&&(-1!==this._pane.leftPriceScale().dataSources().indexOf(this._series)?B="left":-1!==this._pane.rightPriceScale().dataSources().indexOf(this._series)?B="right":this._pane.isOverlay(this._series)&&(B="none")),B&&(R={left:$.t("Scale Left"),right:$.t("Scale Right")},Ae._pane.actionNoScaleIsEnabled(Ae._series)&&(R.none=$.t("Screen (No Scale)")),N=this.createKeyCombo(R).val(B).change(function(){switch(this.value){case"left":Ae._model.move(Ae._series,Ae._pane,Ae._pane.leftPriceScale());break;case"right":Ae._model.move(Ae._series,Ae._pane,Ae._pane.rightPriceScale());break;case"none":Ae._model.move(Ae._series,Ae._pane,null)}}),F=this.addRow(b),$("<td>"+$.t("Scale")+"</td>").appendTo(F),$("<td>").appendTo(F).append(N))),e.enabled("chart_property_page_scales")&&(z=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),W=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){Ae._model.m_model.invalidate(new y(y.LIGHT_UPDATE))},0)}),H=this.addLabeledRow(z,$.t("Auto Scale"),W),U=function(t){this._undoModel.setAutoScaleProperty(this._property,t,Ae._series.priceScale(),this._undoText)},$("<td>").append(W).prependTo(H),this.bindControl(new p(W,this._scaleProperty.autoScale,!0,this.model(),"Auto Scale",U)),this.bindControl(new m(W,this._scaleProperty.autoScaleDisabled,!0,this.model(),"Auto Scale")),j=$('<input type="checkbox">'),q=this.addLabeledRow(z,$.t("Percentage"),j),Y=function(t){this._undoModel.setPercentProperty(this._property,t,Ae._series.priceScale(),this._undoText)},$("<td>").append(j).prependTo(q),this.bindControl(new p(j,this._mainAxisProperty.percentage,!0,this.model(),"Scale Percentage",Y)),this.bindControl(new m(j,this._mainAxisProperty.percentageDisabled,!0,this.model(),"Scale Percentage")),G=$('<input type="checkbox">'),K=this.addLabeledRow(z,$.t("Log Scale"),G),X=function(t){this._undoModel.setLogProperty(this._property,t,Ae._series.priceScale(),this._undoText)},
$("<td>").append(G).prependTo(K),this.bindControl(new p(G,this._mainAxisProperty.log,!0,this.model(),"Log Scale",X)),this.bindControl(new m(G,this._mainAxisProperty.logDisabled,!0,this.model(),"Log Scale")),Z=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){Ae._model.m_model.invalidate(new y(y.LIGHT_UPDATE))},0)}),J=this.addLabeledRow(z,$.t("Scale Series Only"),Z),$("<td>").append(Z).prependTo(J),this.bindControl(new p(Z,this._property.scalesProperties.scaleSeriesOnly,!0,this.model(),"Scale Series Only")),Q=$("<input type='checkbox'/>"),tt=this.addLabeledRow(z,$.t("Lock scale"),Q),et=function(t){this._undoModel.setLockScaleProperty(this._property,t,Ae._series,this._undoText)},it=function(t){tt.toggle(t.value()===v.STYLE_PNF)},$("<td>").append(Q).prependTo(tt),this.bindControl(new p(Q,this._seriesProperty.lockScale,!0,this.model(),"Change lock scale",et)),this._seriesProperty.style.listeners().subscribe(this,it),ot=$("<input type='checkbox'/>"),nt=this.addLabeledRow(z,$.t("Track time"),ot),$("<td>").append(ot).prependTo(nt),this.bindControl(new g(ot,this._model.trackTime(),null,"Change track time")),st=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),rt=$('<input type="text" class="ticker">'),at=this.addLabeledRow(st,$.t("Top Margin"),rt),$("<td>").appendTo(at).append(rt),$("<td>%</td>").appendTo(at),lt=[c(this._property.paneProperties.topMargin.value())],lt.push(h(25)),lt.push(l(0)),this.bindControl(new d(rt,this._property.paneProperties.topMargin,lt,!0,this.model(),"Top Margin")),ht=$('<input type="text" class="ticker">'),ct=this.addLabeledRow(st,$.t("Bottom Margin"),ht),$("<td>").appendTo(ct).append(ht),$("<td>%</td>").appendTo(ct),dt=[c(this._property.paneProperties.bottomMargin.value())],dt.push(h(25)),dt.push(l(0)),this.bindControl(new d(ht,this._property.paneProperties.bottomMargin,dt,!0,this.model(),"Bottom Margin")),pt=$('<input type="text" class="ticker">'),ut=this.addLabeledRow(st,$.t("Right Margin"),pt),$("<td>").appendTo(ut).append(pt),$("<td>"+$.t("bars",{context:"margin"})+"</td>").appendTo(ut),_t=[c(this._property.timeScale.rightOffset.value())],_t.push(h(~~this._chart.m_timeScale.maxOffset())),_t.push(l(-200)),this.bindControl(new d(pt,this._property.timeScale.rightOffset,_t,!0,this.model(),"Right Margin")),ft=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),mt=$("<input type='checkbox' />"),gt=this.addLabeledRow(ft,$.t("Left Axis"),mt),$("<td>").append(mt).prependTo(gt),setTimeout(function(){this.bindControl(new p(mt,this._property.scalesProperties.showLeftScale,!0,this.model(),"Show Left Axis"))}.bind(this),0),vt=$("<input type='checkbox' />"),yt=this.addLabeledRow(ft,$.t("Right Axis"),vt),$("<td>").append(vt).prependTo(yt),setTimeout(function(){this.bindControl(new p(vt,this._property.scalesProperties.showRightScale,!0,this.model(),"Show Right Axis"))}.bind(this),0),e.enabled("countdown")&&(bt=$("<input type='checkbox'>"),
wt=this.addLabeledRow(ft,$.t("Countdown"),bt),$("<td>").append(bt).prependTo(wt),this.bindControl(new p(bt,this._seriesProperty.showCountdown,!0,this.model(),"Change Show Countdown"))),St=$('<input type="checkbox">'),Tt=this.addLabeledRow(ft,$.t("Symbol Last Value"),St),$("<td>").append(St).prependTo(Tt),this.bindControl(new p(St,this._property.scalesProperties.showSeriesLastValue,!0,this.model(),"Change Symbol Last Value Visibility")),Ct=$('<input type="checkbox">'),xt=this.addLabeledRow(ft,$.t("Indicator Last Value"),Ct),$("<td>").append(Ct).prependTo(xt),this.bindControl(new p(Ct,this._property.scalesProperties.showStudyLastValue,!0,this.model(),"Change Indicator Last Value Visibility")),Pt=$('<input type="checkbox">'),Lt=this.addLabeledRow(ft,$.t("Symbol Labels"),Pt),$("<td>").append(Pt).prependTo(Lt),this.bindControl(new p(Pt,this._property.scalesProperties.showSymbolLabels,!0,this.model(),"Show Symbol Labels")),kt=$('<input type="checkbox">'),It=this.addLabeledRow(ft,$.t("Indicator Labels"),kt),$("<td>").append(kt).prependTo(It),this.bindControl(new p(kt,this._property.scalesProperties.showStudyPlotLabels,!0,this.model(),"Show Study Plots Labels")),At=$("<input type='checkbox' />"),Et=this.addLabeledRow(ft,$.t("Precise Labels"),At),$("<td>").append(At).prependTo(Et),this.bindControl(new p(At,this._scaleProperty.alignLabels,!0,this.model(),"Precise Labels")),Mt=$('<div class="property-page-column-2">').append(z).append(st),Dt=$('<div class="property-page-column-2">').append(ft),T=$("<div>").css("min-width","420px").data("layout-tab",$.t("Scales")),T.append(Mt).append(Dt),this.scalesTab=T),e.enabled("chart_property_page_background")&&(Ot=$('<table class="property-page" cellspacing="0" cellpadding="2">'),$t=this.createColorPicker({hideTransparency:!0}),Vt=this.addLabeledRow(Ot,$.t("Background")),$('<td colspan="2">').append($t).appendTo(Vt),this.bindControl(new _($t,this._property.paneProperties.background,!0,this.model(),"Change Chart Background Color")),Bt=this.addLabeledRow(Ot,$.t("Vert Grid Lines")),Rt=this.createColorPicker(),$("<td>").append(Rt).appendTo(Bt),this.bindControl(new _(Rt,this._property.paneProperties.vertGridProperties.color,!0,this.model(),"Change Vert Grid Lines Color")),Nt=w(),$('<td colspan="2">').append(Nt.render()).appendTo(Bt),this.bindControl(new f(Nt,this._property.paneProperties.vertGridProperties.style,parseInt,!0,this.model(),"Change Vert Grid Lines Style")),Ft=this.addLabeledRow(Ot,$.t("Horz Grid Lines")),zt=this.createColorPicker(),$("<td>").append(zt).appendTo(Ft),this.bindControl(new _(zt,this._property.paneProperties.horzGridProperties.color,!0,this.model(),"Change Horz Grid Lines Color")),Wt=w(),$('<td colspan="2">').append(Wt.render()).appendTo(Ft),this.bindControl(new f(Wt,this._property.paneProperties.horzGridProperties.style,parseInt,!0,this.model(),"Change Horz Grid Lines Style")),Ht=this.createColorPicker(),Ut=this.addLabeledRow(Ot,$.t("Scales Text")),$("<td>").append(Ht).appendTo(Ut),
@@ -552,17 +552,17 @@ this.bindControl(new p(de,this._property.paneProperties.legendProperties.showStu
o.prototype.defaultProperties=function(){var t=this,e=[t._seriesProperty.extendedHours,t._property.scalesProperties.showLeftScale,t._property.scalesProperties.showRightScale,t._property.timeScale.rightOffset].map(function(t){return{property:t,previousValue:t.value()}});return setTimeout(function(){e.forEach(function(t){t.property.value()!==t.previousValue&&t.property.listeners().fire(t.property)});var i=new C("chartproperties.paneProperties.rightAxisProperties");$.each(["autoScale","percentage","log"],function(e,o){var n=t._scaleProperty[o],s=i[o].value();s!==n.value()&&n.setValue(s)})},0),[this._property,this._seriesProperty]},o.prototype.createEventsTable=function(t){var i,o,n,s,r,a,l,h,c,d,g,v,y,T,C,x,P,L,k,I,A,E,M,D,O,V,B,R,N=$("<tr>").appendTo(t),F=$('<input type="checkbox" />'),z=this.addLabeledRow(N,$.t("Show Dividends on Chart"),F);$("<td>").append(F).prependTo(z),z.append("<td>"),this.bindControl(new p(F,this._seriesProperty.esdShowDividends,!0,this.model(),"Change Show or Hide Dividends")),i=$('<input type="checkbox" />'),z=this.addLabeledRow(N,$.t("Show Splits on Chart"),i),$("<td>").append(i).prependTo(z),z.append("<td>"),this.bindControl(new p(i,this._seriesProperty.esdShowSplits,!0,this.model(),"Change Show or Hide Splits")),o=$('<input type="checkbox" />'),z=this.addLabeledRow(N,$.t("Show Earnings on Chart"),o),$("<td>").append(o).prependTo(z),z.append("<td>"),this.bindControl(new p(o,this._seriesProperty.esdShowEarnings,!0,this.model(),"Change Show or Hide Earnings")),n=this.createTableInTable(t),s=$('<input type="checkbox" />'),r=w(),a=S(),z=this.addLabeledRow(n,$.t("Earnings breaks"),s),$("<td>").append(s).prependTo(z),l=b($("<td>").appendTo(z)),$("<td>").append(r.render()).appendTo(z),$("<td>").append(a).appendTo(z),z.addClass("offset-row"),z.append("<td>"),this.bindControl(new p(s,this._seriesProperty.esdShowBreaks,!0,this.model(),"Change Show or Hide Earnings")),this.bindControl(new _(l,this._seriesProperty.esdBreaksStyle.color,!0,this.model(),"Change earnings color")),this.bindControl(new f(r,this._seriesProperty.esdBreaksStyle.style,parseInt,!0,this.model(),"Change style")),this.bindControl(new u(a,this._seriesProperty.esdBreaksStyle.width,!0,this.model(),"Change width")),h=function(t){s.prop("disabled",!t.value())},this._seriesProperty.esdShowEarnings.listeners().subscribe(this,h),e.enabled("chart_events")&&(c=$('<input type="checkbox">'),d=$('<input type="checkbox">'),g=$('<input type="checkbox" />'),v=w(),y=S(),T=this.createColorPicker(),C=this._property.chartEventsSourceProperties,this.bindControl(new p(c,C.visible,!0,this.model(),"Change Show Economic Events on Chart")),this.bindControl(new p(d,C.futureOnly,!0,this.model(),"Change Show Only Future Events")),this.bindControl(new m(d,C.visible,!0,this.model(),"",!0)),this.bindControl(new m(g,C.visible,!0,this.model(),"",!0)),this.bindControl(new p(g,C.breaks.visible,!0,this.model(),"Change Show or Hide Events Breaks")),this.bindControl(new _(T,C.breaks.color,!0,this.model(),"Change Events Breaks Color")),
this.bindControl(new f(v,C.breaks.style,parseInt,!0,this.model(),"Change Events Breaks Style")),this.bindControl(new u(y,C.breaks.width,!0,this.model(),"Change Events Breaks Width")),x=$("<tr>").appendTo(t),z=this.addLabeledRow(x,$.t("Show Economic Events on Chart"),c),$("<td>").append(c).prependTo(z),P=this.createTableInTable(t),z=this.addLabeledRow(P,$.t("Show Only Future Events"),d),$("<td>").append(d).prependTo(z),z.addClass("offset-row"),L=this.createTableInTable(t),z=this.addLabeledRow(L,$.t("Events Breaks"),g),$("<td>").append(g).prependTo(z),$("<td>").append(T).appendTo(z),$("<td>").append(v.render()).appendTo(z),$("<td>").append(y).appendTo(z),z.addClass("offset-row")),e.enabled("alerts")&&(k=$("<tr>").appendTo(t),I=$('<input type="checkbox" />'),z=this.addLabeledRow(k,$.t("Show Alert Labels"),I),$("<td>").append(I).prependTo(z),z.append("<td>"),A=this._property.alertsProperties.labels.visible,this.bindControl(new p(I,A,!0,this.model(),"Change Show or Hide Alert Labels",function(t){this._model.beginUndoMacro("Show Alert Labels"),this._model.setProperty(A,t,"Show Alert Labels"),this._model.endUndoMacro()}.bind(this))),E=this.createTableInTable(t),M=$('<input type="checkbox">'),D=S(),O=w(),V=O.render(),z=this.addLabeledRow(E,$.t("Extended Alert Line"),M),$("<td>").append(M).prependTo(z),B=b($("<td>").appendTo(z)),$("<td>").append(V).appendTo(z),$("<td>").append(D).appendTo(z),z.addClass("offset-row"),z.append("<td>"),this.bindControl(new p(M,this._property.alertsProperties.labels.line.visible,!0,this.model(),"Change Show or Hide Alert Labels Lines")),this.bindControl(new _(B,this._property.alertsProperties.labels.color,!0,this.model(),"Change Alerts Labels color")),this.bindControl(new f(O,this._property.alertsProperties.labels.line.style,parseInt,!0,this.model(),"Change style")),this.bindControl(new u(D,this._property.alertsProperties.labels.line.width,!0,this.model(),"Change width")),R=function(t){M.prop("disabled",!t.value()),V.prop("disabled",!t.value()),D.prop("disabled",!t.value())},A.listeners().subscribe(this,R))},o.prototype.createSessTable=function(t){var e,i,o,n,s,r=this._series.sessionsStudy().properties(),a=this.createTableInTable(t),l=r.name.value(),h=$("<input type='checkbox' />"),c=this.addLabeledRow(a,$.t("Session Breaks"),h),d=w(),m=this.createColorPicker(),g=S();return $("<td>").append(h).prependTo(c),$("<td>").append(m).appendTo(c),$("<td>").append(d.render()).appendTo(c),$("<td>").append(g).appendTo(c),this.bindControl(new p(h,r.graphics.vertlines.sessBreaks.visible,!0,this.model(),"Change "+l+" visibility")),this.bindControl(new _(m,r.graphics.vertlines.sessBreaks.color,!0,this.model(),"Change "+l+" color")),this.bindControl(new f(d,r.graphics.vertlines.sessBreaks.style,parseInt,!0,this.model(),"Change "+l+" style")),this.bindControl(new u(g,r.graphics.vertlines.sessBreaks.width,!0,this.model(),"Change "+l+" width")),a=this.createTableInTable(t),e=this._extendedHoursEditor=$('<input type="checkbox" />'),c=this.addLabeledRow(a,$.t("Extended Hours (Intraday Only)"),e),
$("<td>").append(e).prependTo(c),this.bindControl(new p(e,this._seriesProperty.extendedHours,!0,this.model(),"Change Extended Hours")),this._seriesProperty.sessVis=r.graphics.vertlines.sessBreaks.visible,a=this.createTableInTable(t),i=this._createStudySessRow(a,$.t("Extended Hours"),r.graphics.backgrounds.outOfSession),o=this._createStudySessRow(a,$.t("In Session"),r.graphics.backgrounds.inSession),n=function(t){i.prop("disabled",!t.value()),o.prop("disabled",!t.value())},this._seriesProperty.extendedHours.listeners().subscribe(this,n),n(this._seriesProperty.extendedHours),s=this._series.isIntradayInterval(),h.prop("disabled",!s),a},o.prototype._createStudySessRow=function(t,e,i){var o,n=$("<input type='checkbox' />"),s=this.addLabeledRow(t,e,n),r=b($("<td>").appendTo(s));return this.bindControl(new p(n,i.visible,!0,this.model(),"Change "+e+" visibility")),this.bindControl(new _(r,i.color,!0,this.model(),e+" color",i.transparency)),o=$("<td>"),o.append(n).prependTo(s),s.addClass("offset-row"),n},o.prototype.createTradingTable=function(){var t,e,i,o,n,s,r,a,_,m,g,v=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Trading")),y=$("<tr>").appendTo(v),b=$("<td>").appendTo(y),T=$('<table cellspacing="0" cellpadding="0">').appendTo(b),C=$('<input type="checkbox">');return y=this.addLabeledRow(T,$.t("Show Positions"),C),$("<td>").append(C).prependTo(y),this.bindControl(new p(C,this._property.tradingProperties.showPositions,!0,this.model(),"Change Positions Visibility")),t=$('<input type="checkbox">'),y=this.addLabeledRow(T,$.t("Show Orders"),t),$("<td>").append(t).prependTo(y),this.bindControl(new p(t,this._property.tradingProperties.showOrders,!0,this.model(),"Change Orders Visibility")),e=$('<input type="checkbox">'),i=this.addLabeledRow(T,$.t("Extend Lines Left"),e),$("<td>").append(e).prependTo(i),this.bindControl(new p(e,this._property.tradingProperties.extendLeft,!0,this.model(),"Extend Lines Left")),o=S(),this.bindControl(new u(o,this._property.tradingProperties.lineWidth,!0,this.model(),"Change Connecting Line Width")),n=w(),this.bindControl(new f(n,this._property.tradingProperties.lineStyle,parseInt,!0,this.model(),"Change Connecting Line Style")),s=$('<input type="text" class="ticker">'),r=[c(this._property.tradingProperties.lineLength.value()),h(100),l(0)],this.bindControl(new d(s,this._property.tradingProperties.lineLength,r,!0,this.model(),"Change Connecting Line Length")),a=$("<tbody>"),_=this.addLabeledRow(T,$.t("Connecting Line"),a),$("<td>").prependTo(_),$("<td>").append(o).appendTo(_),$('<td colspan="3">').append(n.render()).appendTo(_),$('<td colspan="3">').append(s).appendTo(_),$("<td>%</td>").appendTo(_),m=$('<input type="checkbox">'),g=this.addLabeledRow(T,$.t("Show Executions"),m),$("<td>").append(m).prependTo(g),this.bindControl(new p(m,this._property.tradingProperties.showExecutions,!0,this.model(),"Change Executions Visibility")),v},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t){var e,i,o=Object.keys(u),n=o.length
;for(e=0;e<n;++e)if(i=o[e],u[i].name===t)return i;return null}function n(t){return"LineToolRiskRewardLong"===t||"LineToolRiskRewardShort"===t}var s=i(574),r=i(281),a=i(25),l=i(7).DefaultProperty,h=i(118).availIcons,c=i(58),d=i(43).Interval,p=i(57),u=i(189),_=i(262).createTooManyStudiesNotice,f=function(t){this._chartWidget=t};f.prototype._makeSubscriptionFromDelegate=function(t){var e=$.extend({},t);return delete e.fire,e},f.prototype.executeAction=function(t){this._chartWidget.executeActionByName(t)},f.prototype.executeActionById=function(t){this._chartWidget.executeActionById(t)},f.prototype.getCheckableActionState=function(t){return this._chartWidget.getCheckableActionState(t)},f.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},f.prototype.clearMarks=function(){this._chartWidget.clearMarks()},f.prototype.symbol=function(){return this._chartWidget.getSymbol()},f.prototype.symbolExt=function(){var t=this._chartWidget.model().mainSeries().symbolInfo();return t?{symbol:t.name,full_name:t.full_name,exchange:t.exchange,description:t.description,type:t.type}:null},f.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},f.prototype.setSymbol=function(t,i){function o(){n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,o),i&&i()}if(t!==this.symbol()||e.enabled("same_data_requery")){var n=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,o),this._chartWidget.setSymbol(t)}},f.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},f.prototype.setResolution=function(t,e){function i(){o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,i),e&&e()}if((t=t.toUpperCase())!==this.resolution()){var o=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,i),this._chartWidget.setResolution(t)}},f.prototype.setEntityVisibility=function(t,e){var i,o=this._chartWidget.model().model().dataSourceForId(t);o&&(i=o.properties())&&i.visible&&i.visible.setValue(e)},f.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(t){return{id:t._id,name:t._metaInfo.description}})},f.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(t){return{id:t._id,name:o(t.toolname)}}).filter(function(t){return null!==t.name})},f.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},f.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},f.prototype.removeEntity=function(t){var e=this._chartWidget.model().chartModel().dataSourceForId(t);if(!e)return void console.warn("Can't find a source with id: "+t);this._chartWidget.model().chartModel().removeSource(e,!0)},f.prototype.createStudyTemplate=function(t){return this._chartWidget.model().model().studyTemplate(t.saveInterval)},f.prototype.applyStudyTemplate=function(t){this._chartWidget.model().model().restoreStudyTemplate(t,""+1e3*Math.random())},
;for(e=0;e<n;++e)if(i=o[e],u[i].name===t)return i;return null}function n(t){return"LineToolRiskRewardLong"===t||"LineToolRiskRewardShort"===t}var s=i(574),r=i(281),a=i(25),l=i(7).DefaultProperty,h=i(118).availIcons,c=i(58),d=i(36).Interval,p=i(57),u=i(189),_=i(262).createTooManyStudiesNotice,f=function(t){this._chartWidget=t};f.prototype._makeSubscriptionFromDelegate=function(t){var e=$.extend({},t);return delete e.fire,e},f.prototype.executeAction=function(t){this._chartWidget.executeActionByName(t)},f.prototype.executeActionById=function(t){this._chartWidget.executeActionById(t)},f.prototype.getCheckableActionState=function(t){return this._chartWidget.getCheckableActionState(t)},f.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},f.prototype.clearMarks=function(){this._chartWidget.clearMarks()},f.prototype.symbol=function(){return this._chartWidget.getSymbol()},f.prototype.symbolExt=function(){var t=this._chartWidget.model().mainSeries().symbolInfo();return t?{symbol:t.name,full_name:t.full_name,exchange:t.exchange,description:t.description,type:t.type}:null},f.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},f.prototype.setSymbol=function(t,i){function o(){n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,o),i&&i()}if(t!==this.symbol()||e.enabled("same_data_requery")){var n=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,o),this._chartWidget.setSymbol(t)}},f.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},f.prototype.setResolution=function(t,e){function i(){o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,i),e&&e()}if((t=t.toUpperCase())!==this.resolution()){var o=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,i),this._chartWidget.setResolution(t)}},f.prototype.setEntityVisibility=function(t,e){var i,o=this._chartWidget.model().model().dataSourceForId(t);o&&(i=o.properties())&&i.visible&&i.visible.setValue(e)},f.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(t){return{id:t._id,name:t._metaInfo.description}})},f.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(t){return{id:t._id,name:o(t.toolname)}}).filter(function(t){return null!==t.name})},f.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},f.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},f.prototype.removeEntity=function(t){var e=this._chartWidget.model().chartModel().dataSourceForId(t);if(!e)return void console.warn("Can't find a source with id: "+t);this._chartWidget.model().chartModel().removeSource(e,!0)},f.prototype.createStudyTemplate=function(t){return this._chartWidget.model().model().studyTemplate(t.saveInterval)},f.prototype.applyStudyTemplate=function(t){this._chartWidget.model().model().restoreStudyTemplate(t,""+1e3*Math.random())},
f.prototype.setVisibleRange=function(t,i){var o,n,s,r;if(void 0===t||!t.from||!t.to||isNaN(t.from)||isNaN(t.to))return void console.warn("Wrong time range: "+JSON.stringify(t)+'. Expected an object with "from" and "to" numeric values.');o=this._chartWidget.model().model(),n=o.mainSeries(),s=[parseInt(t.from),parseInt(t.to)],r=d.isDWM(n.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(s):s,t.from=r[0],t.to=r[1],this._chartWidget.setVisibleTimeRange(t.from,t.to,i)},f.prototype.getVisibleRange=function(){var t=this._chartWidget.model().timeScale(),e=t.visibleBars(),i={from:t.indexToUserTime(e.firstBar()<0?0:e.firstBar()),to:t.indexToUserTime(e.lastBar())};return{from:(+i.from||0)/1e3,to:(+i.to||0)/1e3}},f.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},f.prototype._createTradingPrimitive=function(t,e){function i(){var t=o._chartWidget.model().timeScale().m_points.lastTimePointIndex();return{index:t,price:o._chartWidget.model().mainSeries().data().valueAt(t)[4]}}var o=this,n=this._chartWidget.model().model(),s=n.paneForSource(this._chartWidget.model().model().mainSeries());return(e?this._chartWidget.model().chartModel():this._chartWidget.model()).createLineTool(s,i(),t)._adapter},f.prototype.createOrderLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolOrder",t.disableUndo)},f.prototype.createPositionLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolPosition",t.disableUndo)},f.prototype.createExecutionShape=function(t){var t=t||{};return this._createTradingPrimitive("LineToolExecution",t.disableUndo)},f.prototype.createVerticalLine=function(t,e){this._chartWidget.createShape(t,$.extend(e,{shape:"vertical_line"}))},f.prototype.createShape=function(t,e,i){return this.createMultipointShape([t],e,i)},f.prototype._alignPoints=function(t){var e,i=this._chartWidget.model().model(),o=i.mainSeries(),n=o.symbolInfo(),s=p.get_timezone(n.timezone);return i.timeScale().isEmpty()?t:(e=(new c.Session).init(s,n.session),t.map(function(t){return t?c.alignExchangeTimeToSessionStartAndReturnUTC(e.timezone,e.spec,new Date(1e3*t))/1e3:t}))},f.prototype.createMultipointShape=function(t,i,o){function s(t,e,i,o){var n,s,r,a=T.closestIndexLeft(e)||0,l={index:a},h=T.valueAt(a);return e>h&&(n=S.syncModel().distance(h,e),n.success&&(l.index=l.index+n.result)),i?l.price=i:(s=["open","high","low","close"],r=o?s.indexOf(o)+1:1,r<=0&&(r=1),l.price=C.valueAt(a)[r]),l}var r,a,c,p,_,f,m,g,v,y,b=i.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),w=this._chartWidget.model().model(),S=w.mainSeries(),T=w.timeScale().points(),C=S.data();if(!w.timeScale().isEmpty()){for(r=w.paneForSource(S),a=t.map(function(t){return t.time}),c=d.isDWM(S.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(a):a,_=[],p=0;p<t.length;p++)f=t[p],_.push(s(f.time,c[p],f.price,f.channel));if(m=u[i.shape]||u.flag,
"LineToolPolyline"===m.name)_[0].price===_[_.length-1].price&&_[0].index===_[_.length-1].index||_.push(_[0]);else if("LineToolIcon"===m.name){if(i.icon=i.icon||i.overrides&&i.overrides.icon,!i.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===h.indexOf(i.icon))throw Error("icon value must be valid");i.overrides=i.overrides||{},i.overrides.icon=i.icon}if(g=new l(m.name.toLowerCase()),i.overrides)for(v in i.overrides)g[v]?g[v].setValue(i.overrides[v]):n(m.name)&&-1!==["profitLevel","stopLevel"].indexOf(v)&&g.addProperty(v,i.overrides[v]);if(m.supportsText&&i.text&&g.text.setValue(i.text),y=b.createLineTool(r,_[0],m.name,g),y.pointsCount()!==_.length&&-1!==y.pointsCount())throw Error("Wrong points count for "+i.shape+". Required "+y.pointsCount());for(p=1;p<_.length&&this._chartWidget.model().lineBeingCreated();p++)b.coninueCreatingLine(_[p],{},p<_.length-1);return i.lock&&y.setUserEditEnabled(!1),i.disableSelection&&(y.customization.disableSelection=!0),i.disableSave&&(y.customization.disableSave=!0),i.hasOwnProperty("showInObjectsTree")&&(y.customization.showInObjectsTree=i.showInObjectsTree),i.zOrder&&("top"===i.zOrder?b.bringToFront(y):"bottom"===i.zOrder&&b.sendToBack(y)),o&&o(y.id()),y.id()}},f.prototype.createStudy=function(t,e,i,o,n,l,h){var c,d,p,u;if(h&&h.checkLimit&&!this._chartWidget.model().canCreateStudy())return void _().open();if(t=t.toLowerCase(),c=a.findStudyMetaInfoByDescription(this._chartWidget.model().studiesMetaData(),t),c=$.extend({},c),delete c.state,c||console.warn("Study `"+t+"` not found."),d={},l){l=l;for(p in l)r.setMetainfoProperty(c,p,l[p]);d.styles=c.defaults.styles,d.bands=c.defaults.bands,d.filledAreasStyle=c.defaults.filledAreasStyle}o&&(d.inputs=s.getStudyRecordFromArray([t].concat(o),this._chartWidget).inputs),u=this._chartWidget.model().chartModel().insertStudy(c,d,e),i&&u.setUserEditEnabled(!1),n&&n(u.id())},f.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},f.prototype.setChartType=function(t){this._chartWidget.model().mainSeries().properties().style.setValue(t)},f.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},f.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onCompleted())},f.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onSymbolResolved())},f.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},f.prototype.dataReady=function(t){var e=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return t&&(e?this.onDataLoaded().subscribe(null,t,!0):t()),!e},f.prototype.crossHairMoved=function(t){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,t)},f.prototype.setTimezone=function(t){
this._chartWidget.setTimezone(t)},t.exports=f}).call(e,i(3))},function(t,e,i){(function(e,o){"use strict";function n(t){function i(t,e){var i,o,n=[],r=s[xt].count;for(i=0;i<r;i++)n.push(bt[i].chartWidget.state(t,e));return o={layout:xt,charts:n},kt.value()&&(o.symbolLock=1),It.value()&&(o.intervalLock=1),At.value()&&(o.trackTimeLock=1),l.hideAllDrawings().value()&&(o.hideAllDrawings=!0),o}function n(t){var e,i=$.Deferred(),o=[],n=s[xt].count;for(e=0;e<n;e++)o.push(bt[e].chartWidget.asyncState(t));return $.when.apply($,o).then(function(){var t,e={charts:[]};for(t=0;t<arguments.length;t++)e.charts.push(arguments[t]);i.resolve(e)}),i}function f(){if(Ct&&!ot)for(var t=0;t<Ct.count;t++)m(t);else m(Tt);lt.trigger("chart-rect-update",lt[0].getBoundingClientRect())}function m(t){var e,i=bt[t];i&&(e=ot?s.s.sizer(0,{width:et.value(),height:it.value()},mt,gt):Ct.sizer(t,{width:et.value(),height:it.value()},mt,gt),bt[t].wrap.css({width:Math.max(e.width||0,0),height:Math.max(e.height||0,0),top:Math.max(e.top||0,0),left:Math.max(e.left||0,0)}),i.metrics&&i.metrics.width===e.width&&i.metrics.height===e.height||(i.metrics=e,i.chartWidget&&i.chartWidget.resize()))}function g(){for(var t=0;t<bt.length;t++)bt[t].chartWidget.resizeSeriesControlUI()}function v(){for(var t=0;t<bt.length;t++)bt[t].chartWidget.tickSeriesControlClock()}function y(t){var e,i,o,n;return t=Object.assign({chartWidgetCollection:ft,isActive:0===bt.length},t||{}),i=$(document.createElement("div")).addClass("chart-container").appendTo(lt).css({position:"absolute",overflow:"hidden"}),i.on("mousedown touchstart",function(){vt.setValue(e)}),o=bt.length,n={wrap:i},bt.push(n),m(o),t.jqParent=i,n.chartWidget=e=new r.ChartWidget(t),ft.firstWidgetInitialized||e.chartWidgetInitialized.subscribe(null,function(){try{c.sendEvent("chart_widget_initialized")}catch(t){}ft.firstWidgetInitialized=!0,g()},!0),(1===bt.length||u.enabled("show_logo_on_all_charts"))&&e.createBranding(),t.containsData?e.finishInitWithoutConnect():e.connect(),w(),S(),ct.fire(e),e}function b(t,e){var i,o,n,r;t in s||(t="s"),i=s[t].count,d.emit("layout_about_to_be_changed",t),xt=t,ot=e,nt.setValue(ot),Ct=s[t];for(o=0;o<i||o<bt.length;o++)n=e?Tt===o:o<i,n?(bt[o]?(lt.append(bt[o].wrap),bt[o].chartWidget.isDetached=!1,(r=Pt.shift())&&(Lt=!0,bt[o].chartWidget.loadContent(r.content),Lt=!1)):y($.extend({},st,Pt.shift()||(vt.value()?{content:vt.value().state()}:null)||{},0===o||kt.value()?{}:{defSymbol:null})),bt[o].wrap.toggleClass("multiple",i>1),m(o)):bt[o]&&(bt[o].chartWidget.isDetached=!0,bt[o].wrap.detach());return w(),d.emit("layout_changed"),!0}function w(){var t,e=Math.min(Ct.count,bt.length)-1;if(e<0)return void vt.deleteValue();t=Tt,t<0&&(t=0),t>e&&(t=e),vt.setValue(bt[t].chartWidget)}function S(){var t,e;for(t=bt.length;t--;)e=t===Tt,bt[t].wrap.toggleClass("active",e).toggleClass("inactive",!e)}function T(){return $.grep(bt,function(t){return!t.chartWidget.isDetached}).sort(function(t,e){var i=t.metrics.top,o=e.metrics.top,n=t.metrics.left,s=e.metrics.left;return i===o?n<s?-1:n>s?1:0:i<o?-1:1})}
function C(){var t,e,i,o=ft.layout.value();"s"!==o&&(t=s[o].count,nt.value()||(wt=T()),e=St+1,i=wt[e],!i||e>t?(i=wt[0],St=0):St=e,vt.setValue(i.chartWidget),nt.value()&&b(o,!0))}function x(t){var e,i,o,n;ut!==t&&(ut&&(ut.modelCreated().unsubscribe(null,P),(e=ut.model())&&(i=e.mainSeries().properties(),i.style.unsubscribe(null,L),o=e.model(),o.onSelectedSourceChanged().unsubscribe(null,k),ut=null)),t&&(n=t.model(),n?P(n):t.modelCreated().subscribe(null,P),ut=t))}function P(t){var e,i=t.mainSeries().properties();i.style.subscribe(null,L),L(i.style),e=t.model(),e.onSelectedSourceChanged().subscribe(null,k),k(t.selectedSource())}function L(t){dt.setValue(t.value())}function k(t){pt.setValue(t)}function I(t){var e,i,o,n;if(t!==kt.value()){if(a.beginUndoMacro("Symbol Lock"),t)for(e=vt.value(),i=e.getSymbol(),o=0;o<bt.length;o++)(n=bt[o].chartWidget)!==e&&n.getSymbol()!==i&&n.setSymbol(i);a.setWatchedValue(kt,t,"Symbol Lock"),a.endUndoMacro()}}function A(t){var e,i,o,n;if(t!==It.value()){if(a.beginUndoMacro("Interval Lock"),t)for(e=vt.value(),i=e.getResolution(),o=0;o<bt.length;o++)(n=bt[o].chartWidget)!==e&&n.getResolution()!==i&&n.setResolution(i);a.setWatchedValue(It,t,"Resolution Lock"),a.endUndoMacro()}}function E(t){At.value()!==t&&a.setWatchedValue(At,t,"Track Time")}function M(t){return tt.value()!==t&&(a.pushUndoCommand(new _(ft,t)),!0)}function D(t){kt.value()?O(t):vt.value().setSymbol(t)}function O(t){var e,i,o=!1;for(e=0;e<bt.length;e++)i=bt[e].chartWidget,(i.model().mainSeries().properties().symbol.value()!==t||u.enabled("same_data_requery"))&&(o||(a.beginUndoMacro("Change Symbol"),o=!0),i.setSymbol(t));o&&a.endUndoMacro()}function V(t){var e,i,o;if(!Lt)if(It.value()){for(e=!1,i=0;i<bt.length;i++)o=bt[i].chartWidget,o.model().mainSeries().properties().interval.value()!==t&&(e||(a.beginUndoMacro("Change Resolution"),e=!0),o.setResolution(t));e&&a.endUndoMacro()}else vt.value().setResolution(t)}function B(t){var e,i,o;if(t&&t.onlyActiveChart||ot)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[vt.value().images()]};for(e=[],i=Ct.count,o=0;o<bt.length&&o<i;o++)e.push(bt[o].chartWidget.images());return{layout:xt,hidpiRatio:window.hidpiCanvasRatio||1,charts:e}}function R(){var t,e=[];for(t=0;t<bt.length&&t<Ct.count;t++)e=e.concat(bt[t].chartWidget.tags());return e=$.unique(e),e=$.map(e,function(t){return t.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")})}function N(t,e,i,o){var n,s,r,a;if(i||Dt&&!ot)for(n=Ct.count,s=0;s<bt.length&&s<n;s++)(r=bt[s].chartWidget)!==e&&(a=r.model())&&a.model().setExternalPosition(t,o)}function F(t,e){var i,o,n,s;if(At.value()){for(i=Ct.count,a.beginUndoMacro("Sync Time"),o=0;o<bt.length&&o<i;o++)if(n=bt[o].chartWidget,s=n.model()){if(s.model()===e)continue;s.gotoTime(t,{centerIfVisible:!1,model:e})}a.endUndoMacro()}}function z(){return ht.resolve(),bt.forEach(function(t){t.chartWidget.destroy()})}function W(){return ht.promise()}function H(){return ct}function U(){at.id.setValue(void 0),at.uid.setValue(void 0),at.name.setValue(void 0)}
function j(){var e={snapshotUrl:t.snapshotUrl};(u.enabled("show_dialog_on_snapshot_ready")?p.getImageOfChart:p.getImageOfChartSilently)(this,e,function(t){d.emit("onScreenshotReady",t)})}function q(){for(var t=s[xt].count;t<bt.length;t++)bt[t].chartWidget.destroy();bt.splice(s[xt].count)}function Y(t){for(var e=0;e<bt.length;e++)bt[e].chartWidget.applyOverrides(t)}function G(){t.resizerBridge.requestFullscreen()}function K(){t.resizerBridge.exitFullscreen()}function X(){return lt}function Z(t){return u.enabled("charting_library_base")?t:"s"===t||u.enabled(productFeatures.MULTIPLE_CHARTS)&&u.getConfig(productFeatures.MULTIPLE_CHARTS).layout.indexOf(t)>=0||st.containsData||yt?t:"s"}function J(t){if(Pt=[],t){t.charts||(t={layout:"s",charts:[t]}),xt=Z(t.layout||"s");for(var e=0;e<t.charts.length;e++)Pt.push({content:t.charts[e]});t.symbolLock&&kt.setValue(!0),t.intervalLock&&It.setValue(!0),t.trackTimeLock&&At.setValue(!0),t.hideAllDrawings&&Et.setValue(!0)}tt.setValue(xt),b(xt,ot)&&(l.hideAllDrawings().setValue(Et.value()),Pt.splice(0,Pt.length))}function Q(){0===--_t&&d.emitOnce("onChartReady")}var tt,et,it,ot,nt,st,rt,at,lt,ht,ct,dt,pt,ut,_t,ft=this,mt=2,gt=0,vt=new e,yt=!1,bt=[],wt=[],St=0,Tt=0,Ct=null,xt="s",Pt=[],Lt=!1,kt=new e(!1),It=new e(!1),At=new e(!1),Et=new e(!1),Mt=new e(TVSettings.getBool("chart.syncCrosshair",!0)),Dt=Mt.value();Mt.subscribe(function(t){t=!!t,Dt=t,TVSettings.setValue("chart.syncCrosshair",t)}),tt=new e(xt),et=t.resizerBridge.width,it=t.resizerBridge.height,ot=!1,nt=new e(ot),t=t||{},"padding"in t&&(mt=t.padding),"edge"in t&&(gt=t.edge),st=t.widgetOptions||{},st.readOnly&&(yt=!0),rt=t.metaInfo||{},at={id:new e(rt.id),name:new e(rt.name),description:new e(rt.description),username:new e(rt.username),uid:new e(rt.uid)},lt=$(t.resizerBridge.body.value()).eq(0),ht=$.Deferred(),ct=new o,et.subscribe(f),it.subscribe(f),this.updateLayout=f,dt=new e,pt=new e,dt.subscribe(function(t){var e,i,o=vt.value();o&&(e=o.model())&&(i=e.mainSeries().properties().style,i.value()!==t&&e.setChartStyleProperty(i,t,"Change Series Style"))}),ut=null,vt.subscribe(function(t){var e,i;if(t){for(i=bt.length;i--;)if(bt[i].chartWidget===t){e=i;break}if(!isFinite(e))throw Error("Cannot make detached ChartWidget active");if(Tt!==e){for(Tt=e,S(),wt.length&&(St=wt.indexOf(bt[Tt])),i=bt.length;i--;)bt[i].chartWidget.setActive(!1);t.setActive(!0)}x(t)}},{callWithLast:!0}),Object.assign(this,{createChartWidget:y,getAll:function(){return bt.map(function(t){return t.chartWidget})},destroy:z,layout:tt,maximizeCurrentChart:nt,activeChartWidget:vt,activeChartStyle:dt,selectedSource:pt.readonly(),metaInfo:at,state:i,asyncState:n,readOnly:function(){return yt},lock:{symbol:kt,setSymbolLockWithUndo:I,interval:It,setIntervalLockWithUndo:A,crosshair:Mt,trackTime:At,setTrackTimeWithUndo:E},setSymbol:D,setResolution:V,updateLayout:f,setChartLayoutWithUndo:M,resizeWidgetsUI:g,images:B,tags:R,syncCrosshair:N,syncScroll:F,setSymbolAll:O,clearChartMetaInfo:U,onfeatures:t.onfeatures,takeScreenshot:j,loadContent:J,purgeUnusedWidgets:q,
applyOverrides:Y,switchChart:C,startFullscreen:G,exitFullscreen:K,destroyPromise:W,chartWidgetCreated:H,getContainer:X,onWidget:st.onWidget}),J(t.onfeatures?void 0:t.content),tt.subscribe(function(t){S(),b(t,!1)&&(wt=T(),St=wt.indexOf(bt[Tt]))}),tt.hook=function(t){return t===this.value()?t:Z(t)},yt&&(tt.writeLock=!0),nt.subscribe(function(t){t!==ot&&(wt=T(),b(xt,t))}),setInterval(v,1e3),$(window).on("resize",f),$(document).on("onUpdate",f),u.enabled("datasource_copypaste")&&(h.init(),t.globalEvents&&($(window).on("appclip:paste",function(t){vt.value().onAppClipboardPaste(),t.preventDefault()}),$(window).on("appclip:copy",function(t){vt.value().onAppClipboardCopy(),t.preventDefault()}),$(window).on("appclip:cut",function(t){vt.value().onAppClipboardCut(),t.preventDefault()}))),_t=0,bt.forEach(function(t){if(t){_t++;var e=t.chartWidget;e.withModel(null,function(){if(e.model().mainSeries().bars().size()>0)Q();else{var t=function(){Q(),e.model().mainSeries().onBarReceived().unsubscribe(null,t),e.model().mainSeries().onCompleted().unsubscribe(null,t)};e.model().mainSeries().onBarReceived().subscribe(null,t),e.model().mainSeries().onCompleted().subscribe(null,t)}})}})}var s=i(218).layouts,r=i(191),a=i(53).UndoHistory,l=i(41),h=i(192),c=i(722),d=i(34),p=i(747),u=i(3),_=i(741).SetChartLayoutCommand;t.exports=n}).call(e,i(40),i(15))},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this.prepareLayout()}var n=i(5),s=n.PropertyPage,r=n.SimpleComboBinder;inherit(o,s),o.prototype.prepareLayout=function(){var t,e;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createKeyCombo({open:$.t("Open"),high:$.t("High"),low:$.t("Low"),close:$.t("Close")}),e=this.addLabeledRow(this._table,$.t("Source",{context:"compare"})),$("<td>").appendTo(e).append(t),this.bindControl(new r(t,this._property.inputs.source,null,!0,this.model(),"Change Price Source")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t){return null==t._parentMenu?null:n(t._parentMenu)}function n(t){return null==t._parentMenuItem?t:o(t._parentMenuItem)}function s(t,e){this.action=t,this._parentMenu=e}function r(t,e){this.action=t,this._parentMenu=e}var a=i(288),l=i(144);s.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createDeleteButton=function(){var t,e,i;if(!this.action.deleteButton)return null;t=this,e=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),e&&i.click(function(){return e.call(t),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},s.prototype._createTextTag=function(){var t=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqText},s.prototype._createRightTag=function(){var t=this._rightTagAttributes()
applyOverrides:Y,switchChart:C,startFullscreen:G,exitFullscreen:K,destroyPromise:W,chartWidgetCreated:H,getContainer:X,onWidget:st.onWidget}),J(t.onfeatures?void 0:t.content),tt.subscribe(function(t){S(),b(t,!1)&&(wt=T(),St=wt.indexOf(bt[Tt]))}),tt.hook=function(t){return t===this.value()?t:Z(t)},yt&&(tt.writeLock=!0),nt.subscribe(function(t){t!==ot&&(wt=T(),b(xt,t))}),setInterval(v,1e3),$(window).on("resize",f),$(document).on("onUpdate",f),u.enabled("datasource_copypaste")&&(h.init(),t.globalEvents&&($(window).on("appclip:paste",function(t){vt.value().onAppClipboardPaste(),t.preventDefault()}),$(window).on("appclip:copy",function(t){vt.value().onAppClipboardCopy(),t.preventDefault()}),$(window).on("appclip:cut",function(t){vt.value().onAppClipboardCut(),t.preventDefault()}))),_t=0,bt.forEach(function(t){if(t){_t++;var e=t.chartWidget;e.withModel(null,function(){if(e.model().mainSeries().bars().size()>0)Q();else{var t=function(){Q(),e.model().mainSeries().onBarReceived().unsubscribe(null,t),e.model().mainSeries().onCompleted().unsubscribe(null,t)};e.model().mainSeries().onBarReceived().subscribe(null,t),e.model().mainSeries().onCompleted().subscribe(null,t)}})}})}var s=i(218).layouts,r=i(191),a=i(53).UndoHistory,l=i(42),h=i(192),c=i(722),d=i(34),p=i(747),u=i(3),_=i(741).SetChartLayoutCommand;t.exports=n}).call(e,i(41),i(15))},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this.prepareLayout()}var n=i(5),s=n.PropertyPage,r=n.SimpleComboBinder;inherit(o,s),o.prototype.prepareLayout=function(){var t,e;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createKeyCombo({open:$.t("Open"),high:$.t("High"),low:$.t("Low"),close:$.t("Close")}),e=this.addLabeledRow(this._table,$.t("Source",{context:"compare"})),$("<td>").appendTo(e).append(t),this.bindControl(new r(t,this._property.inputs.source,null,!0,this.model(),"Change Price Source")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t){return null==t._parentMenu?null:n(t._parentMenu)}function n(t){return null==t._parentMenuItem?t:o(t._parentMenuItem)}function s(t,e){this.action=t,this._parentMenu=e}function r(t,e){this.action=t,this._parentMenu=e}var a=i(288),l=i(144);s.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createDeleteButton=function(){var t,e,i;if(!this.action.deleteButton)return null;t=this,e=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),e&&i.click(function(){return e.call(t),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},s.prototype._createTextTag=function(){var t=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqText},s.prototype._createRightTag=function(){var t=this._rightTagAttributes()
;return this.jqRight=l.create(a.RIGHT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqRight},s.prototype._createSubmenuTag=function(){var t=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqSubmenu},s.prototype._iconTagAttributes=function(){var t={},e=[];return this.action&&(this.action.icon?(e.push("icon"),e.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(e.push("icon"),this.action.checked?e.push("checked-icon"):e.push("unchecked-icon")):e.push("spacer")),t.class=e.join(" "),t},s.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},s.prototype.highlight=function(t){t?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(t?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},s.prototype._rightTagAttributes=function(){var t={},e=["right"];return this.action&&this.action.shortcut&&(e.push("shortcut"),t.class=e.join(" "),t.html=this.action.shortcut),t},s.prototype._submenuTagAttributes=function(){var t={};return this.action&&this.action.hasSubActions()?t.class="submenu-arrow":t.class="context-menu spacer",t},s.prototype.render=function(){this._createRow(),this.jqRow.append(this._createIconTag()),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback();var t=this;return this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},s.prototype._createRow=function(){var t,e,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),t=this,this.action&&!this.action.hasSubActions()&&(e=function(t){t.destroy(),t._parentMenuItem&&e(t._parentMenuItem._parentMenu)},this.jqRow.click(function(i){e(t._parentMenu)}))},s.prototype.showSubmenu=function(t){if(this._parentMenu.closeOtherSubmenus(this),!this.action||this.action.hasSubActions()){if(!this._menu){var e=i(101);this._menu=e.createMenu(this.action.subActions,null,this)}t.pageX=this._parentMenu.jqMenu.width()-2,t.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(t,this._parentMenu.jqMenu)}},s.prototype._rowTagAttributes=function(){var t=[];return this.action&&(!1===this.action.enabled&&t.push("disabled"),!1===this.action.visible&&t.push("hidden"),this.action.font&&t.push("font_"+this.action.font),this.action.hasSubActions()&&t.push("has_submenu"),this.action.htmlclass&&t.push(this.action.htmlclass)),{class:t.join(" ")}},s.prototype.appendCallback=function(){var t=this;this.jqRow.click(function(e){t.action.enabled&&t.action.executeCallback(e)})},s.prototype.getTopLevelMenu=function(){
return o(this)},r.prototype.render=function(t){this._createRow();var e=this;return this.action.deferred.then(function(o){var n,s,r,a=i(289);for(n in o)s=o[n],r=e._parentMenu.addItem(s),a.renderItem(t,r)}).always(function(){e.jqRow.hide()}),this.jqRow},r.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createRow=function(){var t=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,t),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},r.prototype._rowTagAttributes=function(){var t=[];return this.action&&t.push("spinner"),{class:t.join(" ")}},r.prototype.highlight=function(t){},r.prototype._iconTagAttributes=function(){var t={},e=[];return e.push("spacer"),t.class=e.join(" "),t.colspan="10",t},e.Item=s,e.ItemPlaceholder=r},function(t,e,i){(function(e){"use strict";function o(t,e,i){this._chart=t,this._parent=e,this.zoom_active=!1,this._real=i,this._state="stop",this.init(),i&&this.initToRealChart(),this.initHandlers(),t.navigationButtonsController().addWidget({widget:this._widget,acceptableOffset:100})}var n=i(21);o.visibilityProperty=new e,o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent),$('<div class="control-bar">').append($(i(224)).attr("class","move-left-button-control-bar")).append($(i(909)).attr("class","zoom-out-right-button-control-bar").css("fill","#8A8B8D")).append($(i(911)).attr("class","turn-button-control-bar")).append($(i(910)).attr("class","zoom-in-button-control-bar").css("fill","#8A8B8D")).append($(i(383)).attr("class","move-right-button-control-bar")).appendTo(this._widget),this._buttons={zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")}},o.prototype.initToRealChart=function(){var t,e=this;this._back=$(i(893)).attr({class:"back-to-present js-hidden"}).appendTo(this._parent),this._backButtonVisible=!1,this._back.on("click",function(){e._chart.model().timeScale().scrollToRealtime(!0),e._chart.model().model()._invalidateHandler(new n(n.FULL_UPDATE))}),t=function(){var t=e._chart.maxRhsPriceAxisWidth+4;t&&e._back.css("marginRight",t)},this._chart.rhsPriceAxisWidthChanged.subscribe(this,t),t(),this._chart.withModel(this,function(){this._chart.model().model().setInterval(function(){e.check()},1e3)})},o.prototype.check=function(){var t=this._chart.model(),e=!!t&&t.timeScale().rightOffset()<0;e!==this._backButtonVisible&&(this._backButtonVisible=e,this._backButtonVisible?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present js-hidden"))},o.prototype._move=function(t){var e,i;"stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),this._state="moving",this._moveType="animated",
this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=+new Date,this._movingTimeout||(e=this._startTime,i=10,this._movingTimeout=setTimeout(function o(){this._moveStep.call(this,e,0,50*t,1e3),this._movingTimeout=setTimeout(o.bind(this),i)}.bind(this),i))},o.prototype._moveStep=function(t,e,i,o){var n,s,r;if(!this._chart.model().timeScale().isEmpty())return n=+new Date,s=1-(Math.max(0,t+o-n)/o||0),s<1&&(r=jQuery.easing.easeOutCubic(null,o*s,0,1,o),this.currentDistance=(i-e)*r+e),this._chart.model().scrollChart(this.currentDistance),s},o.prototype._finishMove=function(t){var e,i;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0,e=this.currentDistance,i=+new Date,this._finishingTimeout=setTimeout(function t(){this._moveStep.call(this,i,e,0,700)<1?this._finishingTimeout=setTimeout(t.bind(this),10):(this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())}.bind(this),10)},o.prototype._stopMove=function(t){"moving"===this._state&&(this._state="wait_finishing",(new Date).getTime()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())},o.prototype._moveByBar=function(t){var e,i,o,n,s=this._chart.model().timeScale();s.isEmpty()||("stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),e=s.indexToCoordinate(s.visibleBars().lastBar())+s.barSpacing()/2,Math.abs(s.width()-e)>s.barSpacing()/6&&this._chart.model().scrollChart(s.width()-e),this._state="moving",this._moveType="by_bar",this._startTime=+new Date,this._movingTimeout||(i=400,o=150,n=0,this._movingTimeout=setTimeout(function e(){this._moveByBarStep(t),n++,o>100&&(o-=n/5*20),this._movingTimeout=setTimeout(e.bind(this),o)}.bind(this),i),this._moveByBarStep(t)))},o.prototype._moveByBarStep=function(t){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(t)},o.prototype._stopMoveByBar=function(t){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())},o.prototype.initHandlers=function(){var t,e=this._chart,i=Modernizr.touch?"touchstart":"mousedown",o=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(i,this._moveByBar.bind(this,1)),this._buttons.moveLeft.on(o,this._stopMoveByBar.bind(this,1)),this._buttons.moveRight.on(i,this._moveByBar.bind(this,-1)),this._buttons.moveRight.on(o,this._stopMoveByBar.bind(this,-1)),this._buttons.turn.on("click",function(){e.GUIResetScales()}),this._buttons.zoomOut.on("click",function(){e.model()&&e.model().zoomOut()}),this._buttons.zoomIn.on("click",function(){e.model()&&e.model().zoomIn()}),t={},$("body").on("keydown",function(e){
if(!$(e.target).closest("input, textarea").length&&!(e.metaKey||e.which in t))switch(t[e.which]=!0,e.which){case 37:e.ctrlKey||e.altKey?this._move(1):this._moveByBar(1),e.preventDefault();break;case 39:e.ctrlKey||e.altKey?this._move(-1):this._moveByBar(-1),e.preventDefault()}}.bind(this)).on("keyup",function(e){if(!$(e.target).closest("input, textarea").length)switch(delete t[e.which],e.which){case 37:case 39:"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))},t.exports=o}).call(e,i(24))},function(t,e,i){"use strict";function o(t){this._e=$("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title",$.t("Fullscreen mode")).append($(i(857)).attr({width:18,height:18})),this._e.click(function(){t.startFullscreen()})}o.prototype.element=function(){return this._e},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._options=i||{},this._w=t,this._opener=e,this._addMetric=1,this._addOpened=!1}var n=i(43).Interval,s=i(215),r=i(63).bindPopupMenu,a=i(3);i(126),o.prototype._interval=function(t){var e=$(t.target);e.hasClass("disabled")||(this._w.setInterval(e.data("interval")),this.close())},o.prototype._quickTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},o.prototype._onQuick=function(t){var e=$(t.target).closest(".item"),i=this._w.toggleQuick(e.data("interval"));return e.find(".to-quick").toggleClass("quicked",i).attr("title",this._quickTitle(i)),!1},o.prototype._onDelete=function(t){var e=$(t.target).closest(".item");return this._w.removeInterval(e.data("interval")),this._reopen(),!1},o.prototype._showControlButtons=function(){return!0},o.prototype._append=function(t,e){var o=$("<span>").addClass("item").toggleClass("active",e===this._w.getInterval()).toggleClass("disabled",!s.isAvailable(e)).text(this._w.fullLabel(e)).data("interval",e);this._showControlButtons()&&(this._w.isDefaultInterval(e)||o.prepend($("<span>").addClass("delete").attr("title",$.t("Remove custom interval")).html(i(129)).click(this._onDelete.bind(this))),this._w._options.notShowQuicks||o.prepend($("<span>").addClass("to-quick").toggleClass("quicked",this._w.inQuick(e)).append($(i(165)).attr({width:16,height:16})).attr("title",this._quickTitle(this._w.inQuick(e))).click(this._onQuick.bind(this)))),o.click(this._interval.bind(this)),t.append(o)},o.prototype._appendAdd=function(t){function e(){var t,e=parseInt(s.val());e<1&&s.val(1),t={1:1440,60:24,D:364,W:52,M:12}[this._addMetric],e>t&&s.val(t)}var i,o=$("<span>").addClass("item-add"),n=$('<span class="item-add-wrap">').appendTo(o),s=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(n).TVTicker(),a=$("<span>").addClass("_tv-button mins").append($("<span>")).append($("<i>")).appendTo(n),l=$("<span>").addClass("_tv-button add").text($.t("Add")).appendTo(n),h={1:$.t("Minutes",{context:"interval"}),60:$.t("Hours",{context:"interval"}),D:$.t("Days",{context:"interval"}),W:$.t("Weeks",{context:"interval"}),M:$.t("Months",{context:"interval"})};a.find("span").text(h[this._addMetric||1]),
if(!$(e.target).closest("input, textarea").length&&!(e.metaKey||e.which in t))switch(t[e.which]=!0,e.which){case 37:e.ctrlKey||e.altKey?this._move(1):this._moveByBar(1),e.preventDefault();break;case 39:e.ctrlKey||e.altKey?this._move(-1):this._moveByBar(-1),e.preventDefault()}}.bind(this)).on("keyup",function(e){if(!$(e.target).closest("input, textarea").length)switch(delete t[e.which],e.which){case 37:case 39:"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))},t.exports=o}).call(e,i(24))},function(t,e,i){"use strict";function o(t){this._e=$("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title",$.t("Fullscreen mode")).append($(i(857)).attr({width:18,height:18})),this._e.click(function(){t.startFullscreen()})}o.prototype.element=function(){return this._e},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._options=i||{},this._w=t,this._opener=e,this._addMetric=1,this._addOpened=!1}var n=i(36).Interval,s=i(215),r=i(63).bindPopupMenu,a=i(3);i(126),o.prototype._interval=function(t){var e=$(t.target);e.hasClass("disabled")||(this._w.setInterval(e.data("interval")),this.close())},o.prototype._quickTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},o.prototype._onQuick=function(t){var e=$(t.target).closest(".item"),i=this._w.toggleQuick(e.data("interval"));return e.find(".to-quick").toggleClass("quicked",i).attr("title",this._quickTitle(i)),!1},o.prototype._onDelete=function(t){var e=$(t.target).closest(".item");return this._w.removeInterval(e.data("interval")),this._reopen(),!1},o.prototype._showControlButtons=function(){return!0},o.prototype._append=function(t,e){var o=$("<span>").addClass("item").toggleClass("active",e===this._w.getInterval()).toggleClass("disabled",!s.isAvailable(e)).text(this._w.fullLabel(e)).data("interval",e);this._showControlButtons()&&(this._w.isDefaultInterval(e)||o.prepend($("<span>").addClass("delete").attr("title",$.t("Remove custom interval")).html(i(129)).click(this._onDelete.bind(this))),this._w._options.notShowQuicks||o.prepend($("<span>").addClass("to-quick").toggleClass("quicked",this._w.inQuick(e)).append($(i(165)).attr({width:16,height:16})).attr("title",this._quickTitle(this._w.inQuick(e))).click(this._onQuick.bind(this)))),o.click(this._interval.bind(this)),t.append(o)},o.prototype._appendAdd=function(t){function e(){var t,e=parseInt(s.val());e<1&&s.val(1),t={1:1440,60:24,D:364,W:52,M:12}[this._addMetric],e>t&&s.val(t)}var i,o=$("<span>").addClass("item-add"),n=$('<span class="item-add-wrap">').appendTo(o),s=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(n).TVTicker(),a=$("<span>").addClass("_tv-button mins").append($("<span>")).append($("<i>")).appendTo(n),l=$("<span>").addClass("_tv-button add").text($.t("Add")).appendTo(n),h={1:$.t("Minutes",{context:"interval"}),60:$.t("Hours",{context:"interval"}),D:$.t("Days",{context:"interval"}),W:$.t("Weeks",{context:"interval"}),M:$.t("Months",{context:"interval"})};a.find("span").text(h[this._addMetric||1]),
s.change(e.bind(this)),i=this,r(a,null,{direction:"up",event:"button-popup",addClass:"thin small-font metrics",popupSpacing:~~this._w._options.popupSpacing,onRemove:function(){i._addOpened=!1}}),a.click(function(){i._addOpened=!0,a.trigger("button-popup",[$.map(h,function(t,o){return{title:t.toUpperCase(),active:o===i._addMetric,action:function(){return i._addMetric=o,a.find("span").text(t),e.call(i),!1}}})])}),l.click(function(){}),t.append($("<div>").addClass("separator")),t.append(o)},o.prototype._addInterval=function(t){this._w.addInterval(t),this._reopen({highlight:t})},o.prototype._open=function(t,e){var i,o,s,r,l;t.find(".item, .item-add, .separator").remove(),i=[],o=[],s=[],r=[],l=$("<span>").addClass("separator"),$.each(e,function(t,e){var a=new n(e);a.isDWM()?r.push(e):a.kind()===n.HOURS?s.push(e):a.kind()===n.MINUTES?o.push(e):i.push(e)}),i.length&&i.forEach(function(e){this._append(t,e)}.bind(this)),o.length&&(t.append(l.clone()),o.forEach(function(e){this._append(t,e)}.bind(this))),s.length&&(t.append(l.clone()),s.forEach(function(e){this._append(t,e)}.bind(this))),r.length&&(t.append(l.clone()),r.forEach(function(e){this._append(t,e)}.bind(this))),a.enabled("custom_resolutions_box")&&this._appendAdd(t)},o.prototype._reopen=function(t){if(this._open(this._menu,this._w.getSortedIntervals()),t&&t.highlight){var e=this._menu.find(".item").filter(function(){return $(this).data("interval")===t.highlight});e.length&&e.highlight(2)}},o.prototype.open=function(t){var e,i=this,o=$("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch",Modernizr.touch),n=this._w.mainButton().offset(),s=this._w.mainButton().outerHeight(),r=n.top+s+parseInt(i._options.popupSpacing||0);o.appendTo(document.body),o.css({top:r,left:n.left}).show(),this._menu=o,this._opener.addClass("active"),this._open(o,t),e=Math.min($("body").height(),$(window).height())-s-r-10,this._setMaxHeight(o,e),setTimeout(function(){o.on("mousedownoutside",function(t){this.close(t)&&o.unbind("mousedownoutside")}.bind(this))}.bind(this),0)},o.prototype._setMaxHeight=function(t,e){t.height()>=e&&(t.css("max-height",e+"px"),t.width(t.width()+18))},o.prototype.close=function(t){return(!t||!$(t.target).parents("span.item-add, .charts-popup-list.metrics").length)&&(!(t&&$(t.target).hasClass("submenu")&&$(t.target).parents(".intervals-container").length)&&(this._menu.remove(),$(document.body).off(".interval-menu"),delete this._menu,this._opener.removeClass("active"),!0))},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e,i,o){this.reset(t,e,i,o)}var n=i(163).makeFont;o.prototype.maxCount=50,o.prototype.reset=function(t,e,i,o){for(var s=this._next;s&&s!==this;s=s._next)s.canvas.width=0,s._next=null,s._prev=null;this._next=this,this._prev=this,this._count=0,this._fontSize=t,this._color=o,this._font=n(t,e,i),this._hash={}},o.prototype.paintTo=function(t,e,i,o,n){var s=this.getLabelImage(e);"left"!==n&&(i-=s.width),o-=Math.floor(s.height/2),t.drawImage(s.canvas,i,o)},o.prototype.getLabelImage=function(t){var i,o,n,s,r
;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._count<this.maxCount?(this._count++,i={_next:this._next,_prev:this,text:t,width:0,height:0,canvas:document.createElement("canvas")},o=i.canvas.getContext("2d"),o.font=this._font):(i=this._prev,delete this._hash[i.text],i.text=t,o=i.canvas.getContext("2d")),n=Math.ceil(this._fontSize/4),s=Math.round(this._fontSize/10),r=o.measureText(t).width,i.height=this._fontSize+2*n,i.width=Math.max(1,r),0!==r?this._hash[i.text]=i:e.enabled("charting_library_debug_mode")&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.height=i.height,i.canvas.width=i.width,o=i.canvas.getContext("2d"),o.font=this._font,o.fillStyle=this._color,o.fillText(t,0,n+this._fontSize-s)),this._next!==i&&(i._next._prev=i._prev,i._prev._next=i._next,i._prev=this,i._next=this._next,this._next._prev=i,this._next=i),i},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.$el=$(document.createElement("div")).addClass("pane-legend"),this._itemsBinding=[],this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);var o=this._chart.properties().scalesProperties.textColor;o.listeners().subscribe(this,function(t){this.$el.css("color",t)}),this.$el.css("color",o.value()),this.updateLayout()}var n=i(31).Study,s=i(33).trackEvent,r=i(12).getLogger("Chart.LegendWidget"),a=i(14),l=i(106).setMouseEventHandler;o.prototype.contextMenuEvent=function(t,i){if(!this._model.chartModel().readOnly()&&e.enabled("legend_context_menu")){var o=i.source;this._paneWidget.showContextMenuForSource(o,t)}},o.prototype.updateLayout=function(){var t,o,n,s,r,a,h,c,d,p,u;if(this._itemsBinding.length=0,this.$el.find(".apply-common-tooltip").trigger("mouseleave"),this.$el.empty(),(t=this._paneWidget.state())&&this._model){for(o={showStudyTitles:this._model.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value(),showLegend:this._model.model().properties().paneProperties.legendProperties.showLegend.value()},n=this._model.mainSeries(),s=t.orderedSources().slice(),r=s.indexOf(n),r>-1&&(s.splice(r,1),s.push(n)),a=s.length-1;a>=0;a--)h=s[a],
(c=h.statusView())&&(!(d=h===n)||o.showSeriesTitle||o.showSeriesOHLC||o.showStudyTitles||o.showStudyValues)&&(d&&e.enabled("fundamental_widget")||(o.showLegend||!d?(d||o.showStudyTitles||o.showStudyValues)&&o.showLegend&&(p=$("<div>").addClass("pane-legend-line pane-legend-wrap").appendTo(this.$el),p.source=h,d?(u=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Hide")+'"></a>').append($(i(906)).attr({class:"expand"})),p.addClass("main").append(u.on("click touchend",this.toggleTitles.bind(this)))):p.addClass("study"),h.properties().visible.value()||p.addClass("disabled"),this._generateItemsForRow(p,c,o),l(p,this,!0)):this.$el.find(".expand-line").length||(p=$("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line").appendTo(this.$el),u=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Show")+'"></a>').append($(i(905)).attr({class:"expand closed"})),p.append(u.on("click touchend",this.toggleTitles.bind(this))),p.source=h,o={showStudyTitles:!1,showSeriesTitle:!1,showSeriesOHLC:o.showSeriesOHLC,showStudyValues:!1},this._generateItemsForRow(p,c,o),l(p,this,!0),this.update())));this.update()}},o.prototype._generateItemsForRow=function(t,o,s){var a,l,h,c,d,p,u,_,f,m,g,v,y,b,w=t.source,S=this,T=w===this._model.mainSeries();if((T&&s.showSeriesTitle||!T&&s.showStudyTitles)&&(a=$("<span>"),a.addClass("pane-legend-line apply-overflow-tooltip"),e.enabled("legend_context_menu")&&!this._chart.readOnly()||a.addClass("no-context-menu"),T&&a.addClass("main"),w.properties().visible.value()||a.addClass("disabled"),a.css({"font-weight":o.bold()?"bold":"normal","font-size":o.size()}),a.click(function(e){S.contextMenuEvent(e,t)}),a.appendTo(t),this._itemsBinding.push({value:o,cell:a,source:t.source}),!this._chart.readOnly()&&w.userEditEnabled()&&e.enabled("edit_buttons_in_legend")&&(l=$('<span class="pane-legend-icon-container">').appendTo(t),e.enabled("show_hide_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').append($(i(860)).attr({width:14,height:14})).appendTo(l).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,w)),e.enabled("property_pages")&&(!T||e.enabled("show_chart_property_page")&&!this._chart.onWidget())&&e.enabled("format_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').append($(i(856)).attr({width:14,height:14})).appendTo(l).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,w)),w instanceof n&&!this._chart.onWidget()&&e.enabled("study_buttons_in_legend")&&(h=w.metaInfo(),TradingView.isExistent(h.pine)&&(c=$('<a class="pane-legend-icon apply-common-tooltip source" title="'+$.t("Show Source Code")+'">').append($(i(867)).attr({width:14,height:14})).appendTo(l).on("click touchend",this._generateItemsForRow._onViewSorceClick.bind(this,w)),TradingView.ScriptEditorWidget&&(d=TradingView.ScriptEditorWidget.loadedScriptIdPart())&&h.scriptIdPart===d&&c.addClass("active"),
@@ -597,7 +597,7 @@ n=$("<input type='checkbox' class='visibility-switch'>"),n.appendTo(o),s=$("<td>
this.bindControl(new h(b,e.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style")),this.bindControl(new c(v,e.linewidth,!0,this.model(),"Change Pitchfork Line Width"))},o.prototype.prepareLayout=function(){var t,e,i,o,n,s;for(this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.addLevelEditor(null,this._linetool.properties().median,!1),t=0;t<=8;t++)e="level"+t,this.addLevelEditor($.t("Level {0}").format(t+1),this._linetool.properties()[e],!1);this.addOneColorPropertyWidget(this._table),i=$("<tr>"),i.appendTo(this._table),o=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(o).appendTo(i),this.createLabeledCell("Background",o).appendTo(i),n=_(),$('<td colspan="3">').append(n).appendTo(i),s=$("<select><option value='0'>"+$.t("Original")+"</option><option value='3'>"+$.t("Schiff")+"</option><option value='1'>"+$.t("Modified Schiff")+"</option><option value='2'>"+$.t("Inside")+"</option></select>"),i=$("<tr>"),i.appendTo(this._table),$("<td>"+$.t("Style")+"</td>").appendTo(i),$("<td>").append(s).appendTo(i),this.bindControl(new h(s,this._linetool.properties().style,parseInt,!0,this.model(),"Change Pitchfork Style")),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility")),this.bindControl(new c(n,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(10),s=i(5),r=s.BooleanBinder,a=s.ColorBinding,l=s.SliderBinder,h=i(13).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=h(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),i.prepend("<td>"),$("<td>").append(e).appendTo(i),$("<td>").append(t).appendTo(i),o=$('<input type="checkbox" class="visibility-switch">'),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background",o),$("<td>").append(o).prependTo(i),$("<td>").append(n).appendTo(i),this.bindControl(new r(o,this._linetool.properties().fillBackground,!0,this.model(),"Change Polyline Filling")),this.bindControl(new a(e,this._linetool.properties().linecolor,!0,this.model(),"Change Polyline Line Color")),this.bindControl(new a(n,this._linetool.properties().backgroundColor,!0,this.model(),"Change Polyline Background Color",this._linetool.properties().transparency)),this.bindControl(new l(t,this._linetool.properties().linewidth,!0,this.model(),"Change Polyline Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}
var n=i(10),s=i(5),r=s.ColorBinding,a=s.SliderBinder,l=i(13).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n,s,h,c,d,p,u,_,f,m,g,v,y,b,w=$('<table class="property-page" cellspacing="0" cellpadding="2">'),S=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),T=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=w.add(S).add(T),t=this.createColorPicker(),e=l(),i=this.addLabeledRow(w,"Line"),$("<td>").append(t).appendTo(i),$("<td>").append(e).appendTo(i),o=$("<tr>").appendTo(S),n=$("<td>").appendTo(o).css({"vertical-align":"top",width:"50%"}),s=$("<td>").appendTo(o).css({"vertical-align":"top",width:"50%"}),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(n),c=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(s),d=this.addColorPickerRow(h,$.t("Source back color")),p=this.addColorPickerRow(h,$.t("Source text color")),u=this.addColorPickerRow(h,$.t("Source border color")),_=this.addColorPickerRow(h,$.t("Success back color")),f=this.addColorPickerRow(h,$.t("Success text color")),m=this.addColorPickerRow(c,$.t("Target back color")),g=this.addColorPickerRow(c,$.t("Target text color")),v=this.addColorPickerRow(c,$.t("Target border color")),y=this.addColorPickerRow(c,$.t("Failure back color")),b=this.addColorPickerRow(c,$.t("Failure text color")),this.bindControl(new r(t,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color")),this.bindControl(new a(e,this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width")),this.bindControl(new r(t,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color")),this.bindControl(new a(e,this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width")),this.bindControl(new r(d,this._linetool.properties().sourceBackColor,!0,this.model(),"Forecast Source Background Color",this._linetool.properties().transparency)),this.bindControl(new r(u,this._linetool.properties().sourceStrokeColor,!0,this.model(),"Forecast Source Border Color")),this.bindControl(new r(p,this._linetool.properties().sourceTextColor,!0,this.model(),"Forecast Source Text Color")),this.bindControl(new r(m,this._linetool.properties().targetBackColor,!0,this.model(),"Forecast Target Background Color")),this.bindControl(new r(v,this._linetool.properties().targetStrokeColor,!0,this.model(),"Forecast Target Border Color")),this.bindControl(new r(g,this._linetool.properties().targetTextColor,!0,this.model(),"Forecast Target Text Color")),this.bindControl(new r(_,this._linetool.properties().successBackground,!0,this.model(),"Forecast Success Back Color")),this.bindControl(new r(f,this._linetool.properties().successTextColor,!0,this.model(),"Forecast Success Text Color")),this.bindControl(new r(y,this._linetool.properties().failureBackground,!0,this.model(),"Forecast Failure Back Color")),
this.bindControl(new r(b,this._linetool.properties().failureTextColor,!0,this.model(),"Forecast Failure Text Color")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(10),s=i(5),r=s.SimpleComboBinder,a=s.ColorBinding;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createColorPicker(),e=this.createFontSizeEditor(),i=this.createColorPicker(),o=this.createColorPicker(),n=this.addLabeledRow(this._table,$.t("Text")),$("<td>").append(t).appendTo(n),$("<td>").append(e).appendTo(n),n=this.addLabeledRow(this._table,$.t("Background")),$("<td>").append(i).appendTo(n),n=this.addLabeledRow(this._table,$.t("Border")),$("<td>").append(o).appendTo(n),this.bindControl(new a(t,this._linetool.properties().color,!0,this.model(),"Change Price Text Color")),this.bindControl(new r(e,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Price Text Font Size")),this.bindControl(new a(i,this._linetool.properties().backgroundColor,!0,this.model(),"Change Background Color",this._linetool.properties().transparency)),this.bindControl(new a(o,this._linetool.properties().borderColor,!0,this.model(),"Change Border Color")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this.prepareLayout()}var n=i(10),s=i(5),r=s.SliderBinder,a=s.ColorBinding,l=i(13).createLineWidthEditor;inherit(o,n),o.prototype.prepareLayout=function(){var t,e,i,o,n;this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this.createColorPicker(),e=this.createColorPicker(),i=this.addLabeledRow(this._table,"Background"),$("<td>").append(t).appendTo(i),$("<td>").append(e).appendTo(i),o=l(),n=this.createColorPicker(),i=this.addLabeledRow(this._table,"Border"),$("<td>").append(n).appendTo(i),$("<td>").appendTo(i),$("<td>").append(o).appendTo(i),this.bindControl(new a(n,this._linetool.properties().trendline.color,!0,this.model(),"Change Projection Line Color")),this.bindControl(new a(t,this._linetool.properties().color1,!0,this.model(),"Change Projection Background Color",this._linetool.properties().transparency)),this.bindControl(new a(e,this._linetool.properties().color2,!0,this.model(),"Change Projection Background Color",this._linetool.properties().transparency)),this.bindControl(new r(o,this._linetool.properties().linewidth,!0,this.model(),"Change Projection Border Width")),this.loadData()},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){(function(e,o){"use strict";function n(t){this._chartWidgetCollection=t,this._bindings=[],this._hasAlertWathcedValue=null,this._$templatesButton=null,this._currentProperties=null,this._toolbarWidgets=[],
this._clearProeprtiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function s(t,e){t.push({id:e,widget:$('<div class="tv-linetool-properties-toolbar__text">'+e+"</div>")[0]})}function r(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t,e){return $("<div>").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}function l(t){return a(t,"tv-linetool-properties-toolbar__icon--line-props")}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C=i(5),x=C.PropertyPage,P=C.ColorBinding,L=i(102).BarsMarksContainer,k=i(1).LineDataSource,I=i(41),A=i(295),E=i(63).bindPopupMenu,M=i(7).DefaultProperty,D=i(734).GroupButtonFloatingToolbar,O=i(76);i(137),i(503),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSource=function(){return this._chartWidgetCollection.selectedSource.value()},n.prototype._init=function(){this._floatingToolbar=new D({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:window.headerChartPanel.outerHeight()+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSource||e.isVisibleForSource(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){I.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this))},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){var e=e instanceof M?e:new M(t.toLowerCase());this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSource()?this.onSourceChanged(this.selectedSource()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,i,o,n;for(e=0;e<this.activeChartWidget().model().panes().length;e++)for(i=this.activeChartWidget().model().panes()[e],o=i.orderedSources(),n=0;n<o.length;n++)if(o[n]===t)return o[n]},n.prototype.onSourceChanged=function(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),
this._clearProeprtiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function s(t,e){t.push({id:e,widget:$('<div class="tv-linetool-properties-toolbar__text">'+e+"</div>")[0]})}function r(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t,e){return $("<div>").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}function l(t){return a(t,"tv-linetool-properties-toolbar__icon--line-props")}var h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C=i(5),x=C.PropertyPage,P=C.ColorBinding,L=i(102).BarsMarksContainer,k=i(1).LineDataSource,I=i(42),A=i(295),E=i(63).bindPopupMenu,M=i(7).DefaultProperty,D=i(734).GroupButtonFloatingToolbar,O=i(76);i(137),i(503),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSource=function(){return this._chartWidgetCollection.selectedSource.value()},n.prototype._init=function(){this._floatingToolbar=new D({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:window.headerChartPanel.outerHeight()+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSource||e.isVisibleForSource(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){I.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this))},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){var e=e instanceof M?e:new M(t.toLowerCase());this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSource()?this.onSourceChanged(this.selectedSource()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,i,o,n;for(e=0;e<this.activeChartWidget().model().panes().length;e++)for(i=this.activeChartWidget().model().panes()[e],o=i.orderedSources(),n=0;n<o.length;n++)if(o[n]===t)return o[n]},n.prototype.onSourceChanged=function(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),
this._hasAlertWathcedValue=null),!t)return void this.hide();t instanceof k&&!(t instanceof L)&&this.findSourceOnWidget(t)?(!t.userEditEnabled()||"LineToolBrush"!==t.toolname&&this.activeChartWidget().model().lineBeingCreated()?this._hideAllSourceActions():(this._updateSourceActionsVisibility(t),t.canHasAlert()&&(this._hasAlertWathcedValue=t.hasAlert.spawn(),this._hasAlertWathcedValue.subscribe(this._updateSourceActionsVisibility.bind(this,t)))),this.showPropertiesOf(t.getConstructor(),t.properties()),this.showTemplatesOf({source:t}),this._setupToggleLockButton(t),this._updateVisibility()):this.hide()},n.prototype.showTemplatesOf=function(t){var o,n,s,r,a;e.enabled("line_tool_templates")&&(o=t.source,o?(n=o.getConstructor(),s=o.properties()):(n=t.tool,s=t.properties),this._$templatesButton&&(this._floatingToolbar.removeWidget(this._$templatesButton[0]),this._$templatesButton=null),r=this,a=function(t){o?(o.restoreTemplate(t),r.activeChartWidget().model().model().updateSource(this._linetool),r.onSourceChanged(o)):(s.merge(t),s.listeners().fire(this),s.saveDefaults(),r.onToolChanged(n,s))},TradingView.onWidget()&&!window.is_authenticated||!e.enabled("linetoolpropertieswidget_template_button")||(this._templatesList=new A(n,a,{buttonInner:'<div class="tv-linetool-properties-toolbar__icon">'+i(897)+'</div><span class="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret"></span>',buttonClass:"tv-linetool-properties-toolbar__button apply-common-tooltip",defaultsCallback:function(){s.restoreFactoryDefaults(),r.showPropertiesOf(n,s)},saveAsText:$.t("Save Drawing Template As..."),applyDefaultText:$.t("Apply Default Drawing Template"),getDataForSaveAs:o?function(){return o.template()}:null,popupActiveClass:"i-dropped",popupDirection:this._bindPopupMenuDirection.bind(this)}),this._$templatesButton=this._templatesList.createButton().attr("title",$.t("Templates")),this._floatingToolbar.addWidget(this._$templatesButton[0],{index:0})),this._templatesVisible=!0)},n.prototype.templatesList=function(){return this._templatesList},n.prototype._createButton=function(t){var e,i,o;return t=t||{},e=document.createElement("div"),e.setAttribute("title",t.title),e.className+="tv-linetool-properties-toolbar__button apply-common-tooltip",e.addEventListener("click",t.callback),t.svgIcon&&(i=document.createElement("div"),i.classList.add("tv-linetool-properties-toolbar__icon"),i.appendChild(t.svgIcon),e.appendChild(i)),t.addCaret&&(o=document.createElement("div"),o.className="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret",e.appendChild(o)),e},n.prototype._createSettingsButton=function(){var t=this;return this._createButton({title:$.t("Settings"),callback:function(){new O(t.selectedSource(),t.activeChartWidget().model()).show({onWidget:t.activeChartWidget()._options.onWidget})},svgIcon:$(i(849))[0]})},n.prototype._createZOrderButton=function(){var t=this._createButton({title:$.t("Visual Order"),callback:function(){
t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getZOrderActions()])}.bind(this),svgIcon:$(i(883))[0],addCaret:!0});return E($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createCloneButton=function(){var t,o=$.t("Clone");return e.enabled("datasource_copypaste")&&(o+=", "+$.t("Copy")),e.enabled("support_multicharts")&&(o+=", "+$.t("Sync")),t=this._createButton({title:o,callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getCloneActions()])}.bind(this),svgIcon:$(i(882))[0],addCaret:!0}),E($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createLockButton=function(){var t=this._createButton({title:$.t("Lock"),callback:function(){this.activeChartWidget().toggleLockSelectedObject()}.bind(this),svgIcon:$(i(377))[0]});return this._lockChangeListener=function(e){t.classList.toggle("i-active",!!e.value())},t},n.prototype._createHideButton=function(){return this._createButton({title:$.t("Hide"),callback:function(){this.activeChartWidget().hideSelectedObject()}.bind(this),svgIcon:$(i(884))[0]})},n.prototype._createRemoveButton=function(){return this._createButton({title:$.t("Remove"),callback:function(){this.activeChartWidget().removeSelectedSource()}.bind(this),svgIcon:$(i(898))[0]})},n.prototype._createSourceActions=function(){var t=[];return e.enabled("property_pages")&&t.push({button:this._createSettingsButton()}),t.push({button:this._createZOrderButton()},{button:this._createCloneButton(),isVisibleForSource:function(t){var e=TradingView.className(t.constructor);return!this.activeChartWidget().model().model().isSingleInstanceLineTool(e)}.bind(this)},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t=this.activeChartWidget().model(),i=this.selectedSource(),o=[];return i.properties().clonable.value()&&o.push({title:$.t("Clone"),action:function(){t.cloneLineTool(i)}}),e.enabled("datasource_copypaste")?(o.push({title:$.t("Copy"),shortcut:"Ctrl-C",action:function(){t.copySourceToClip(i)}}),e.enabled("support_multicharts")?(i.linkKey?o.push({title:$.t("Stop syncing"),action:function(){t.unlinkLine(i)}}):o.push({title:$.t("Sync to all charts"),action:function(){t.copyToOtherCharts(i)}}),o):o):o},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSource(),i=this.activeChartWidget().model(),o={title:$.t("Bring to Front"),action:function(){i.bringToFront(e)}},n={title:$.t("Send to Back"),action:function(){i.sendToBack(e)}},s={title:$.t("Bring Forward"),action:function(){i.changeZOrder(e,1)}},r={title:$.t("Send Backward"),action:function(){i.changeZOrder(e,-1)}},a=i.paneForSource(this.selectedSource()),l=a.getZOrderMinMax();return e.zorder()===l.minZOrder&&(n.disabled=!0,r.disabled=!0),e.zorder()===l.maxZOrder&&(s.disabled=!0,o.disabled=!0),
t.push(o,n,s,r),t},n.prototype._getPossibleProperty=function(t){var e,i,o=[],s=this._defaultToolProperties();for(e=0;e<s.length;e++)i=s[e],i.name in t&&o.push(i);return t.extendLeft||(o=o.map(function(t){return"leftEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),t.extendRight||(o=o.map(function(t){return"rightEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),o},n.prototype.showPropertiesOf=function(t,e){var i,o,n,a,l,h,c,d;if(this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases()),i=this._toolExceptionCases[t]||this._getPossibleProperty(e),this._clearProperties(),this._propertiesVisible=!1,i.length){for(o={},n=i.length-1;n>=0;--n)if(a=i[n],l=e[a.name],"function"!=typeof(h=a.showIf)||h(l,e)){if(!l)continue;if(this._propertiesVisible=!0,c=[],"combobox"!==a.inputType){d=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(d[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(d[0]);continue}a.simple?a.comboboxOptions.forEach(s.bind(null,c)):a.comboboxOptions.forEach(r.bind(null,c)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),o[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:c,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=o}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){this._currentProperties&&(this._clearProeprtiesOnHideTimeoutId&&(clearTimeout(this._clearProeprtiesOnHideTimeoutId),this._clearProeprtiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t)},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearProeprtiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())},n.prototype._setupToggleLockButton=function(t){t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},
@@ -613,10 +613,10 @@ this.bindControl(new a(e,this._linetool.properties().color,!0,this.model(),"Chan
$("<td>").append(o).appendTo(i),this.bindControl(new r(u,t.weeks,!0,this.model(),"Change Line Tool Visibility On Weeks")),i=$("<tr>").css("height","29px").appendTo(this._block),o=$("<label>").append($.t("Months")),_=$("<input type='checkbox'>").prependTo(o),$("<td>").append(o).appendTo(i),this.bindControl(new r(_,t.months,!0,this.model(),"Change Line Tool Visibility On Months")),this.loadData()},o.prototype.widget=function(){return this._block},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e,o,n){"use strict";function s(){this.title=$.t("Load Chart Layout"),this._removeDialogShown=!1,this.options={},this.matchedItems=[],this.itemsData=[],this.qs=new s.QuickSearch(this.fieldsExtractor,this.searchResult.bind(this)),this.sortObj=new s.SortObject(this.modifiedCompare),this.nameSort=new s.SortObject(this.nameCompare),this.symbolSort=new s.SortObject(this.symbolCompare),this.toolsSort=new s.SortObject(this.toolsCompare),l.on("chart_loaded",s.onChartLoaded,this)}var r,a,l=i(34),h=i(71).createDialog,c=i(370).createSearchControl,d=i(222).regExpEscape;i(504),r='<div class="js-table-row tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--item {{^withFavs}}tv-load-chart-dialog-table__row--item-without-favs{{/withFavs}} {{#isActive}}i-active{{/isActive}}">{{#withFavs}}<div class="tv-load-chart-dialog-table__favorite-icon-container {{#starred}}i-starred{{/starred}}" ><span class="js-empty-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--empty" title="'+$.t("Add to favorites")+'">'+i(381)+'</span><span class="js-filled-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--filled" title="'+$.t("Remove from favorites")+'">'+i(380)+'</span></div>{{/withFavs}}<div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-name">{{title}}</div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-modified">{{modifiedDate}}</div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-symbol">{{chartSymbol}}</div><div class="js-remove-button tv-load-chart-dialog-table__column-name-action tv-load-chart-dialog-table__remove-icon" title="'+$.t("Delete chart layout")+'">'+i(129)+"</div></div>",
a='<div class="tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--header"><div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-name">'+$.t("Chart Layout Name")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-modified">'+$.t("Last Modified")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-symbol">'+$.t("Active Symbol")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div></div>',s.onChartLoaded=function(){this.itemsData&&this.itemsData.length>0&&this._refreshChartsList()},s.QuickSearch=function(t,e){this.fieldsExtractor=t,this.callback=e,this.regExps=[]},s.QuickSearch.prototype.onInput=function(t){this.query=t,this.createRegexps(t),this.search()},s.QuickSearch.prototype.createRegexps=function(t){this.regExps=[],this.regExps.push(RegExp("("+t.split("").map(function(t){return d(t)}).join(")(.*?)(")+")","i"))},s.QuickSearch.prototype.match=function(t){var e,i,o,n;for(e=0;e<this.regExps.length;e++)for(i=this.regExps[e],i.lastIndex=0,o=this.fieldsExtractor(t),n=0;n<o.length;n++)if(i.test(o[n]))return!0;return 0===this.regExps.length},s.QuickSearch.prototype.search=function(){var t,e,i=[];for(t=0;t<this.items.length;t++)e=this.items[t],this.match(e)&&i.push(e);this.callback(i,this.regExps)},s.QuickSearch.prototype.setItems=function(t){this.items=t},s.SortObject=function(t,e){this.isAscending=!1,this.sortingFunc=t,this.getPredicate=function(){return function(t,e){var i=this.sortingFunc(t,e);return this.isAscending&&(i*=-1),i}.bind(this)},this.inverse=function(){this.isAscending=!this.isAscending},this.setIsAscending=function(t){return"boolean"==typeof t&&(this.isAscending=t),this.isAscending},this.reset=function(){this.isAscending=!1}},s.prototype.fieldsExtractor=function(t){var e=s.symbolWrap(t);return[t.title,e]},s.prototype.saveFavorite=function(t,e){e?this.favorites[t]=e:delete this.favorites[t]},s.prototype.filterFavorites=function(){var t={};this.itemsData.map(function(e){this.favorites.hasOwnProperty(e.id)&&(t[e.id]=!0)}.bind(this)),this.favorites=t},s.prototype.getFavorite=function(t){return this.favorites.hasOwnProperty(t)},s.prototype._onFavoriteClicked=function(t,e,i){this.saveFavorite(t.id,e),this.filterFavorites(),this.fillList(),t.favoriteAction(this.favorites),i.preventDefault()},s.prototype._onItemClicked=function(t,e){e.defaultPrevented||(e.preventDefault(),t.openAction())},s.prototype._onRemoveButtonClicked=function(t,e){var i=this,o=$.Deferred();this._removeDialogShown=!0,o.done(function(){i.removeItem(t)}).always(function(){setTimeout(function(){i._removeDialogShown=!1})}),t.deleteAction(o,t.title),e.preventDefault()},s.prototype._createListItem=function(t){
var i=$(e.render(r,{isActive:t.active(),title:t.title,url:t.url,withFavs:o.enabled("items_favoriting"),starred:this.getFavorite(t.id),modifiedDate:n.unix(t.modified).format("L LT"),chartSymbol:""===t.symbol?"multiple charts":t.symbol+", "+t.interval}));return o.enabled("items_favoriting")&&(i.find(".js-empty-star")[0].addEventListener("click",this._onFavoriteClicked.bind(this,t,!0)),i.find(".js-filled-star")[0].addEventListener("click",this._onFavoriteClicked.bind(this,t,!1))),i.find(".js-remove-button")[0].addEventListener("click",this._onRemoveButtonClicked.bind(this,t)),i[0].addEventListener("click",this._onItemClicked.bind(this,t)),i},s.prototype.removeItem=function(t){var e=this.itemsData.indexOf(t);e>-1&&this.itemsData.splice(e,1),this.setChartsData(this.itemsData)},s.prototype.modifiedCompare=function(t,e){var i=t.modified,o=e.modified;return n(o).diff(n(i))},s.prototype.nameCompare=function(t,e){return t.title.localeCompare(e.title)},s.symbolWrap=function(t){return""===t.symbol?"multiple charts":t.symbol+" "+t.interval},s.prototype.symbolCompare=function(t,e){return s.symbolWrap(t).localeCompare(s.symbolWrap(e))},s.prototype.toolsCompare=function(t,e){var i=t.toolsCount,o=e.toolsCount;return i<o?-1:i===o?0:1},s.prototype.sortClick=function(t){this.setSort($(t.target).data("sort"),!0),this.fillList()},s.prototype.setSort=function(t,e){var i,o,n={field:TVSettings.getValue("loadChartDialog.sort.field")||"modified",isAscending:TVSettings.getValue("loadChartDialog.sort.asc")||"0"},s=t||n.field,r=e?"0"===n.isAscending?"1":"0":n.isAscending;this.currentSortObj&&!(i=s!==n.field)||(this.currentSortObj="name"===s?this.nameSort:"symbol"===s?this.symbolSort:"tools"===s?this.toolsSort:this.sortObj,i&&TVSettings.setValue("loadChartDialog.sort.field",s)),this.currentSortObj.setIsAscending("1"===r),r!==n.isAscending&&TVSettings.setValue("loadChartDialog.sort.asc",r),o=this,$.each(this.header.children(".tv-load-chart-dialog-table__column--header"),function(){var t=$(this),e=t.data("sort")===s;t.removeClass("i-active i-dropped"),e&&t.addClass("i-active "+(o.currentSortObj.isAscending?"":"i-dropped"))})},s.prototype.sortList=function(){var t,e=[],i=[];this.matchedItems.map(function(t){this.favorites.hasOwnProperty(t.id)?e.push(t):i.push(t)}.bind(this)),void 0!==this.currentSortObj&&(t=this.currentSortObj.getPredicate(),i.sort(t),e.sort(t)),this.matchedItems=e.concat(i)},s.prototype.fillList=function(){var t,e;for(this.sortList(),this.itemsList=this.itemsList.detach(),this.itemsList[0].innerHTML="",t=this.matchedItems.length,e=0;e<t;++e)this.itemsList.append(this._createListItem(this.matchedItems[e]));this.itemsListContainer.toggleClass("i-empty",0===this.itemsData.length),this.highlightOccurrences(this.qs.regExps),this._dialog&&(this._dialog.scrollToStart(),this._dialog.updateScroll()),this.itemsListContainer.prepend(this.itemsList)},s.prototype.searchResult=function(t,e){this.matchedItems=t,this.fillList()},s.prototype.updateChartsData=function(t){this.setChartsData(t)},s.prototype.updateFavoritesData=function(t){
this.favorites=t,this.itemsList&&this.qs.search()},s.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData),this.qs.search()},s.prototype.setChartsData=function(t){this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},s.prototype.layoutHeader=function(){var t=$(a);return t.find(".js-column-name").data("sort","name"),t.find(".js-column-modified").data("sort","modified"),t.find(".js-column-symbol").data("sort","symbol"),t.appendTo(this.content),t},s.prototype.resetSort=function(){this.sortObj.reset(),this.nameSort.reset(),this.symbolSort.reset(),this.toolsSort.reset(),this.currentSortObj=this.sortObj},s.prototype.show=function(t,e){var i=c({placeholder:$.t("Search")}),o=$("<div>");o.append(i.$control),o.append('<div class="tv-load-chart-dialog-table">'),this.content=$("<div>").appendTo(o.find(".tv-load-chart-dialog-table")),this.header=this.layoutHeader(),this.setSort(),this.itemsListContainer=$('<div class="tv-load-chart-dialog-table__items-list-container js-dialog__scroll-wrap">').appendTo(this.content),this.itemsList=$('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer),$('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer),this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this,"sortClick")),i.inputChangedDelegate.subscribe(this.qs,this.qs.onInput),this.favorites=e,this.setChartsData(t),this.qs.onInput(""),this._dialog&&this._dialog.close(),this._dialog=h({title:this.title,width:600,height:550,content:o,contentWrapTemplate:"<div>",destroyOnClose:!0,isClickOutFn:function(){return!this._removeDialogShown&&void 0}.bind(this)}),this._dialog.open()},s.prototype.highlightOccurrences=function(t){this.itemsList.children(".js-table-row").each(function(){var e,i=$(this).find(".js-column-name"),o=i.text();o=s.highlightText(o,t),i.html(o),e=$(this).find(".js-column-symbol"),o=e.text(),o=s.highlightText(o,t),e.html(o)})},s.highlightText=function(t,e){var i,o,n,s,r,a;if(t=$("<div>").text(t).html(),0===e.length)return t;for(i=0;i<e.length;i++){if(o=e[i],o.lastIndex=0,n="",s="",(r=o.exec(t))&&r.length)for(a=1;a<r.length;a++)n+=a%2?'<span class="i-match">$'+a+"</span>":"$"+a;if((s=t.replace(o,n))&&s!==t)return s}},t.exports=s}).call(e,i(30),i(3),i(39))},,function(t,e){"use strict";function i(){this._widgets=[],this._mouseMoveEventType=Modernizr.touch?"touchmove":"mousemove",this._omMouseMoveHandler=this._onMouseUnderWidget.bind(this),this._subscribed=!1,this.subscribeOnEvents(!0)}i.prototype.subscribeOnEvents=function(t){this._subscribed!==t&&(this._subscribed=t,t?document.addEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1):document.removeEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1))},i.prototype.addWidget=function(t){this._widgets.push(t)},i.prototype._onMouseUnderWidget=function(t){t.buttons||this._widgets.forEach(function(e){
this.favorites=t,this.itemsList&&this.qs.search()},s.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData),this.qs.search()},s.prototype.setChartsData=function(t){this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},s.prototype.layoutHeader=function(){var t=$(a);return t.find(".js-column-name").data("sort","name"),t.find(".js-column-modified").data("sort","modified"),t.find(".js-column-symbol").data("sort","symbol"),t.appendTo(this.content),t},s.prototype.resetSort=function(){this.sortObj.reset(),this.nameSort.reset(),this.symbolSort.reset(),this.toolsSort.reset(),this.currentSortObj=this.sortObj},s.prototype.show=function(t,e){var i=c({placeholder:$.t("Search")}),o=$("<div>");o.append(i.$control),o.append('<div class="tv-load-chart-dialog-table">'),this.content=$("<div>").appendTo(o.find(".tv-load-chart-dialog-table")),this.header=this.layoutHeader(),this.setSort(),this.itemsListContainer=$('<div class="tv-load-chart-dialog-table__items-list-container js-dialog__scroll-wrap">').appendTo(this.content),this.itemsList=$('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer),$('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer),this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this,"sortClick")),i.inputChangedDelegate.subscribe(this.qs,this.qs.onInput),this.favorites=e,this.setChartsData(t),this.qs.onInput(""),this._dialog&&this._dialog.close(),this._dialog=h({title:this.title,width:600,height:550,content:o,contentWrapTemplate:"<div>",destroyOnClose:!0,isClickOutFn:function(){return!this._removeDialogShown&&void 0}.bind(this)}),this._dialog.open()},s.prototype.highlightOccurrences=function(t){this.itemsList.children(".js-table-row").each(function(){var e,i=$(this).find(".js-column-name"),o=i.text();o=s.highlightText(o,t),i.html(o),e=$(this).find(".js-column-symbol"),o=e.text(),o=s.highlightText(o,t),e.html(o)})},s.highlightText=function(t,e){var i,o,n,s,r,a;if(t=$("<div>").text(t).html(),0===e.length)return t;for(i=0;i<e.length;i++){if(o=e[i],o.lastIndex=0,n="",s="",(r=o.exec(t))&&r.length)for(a=1;a<r.length;a++)n+=a%2?'<span class="i-match">$'+a+"</span>":"$"+a;if((s=t.replace(o,n))&&s!==t)return s}},t.exports=s}).call(e,i(30),i(3),i(40))},,function(t,e){"use strict";function i(){this._widgets=[],this._mouseMoveEventType=Modernizr.touch?"touchmove":"mousemove",this._omMouseMoveHandler=this._onMouseUnderWidget.bind(this),this._subscribed=!1,this.subscribeOnEvents(!0)}i.prototype.subscribeOnEvents=function(t){this._subscribed!==t&&(this._subscribed=t,t?document.addEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1):document.removeEventListener(this._mouseMoveEventType,this._omMouseMoveHandler,!1))},i.prototype.addWidget=function(t){this._widgets.push(t)},i.prototype._onMouseUnderWidget=function(t){t.buttons||this._widgets.forEach(function(e){
var i=e.checkingWidget||e.widget,o=i.get(0).getBoundingClientRect(),n=t.clientX-o.left,s=t.clientY-o.top,r=o.right-o.left,a=o.bottom-o.top,l=n<-e.acceptableOffset||s<-e.acceptableOffset||n>r+e.acceptableOffset||s>a+e.acceptableOffset;e.callback(e.widget,l)})},t.exports=new i},,,,function(t,e,i){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.jqDiv=$('<div class="pane-controls">').appendTo(i),this._chart.navigationButtonsController().addWidget({widget:this.jqDiv,acceptableOffset:0,checkingWidget:i}),this.update()}o.prototype.update=function(){var t,e,o,n,s,r,a,l;if(!this._chart.isActive())return void this.jqDiv.css("display","none");if(this.jqDiv.css("display","block"),t=this,e=t._model,o=t._paneWidget.state(),n=e.panes().indexOf(o),this.jqDiv.toggleClass("toppane",0===n||this._chart.isMaximizedPane()),s=!1,!o.containsMainSeries()&&!this._chart.isMaximizedPane()){for(r=0,a=o.dataSources(),l=a.length;l--;)if(a[l]instanceof TradingView.Study&&++r>1){s=!0;break}a=null}n>0&&!this._chart.isMaximizedPane()?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").append($(i(868)).attr({width:14,height:14})).attr("title",$.t("Move Up")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach(),n<this._model.panes().length-1&&!this._chart.isMaximizedPane()?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").append($(i(864)).attr({width:14,height:14})).attr("title",$.t("Move Down")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach(),s?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(378)).attr({width:14,height:14})).attr("title",$.t("Delete")).on("click",function(){t._model.removePane(t._chart,t._model.panes().indexOf(t._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach(),this._model.panes().length>1&&!this._chart.isMaximizedPane()?(this._$maximizeButton||(this._$maximizeButton=$(document.createElement("a")).addClass("pane-legend-icon maximize").append($(i(865)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$maximizeButton.appendTo(this.jqDiv)):this._$maximizeButton&&this._$maximizeButton.detach(),this._model.panes().length>1&&this._chart.isMaximizedPane()?(this._$restoreButton||(this._$restoreButton=$(document.createElement("a")).addClass("pane-legend-icon restore").append($(i(866)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),
this._$restoreButton.appendTo(this.jqDiv)):this._$restoreButton&&this._$restoreButton.detach()},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this.chart=t,this.paneA=t.paneWidgets()[e],this.paneB=t.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(o.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),s(this.handle,this)}var n,s;i(492),n=i(2),s=i(106).setMouseEventHandler,o.HEIGHT=1,o.prototype.hide=function(){this.jqRow.addClass("js-hidden")},o.prototype.show=function(){this.jqRow.removeClass("js-hidden")},o.prototype.mouseDownEvent=function(t){(0===t.button||Modernizr.touch)&&(this.startY=t.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o,s;(0===t.button||Modernizr.touch)&&(t.preventDefault(),this.deltaY=t.pageY-this.startY,e=this.paneA.size.h,i=n.clamp(e+this.deltaY,this.minPaneHeight,this.maxPaneHeight),o=i*this.pixelStretchFactor,s=this.totalStretch-o,this.paneA.setStretchFactor(o),this.paneB.setStretchFactor(s),this.chart._adjustSize(),this.paneA.size.h!==e&&(this.startY=t.pageY),this.chart.paint())},o.prototype.mouseUpEvent=function(t){(0===t.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},o.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},o.prototype.paint=function(){},o.prototype.image=function(){var t={},e=o.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,n=this.paneA.size.w,s=this.paneA.rhsPriceAxisWidget.size.w,r=$('<canvas width="'+i+'" height="'+e+'">')[0],a=r.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,e),t.leftAxis={content:r.toDataURL(),contentWidth:i,contentHeight:e},r=$('<canvas width="'+n+'" height="'+e+'">')[0],a=r.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,n,e),t.content=r.toDataURL(),t.contentWidth=n,t.contentHeight=e,r=$('<canvas width="'+s+'" height="'+e+'">')[0],a=r.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,s,e),t.rightAxis={content:r.toDataURL(),contentWidth:s,contentHeight:e},t},t.exports=o},function(t,e,i){(function(e){"use strict"
;function o(t,e,i,o){this._chart=t,this.dialog=t.dialog,this._state=e,this.verticalTouchScroll=o,this._disableContextMenu=!!i,this.lhsPriceAxisWidget=new h(this,h.LHS),this.rhsPriceAxisWidget=new h(this,h.RHS),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=A(this._dv,new E(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=A(this._dv,new E(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.legendWidget=new l(this,this._chart.model(),this._chart._jqMainDiv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this.legendWidget.$el.appendTo(this._dv),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),M($(this.top_canvas),this,!0,o),e&&!this._chart.readOnly()&&(this.paneControls=new C(this,this._chart.model(),this._dv)),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=S.lockDrawings(),this._chart.withModel(this,function(){var t=this._chart.model();t.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),t.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V;i(493),n=i(2),s=i(373).UndoMacroCommand,r=i(53).UndoHistory,a=i(31).Study,l=i(605),h=i(194),c=i(325),d=i(328),p=i(1).LineDataSource,u=i(201),_=i(102).BarsMarksContainer,f=i(33).trackEvent,m=i(48).PriceDataSource,g=i(47),v=g.Action,y=g.ActionPlaceholder,b=g.ActionSeparator,w=i(101),S=i(41),T=i(8),C=i(657),x=i(21),P=i(34),L=i(120),k=L.resizeCanvas,I=L.clearRect,A=L.addCanvasTo,E=L.Size,M=i(106).setMouseEventHandler,D=i(192),O=i(125),V=i(12).getLogger("Chart.PaneWidget"),o.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener),this.legendWidget&&(this.legendWidget.$el.remove(),delete this.legendWidget),this.paneControls&&(this.paneControls.jqDiv.remove(),
;function o(t,e,i,o){this._chart=t,this.dialog=t.dialog,this._state=e,this.verticalTouchScroll=o,this._disableContextMenu=!!i,this.lhsPriceAxisWidget=new h(this,h.LHS),this.rhsPriceAxisWidget=new h(this,h.RHS),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=A(this._dv,new E(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=A(this._dv,new E(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.legendWidget=new l(this,this._chart.model(),this._chart._jqMainDiv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this.legendWidget.$el.appendTo(this._dv),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),M($(this.top_canvas),this,!0,o),e&&!this._chart.readOnly()&&(this.paneControls=new C(this,this._chart.model(),this._dv)),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=S.lockDrawings(),this._chart.withModel(this,function(){var t=this._chart.model();t.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),t.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,O,V;i(493),n=i(2),s=i(373).UndoMacroCommand,r=i(53).UndoHistory,a=i(31).Study,l=i(605),h=i(194),c=i(325),d=i(328),p=i(1).LineDataSource,u=i(201),_=i(102).BarsMarksContainer,f=i(33).trackEvent,m=i(48).PriceDataSource,g=i(47),v=g.Action,y=g.ActionPlaceholder,b=g.ActionSeparator,w=i(101),S=i(42),T=i(8),C=i(657),x=i(21),P=i(34),L=i(120),k=L.resizeCanvas,I=L.clearRect,A=L.addCanvasTo,E=L.Size,M=i(106).setMouseEventHandler,D=i(192),O=i(125),V=i(12).getLogger("Chart.PaneWidget"),o.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener),this.legendWidget&&(this.legendWidget.$el.remove(),delete this.legendWidget),this.paneControls&&(this.paneControls.jqDiv.remove(),
delete this.paneControls),this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var t in this)delete this[t]},o.prototype.cancelZoom=function(){this._zoomSelector.css("display","none"),delete this._firstZoomPoint},o.prototype._onKeyUpListener=function(t){if(27===t.keyCode){this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom();this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip()}},o.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(t){}},o.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()},o.prototype.priceAxisByCanvas=function(t){return t===this.lhsPriceAxisWidget.canvas||t===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:t===this.rhsPriceAxisWidget.canvas||t===this.rhsPriceAxisWidget.top_canvas?this.rhsPriceAxisWidget:null},o.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()),this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())},o.prototype.chart=function(){return this._chart},o.prototype.state=function(){return this._state},o.prototype.setState=function(t){this._state=t},o.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:Pane.DEFAULT_STRETCH_FACTOR},o.prototype.setStretchFactor=function(t){this._state&&(this._state._stretchFactor=t)},o.prototype.mouseEnterEvent=function(t){var e=this._chart.model();e&&(e.crossHairSource().visible=!0,"function"==typeof this.onMouseEnter&&this.onMouseEnter(this))},o.prototype.isLineTool=function(t){var e=TradingView[t];return"function"==typeof e&&e.prototype instanceof p},o.prototype.hideInplaceEditor=function(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)},o.prototype._processMouseMoveWhileZoom=function(t){var e=Math.floor(this._chart.model().timeScale().coordinateToIndex(t.localX)),i=this._chart.model().timeScale().indexToCoordinate(e)-.5*this._chart.model().timeScale().barSpacing(),o=t.localY,n=Math.abs(i-this._firstZoomPoint.x),s=Math.abs(o-this._firstZoomPoint.y);i<this._firstZoomPoint.x?this._zoomSelector.css("left",i):this._zoomSelector.css("left",this._firstZoomPoint.x),t.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",t.localY):this._zoomSelector.css("top",this._firstZoomPoint.y),this._zoomSelector.width(n),this._zoomSelector.height(s)},o.prototype._finishZoom=function(t){var e=this._state.defaultPriceScale(),i=e.coordinateToPrice(t.localY),o=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX));o!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,o,this._firstZoomPoint.price,i,this.state()),
this._zoomSelector.css("display","none"),this._firstZoomPoint=null,S.resetToCursor()},o.EvironmentState=function(t){t.shiftKey&&(this.shift=!0),t.ctrlKey&&(this.control=!0)},o.prototype.checkMovepoint=function(t){return t===T.MOVEPOINT||t===T.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()},o.prototype.mouseDownEvent=function(t){var i,s,r,l,h,c,d,u,_,f,g,v,y,b;if(document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),P.emit("mouse_down",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),this._updateCommonTooltip(null),i=this._chart.model(),s=new o.EvironmentState(t),i.mainSeries().setGotoDateResult(),this.hideInplaceEditor(),TradingView.supportTouch()&&(this._skipFirstMove=!0),r=this._state.defaultPriceScale(),!r.isEmpty()&&!i.timeScale().isEmpty()){if(l=i.crossHairSource(),TradingView.supportTouch()&&"LineToolBrush"!==S.tool.value()||i.setCurrentPosition(t.localX,t.localY,this._state),h=l.price,c=l.index,l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),s.shift&&S.toolIsCursor(S.tool.value())&&S.tool.setValue("measure"),"measure"===S.tool.value()&&!l.startMeasurePoint())return void l.startMeasuring({price:h,index:c,x:t.localX,y:t.localY},this._state);if(l.startMeasurePoint()&&!l.endMeasurePoint())return l.finishMeasure({price:h,index:c,x:t.localX,y:t.localY}),void S.resetToCursor();if(this._firstZoomPoint)return void this._finishZoom(t);if("zoom"===S.tool.value()&&e.enabled("chart_zoom"))return d=i.timeScale().indexToCoordinate(c)-.5*i.timeScale().barSpacing(),this._firstZoomPoint={price:h,index:c,x:d,y:t.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",d),this._zoomSelector.css("top",t.localY),this._zoomSelector.width(0),void this._zoomSelector.height(0);if(this.isLineTool(S.tool.value())||i.lineBeingCreated())return void((!e.enabled("charting_library_base")||c>=0)&&this._mouseDownEventForLineTool(t,s,c,h));if(u=this.dataSourceAtPoint(t.localX,t.localY),_=u&&u.source&&u.source.customization?u.source.customization:{},u.hittest&&u.hittest.result()===T.CUSTOM&&(f=u.hittest.data().mouseDownHandler)&&f(t),!this._chart.readOnly()){if(u&&!_.disableSelection&&(g=u.hittest&&u.hittest.result()>T.MOVEPOINT_BACKGROUND,g=g||u.hittest&&u.hittest.result()===T.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),g?i.setSelectedSource(u.source,u.hittest&&u.hittest.data()):i.setSelectedSource(null)),u.source&&"eraser"===S.tool.value()&&!_.disableErasing&&(TradingView.isInherited(u.source.constructor,p)||TradingView.isInherited(u.source.constructor,a)))return v=u.hittest.eraseMarker(),void(t.ctrlKey&&void 0!==v&&u.source.processErase?u.source.processErase(i,v):i.removeSource(u.source));if(y=u.source&&TradingView.isInherited(u.source.constructor,p)&&u.source.isLocked(),
!(this._lockDrawingsProperty.value()||y)){if(u.source&&u.source.userEditEnabled&&!u.source.userEditEnabled())return;if(u.hittest&&u.hittest.result()===T.CHANGEPOINT)return r=u.source.priceScale(),h=r.coordinateToPrice(t.localY),i.startChangingLinetool(u.source,{index:c,price:h},u.hittest.data(),s),void this._updateTooltip(t.localX,t.localY);if(u.hittest&&this.checkMovepoint(u.hittest.result()))return b=u.source.properties(),s.control&&b.clonable&&b.clonable.value()?void(this._clonningAtMoveLineTool=u.source):void(u.source.isFixed&&u.source.isFixed()?i.startMovingSource(u.source,new n.Point(t.localX,t.localY),u.hittest.data()):(r=u.source.priceScale(),h=r.coordinateToPrice(t.localY),i.startMovingSource(u.source,{index:c,price:h},u.hittest.data())))}if(u.source&&TradingView.isInherited(u.source.constructor,m)&&u.source.isDraggable())return void(this._chart.draggingSource=u.source)}u.hittest&&u.hittest.result()===T.REGULAR||(this._processing=!0)}},o.prototype.drawRightThere=function(t){var e,i;this.isLineTool(t)&&(e=this._chart.model(),i=e.crossHairSource(),e.createLineTool(this._state,{index:i.index,price:i.price},t))},o.prototype._finishTool=function(t){var e,i=this._chart.model(),o=S.tool.value();S.resetToCursor(),this._hideTooltip(),i.setSelectedSource(t),this._chart.isTextTool(o)&&(e=i.createUndoCheckpoint(),this._chart.showEditObjectDialog(t,i,null,e).then(function(t){t.focusOnText()}))},o.prototype._mouseDownEventForLineTool=function(t,e,i,o){var s,r,a,l,h,c,d,p,_,f,m=this._chart.model(),g=!1,v=null,y=t.localX,b=t.localY,w=this._chart.model().model().crossHairSource(),T=S.tool.value();if(S.hideAllDrawings().setValue(!1),S.lockDrawings().setValue(!1),TradingView.supportTouch()&&this.isLineTool(T)&&"LineToolBrush"!==T&&!m.lineBeingCreated()&&(this._startTouchPoint=new n.Point(y,b),this._initCrossHairPosition=w.currentPoint(),this._skipFirstMove=!0),!m.lineBeingCreated()||m.lineBeingCreated()instanceof u)TradingView.supportTouch()&&"LineToolBrush"!==T||(f={index:i,price:o},v=m.createLineTool(this._state,f,T),m.lineBeingCreated()||(g=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint)return this._startTouchPoint=new n.Point(y,b),s=m.lineBeingCreated().points(),r=s[s.length-1],a=m.timeScale().indexToCoordinate(r.index),o=r.price,l=m.lineBeingCreated().priceScale(),l.isPercent()&&(h=m.lineBeingCreated().ownerSource().firstValue(),o=l.priceRange().convertToPercent(o,h)),c=l.priceToCoordinate(o),void(this._lastDrawingPoint=new n.Point(a,c))}else v=m.lineBeingCreated(),d=m.paneForSource(v),d!==this._state?(p=this._dv.offset(),y=t.localX+p.left,b=t.localY+p.top,_=this._chart.paneByState(d),p=_._dv.offset(),y-=p.left,b-=p.top,o=v.priceScale().coordinateToPrice(b),i=Math.round(m.timeScale().coordinateToIndex(y)),g=m.coninueCreatingLine({index:i,price:o},e)):g=m.coninueCreatingLine({index:i,price:o},e);m.setSelectedSource(v),g?this._finishTool(v):TradingView.supportTouch()&&"LineToolBrush"!==T||this._updateTooltip(t.localX,t.localY)},o.prototype._equalsCursorCache=function(t,e){
@@ -644,7 +644,7 @@ this._$autoScaleButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d
d.model().mainSeries().onSymbolResolved().subscribe(c,c._resetCurrentRange),d.model().mainSeries().properties().extendedHours.subscribe(c,c._resetCurrentRange),d.model().mainSeries().onIntervalChanged().subscribe(null,function(t,e){e&&c._currentRange===e.timeframe||c._resetCurrentRange()})})}var n=i(122).TimeFormatter,s=i(47).ActionSeparator,r=i(375).parseTzOffset,a=i(63),l=a.bindPopupMenu,h=a.unbindPopupMenu;o.prototype._resetCurrentRange=function(){this._currentRange&&(this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),this._currentRange=null)},o.prototype.updateScaleButtons=function(){var t=this._chartWidget.model().mainSeries(),e=t.priceScale().properties(),i=e.log.value(),o=e.percentage.value(),n=e.autoScale.value();this._$logButton.toggleClass("active",i),this._$percButton.toggleClass("active",o),this._$autoScaleButton.toggleClass("active",n)},o.prototype.updateDateRangeButtons=function(){var t,e,i,o,n,s,r=this._chartWidget,a=r.model().mainSeries().status();if(a!==TradingView.Series.STATUS_LOADING&&a!==TradingView.Series.STATUS_RESOLVING){if(t=r._dateRangeResolutions(),e=function(t,e){this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),e.addClass("active"),this._currentRange=e.data("value"),r.model().loadRange(t)},this._dateRangesPopupList=[],t.length)for(this._$dateRanges.empty(),i=0;i<t.length;i++)o=t[i],n=$(document.createElement("a")).text(o.text).attr("title",o.description||o.text).addClass("date-range-preset-btn apply-common-tooltip").data("value",o.value),o.value===this._currentRange&&n.addClass("active"),s=e.bind(this,{val:o.value,res:o.targetResolution},n),n.appendTo(this._$dateRanges).click(s),this._dateRangesPopupList.push({title:o.description||o.text,action:s});this.updateTimeframePopupMenu()}},o.prototype.updateTimeframePopupMenu=function(){this._$dateRangesBtn.toggleClass("i-hidden",!(this._dateRangesPopupList.length||this._goToPopupBtn.length)),h(this._$dateRangesBtn),l(this._$dateRangesBtn,this._dateRangesPopupList.concat(this._goToPopupBtn),{direction:"up",addClass:"date-range-popupmenu"}),this.resizeUI()},o.prototype.updateTimezonesButton=function(){var t,e,i;null!==this._chartWidget.model().mainSeries().symbolInfo()&&(t=this._chartWidget.model().model().timezone(),"exchange"===t&&(e=this._chartWidget.model().mainSeries().symbolInfo().timezone)&&(t=e),i=r(t),this.tzOffset=i.offset,this._$timezoneName.text("("+i.string+")"),this.tickClock(),this.resizeUI())},o.prototype.checkTimezonesButton=function(t){this._$timezoneButton.toggleClass("i-invisible",t!==this._chartWidget),this.resizeUI()},o.prototype.tickClock=function(){void 0!==this.tzOffset&&this._$timezoneClock.text(this._timeFormatter.format(new Date(Date.now()+this.tzOffset+1e3*ChartApiInstance.serverTimeOffset())))},o.prototype.updateExtendedHoursButton=function(){if(this._$extendedHoursButton){this._chartWidget.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"),this.resizeUI()}},
o.prototype.updateFullscreenChartButton=function(){var t=this._chartWidget._chartWidgetCollection;if(!t||"s"===t.layout.value())return void this._$fullscreenChartButton.addClass("i-hidden");this._$fullscreenChartButton.removeClass("i-hidden"),this._$fullscreenChartButton.toggleClass("active",t.maximizeCurrentChart.value()),this.resizeUI()},o.prototype.updateUI=function(){this.updateScaleButtons(),this.resizeUI()},o.prototype.resizeUI=function(){var t,e,i,o,n,s,r;if(this._$seriesControls&&this._$dateRanges){for(this.$parent.addClass("i-measure"),t=this.$parent.width(),e=this._$dateRanges.width(),i=this._$dateRangesBtn.outerWidth(),o=0,this._$seriesControls.find("a").each(function(){var t=$(this);t.hasClass("i-hidden")||(o+=t.outerWidth())}),n=o,s=0;s<this._iterativeHide.length;s++)this._iterativeHide[s].hasClass("i-hidden")||(r=this._iterativeHide[s].outerWidth(),this._iterativeHide[s].toggleClass("i-compact",t-i<n),n-=r);this._$dateRangesWrap.toggleClass("i-compact",e>t-o),this.$parent.removeClass("i-measure")}},t.exports=o}).call(e,i(3))},function(t,e,i){(function(e){"use strict";function o(t){function i(){var t=L.last();k.toolsGroupsHeight=t.offset().top+t.outerHeight()}var s,r,l,h,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k=this;t=t||{},this.options=t,a.init(),s=t.resizerBridge.body.value(),r=this._container=$("<div>",s).addClass("tv-side-toolbar").appendTo(s),this._heightWV=t.resizerBridge.height,this._chartWidgetCollection=t.chartWidgetCollection,this._container.on("contextmenu",function(t){t.preventDefault()}),this._allToolGroups=[],this._toolsFilter=new o.ModernToolsFilter(t.drawingsAccess||{type:"black",tools:[]}),t.readOnly||(l=$("<div>").addClass("tools-group no-delimiter").appendTo(r),this._main=l,this.appendToolsGroup([{tool:"cursor"},{tool:"dot"},{tool:"arrow"},{tool:"eraser"}]),this.appendToolsGroup([{tool:"LineToolTrendLine"},{tool:"LineToolTrendAngle"},{tool:"LineToolHorzLine",shortcut:{keys:"Alt+H",immediately:!0}},{tool:"LineToolHorzRay"},{tool:"LineToolVertLine",shortcut:{keys:"Alt+V",immediately:!0}},{tool:"LineToolArrow"},{tool:"LineToolRay"},{tool:"LineToolExtended"},{tool:"LineToolParallelChannel"},{tool:"LineToolDisjointAngle"},{tool:"LineToolFlatBottom"}]),this.appendToolsGroup([{tool:"LineToolPitchfork"},{tool:"LineToolSchiffPitchfork2"},{tool:"LineToolSchiffPitchfork"},{tool:"LineToolInsidePitchfork"},{tool:"LineToolPitchfan"},{tool:"LineToolGannSquare"},{tool:"LineToolGannComplex"},{tool:"LineToolGannFan"},{tool:"LineToolFibRetracement"},{tool:"LineToolTrendBasedFibExtension"},{tool:"LineToolFibSpeedResistanceFan"},{tool:"LineToolFibTimeZone"},{tool:"LineToolTrendBasedFibTime"},{tool:"LineToolFibCircles"},{tool:"LineToolFibSpiral"},{tool:"LineToolFibSpeedResistanceArcs"},{tool:"LineToolFibWedge"},{tool:"LineToolFibChannel"}]),this.appendToolsGroup([{tool:"LineToolBrush"},{tool:"LineToolRectangle"},{tool:"LineToolRotatedRectangle"},{tool:"LineToolEllipse"},{tool:"LineToolTriangle"},{tool:"LineToolPolyline"},{tool:"LineToolBezierQuadro"},{tool:"LineToolBezierCubic"},{tool:"LineToolArc"}]),
this.appendToolsGroup([{tool:"LineToolText"},{tool:"LineToolTextAbsolute"},{tool:"LineToolNote"},{tool:"LineToolNoteAbsolute"},{tool:"LineToolCallout"},{tool:"LineToolBalloon"},{tool:"LineToolPriceLabel"},{tool:"LineToolArrowMarkLeft"},{tool:"LineToolArrowMarkRight"},{tool:"LineToolArrowMarkUp"},{tool:"LineToolArrowMarkDown"},{tool:"LineToolFlagMark"}]),this.appendToolsGroup([{tool:"LineTool5PointsPattern"},{tool:"LineToolCypherPattern"},{tool:"LineToolABCD"},{tool:"LineToolTrianglePattern"},{tool:"LineToolThreeDrivers"},{tool:"LineToolHeadAndShoulders"},{tool:"LineToolElliottImpulse"},{tool:"LineToolElliottTriangle"},{tool:"LineToolElliottTripleCombo"},{tool:"LineToolElliottCorrection"},{tool:"LineToolElliottDoubleCombo"},{tool:"LineToolCircleLines"},{tool:"LineToolTimeCycles"},{tool:"LineToolSineLine"}]),this.appendToolsGroup([{tool:"LineToolRiskRewardLong"},{tool:"LineToolRiskRewardShort"},{tool:"LineToolPrediction"},{tool:"LineToolDateRange"},{tool:"LineToolPriceRange"},{tool:"LineToolDateAndPriceRange"},{tool:"LineToolBarsPattern"},{tool:"LineToolGhostFeed"},{tool:"LineToolProjection"}]),this._toolsFilter.isToolEnabled("Font Icons")&&(h=new this.Button(this.createIconActions(),{addClass:"font-awesome line-tool-icons-popup",buttonClass:"font-awesome"},!0),this._icons=h,l.append(h.element()),this._allToolGroups.push(h)),p=$("<div>").addClass("tools-group").appendTo(r),u=new this.Button({tool:"zoom",action:function(){a.tool.setValue("zoom")}}),p.append(u.element()),this._allToolGroups.push(u),k._chartWidgetCollection&&(_=new this.Button({tool:"zoom-out",action:function(){var t,e=k._chartWidgetCollection;e&&(t=e.activeChartWidget.value().model())&&t.zoomFromViewport()}}),p.append(_.element()),_.element().addClass("js-hidden"),function(){function t(){var i=k._chartWidgetCollection.activeChartWidget.value(),o=i.model(),n=!1;o?(e!==o&&(e&&e.zoomStack().onChange().unsubscribe(null,t),o.zoomStack().onChange().subscribe(null,t),e=o),n=!o.zoomStack().isEmpty()):i.withModel(null,t),_.element().toggleClass("js-hidden",!n)}var e=null;k._chartWidgetCollection.activeChartWidget.subscribe(t,{callWithLast:!0})}()),f=new this.Button({tool:"measure",action:function(){a.tool.setValue("measure")}}),p.append(f.element()),this._allToolGroups.push(f),m=$("<div>").addClass("tools-group").appendTo(r),g=!!a.properties().magnet.value(),v=new this.Button({tool:"magnet",action:this.ToolbarActions.magnet.bind(this)}),this.magnet=v,m.append(v.element()),v.activate(g),a.properties().magnet.subscribe(this,function(t){v.activate(t.value())}),t.onWidget&&!c.enabled("charting_library_base")||(g=!!a.properties().stayInDrawingMode.value(),y=new this.Button({tool:"drawginmode",action:this.ToolbarActions.drawingmode.bind(this)}),this.drawingmode=y,m.append(y.element()),y.activate(g),a.properties().stayInDrawingMode.subscribe(this,function(t){y.activate(t.value())}),g=!!a.lockDrawings().value(),b=new this.Button({tool:"lockAllDrawings",action:this.ToolbarActions.lockDrawings.bind(this)}),this.lockDrawings=b,m.append(b.element()),b.activate(g),
a.lockDrawings().subscribe(this,function(t){b.activate(t.value())}),g=!!a.hideAllDrawings().value(),w=new this.Button({tool:"hideAllDrawings",action:this.ToolbarActions.hideAllDrawings.bind(this)}),this.hideAllDrawings=w,m.append(w.element()),w.activate(g),a.hideAllDrawings().subscribe(this,function(t){w.activate(t.value())}),c.enabled("support_multicharts")&&(g=!!a.drawOnAllCharts().value(),S=new this.Button({tool:"SyncDrawing",action:this.ToolbarActions.drawAllCharts.bind(this)}),this.drawOnAllCharts=S,m.append(S.element()),S.activate(g),a.drawOnAllCharts().subscribe(this,function(t){S.activate(t.value())})),T=$("<div>").addClass("tools-group").appendTo(r),this.removeAndObjectsTreeTools=T,C=new this.Button({tool:"showObjectsTree",action:this.ToolbarActions.showObjectsTree.bind(this)}),this.showObjectsTree=C,T.append(C.element()),x=new this.Button({tool:"removeAllDrawingTools",action:this.ToolbarActions.removeTools.bind(this)}),this.removeTools=x,T.append(x.element()),P=$("<div>").addClass("tools-group no-delimiter").appendTo(r),this.responsiveToolbar=new this.ResponsiveToolbar(this),P.append(this.responsiveToolbar.getButton().element())),t.onWidget||(this._favoriteDrawingToolbar=new n({top:window.headerChartPanel.outerHeight()+61,left:window.innerWidth/2}),this._favoriteDrawingToolbar.onButtonClicked().subscribe(null,function(t){this._onLinetoolButtonClicked(t,!0)}.bind(this)))),t.readOnly||a.tool.subscribe(function(t){this._syncView(t)}.bind(this),{callWithLast:!0}),$(document).bind("keydown","esc",function(){a.resetToCursor(!0)}),this._twoColumnLayout=!1,t.onWidget&&!c.enabled("charting_library_base")||(L=r.find(".tools-group"),i(),this._heightWV.subscribe(this.updateToolsVisibility.bind(this),{callWithLast:!0})),this.visible=new e,this.visible.subscribe(this,function(t){this._fold(!t.value()),this.$panelClose&&this.$panelClose.prop("title",this.getVisibilityChangeText(t.value())),TVSettings.setValue("ChartSideToolbarWidget.visible",t.value())}),this.visible.setValue("boolean"==typeof t.forceVisible?t.forceVisible:TVSettings.getBool("ChartSideToolbarWidget.visible",!0)),this.$panelClose=$('<a href="#" class="tv-close-panel left" title="'+this.getVisibilityChangeText(this.visible.value())+'"></a>'),this.$panelClose.on("click",function(t){var e,i=this.activeChartWidget().model();i&&(e=this.visible.value(),this.$panelClose.prop("title",this.getVisibilityChangeText(!e)),i.setProperty(this.visible,!e,this.getVisibilityChangeText(e)),d.emit("toggle_sidebar",!e),t.preventDefault())}.bind(this)).appendTo(r)}var n=i(733).FavoriteDrawingToolbar,s=i(118),r=i(366),a=i(41),l=i(217).lineToolsInfo,h=i(372).LinetoolsFavoritesStore,c=i(3),d=i(34),p=i(63).bindPopupMenu,u=i(7).saveDefaultProperties;i(524),o.prototype.favoriteDrawingToolbar=function(){return this._favoriteDrawingToolbar},o.prototype.updateToolsVisibility=function(){var t=this._heightWV.value()<this.toolsGroupsHeight+10;t!==this._twoColumnLayout&&(this.magnet.element().toggleClass("js-hidden",t),this.drawingmode.element().toggleClass("js-hidden",t),
a.lockDrawings().subscribe(this,function(t){b.activate(t.value())}),g=!!a.hideAllDrawings().value(),w=new this.Button({tool:"hideAllDrawings",action:this.ToolbarActions.hideAllDrawings.bind(this)}),this.hideAllDrawings=w,m.append(w.element()),w.activate(g),a.hideAllDrawings().subscribe(this,function(t){w.activate(t.value())}),c.enabled("support_multicharts")&&(g=!!a.drawOnAllCharts().value(),S=new this.Button({tool:"SyncDrawing",action:this.ToolbarActions.drawAllCharts.bind(this)}),this.drawOnAllCharts=S,m.append(S.element()),S.activate(g),a.drawOnAllCharts().subscribe(this,function(t){S.activate(t.value())})),T=$("<div>").addClass("tools-group").appendTo(r),this.removeAndObjectsTreeTools=T,C=new this.Button({tool:"showObjectsTree",action:this.ToolbarActions.showObjectsTree.bind(this)}),this.showObjectsTree=C,T.append(C.element()),x=new this.Button({tool:"removeAllDrawingTools",action:this.ToolbarActions.removeTools.bind(this)}),this.removeTools=x,T.append(x.element()),P=$("<div>").addClass("tools-group no-delimiter").appendTo(r),this.responsiveToolbar=new this.ResponsiveToolbar(this),P.append(this.responsiveToolbar.getButton().element())),t.onWidget||(this._favoriteDrawingToolbar=new n({top:window.headerChartPanel.outerHeight()+61,left:window.innerWidth/2}),this._favoriteDrawingToolbar.onButtonClicked().subscribe(null,function(t){this._onLinetoolButtonClicked(t,!0)}.bind(this)))),t.readOnly||a.tool.subscribe(function(t){this._syncView(t)}.bind(this),{callWithLast:!0}),$(document).bind("keydown","esc",function(){a.resetToCursor(!0)}),this._twoColumnLayout=!1,t.onWidget&&!c.enabled("charting_library_base")||(L=r.find(".tools-group"),i(),this._heightWV.subscribe(this.updateToolsVisibility.bind(this),{callWithLast:!0})),this.visible=new e,this.visible.subscribe(this,function(t){this._fold(!t.value()),this.$panelClose&&this.$panelClose.prop("title",this.getVisibilityChangeText(t.value())),TVSettings.setValue("ChartSideToolbarWidget.visible",t.value())}),this.visible.setValue("boolean"==typeof t.forceVisible?t.forceVisible:TVSettings.getBool("ChartSideToolbarWidget.visible",!0)),this.$panelClose=$('<a href="#" class="tv-close-panel left" title="'+this.getVisibilityChangeText(this.visible.value())+'"></a>'),this.$panelClose.on("click",function(t){var e,i=this.activeChartWidget().model();i&&(e=this.visible.value(),this.$panelClose.prop("title",this.getVisibilityChangeText(!e)),i.setProperty(this.visible,!e,this.getVisibilityChangeText(e)),d.emit("toggle_sidebar",!e),t.preventDefault())}.bind(this)).appendTo(r)}var n=i(733).FavoriteDrawingToolbar,s=i(118),r=i(366),a=i(42),l=i(217).lineToolsInfo,h=i(372).LinetoolsFavoritesStore,c=i(3),d=i(34),p=i(63).bindPopupMenu,u=i(7).saveDefaultProperties;i(524),o.prototype.favoriteDrawingToolbar=function(){return this._favoriteDrawingToolbar},o.prototype.updateToolsVisibility=function(){var t=this._heightWV.value()<this.toolsGroupsHeight+10;t!==this._twoColumnLayout&&(this.magnet.element().toggleClass("js-hidden",t),this.drawingmode.element().toggleClass("js-hidden",t),
this.lockDrawings.element().toggleClass("js-hidden",t),this.hideAllDrawings.element().toggleClass("js-hidden",t),this.drawOnAllCharts&&this.drawOnAllCharts.element().toggleClass("js-hidden",t),this.showObjectsTree.element().toggleClass("js-hidden",t),this.removeTools.element().toggleClass("js-hidden",t),this.removeAndObjectsTreeTools.toggleClass("js-hidden",t),this.responsiveToolbar.getButton().element().toggleClass("js-hidden",!t),this._twoColumnLayout=t)},o.prototype.appendToolsGroup=function(t){var e,i=this.filterEnabledTools(this.extendTools(t));i.length>0&&(e=new this.Button(i),this._main.append(e.element()),this._allToolGroups.push(e))},o.prototype.filterEnabledTools=function(t){return t.filter(function(t){return this._toolsFilter.isToolEnabled(l[t.tool].localizedName)},this)},o.prototype.element=function(){return this._container},o.prototype._syncView=function(t){var e,i,o,n;if(this._allToolGroups)for(e=this._allToolGroups.length;e--;)if(i=this._allToolGroups[e],i.textAsIcon)i.activate("LineToolIcon"===t);else{for(o=!1,n=i.tools.length;n--;)i.tools[n].tool===t&&(i.setCurrent(n),o=!0);i.activate(o)}},o.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},o.prototype._onLinetoolButtonClicked=function(t,e){if(a.tool.value()===t)return void(e&&a.resetToCursor());TradingView.supportTouch()&&this._chartWidgetCollection.selectedSource.value()&&this.activeChartWidget().model().lineBeingCreated()&&this.activeChartWidget().model().cancelCreatingLine(),a.tool.setValue(t)},o.prototype.extendTools=function(t){var e=this,i=this._addToFavorite.bind(this),o=e._removeFromFavorite.bind(this),n=c.enabled("items_favoriting");return $.map(t,function(t){var s={tool:t.tool,addClass:e._toolsFilter.isToolGrayed(l[t.tool].localizedName)&&" grayed",shortcut:t.shortcut,action:e._onLinetoolButtonClicked.bind(e,t.tool,!1),favOptions:{allowMakeFavorite:!e.options.onWidget&&n,addToFavorite:i,removeFromFavorite:o}};return s.favOptions.isFavorite=h.isFavorite(t.tool),t.shortcut&&r.bind(t.shortcut.keys,function(i){return i.preventDefault(),t.shortcut.immediately?e.activeChartWidget().activePaneWidget&&e.activeChartWidget().activePaneWidget.drawRightThere(t.tool):s.action(),!1}),s})},o.prototype._addToFavorite=function(t){t.favOptions.isFavorite=!0,h.addFavorite(t.tool)},o.prototype._removeFromFavorite=function(t){t.favOptions.isFavorite=!1,h.removeFavorite(t.tool)},o.prototype.createIconActions=function(t){var e=this,i=s.availIcons,o=TVSettings.getJSON("linetoolicon.recenticons");return o&&(i=o.concat(["separator"]).concat(i)),$.map(i,function(t){return"separator"===t?{separator:!0}:{tool:"LineToolIcon",name:String.fromCharCode(t),addClass:e._toolsFilter.isToolGrayed("Font Icons")&&" grayed",action:function(){var i,o,n=defaults("linetoolicon");n.icon=t,TradingView.saveDefaults("linetoolicon",n),a.tool.setValue("LineToolIcon"),e._icons.setTools(e.createIconActions()),i=TVSettings.getJSON("linetoolicon.recenticons")||[],o=10,i=$.grep(i,function(e){return e!==t}),i.unshift(t),
i.length>o&&(i=i.slice(0,o)),TVSettings.setJSON("linetoolicon.recenticons",i)}}})},o.prototype.changeTool=function(t){t?this._chartWidget.setCurrentTool(t):this._chartWidget.setCurrentTool(this._chartWidget.currentCursorTool())},o.prototype._fold=function(t){t=!!t,this._container.toggleClass("hidden",t),this.options.resizerBridge.negotiateWidth(t?0:52)},o.prototype.getVisibilityChangeText=function(t){return t?$.t("Hide Drawings Toolbar"):$.t("Show Drawings Toolbar")},o.prototype.Button=function(t,e,o){t=Array.isArray(t)?t:[t],this.isGroup=t.length>1,this.textAsIcon=o,this.setTools(t),this._e=$("<span>").addClass("button").addClass("apply-common-tooltip common-tooltip-vertical"),this._main=$("<span>").addClass("main"),o&&(this._main.addClass("text-as-icon"),this._main.text(this._firstNonGrayedTool().localizedName)),this.isGroup&&(this._side=$("<span>").addClass("side").append($(i(895)).attr({width:3,height:6})),this._e.addClass("subgroup"));var n=o?$.t("Icon"):this.tools[0].localizedName;this._e.append(this._main).attr("title",n).append(this._side),this.isGroup&&(e=$.extend({direction:"right",event:"button-popup",addClass:"drawings-popup-list favored-list",reverse:!1,popupSpacing:4,svg:!o,listInner:!0,listTable:!0,wrapIcon:!0},e||{}),o||(e.addClass+=" iconed"),"function"==typeof TradingView.setWidgetLogoOverlayVisibility&&(this._e.on(e.event,function(){TradingView.setWidgetLogoOverlayVisibility(!1)}),e.onRemove=function(){TradingView.setWidgetLogoOverlayVisibility(!0)}),p(this._e,null,e)),this.activated=t.activated||!1,this.setCurrent(this.tools.indexOf(this._firstNonGrayedTool())),this.isGroup?(Modernizr.touch?(this._main.bind("touchstart",$.proxy(this,"_startclick")),this._main.bind("touchend",$.proxy(this,"_stopclick"))):(this._main.mousedown($.proxy(this,"_startclick")),this._main.mouseup($.proxy(this,"_stopclick"))),this._side.click($.proxy(this,"_submenu")),this._e.click(function(){return!1})):this._e.click($.proxy(this,"action"))},o.prototype.Button.prototype.toggle=function(){switch(this.element().css("display")){case"none":this.element().css("display","block");break;case"block":this.element().css("display","none")}},o.prototype.Button.prototype._isToolGrayed=function(t){return t.addClass&&t.addClass.indexOf("grayed")>-1},o.prototype.Button.prototype._firstNonGrayedTool=function(){var t,e;for(t=0;t<this.tools.length;++t)if(e=this.tools[t],!this._isToolGrayed(e)&&!e.separator)return e;return this.tools[0]},o.prototype.Button.prototype.element=function(){return this._e},o.prototype.Button.prototype.setTools=function(t){if(Array.isArray(t)){var e=this;this.tools=$.map(t,$.proxy(function(t,i){if(t.separator)return{separator:!0};var o=t.name||l[t.tool].localizedName;return{icon:e.textAsIcon?t.name:t.tool,name:o,shortcut:t.shortcut,localizedName:o,tool:t.tool,addClass:t.addClass,action:"function"==typeof t.action?t.action:e._defaultAction,favOptions:t.favOptions}},this))}},o.prototype.Button.prototype._setIcon=function(t){var e=$(l[t].icon).attr({width:30,height:30});this._main.empty().append(e)},
o.prototype.Button.prototype._setTextAsIcon=function(t){this._main.text(t)},o.prototype.Button.prototype.setIcon=function(t){this.icon=t,this.textAsIcon?this._setTextAsIcon(t):this._setIcon(t)},o.prototype.Button.prototype._getPopupMenuItems=function(){function t(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")}var e=this;return $.map(this.tools,function(o,n){var s,r;return o.separator?o:(s=function(){e._isToolGrayed(o)?d.emit("onGrayedObjectClicked",{type:"drawing",name:l[o.tool].localizedName}):(e.setCurrent(n),o.action.call(e,o),$(document).trigger("click"),$(document).trigger("touch"))},!e.textAsIcon&&o.favOptions.allowMakeFavorite&&(r=$('<span class="to-quick" title="'+t(o.favOptions.isFavorite)+'"></span>').append($(i(165)).attr({width:16,height:16})).toggleClass("quicked",!!o.favOptions.isFavorite)),{title:""+o.localizedName,action:s,shortcut:o.shortcut,active:n===e.current,svg:!e.textAsIcon&&$(l[o.icon].icon).attr({width:30,height:30}),addClass:o.addClass,buttons:e.textAsIcon||!o.favOptions.allowMakeFavorite?void 0:[{el:r,handler:function(e){o.favOptions.isFavorite?(o.favOptions.removeFromFavorite(o),r.removeClass("quicked").attr("title",t(!1))):(o.favOptions.addToFavorite(o),r.addClass("quicked").attr("title",t(!0))),e.stopPropagation(),e.preventDefault()}}]})})},o.prototype.Button.prototype._defaultAction=function(){this.activate()},o.prototype.Button.prototype._startclick=function(){this._e.hasClass("active")?($(document).trigger("click"),this.action()):this._delay=setTimeout($.proxy(function(){this._delay=null,this.openSubmenu()},this),200)},o.prototype.Button.prototype._stopclick=function(){this._delay&&(clearTimeout(this._delay),this._delay=null,this.action())},o.prototype.Button.prototype._submenu=function(){if(this._e.hasClass("active"))return void $(document).trigger("click");this.openSubmenu()},o.prototype.Button.prototype.activate=function(t){t=void 0===t||!!t,this.activated=t,t?this._e.addClass("selected"):this._e.removeClass("selected"),this.textAsIcon||this._setIcon(this.icon)},o.prototype.Button.prototype.action=function(){var t=this.getCurrent();this._isToolGrayed(t)?d.emit("onGrayedObjectClicked",{type:"drawing",name:l[t.tool].localizedName}):t.action.call(this,t)},o.prototype.Button.prototype.openSubmenu=function(){this._e.trigger("button-popup",[this._getPopupMenuItems()])},o.prototype.Button.prototype.setCurrent=function(t){if(t>=0&&t<this.tools.length){var e=this.tools[t];this.setIcon(e.icon),this._isToolGrayed(e)?this._e.find(".main").addClass(" grayed"):this._e.find(".main").removeClass(" grayed"),this.isGroup&&!this.textAsIcon&&this._e.attr("title",e.localizedName),this.current=t}},o.prototype.Button.prototype.getCurrent=function(){return this.tools[this.current]},o.prototype.Button.prototype.setCurrentTool=function(t,e){var i,o=this;"LineToolIcon"===t?(i=String.fromCharCode(defaults("linetoolicon").icon),$.each(this.tools,function(t,e){if(e.icon===i)return o.setCurrent(t),o.activate(),!1})):$.each(this.tools,function(e,i){if(i.tool===t)return o.setCurrent(e),
@@ -665,18 +665,18 @@ o.change(function(){var t=!o.prop("checked");i.setValue(t?0:e.defval),t?n.attr("
i.__updateComboCurrency(d,u,"cash_per_contract",$.t(" per contract"))}))},o.prototype.prepareLayout=function(){this._$table=$(document.createElement("table")).addClass("property-page strategy-properties").attr("cellspacing","0").attr("cellpadding","2");var t=this._getStrategyInputs();t.initial_capital.min=1,this._setStdInput(t.initial_capital,$.t("Initial capital")),Array.isArray(t.currency.options)&&"NONE"===t.currency.options[0]&&(t.currency.options[0]=$('<option value="NONE">'+$.t("Default")+"</option>")),this._setStdInput(t.currency,$.t("Base currency")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setPyramidingInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setQtyInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setStdInput(t.calc_on_order_fills,$.t("Recalculate After Order filled")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setStdInput(t.calc_on_every_tick,$.t("Recalculate On Every Tick")),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setFillLimitsInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setSlippageInputs(t),$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table),this._setCommissionInputs(t),this.loadData()},o.prototype.widget=function(){return this._$table},o.prototype.loadData=function(){var t,e,i;s.prototype.loadData.call(this),t=this._getStrategyInputs(),e=t.pyramiding,i=this._property.inputs[e.id],i.setValue(i.value(),!0)},o.prototype.destroy=function(){var t,e,i;s.prototype.destroy.call(this),t=this._getStrategyInputs(),e=t.pyramiding,i=this._property.inputs[e.id],i.unsubscribe(null,this._onAllowUpToChanged)},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e){d.invalidateStudyTemplatesList(),d.removeStudyTemplate(t,e)}function n(t){this._options=t||{},this._chartWidgetCollection=this._options.chartWidgetCollection,this._SAVE_AS_TITLE=$.t("Save Indicator Template As..."),this._list=[],this._$wrapper=null,this._favoredList=null,this._loaded=!1,this._onFirstLoad=new e,this.onFavoriteListResize=new e,loginStateChange.subscribe(this,this.onLoginStateChange)}var s=i(367).FavoredList,r=i(139),a=r.SaveRenameDialog,l=r.CheckboxField,h=r.AutocompleteField,c=i(93).createConfirmDialog,d=i(116),p=i(33).trackEvent;n.prototype.onLoginStateChange=function(){d.invalidateStudyTemplatesList(),this.refreshFavoriteDropdownMenu()},n.prototype.appendMenuButtonTo=function(t){t&&(this._$wrapper=t,this._generateFavoriteList())},n.prototype.refreshStudyTemplateList=function(t){var e=this;d.getStudyTemplatesList(function(i){e._list=i||[],"function"==typeof t&&t()})},n.prototype._generateFavoriteList=function(){var t=this;this._favoredList=new s("StudyTemplates",t._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,svg:!1,popupSpacing:this._options.popupSpacing,
notShowQuicks:this._options.notShowQuicks,tooltip:$.t("Study Templates"),addTooltipClass:"apply-common-tooltip"}),t.refreshFavoriteDropdownMenu(),this._favoredList.element().appendTo(this._$wrapper),this._favoredList.onSelect().subscribe(t,function(t){t!==this._SAVE_AS_TITLE&&this.applyStudyTemplate(t)}),this._favoredList.onSelect().subscribe(t,function(t){t===this._SAVE_AS_TITLE&&this.showSaveAsDialog()}),this._favoredList.onResize().subscribe(t._chartWidgetCollection,t._chartWidgetCollection.updateLayout),this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire),this._favoredList.onOpen().subscribe(t,function(){t.refreshFavoriteDropdownMenu()})},n.prototype._listPreparedForFavorite=function(t){var e,o,n,s,r;return t=t||this._list,e=this,o=this.plainList("default"),n=this.plainList("custom"),s=[{id:e._SAVE_AS_TITLE,title:e._SAVE_AS_TITLE,addClass:"special",toQuickButtonStyle:{display:"none"}},{separator:!0}],r=function(t,o){return $.map(t,function(t){var n={id:t,title:$.t(t),svg:$(i(165)).attr({width:13,height:13}),favoriteButton:{icon:{},title:t,addClass:"apply-common-tooltip"}};return o&&(n.drop=function(){this.deleteStudyTemplate(t)}.bind(e)),n})},n.length&&(s=s.concat(r(n,!0)).concat([{separator:!0}])),s=s.concat(r(o))},n.prototype.applyStudyTemplate=function(t){function e(e){p("GUI","Load Study Template"),i.model().model().restoreStudyTemplate(JSON.parse(e.content),t),i.updateSeriesControlUI()}var i=this._chartWidgetCollection.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",t),d.getStudyTemplateContent(t,e)},n.prototype.showSaveAsDialog=function(){var t=this,e=this._chartWidgetCollection.activeChartWidget.value(),i=function(i,o){var n,s,r,a,l,h;i=TradingView.clean(i),n=JSON.stringify(e.model().model().studyTemplate(o)),s={name:i,content:n},r=t.plainList().includes(i),a=function(){var e=function(e){e.error||(TVSettings.setValue("defaultStudyTemplate",i),d.invalidateStudyTemplatesList(),t.refreshFavoriteDropdownMenu())};d.saveStudyTemplate(s,e)},r?(l=$.t("Study Template '{0}' already exists. Do you really want to replace it?").format(i),h=c({type:"modal",content:l}),h.on("action:yes",function(t){a(),t.close()}),h.open()):a()};runOrSignIn(function(){var o="text",n="bool";t.refreshStudyTemplateList(function(){new a({fields:[new h({name:o,label:$.t("Template name")+":",error:$.t("Please enter template name"),source:t.list(),valueField:"name",textField:"name",maxLength:64}),new l({name:n,label:$.t("Save Interval"),hint:$.t('When selecting this checkbox the study template will set "__interval__" interval on a chart',{interval:e.model().model().mainSeries().interval()})})],title:$.t("Save Indicator Template As")}).show().then(function(t){i(t[o],t[n])})})},{source:"Study templates save as",sourceMeta:"Chart"})},n.prototype.refreshFavoriteDropdownMenu=function(){var t=this,e=this._favoredList;e&&t.refreshStudyTemplateList(function(){e.reload(t._listPreparedForFavorite()),e.element().hasClass("active")&&(e.element().trigger("click"),e.openMenu())})},
n.prototype.deleteStudyTemplate=function(t){var e=this,i=$.t("Do you really want to delete Study Template '{0}' ?").format(t);runOrSignIn(function(){var n=c({type:"modal",content:i});n.on("action:yes",function(i){e._favoredList.removeById(t),i.actionLoader("yes","start"),o(t,function(){setTimeout(function(){e.refreshFavoriteDropdownMenu(),i.actionLoader("yes","stop"),i.close()},0)})}),n.open()},{source:"Study templates delete"})},n.prototype.container=function(){return this._favoredList?this._favoredList.element():null},n.prototype.list=function(){return this._list},n.prototype.plainList=function(t){return"default"===t?$.map(jQuery.grep(this._list,function(t){return!!t.is_default}),function(t){return t.name}):"custom"===t?$.map(jQuery.grep(this._list,function(t){return!t.is_default}),function(t){return t.name}):$.map(this._list,function(t){return t.name})},t.exports=n}).call(e,i(15))},function(t,e,i){(function(e,o,n){"use strict";function s(t,i){function o(t,o,s){var r,a,l,h,c,d,p,u,_,f,m,g=[];if(s.openEveryDay)g=[0,1,2,3,4,5,6];else if(s.openOnDays)for(r=s.openOnDays,a=0;a<r.length;a++)g.push(parseInt(r[a])-1);else g=[1,2,3,4,5];for(l=function(t){return 60*parseInt(t[0],10)+parseInt(t[1],10)},h=l(t),c=l(o),d=h&&h>=c,d&&0!==g[0]&&g.unshift(0),p="",u=[],_=g[0]-1,f=g.length,a=0;a<f;a++)_+1<g[a]||a+1===f?(p+=n+e.weekdaysMin(g[a]),u.push(p),p=""):p||(p=e.weekdaysMin(g[a])),_=g[a];return m="{0}:{1}{2}{3}:{4}".format(t[0],t[1],n,o[0],o[1]),u.map(function(t){return t+i+m})}var n,s,r,a,l;return i=i||" ",n="-",t?"24x7"===t?o(["00","00"],["00","00"],{openEveryDay:!0}):(s=/([0-2]\d)([0-5]\d)-([0-2]\d)([0-5]\d)(?:\:(\d+))?/,(r=s.exec(t))?(a=[r[1],r[2]],l=[r[3],r[4]],o(a,l,{openOnDays:r[5]})):{}):{}}function r(t,e){var i,r,d,p,u,_,f,m,g,v,y,b,w,S,T;if(null==t&&(t=a.symbol.value()),null!=t)return t+="",i=e&&e.symbolInfo,r=$.t("Symbol Info"),d=TVDialogs.createDialog(r,{width:450}),p=d.find("._tv-dialog-content"),u=$(document.createElement("div")).addClass("main").addClass("symbol-info-dialog").appendTo(p),_=function(t){var e,i=l;for(e=0;e<i.length;e++)if(i[e].id===t)return i[e].title;return t},f=function(t){return s(t).join("<br/>")},m=[{title:$.t("Symbol Name"),propName:o.enabled("charting_library_base")?"name":"pro_name"},{title:$.t("Symbol Description"),propName:"description"},{title:$.t("Symbol Type"),propName:"type"},{title:$.t("Point Value"),propName:"pointvalue"},{title:$.t("Exchange"),propName:"exchange"},{title:$.t("Listed Exchange"),propName:"listed_exchange"},{title:$.t("Currency"),propName:"currency_code",formatter:function(t){return t||"USD"},defValue:"USD"},{title:$.t("Price Scale"),propName:"pricescale"},{title:$.t("Min Move"),propName:"minmov"},{title:$.t("Min Move 2"),propName:"minmove2"},{title:$.t("Sector"),propName:"sector"},{title:$.t("Industry"),propName:"industry"},{title:$.t("Timezone"),propName:"timezone",formatter:_,optional:!0},{title:$.t("Session"),propName:"session",formatter:f,optional:!0,setHtml:!0}],
g='<table cellspacing=0>{{#fields}}<tr{{#optional}} class="js-optional"{{/optional}}><td class="symbol-info-column"><span class="js-symbol-info-title symbol-info-text">{{title}}</span></td><td class="symbol-info-value"><span class="js-symbol-info-value symbol-info-text">{{#defValue}}{{defValue}}{{/defValue}}{{^defValue}}-{{/defValue}}</span></td></tr>{{/fields}}</table>',v=$(n.render(g,{fields:m})).appendTo(u),v.find(".js-symbol-info-title").each(function(t,e){m[t].$title=$(e)}),v.find(".js-symbol-info-value").each(function(t,e){m[t].$element=$(e)}),y=function(t){return t||"-"},b=0,w=function(t){var e,i,o,n;for(e=0;e<m.length;e++)(i=m[e].propName)in t&&(o=t[i],"minmove2"===i&&t.minmove2>0&&!t.fractional&&t.pricescale?(o=new h(t.pricescale/o).format(o/t.pricescale),m[e].$title.text($.t("Pip Size"))):o=(m[e].formatter||y)(o),m[e].setHtml?m[e].$element.html(o):m[e].$element.text(o),m.splice(e,1),e--);(n=t.type&&"economic"===t.type||t.listed_exchange&&["QUANDL","BSE_EOD","NSE_EOD","LSE_EOD"].indexOf(t.listed_exchange)>=0)&&v.find(".js-optional").remove()},i&&w(i),b<m.length&&window.quoteSessionMultiplexerInstance&&(S="symbolinfodialog."+c.guid(),quoteSessionMultiplexerInstance.full.subscribe(S,t,function(e,i){w(i.values),quoteSessionMultiplexerInstance.full.unsubscribe(S,t)})),T=$(document.createElement("div")).addClass("dialog-buttons").appendTo(u),$(document.createElement("a")).addClass("_tv-button").addClass("cancel").text($.t("Close",{context:"input"})).appendTo(T).click(function(){TVDialogs.destroy(d.data("title"))}),TVDialogs.positionDialog(d),TVDialogs.applyHandlers(d),d}var a=i(72),l=i(161).availableTimezones,h=i(27).PriceFormatter,c=i(60);t.exports=r}).call(e,i(39),i(3),i(30))},function(t,e,i){"use strict";var o=i(3);t.exports.displayedExchangesFilter=function(t){return o.enabled("symbol_search_limited_exchanges")&&(t=t.filter(function(t){return!("bitcoin"===t.flag||t.hideInSymbolSearch)})),t},t.exports.sortExchangesListByFlagIfNeeded=function(t){return t}},function(t,e,i){(function(e){"use strict";function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._disableContextMenu=!!e,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=_(this.jqLhsStub,new f(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),
g='<table cellspacing=0>{{#fields}}<tr{{#optional}} class="js-optional"{{/optional}}><td class="symbol-info-column"><span class="js-symbol-info-title symbol-info-text">{{title}}</span></td><td class="symbol-info-value"><span class="js-symbol-info-value symbol-info-text">{{#defValue}}{{defValue}}{{/defValue}}{{^defValue}}-{{/defValue}}</span></td></tr>{{/fields}}</table>',v=$(n.render(g,{fields:m})).appendTo(u),v.find(".js-symbol-info-title").each(function(t,e){m[t].$title=$(e)}),v.find(".js-symbol-info-value").each(function(t,e){m[t].$element=$(e)}),y=function(t){return t||"-"},b=0,w=function(t){var e,i,o,n;for(e=0;e<m.length;e++)(i=m[e].propName)in t&&(o=t[i],"minmove2"===i&&t.minmove2>0&&!t.fractional&&t.pricescale?(o=new h(t.pricescale/o).format(o/t.pricescale),m[e].$title.text($.t("Pip Size"))):o=(m[e].formatter||y)(o),m[e].setHtml?m[e].$element.html(o):m[e].$element.text(o),m.splice(e,1),e--);(n=t.type&&"economic"===t.type||t.listed_exchange&&["QUANDL","BSE_EOD","NSE_EOD","LSE_EOD"].indexOf(t.listed_exchange)>=0)&&v.find(".js-optional").remove()},i&&w(i),b<m.length&&window.quoteSessionMultiplexerInstance&&(S="symbolinfodialog."+c.guid(),quoteSessionMultiplexerInstance.full.subscribe(S,t,function(e,i){w(i.values),quoteSessionMultiplexerInstance.full.unsubscribe(S,t)})),T=$(document.createElement("div")).addClass("dialog-buttons").appendTo(u),$(document.createElement("a")).addClass("_tv-button").addClass("cancel").text($.t("Close",{context:"input"})).appendTo(T).click(function(){TVDialogs.destroy(d.data("title"))}),TVDialogs.positionDialog(d),TVDialogs.applyHandlers(d),d}var a=i(72),l=i(161).availableTimezones,h=i(27).PriceFormatter,c=i(60);t.exports=r}).call(e,i(40),i(3),i(30))},function(t,e,i){"use strict";var o=i(3);t.exports.displayedExchangesFilter=function(t){return o.enabled("symbol_search_limited_exchanges")&&(t=t.filter(function(t){return!("bitcoin"===t.flag||t.hideInSymbolSearch)})),t},t.exports.sortExchangesListByFlagIfNeeded=function(t){return t}},function(t,e,i){(function(e){"use strict";function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._disableContextMenu=!!e,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=_(this.jqLhsStub,new f(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),
this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=_(this._dv,new f(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=_(this._dv,new f(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=_(this.jqRhsStub,new f(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=y.MINUTE_SPAN,m(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y;i(495),n=i(194),s=i(1).LineDataSource,r=i(159),a=i(47),l=a.ActionSeparator,h=i(101),c=i(21),d=i(120),p=d.resizeCanvas,u=d.clearRect,_=d.addCanvasTo,f=d.Size,m=i(106).setMouseEventHandler,g=i(33).trackEvent,v=i(163).makeFont,y=i(221),o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return v(this.fontSize(),"Arial","")},o.prototype.baseBoldFont=function(){return v(this.fontSize(),"Arial","bold")},o.prototype.rendererOptions=function(){var t,e;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new r}),t=this._rendererOptions,t.fontSize!==this.fontSize()&&(e=this.fontSize(),t.fontSize=e,t.font=this.baseFont(),t.paddingTop=Math.ceil(Math.max(e/4.5-t.tickLength/2,0)),t.paddingBottom=Math.ceil(e/4.5),t.paddingHorizontal=Math.ceil(e/3),t.baselineOffset=Math.round(this.fontSize()/10),t.widthCache.reset()),this._rendererOptions},o.prototype.updatePriceScalesVisibility=function(){var t=this.chart.properties().scalesProperties;t.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),t.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},
o.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},o.prototype.mouseDownOutsideEvent=function(t){var e=this.chart.model();!e.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o=this.chart.model();o.timeScale().isEmpty()||(e=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(e=!0),e||(o.scaleTimeTo(t.localX),this._lastScrollScaleTime=i))},o.prototype.mouseUpEvent=function(t){this._mousedown=!1;var e=this.chart.model();e.timeScale().isEmpty()||(e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions())},o.prototype.getContextMenuActions=function(){var t,i,o=this.chart;return o.model().mainSeries().createSessStudy(),o.updateActions(),t=o.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],e.enabled("timezone_menu")||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){g("GUI","Double click time scale"),this.chart.model().resetTimeScale()},o.prototype.optimalHeight=function(){var t=this.rendererOptions();return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.fontSize+t.paddingTop+t.paddingBottom)},o.prototype.setSize=function(t,e,i){this.size&&this.size.equals(t)||(this.lhsStubSize=e,p(this.lhsCanvas,e),this.jqLhsTimeAxisStub.width(e.w),this.jqLhsTimeAxisStub.height(e.h),this.rhsStubSize=i,p(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=t,p(this.canvas,t),p(this.top_canvas,t),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(t.w),this.jqCell.height(t.h))},o.prototype._spanIndex=function(t){for(var e=[y.MINUTE_SPAN,y.HOUR_SPAN,y.DAY_SPAN,y.MONTH_SPAN,y.YEAR_SPAN],i=e.length-1;i>0;){if(e[i]<=t)return i;i--}return i},o.prototype._spanOffset=function(t,e){if(e<t)throw Error("actual span cuold not be less then base");return this._spanIndex(e)-this._spanIndex(t)},o.prototype.update=function(){var t,e;this.chart.model()&&(t=this.chart.model().timeScale().marks())&&(e=this,this._minVisibleSpan=y.YEAR_SPAN,$.each(t,function(){e._minVisibleSpan=Math.min(this.span,e._minVisibleSpan)}))},o.prototype._hightlightBackground=function(t,e){var i,o,n,s,r=this.chart.model(),a=r.timeScale(),l=e[0].index,h=e[0].index;for(i=1;i<e.length;i++)l=Math.min(l,e[i].index),
h=Math.max(h,e[i].index);o=a.indexToCoordinate(l),n=a.indexToCoordinate(h),s="rgba(109, 158, 235, 0.3)",u(t,o,1,n-o,this.size.h-1,s)},o.prototype.drawBackground=function(t){var e,i,o,n,r;if(u(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.chart.model()){if(i=e.timeScale(),(o=e.model().selectedSource())&&o instanceof s&&!i.isEmpty()){if(n=o.axisPoints(),0===n.length)return;this._hightlightBackground(t,n)}r=e.model().crossHairSource(),r.startMeasurePoint()&&this._hightlightBackground(t,r.measurePoints())}},o.prototype.drawBorder=function(t){t.save(),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),t.restore()},o.prototype.drawStubs=function(){var t,e=this._BORDER_SIZE,i=2*this._BORDER_SIZE,o=this.lhsCtx;u(o,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),o.fillStyle=this.lineColor(),o.fillRect(this.lhsStubSize.w-i-.5,.5,i,e),o.fillRect(this.lhsStubSize.w-i-.5,-.5,e,e),t=this.rhsCtx,u(t,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,i,e),t.fillRect(.5,-.5,e,e)},o.prototype.drawTickMarks=function(t){var e,i,o,n,s,r,a,l,h,c,d,p=this.chart.model().timeScale().marks();if(p&&0!==p.length){for(e=p.reduce(function(t,e){return t.span>e.span?t:e},p[0]).span,e>30&&e<40&&(e=30),t.save(),t.strokeStyle=this.lineColor(),i=this.rendererOptions(),o=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,t.textAlign="center",t.translate(.5,.5),t.fillStyle=this.lineColor(),t.beginPath(),n=p.length;n--;)t.rect(p[n].coord,i.borderSize,1,i.tickLength);for(t.fill(),t.fillStyle=this.textColor(),s={},r=this.baseFont(),a=this.baseBoldFont(),n=0;n<p.length;n++)l=p[n].span>=e?a:r,h=s[l]||[],h.push(p[n]),s[l]=h;for(c in s)for(t.setFont(c),d=s[c],n=0;n<d.length;n++)t.fillText(d[n].label,d[n].coord,o);t.restore()}},o.prototype.drawBackLabels=function(t){var e,i,o,n,s,r,a,l;for(t.save(),e=this.chart.model().dataSources(),i=this.chart.model(),o=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),n=this.rendererOptions(),s=0;s<e.length;s++)if((r=e[s])!==this.chart.model().crossHairSource()&&r!==o&&r.timeAxisViews&&(a=r.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(t,n);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,s;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),e=this.chart.model(),i=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated(),o=this.rendererOptions(),i){if(t.save(),i.timeAxisViews&&(n=i.timeAxisViews()))for(s=0;s<n.length;s++)n[s].renderer().draw(t,o);return void t.restore()}if(t.save(),n=this.chart.model().crossHairSource().timeAxisView())for(s=0;s<n.length;s++)n[s].renderer().draw(t,o);t.restore()},o.prototype.paint=function(t){if(0!==t)if(t===c.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var e=this.ctx;this.drawBackground(e),this.drawBorder(e),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(e),this.drawBackLabels(e),this.drawCrossHairLabel(this.top_ctx))}},o.prototype.setStubVisible=function(t,e){
var i=n.isLeft(t)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;e?i.css("display","table-cell"):i.css("display","none")},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ew-resize"!==t||(e="time-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t.lhsStub={},t.lhsStub.content=this.lhsCanvas.toDataURL(),t.lhsStub.contentWidth=this.lhsStubSize.w,t.lhsStub.contentHeight=this.lhsStubSize.h,t.rhsStub={},t.rhsStub.content=this.rhsCanvas.toDataURL(),t.rhsStub.contentWidth=this.rhsStubSize.w,t.rhsStub.contentHeight=this.rhsStubSize.h,t},t.exports=o}).call(e,i(3))},function(t,e,i){"use strict";function o(t,e,i,o){this._chartWidgetCollection=t,this._chartSaverInstance=e,this._chartApiInstance=i,this._saveLoad=o,this._fakeListChangedDelegate=null}var n,s=i(72),r=i(597),a=i(218).layouts,l=i(34),h=i(101),c=i(223).closeAllDialogs,d=i(41),p=i(291),u=i(116),_=i(12),f=i(138).createNoticeDialog,m=i(93).createConfirmDialog;o.prototype.subscribe=function(t,e){l.subscribe(t,e)},o.prototype.unsubscribe=function(t,e){l.unsubscribe(t,e)},o.prototype.onContextMenu=function(t){l.subscribe("onContextMenu",function(e){e.callback(t(e.unixtime,e.price))})},o.prototype.onGrayedObjectClicked=function(t){l.subscribe("onGrayedObjectClicked",t)},o.prototype.activeChart=function(){return new r(this._chartWidgetCollection.activeChartWidget.value())},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(t,e,i){s.interval.setValue(e),s.symbol.setValue(t),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(t){this._chartWidgetCollection.layout.setValue(t)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(t){if(void 0===t&&(t=0),t<0||t>this.chartsCount())throw Error("Incorrect index: "+t);return new r(this._chartWidgetCollection.getAll()[t])},o.prototype.getSymbolInterval=function(t){var e={symbol:s.symbol.value(),interval:s.interval.value()};return t&&t(e),e},o.prototype.getVisibleRange=function(t){var e=this.activeChart().getVisibleRange();return t&&t(e),e},o.prototype.saveChart=function(t){var e=this;this._chartSaverInstance.whenReadyToSave(function(){var i=e._chartSaverInstance.saveToJSON();return t&&t(JSON.parse(i.content))})},o.prototype.loadChart=function(t){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(t.json),this._chartWidgetCollection.purgeUnusedWidgets(),t.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),
var i=n.isLeft(t)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;e?i.css("display","table-cell"):i.css("display","none")},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ew-resize"!==t||(e="time-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t.lhsStub={},t.lhsStub.content=this.lhsCanvas.toDataURL(),t.lhsStub.contentWidth=this.lhsStubSize.w,t.lhsStub.contentHeight=this.lhsStubSize.h,t.rhsStub={},t.rhsStub.content=this.rhsCanvas.toDataURL(),t.rhsStub.contentWidth=this.rhsStubSize.w,t.rhsStub.contentHeight=this.rhsStubSize.h,t},t.exports=o}).call(e,i(3))},function(t,e,i){"use strict";function o(t,e,i,o){this._chartWidgetCollection=t,this._chartSaverInstance=e,this._chartApiInstance=i,this._saveLoad=o,this._fakeListChangedDelegate=null}var n,s=i(72),r=i(597),a=i(218).layouts,l=i(34),h=i(101),c=i(223).closeAllDialogs,d=i(42),p=i(291),u=i(116),_=i(12),f=i(138).createNoticeDialog,m=i(93).createConfirmDialog;o.prototype.subscribe=function(t,e){l.subscribe(t,e)},o.prototype.unsubscribe=function(t,e){l.unsubscribe(t,e)},o.prototype.onContextMenu=function(t){l.subscribe("onContextMenu",function(e){e.callback(t(e.unixtime,e.price))})},o.prototype.onGrayedObjectClicked=function(t){l.subscribe("onGrayedObjectClicked",t)},o.prototype.activeChart=function(){return new r(this._chartWidgetCollection.activeChartWidget.value())},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(t,e,i){s.interval.setValue(e),s.symbol.setValue(t),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(t){this._chartWidgetCollection.layout.setValue(t)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(t){if(void 0===t&&(t=0),t<0||t>this.chartsCount())throw Error("Incorrect index: "+t);return new r(this._chartWidgetCollection.getAll()[t])},o.prototype.getSymbolInterval=function(t){var e={symbol:s.symbol.value(),interval:s.interval.value()};return t&&t(e),e},o.prototype.getVisibleRange=function(t){var e=this.activeChart().getVisibleRange();return t&&t(e),e},o.prototype.saveChart=function(t){var e=this;this._chartSaverInstance.whenReadyToSave(function(){var i=e._chartSaverInstance.saveToJSON();return t&&t(JSON.parse(i.content))})},o.prototype.loadChart=function(t){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(t.json),this._chartWidgetCollection.purgeUnusedWidgets(),t.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),
this._chartWidgetCollection.metaInfo.uid.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(t.extendedData.name)),s.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(t){return!t.is_hidden_study}).map(function(t){return t.name||t.description})},o.prototype.getSavedCharts=function(t){u.getCharts(t)},o.prototype.loadChartFromServer=function(t){u.loadChart(t)},o.prototype.saveChartToServer=function(t,e,i,o){this._chartSaverInstance.saveChartSilently(t,i,e,o)},o.prototype.removeChartFromServer=function(t,e){u.removeChart(t,e)},o.prototype.getIntervals=function(){return p.sortIntervals(p.getIntervals())},o.prototype.closePopupsAndDialogs=function(){document.querySelectorAll("._tv-dialog-title-close").forEach(function(t){t.click()}),c(),h.hideAll()},n={cursor:"",dot:"",arrow_cursor:"arrow",eraser:"",measure:"",zoom:"",brush:"LineToolBrush"},o.prototype.selectLineTool=function(t){var e=i(189);if(e[t])t=e[t].name;else{if(!n.hasOwnProperty(t))return;t=n[t]||t}d.tool.value()!==t&&(TradingView.supportTouch()&&this._chartWidgetCollection.selectedSource.value()&&this._chartWidgetCollection.activeChartWidget.value().model().lineBeingCreated()&&this._chartWidgetCollection.activeChartWidget.value().model().cancelCreatingLine(),d.tool.setValue(t))},o.prototype.selectedLineTool=function(){var t,e,o,s=i(189),r=Object.keys(s),a=d.tool.value();for(t=0;t<r.length;++t)if(s[r[t]].name===a)return r[t];for(r=Object.keys(n),t=0;t<r.length;++t){if(e=r[t],(o=n[e])&&o===a)return r[t];if(e===a)return e}return""},o.prototype.createStudyTemplate=function(t,e){var i=this.activeChart().createStudyTemplate(t);return e&&e(i),i},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(t){function e(){i&&(i(),i=null)}var i,o;t=t||{},i=t.callback,o=f({title:t.title,content:t.body||""}),o.on("action:ok",e),o.on("afterClose",e),o.open()},o.prototype.showConfirmDialog=function(t){function e(t){i&&(i(t),i=null)}var i,o;if(t=t||{},!t.callback)throw Error("callback must be exist");i=t.callback,o=m({title:t.title,content:t.body||""}),o.on("action:yes",e.bind(null,!0)),o.on("action:no",e.bind(null,!1)),o.on("afterClose",e.bind(null,!1)),o.open()},o.prototype.logs=function(){return{getLogHistory:_.getLogHistory,enable:_.loggingOn,disable:_.loggingOff}},o.prototype.showLoadChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrLoadChart()},o.prototype.showSaveAsChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrSaveAs()},t.exports=o},function(t,e,i){"use strict";function o(){this._$wrap=$(document.createElement("span")),this._undo=$('<span class="button undo disabled"></span>').append($(i(899))).attr("title","").appendTo(this._$wrap),this._redo=$('<span class="button redo disabled"></span>').append($(i(890))).attr("title","").appendTo(this._$wrap);var t=this
;this._undo.click(function(){t.undo()}),this._redo.click(function(){t.redo()}),n.undoStack().onChange().subscribe(this,this.update),n.redoStack().onChange().subscribe(this,this.update)}var n=i(53).UndoHistory,s=i(33).trackEvent,r=i(125).updateTooltipText;o.prototype.update=function(){var t=n.undoStack(),e=n.redoStack();t.isEmpty()?(this._undo.addClass("disabled"),this._undo.removeClass("apply-common-tooltip"),this._undo.attr("title",null)):(this._undo.removeClass("disabled"),this._undo.addClass("apply-common-tooltip"),this._undo.attr("title",$.t("Undo {0}").format(t.head().text()||"")+"\nCtrl+Z"),r(this._undo)),e.isEmpty()?(this._redo.addClass("disabled"),this._redo.removeClass("apply-common-tooltip"),this._redo.attr("title",null)):(this._redo.removeClass("disabled"),this._redo.addClass("apply-common-tooltip"),this._redo.attr("title",$.t("Redo {0}").format(e.head().text()||"")+"\nCtrl+Y"),r(this._redo))},o.prototype.undo=function(){this._undo.hasClass("disabled")||(s("GUI","Undo"),n.undo())},o.prototype.redo=function(){this._redo.hasClass("disabled")||(s("GUI","Redo"),n.redo())},o.prototype.element=function(){return this._$wrap},o.prototype.undoElement=function(){return this._undo},o.prototype.redoElement=function(){return this._redo},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){s.call(this,t,e),this._study=i,this.prepareLayout()}var n=i(5),s=n.PropertyPage,r=n.BooleanBinder,a=n.SimpleComboBinder,l=n.SliderBinder,h=n.ColorBinding,c=i(13).createLineWidthEditor,d=i(369).createPlotEditor;inherit(o,s),o.prototype.prepareLayout=function(){var t,e,o,n,s,p,u,_,f,m,g,v,y=this._study.properties();this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=this.addLabeledRow(this._table,"Volume"),e=d(),$("<td>").append(e).appendTo(t),this.bindControl(new a(e,y.styles.vol.plottype,parseInt,!0,this.model(),"Change Volume Plot Style")),o=this._study.metaInfo().version<=46&&"transparency"in y?y.transparency:y.styles.vol.transparency,n=this.createColorPicker(),$("<td>").append(n).appendTo(t),this.bindControl(new h(n,y.palettes.volumePalette.colors[0].color,!0,this.model(),"Change Up Volume color",o)),s=this.createColorPicker(),$("<td>").append(s).appendTo(t),this.bindControl(new h(s,y.palettes.volumePalette.colors[1].color,!0,this.model(),"Change Down Volume color",o)),p=$("<input type='checkbox'>"),$("<td>").appendTo(t),$("<td>").append(p).appendTo(t),$("<td>"+$.t("Price Line")+"</td>").appendTo(t),this.bindControl(new r(p,y.styles.vol.trackPrice,!0,this.model(),"Change Price Line")),u=y.styles.vol_ma,_=this.addLabeledRow(this._table,"Volume MA"),f=d(),$("<td>").append(f).appendTo(_),this.bindControl(new a(f,u.plottype,parseInt,!0,this.model(),"Change Volume MA Plot Style")),$("<td>").html("&nbsp;").appendTo(_),m=this.createColorPicker(),$("<td>").append(m).appendTo(_),this.bindControl(new h(m,u.color,!0,this.model(),"Change Volume MA color",u.transparency)),g=c(),$("<td>").append(g).appendTo(_),this.bindControl(new l(g,u.linewidth,!0,this.model(),"Change Volume MA Line Width")),
p=$("<input type='checkbox'>"),$("<td>").append(p).appendTo(_),$("<td>"+$.t("Price Line")+"</td>").appendTo(_),this.bindControl(new r(p,u.trackPrice,!0,this.model(),"Change Price Line")),v=i(87).StudyStylesPropertyPage,v.prototype._putStudyDefaultStyles.call(this,this._table,8)},o.prototype.widget=function(){return this._table},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._source=t,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=t.model().timeScale().barSpacing.bind(t.model().timeScale()),this._invalidated=!0}function s(t){n.call(this,t)}function r(t,e,i){var o,s;if(n.call(this,t),this._isHlineFill=e.type===h.FilledArea.TYPE_HLINES,c(this._isHlineFill||e.type===h.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+e.type),this._isHlineFill&&this._initBandIndexes(e.objAId,e.objBId),this._fillMetaInfo=e,this._fillStyleProps=i,o=t._metaInfo,e.palette)for(s in o.plots)if(o.plots[s].palette===e.palette){this._colorPlotOffset=parseInt(s),this._colorsMap=o.palettes[e.palette].valToIndex,this._colorValues=t.properties().palettes[e.palette].colors;break}}var a=i(8),l=i(343),h=i(25),c=i(44).assert,d=i(14),p=i(2);o.prototype.hitTest=function(t){var e,i,o;for(o=1;o<this._data.points1.length;++o)if(e=this._data.points1[o],i=this._data.points2[o],this._data.timePoints[o]===t.x&&(t.y>=e&&t.y<=i||t.y<=e&&t.y>=i))return new a(a.REGULAR);return null},o.prototype.draw=function(t){var e,i,o,n,s,r,a,h,c,p,u,_,f,m,g,v,y,b,w=this._data.isHlineFill;if(w||0!==this._data.points1.length&&0!==this._data.points2.length){for(e=this._data.timePoints,i=this._data.points1,o=this._data.points2,n=this._data.colors,s=l.paneRendererCoordinateIsValid,r=isNumber(this._data.transparency)?this._data.transparency:50,r=Math.min(r,100),r=Math.max(r,0),a={},h=[],p=0;p<this._data.timePoints.length;p++)u={point1:w?this._data.level1:i[p],point2:w?this._data.level2:o[p],timePoint:e[p]},_=s(u.point1)&&s(u.point2),_&&(c=n&&n[p]?n[p]:this._data.backcolor,h.push(u)),(p===this._data.timePoints.length-1||n&&c!==n[p+1]||!_)&&(h.length>0&&(f=a[c]||[],f.push(h),a[c]=f),h=_?[u]:[]);for(m in a){for(g=a[m],t.beginPath(),v=0;v<g.length;v++){for(y=g[v],t.moveTo(y[0].timePoint,y[0].point1),b=1;b<y.length;b++)t.lineTo(y[b].timePoint,y[b].point1);for(b=y.length-1;b>=0;b--)t.lineTo(y[b].timePoint,y[b].point2)}t.closePath(),t.fillStyle=d.generateColor(m,r),t.fill()}}},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L;if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()&&(t=this._source.priceScale(),e=this._source._model.timeScale(),t&&!t.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!this._source._series.bars().isEmpty()&&(this._isHlineFill&&(i=this._source.properties().bands[this._bandAKey],o=this._source.properties().bands[this._bandBKey],this._level1=t.priceToCoordinate(i.value.value()),this._level2=t.priceToCoordinate(o.value.value())),
n=this._source.data()._columns.indexOf(this._plotAId())+1,s=this._source.data()._columns.indexOf(this._plotBId())+1,r=this._source._model.timeScale().visibleBars(),!r.isEmpty()))){if(a=this._source._series.nearestIndex(r.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),l=this._source._series.nearestIndex(r.lastBar(),TradingView.SEARCH_NEAREST_LEFT),h=this._source.data().range(a,l),this._source.data()._items.length>0)for(c=this._source.firstValue(),d=h._start,p=h._end,u=this._source.offset(this._plotAId()),_=this._source.offset(this._plotBId()),f=Math.max(u,_),m=Math.min(u,_),g=d+f,v=0,d>v&&(g=d<f?f:d),y=p+m,b=h._items.length,p>b+m&&p<b&&(y=b+m),m<0&&p<=b+m&&(y=p),w=h._indexAt(d),g<d?w+=f:g>p?w+=f:w=h._indexAt(g),S=g;S<y;++S)this._timePoints.push(e.indexToCoordinate(w++)),this._colors&&null!=(T=h._valueAt(S-m)[this._colorPlotOffset+1])&&this._colors.push(this._colorValues[this._colorsMap[T]].color.value()),this._isHlineFill||(C=h._valueAt(S-u),x=h._valueAt(S-_),P=C[n],L=x[s],t.properties().percentage.value()&&(P=100*(P-c)/c,L=100*(L-c)/c),this._points1.push(P),this._points2.push(L));t.pricesArrayToCoordinates(this._points1),t.pricesArrayToCoordinates(this._points2)}},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={};return t.points1=this._points1,t.points2=this._points2,t.timePoints=this._timePoints,t.getBarSpacing=this._getBarSpacing,t.backcolor=this._color(),t.transparency=this._transparency(),t.isHlineFill=this._isHlineFill,t.level1=this._level1,t.level2=this._level2,this._colors&&(t.colors=this._colors),new o(t)},n.prototype._plotAId=function(){c(!1,"Pure virtual call!")},n.prototype._plotBId=function(){c(!1,"Pure virtual call!")},n.prototype._color=function(){c(!1,"Pure virtual call!")},n.prototype._transparency=function(){c(!1,"Pure virtual call!")},n.prototype._visible=function(){c(!1,"Pure virtual call!")},inherit(s,n),s.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},s.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},s.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},s.prototype._transparency=function(){var t=this._source.properties().areaBackground.transparency.value();return p.clamp(t,0,100)},s.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(r,n),r.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},r.prototype._plotAId=function(){return this._fillMetaInfo.objAId},r.prototype._plotBId=function(){return this._fillMetaInfo.objBId},r.prototype._color=function(){return this._fillStyleProps.color.value()},r.prototype._transparency=function(){return this._fillStyleProps.transparency.value()},r.prototype._visible=function(){
return this._fillStyleProps.visible.value()},e.PlotFillPaneView=r,e.AreaBackgroundPaneView=s},function(t,e,i){"use strict";function o(t,e){this._source=e,this._properties=t,this._points=[new a.Point(-1,-1)],this._invalidated=!0}function n(t){this._data=t}function s(t){this._source=t,this._points=[]}function r(t,e,i){this._source=t,this._points=[],d(e.type===c.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+e.type),this._initBandIndexes(e.objAId,e.objBId),this._fillStyleProps=i}var a=i(2),l=i(89).HorzLineRenderer,h=i(8),c=i(25),d=i(44).assert,p=i(14);a=i(2),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e=this._source.priceScale();if(!e||e.isEmpty())return void(this._points[0]=new a.Point(-1,-1));t=this._properties.value.value(),isNumber(t)?this._points[0]=new a.Point(-1,e.priceToCoordinate(t)):this._points[0]=new a.Point(-1,NaN)},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.points=this._points,t.color=this._properties.color.value(),t.linewidth=this._properties.linewidth.value(),t.linestyle=this._properties.linestyle.value(),t.hitTestResult=h.REGULAR,new l(t)},n.prototype.draw=function(t){var e,i,o;0!==this._data.points.length&&(e=t.canvas.width,t.fillStyle=p.generateColor(this._data.backcolor,this._data.transparency),i=Math.min(this._data.points[0],this._data.points[1]),o=Math.max(this._data.points[0],this._data.points[1]),t.fillRect(0,i,e,o-i))},n.prototype.hitTest=function(t){return null},s.prototype.update=function(){var t,e,i,o;this._points=[],t=this._source.properties().bandsBackground,t.fillBackground.value()&&(e=this._source.properties().bands[0],i=this._source.properties().bands[1],(o=this._source.priceScale())&&!o.isEmpty()&&(this._points.push(o.priceToCoordinate(e.value.value())),this._points.push(o.priceToCoordinate(i.value.value()))))},s.prototype.renderer=function(){var t={};return t.points=this._points,t.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),t.transparency=this._source.properties().bandsBackground.transparency.value(),new n(t)},r.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},r.prototype.update=function(){var t,e,i;this._points=[],this._fillStyleProps.visible.value()&&(t=this._source.properties().bands[this._bandAKey],e=this._source.properties().bands[this._bandBKey],(i=this._source.priceScale())&&!i.isEmpty()&&(this._points.push(i.priceToCoordinate(t.value.value())),this._points.push(i.priceToCoordinate(e.value.value()))))},r.prototype.renderer=function(){var t,e=this._fillStyleProps.transparency.value();return e=a.clamp(e,0,100),t={},t.points=this._points,t.backcolor=p.generateColor(this._fillStyleProps.color.value(),e),t.transparency=this._fillStyleProps.transparency.value(),new n(t)},e.BandPaneView=o,e.BandBackgroundPaneView=s,
e.HlineFillPaneView=r},function(t,e,i){(function(e,o,n,s){"use strict";function r(t,i,s,a,l,h,c,d,p){var y,w,S,C;this._version=r.version,this._readOnly=a,this._undoModel=d,this._properties=s,this._isSnapshot=p,this.setStudiesMetaData(h,c),this.m_timeScale=new v(this),this.m_panes=[],this.m_gridSource=new m,this.m_crossHairSource=new u(this,O.properties()),this.m_width=0,this._tagsChanged=new e,this._lineCancelled=new e,this._magnet=new g(O.properties().magnet,this.m_timeScale,s.paneProperties.magnetSensivity),y=new V("chartproperties.mainSeriesProperties"),y.addExclusion("lockScale"),y.addExclusion("minTick"),y.addExclusion("priceAxisProperties.percentage"),y.addExclusion("priceAxisProperties.log"),this.createPane(void 0,!1,{rightAxisProperties:y.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*_.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new e,this._chartApi=t,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,r.prototype.propertyChangeHandler),w=this,this._properties.timezone.listeners().subscribe(null,function(){w._chartApi&&w._chartApi.connected()&&w._chartApi.switchTimezone(w.timezone())}),this._properties.timeScale.rightOffset.listeners().subscribe(null,function(){w.m_timeScale.setOffset(w._properties.timeScale.rightOffset.value()),w.recalculateAllPanes()}),y.merge(s.mainSeriesProperties.state()),this.m_mainSeries=new D(this,y,l),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this.m_mainSeries.onCompleted().subscribe(this,function(){w.clearCurrentPosition(),w._scrollingState&&w.gotoTime()}),a||(y.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),y.lockScale.listeners().subscribe(this,function(t){var e=t.value();e&&(y.priceAxisProperties.percentage.setValue(!1),y.priceAxisProperties.logDisabled.setValue(!1)),y.priceAxisProperties.percentageDisabled.setValue(e),y.priceAxisProperties.logDisabled.setValue(e)}),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(t){t.value()||w._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=[],this._syncPointCache={},o.enabled("charting_library_base")&&(S=new T(this),S.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(S),C=new b(this),C.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(C)),this.m_watermarkSource=new f(this.m_mainSeries),this._brandingSource=null,this.strategySources=[],this.strategySources.change=new e,this._activeStrategySource=new n(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",O.hideAllDrawings().subscribe(this,r.prototype.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,r.prototype.fullUpdate),this._id=N.guid(),this._studyInserted=new e,this._chartThemeLoaded=new e,this._resetScales=new e}
var a=i(36),l=a.parseRgb,h=a.rgbToBlackWhiteString,c=i(2),d=i(199),p=i(1).LineDataSource,u=i(678),_=i(209),f=i(710),m=i(686),g=i(695),v=i(707),y=i(210),b=i(709),w=i(102).BarsMarksContainer,S=i(533).Branding,T=i(708),C=i(21),x=i(31),P=x.Study,L=x.createStudy,k=x.prepareStudyProperties,I=i(80),A=i(157),E=i(78).StudyLineDataSource,M=i(81).ScaleType,D=i(42),O=i(41),V=i(7).DefaultProperty,B=i(356).SyncPoint,R=i(33).trackEvent,N=i(60),F=i(12).getLogger("Chart.ChartModel");r.prototype.setStudiesMetaData=function(t,e){this._studiesMetaData=t,this._studyVersioning=new I(this._studiesMetaData,e)},r.prototype.isSnapshot=function(){return this._isSnapshot},r.prototype.currentTool=function(){return this._currentTool},r.prototype.setCurrentTool=function(t){this._currentTool=t},r.prototype.timezone=function(){return this._properties.timezone.value()},r.prototype.version=function(){return this._version},r.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},r.prototype.dumpViews=function(){var t,e,i,o,n={};for(n.panes=[],t=0;t<this.m_panes.length;t++)n.panes.push(this.m_panes[t].dumpViews());for(n.dataWindow=[],e=this.dataSources(),t=0;t<e.length;t++)i=e[t],(o=i.dataWindowView())&&n.dataWindow.push(o.dump());return n},r.prototype._paneInvalidationMask=function(t,e){var i=new C,o=this.m_panes.indexOf(t);return void 0===e&&(e=C.LIGHT_UPDATE),i.invalidatePane(o,e),i},r.prototype.updatePane=function(t){var e=this._paneInvalidationMask(t);this.invalidate(e)},r.prototype.fullUpdate=function(){this.invalidate(new C(C.FULL_UPDATE))},r.prototype.updateSource=function(t){var e=this.paneForSource(t),i=this._paneInvalidationMask(e);this.invalidate(i)},r.prototype.studiesMetaData=function(){return this._studiesMetaData},r.prototype.studyVersioning=function(){return this._studyVersioning},r.prototype.disconnect=function(){var t,e,i=this.dataSources();for(e=0;e<i.length;e++)t=i[e],t.disconnect&&t.disconnect()},r.prototype.restart=function(){var t,e,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),t=this.dataSources(),e=0;e<t.length;e++)i=t[e],i.restart&&i!==this.m_mainSeries&&i.restart()},r.prototype.startNotStartedStudies=function(){var t,e;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(t=this.dataSources(),e=0;e<t.length;e++)t[e]instanceof P&&!t[e].isStarted()&&t[e].restart&&t[e]!==this.m_mainSeries&&t[e].restart()},r.prototype.updateLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,p)&&(e=i[t],e.tryCreateServerPoints(),e.checkAlert&&e.checkAlert())},r.prototype.realignLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,p)&&(e=i[t],e.calcIsActualSymbol());for(t=0;t<this.m_panes.length;t++)this.m_panes[t].invalidateSourcesCache()},r.prototype.readOnly=function(){return this._readOnly},r.prototype.properties=function(){return this._properties},r.prototype.lineCancelled=function(){return this._lineCancelled},
var a=i(37),l=a.parseRgb,h=a.rgbToBlackWhiteString,c=i(2),d=i(199),p=i(1).LineDataSource,u=i(678),_=i(209),f=i(710),m=i(686),g=i(695),v=i(707),y=i(210),b=i(709),w=i(102).BarsMarksContainer,S=i(533).Branding,T=i(708),C=i(21),x=i(31),P=x.Study,L=x.createStudy,k=x.prepareStudyProperties,I=i(80),A=i(157),E=i(78).StudyLineDataSource,M=i(81).ScaleType,D=i(43),O=i(42),V=i(7).DefaultProperty,B=i(356).SyncPoint,R=i(33).trackEvent,N=i(60),F=i(12).getLogger("Chart.ChartModel");r.prototype.setStudiesMetaData=function(t,e){this._studiesMetaData=t,this._studyVersioning=new I(this._studiesMetaData,e)},r.prototype.isSnapshot=function(){return this._isSnapshot},r.prototype.currentTool=function(){return this._currentTool},r.prototype.setCurrentTool=function(t){this._currentTool=t},r.prototype.timezone=function(){return this._properties.timezone.value()},r.prototype.version=function(){return this._version},r.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},r.prototype.dumpViews=function(){var t,e,i,o,n={};for(n.panes=[],t=0;t<this.m_panes.length;t++)n.panes.push(this.m_panes[t].dumpViews());for(n.dataWindow=[],e=this.dataSources(),t=0;t<e.length;t++)i=e[t],(o=i.dataWindowView())&&n.dataWindow.push(o.dump());return n},r.prototype._paneInvalidationMask=function(t,e){var i=new C,o=this.m_panes.indexOf(t);return void 0===e&&(e=C.LIGHT_UPDATE),i.invalidatePane(o,e),i},r.prototype.updatePane=function(t){var e=this._paneInvalidationMask(t);this.invalidate(e)},r.prototype.fullUpdate=function(){this.invalidate(new C(C.FULL_UPDATE))},r.prototype.updateSource=function(t){var e=this.paneForSource(t),i=this._paneInvalidationMask(e);this.invalidate(i)},r.prototype.studiesMetaData=function(){return this._studiesMetaData},r.prototype.studyVersioning=function(){return this._studyVersioning},r.prototype.disconnect=function(){var t,e,i=this.dataSources();for(e=0;e<i.length;e++)t=i[e],t.disconnect&&t.disconnect()},r.prototype.restart=function(){var t,e,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),t=this.dataSources(),e=0;e<t.length;e++)i=t[e],i.restart&&i!==this.m_mainSeries&&i.restart()},r.prototype.startNotStartedStudies=function(){var t,e;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(t=this.dataSources(),e=0;e<t.length;e++)t[e]instanceof P&&!t[e].isStarted()&&t[e].restart&&t[e]!==this.m_mainSeries&&t[e].restart()},r.prototype.updateLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,p)&&(e=i[t],e.tryCreateServerPoints(),e.checkAlert&&e.checkAlert())},r.prototype.realignLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)TradingView.isInherited(i[t].constructor,p)&&(e=i[t],e.calcIsActualSymbol());for(t=0;t<this.m_panes.length;t++)this.m_panes[t].invalidateSourcesCache()},r.prototype.readOnly=function(){return this._readOnly},r.prototype.properties=function(){return this._properties},r.prototype.lineCancelled=function(){return this._lineCancelled},
r.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},r.prototype.chartApi=function(){return this._chartApi},r.prototype.propertyChangeHandler=function(){this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.updateAllPaneViews=function(){var t,e;for(t=0;t<this.m_panes.length;t++)e=this.m_panes[t],e.updateAllViews()},r.prototype.mainSeries=function(){return this.m_mainSeries},r.prototype.timeScale=function(){return this.m_timeScale},r.prototype.panes=function(){return this.m_panes},r.prototype.gridSource=function(){return this.m_gridSource},r.prototype.watermarkSource=function(){return this.m_watermarkSource},r.prototype.brandingSource=function(){return this._brandingSource},r.prototype.crossHairSource=function(){return this.m_crossHairSource},r.prototype.barsMarksSources=function(){return this._barsMarksSources},r.prototype.width=function(){return this.m_width},r.prototype.setPaneHeight=function(t,e){t.setHeight(e),this.recalculateAllPanes(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.setWidth=function(t){var e,i;for(this.m_width=t,this.m_timeScale.setWidth(this.m_width),e=0;e<this.m_panes.length;++e)i=this.m_panes[e],i.setWidth(t);this.recalculateAllPanes()},r.prototype.createPane=function(t,e,i){var o,n;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),o=this._properties.paneProperties,i&&o.merge(i),n=new _(this.m_timeScale,o,this,e),"number"==typeof t&&isFinite(t)){if(t<0||t>this.m_panes.length)return void F.logDebug("ChartModel.createPane: invalid index: "+t);this.m_panes.splice(t,0,n)}else this.m_panes.push(n);return n.onTagsChanged().subscribe(this,r.prototype.onPaneTagsChanged),n},r.prototype.removePane=function(t){this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),t.destroy();var e=this.m_panes.indexOf(t);-1!==e&&this.m_panes.splice(e,1),this.invalidate(new C(C.FULL_UPDATE))},r.prototype.startScalePrice=function(t,e,i){t.startScalePrice(e,i)},r.prototype.scalePriceTo=function(t,e,i){t.scalePriceTo(e,i),this.mainSeries().properties().lockScale.value()?this.invalidate(new C(C.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.endScalePrice=function(t,e){t.endScalePrice(e),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.startScrollPrice=function(t,e,i){t.startScrollPrice(e,i)},r.prototype.scrollPriceTo=function(t,e,i){t.scrollPriceTo(e,i),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.endScrollPrice=function(t,e){t.endScrollPrice(e),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.setPriceAutoScale=function(t,e,i){t.setPriceAutoScale(e,i),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.restorePriceScaleState=function(t,e,i){t.restorePriceScaleState(e,i),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},
r.prototype.resetPriceScale=function(t,e){t.resetPriceScale(e),this.invalidate(this._paneInvalidationMask(t,C.LIGHT_UPDATE))},r.prototype.updateScales=function(t,e){this._undoModel._chartWidget._updateScalesActions()},r.prototype.startScaleTime=function(t){this.m_timeScale.startScale(t)},r.prototype.scaleTimeTo=function(t){this.m_timeScale.scaleTo(t),this.recalculateAllPanes(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new C(C.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},r.prototype.startScrollTime=function(t){this.m_timeScale.startScroll(t),this._isTimeScrolling=!0},r.prototype.scrollTimeTo=function(t){this.m_timeScale.scrollTo(t),this.recalculateAllPanes(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new C(C.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},r.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(t){t instanceof E&&t.recalcStudyIfNeeded&&t.recalcStudyIfNeeded()})},r.prototype.recalcVisibleRangeStudy=function(t,e){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(t,e)},1e3)},r.prototype._recalcVisibleRangeStudy=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f,m;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),o=this.mainSeries().nearestData(i.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this.mainSeries().nearestData(i.lastBar(),TradingView.SEARCH_NEAREST_LEFT),s=o?o.index:void 0,r=n?n.index:void 0,a=s===this._oldStartVisibleIndex,l=r===this._oldEndVisibleIndex,!a||!l||e))for(this._oldStartVisibleIndex=s,this._oldEndVisibleIndex=r,h=0;h<t.length;h++)if(t[h]instanceof P){for(c=t[h],d=c.metaInfo().inputs,p=null,u=null,_=0;_<d.length;_++)"first_visible_bar_time"===d[_].id?(f=o&&o.value?o.value[TradingView.TIME_PLOT]:0,p=1e3*Math.floor(f)):"last_visible_bar_time"===d[_].id&&(f=n&&n.value?n.value[TradingView.TIME_PLOT]:0,u=1e3*Math.floor(f));m=c.properties().inputs,p&&(u?m.first_visible_bar_time.setValueSilently(p):m.first_visible_bar_time.setValue(p,!0)),u&&m.last_visible_bar_time.setValue(u,!0)}},r.prototype.onResetScales=function(){return this._resetScales},r.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.invalidate(new C(C.LIGHT_UPDATE)),this._resetScales.fire()},r.prototype.restoreTimeScaleState=function(t){this.m_timeScale.restoreState(t),this.recalculateAllPanes(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.restoreFactoryDefaults=function(t){t.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},r.prototype.setSelectedSource=function(t,e){
if(!(this.m_selectedSource===t&&this._lastHittestData===e||t&&t.customization&&t.customization.disableSelection)){this._lastHittestData=e;var i=new C;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!1)})),this.m_selectedSource=t,this._selectedSourceChanged.fire(t),t&&(t.updateAllViews(),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!0)})),i.force=!0,this.invalidate(new C(C.LIGHT_UPDATE)),this.setHoveredSource(t,e)}},r.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof p&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},r.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},r.prototype.setHoveredSource=function(t,e){if(this.m_hoveredSource!==t||this._lastHittestData!==e){this._lastHittestData=e;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new C),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),C.LIGHT_UPDATE))),this.m_hoveredSource=t,t&&(t.updateAllViews(),i||(i=new C),i.merge(this._paneInvalidationMask(this.paneForSource(t),C.LIGHT_UPDATE)),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!0)})),i&&this.invalidate(i)}},r.prototype.selectedSource=function(){return this.m_selectedSource},r.prototype.hoveredSource=function(){return this.m_hoveredSource},r.prototype.lastHittestData=function(){return this._lastHittestData},r.prototype.invalidate=function(t){this._invalidateHandler&&this._invalidateHandler(t)},r.prototype.dataSources=function(){var t,e,i,o=[];for(o.push(this.m_crossHairSource),t=0;t<this.m_panes.length;++t)for(e=this.m_panes[t].dataSources(),i=0;i<e.length;i++)o.push(e[i]);return o},r.prototype.dataSourceForId=function(t){var e,i;for(i=0;i<this.m_panes.length;++i)if(e=this.m_panes[i].dataSourceForId(t))return e;return null},r.prototype.children=function(t,e){return this.dataSources().filter(function(i){return!(!0===e&&i instanceof P&&i.isChildStudy())&&i.ownerSource()===t})},r.prototype.setCurrentPosition=function(t,e,i,o){var n,s,r,a,l,h,c,d,u,_,f,m,g,v=NaN,y=Math.round(this.m_timeScale.coordinateToIndex(t));if(i&&(n=i.defaultPriceScale(),n.isEmpty()||(v=n.coordinateToPrice(e))),(this._lineBeingCreated||p.isLineTool(this.currentTool()))&&(v=this._magnet.align(v,y,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,v,i);for(this.m_crossHairSource.setPosition(y,v,i),this.m_crossHairSource.dataWindowView().update(),s=this.m_panes,r=s.length;r--;)for(a=s[r].dataSources(),
@@ -686,10 +686,10 @@ r.prototype.setExternalPosition=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u;if(!Nu
for(o=e.priceScaleByName(h),n=0;n<a.length;n++)e.move(a[n],o);e.move(t,o)}else{for(s=e||this.createPane(),r=s.priceScaleByName(h),n=0;n<a.length;n++)this.detachSource(a[n]);for(n=0;n<a.length;n++)s.addDataSource(a[n],r);this.detachSource(t),s.addDataSource(t,r)}this.invalidate(new C(C.FULL_UPDATE))},r.prototype.isSingleInstanceLineTool=function(t){return"LineStudyMtpRiskReward"===t||"LineStudyMtpAnalysis"===t},r.prototype._externalTimeStamp=function(t){var e=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(t,e&&e.projectTime.bind(e))},r.prototype.createLineTool=function(t,e,i,o,n){var s,r,a,l,h,p,u,_;return d.isValid(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&R("drawings","Study_Drawing_"+i),s=d.create(i,this,o,null,t.mainDataSource()),r=!s.linkKey&&!n,O.drawOnAllCharts().value()?s.linkKey=n||N.randomHash():s.linkKey=n,s.toolname=i,s.setOwnerSource(t.mainDataSource()),a=t.defaultPriceScale(),t.addDataSource(s,a),h=this.m_timeScale.indexToCoordinate(e.index),p=a.priceToCoordinate(e.price),s.isFixed()?l=s.addFixedPoint(new c.Point(h,p)):(u=s.constructor,u.skipMagnetting||(e.price=this._magnet.align(e.price,e.index,t)),l=s.addPoint(e)),l||(this._lineBeingCreated=s,this._paneBeingCreatedLineOn=t),r&&s.enableCurrentIntervalVisibility(),this.invalidate(new C(C.FULL_UPDATE)),n||!O.drawOnAllCharts().value()||s.properties().singleChartOnly||(_=this._externalTimeStamp(e.index),O.createLineTool({point:{price:e.price,timeStamp:_},linetool:i,properties:s.properties(),symbol:this.mainSeries().symbol(),model:this,linkKey:s.linkKey})),s):null},r.prototype.lineBeingCreated=function(){return this._lineBeingCreated},r.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},r.prototype.coninueCreatingLine=function(t,e,i,o){var n,s,r,a,l,h=this.paneForSource(this._lineBeingCreated);return t.price=this._magnet.align(t.price,t.index,h),n=this._lineBeingCreated.addPoint(t,e,i),s=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),r=new C(C.LIGHT_UPDATE),a=null,n&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,r.force=!0),this.invalidate(r),o||!O.drawOnAllCharts().value()||s.properties().singleChartOnly||(l=this._externalTimeStamp(t.index),O.continueLineTool({point:{price:t.price,timeStamp:l},envState:e,finalState:a,model:this})),n},r.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var t=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),O.drawOnAllCharts().value()&&!t.properties().singleChartOnly&&O.cancelLineTool({model:this})}},r.prototype.startChangingLinetool=function(t,e,i,o){var n,s,r;this._lineBeingEdited=t,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,e),n=this.paneForSource(t),e.price=this._magnet.align(e.price,e.index,n),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,e),
this._lineBeingEdited.setPoint(i,e,o),this._lineBeingEdited.updateAllViews(),s=this._paneInvalidationMask(n,C.LIGHT_UPDATE),s.force=!0,this.invalidate(s),t.linkKey&&!t.properties().singleChartOnly&&(r=this._externalTimeStamp(e.index),O.startChangingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:r},pointIndex:i,envState:o}))},r.prototype.lineBeingEdited=function(){return this._lineBeingEdited},r.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},r.prototype.changeLinePoint=function(t,e){var i,o,n,s,r=this.paneForSource(this._lineBeingEdited);void 0!==t.x&&void 0!==t.y?(n=this._lineBeingEdited.priceScale(),i=n.coordinateToPrice(t.y),o=Math.round(this.timeScale().coordinateToIndex(t.x)),i=this._magnet.align(i,o,r),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:o},e)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,t,e),this._lineBeingEdited.updateAllViews(),this.invalidate(new C(C.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this._externalTimeStamp(o),O.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:e}))},r.prototype.endChangingLinetool=function(t){var e,i,o=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,t),this._lineBeingEdited=null,this._linePointBeingEdited=null,e=new C(C.LIGHT_UPDATE),e.force=!0,this.invalidate(e),i={points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&O.finishChangingLineTool({model:this,linkKey:o.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},r.prototype.startMovingSource=function(t,e,i){var o,n,s;this._sourceBeingMoved=t,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(e,i),o=this.paneForSource(this._sourceBeingMoved),n=this._paneInvalidationMask(o,C.LIGHT_UPDATE),n.force=!0,this.invalidate(n),t.linkKey&&!t.properties().singleChartOnly&&(s=this._externalTimeStamp(e.index),O.startMovingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:s}}))},r.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},r.prototype.moveSource=function(t){if(this._sourceBeingMoved.move(t,this._linePointBeingMoved),this.invalidate(new C(C.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var e=this._externalTimeStamp(t.index);O.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:t.price,timeStamp:e}})}},r.prototype.endMovingSource=function(t){var e,i,o=this._sourceBeingMoved,n=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(t),this._sourceBeingMoved=null,this._linePointBeingMoved=null,e=this._paneInvalidationMask(n,C.LIGHT_UPDATE),e.invalidateAll(C.LIGHT_UPDATE),e.force=!0,this.invalidate(e),o instanceof p&&(i={points:o._timePoint,interval:this.mainSeries().interval()},
o.linkKey&&!o.properties().singleChartOnly&&O.finishMovingLineTool({linkKey:o.linkKey,model:this,finalState:i}))},r.prototype.finishLineTool=function(t){var e=this.lineBeingCreated();e&&(e.finish&&e.finish(),!t&&O.drawOnAllCharts().value()&&e.linkKey&&!e.properties().singleChartOnly&&O.finishLineTool({linkKey:e.linkKey,model:this}))},r.prototype.calculateDefaultTags=function(){var t,e,i=[],o=this.dataSources();for(t=0;t<o.length;t++)e=o[t],e.tags&&(i=i.concat(e.tags()));return i},r.prototype.changeZOrder=function(t,e){this.paneForSource(t).changeZOrder(t,e),this.invalidate(new C(C.FULL_UPDATE))},r.prototype.sendToBack=function(t){this.paneForSource(t).sendToBack(t),this.invalidate(new C(C.FULL_UPDATE))},r.prototype.bringToFront=function(t){this.paneForSource(t).bringToFront(t),this.invalidate(new C(C.FULL_UPDATE))},r.prototype.onTagsChanged=function(){return this._tagsChanged},r.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},r.prototype.setTimeViewport=function(t,e){this.timeScale().zoomToBarsRange(t,e),this.recalculateAllPanes(),this.invalidate(new C(C.LIGHT_UPDATE))},r.prototype.zoomToViewport=function(t,e,i,o,n){var r,a,l;this.setTimeViewport(t,e),r=Math.min(i,o),a=Math.max(i,o),l=n.defaultPriceScale(),l.setAutoScale(!1),l.isLog()&&(r=l.priceToLogical(r),a=l.priceToLogical(a)),l.setPriceRange(new s(r,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(n,C.LIGHT_UPDATE))},r.prototype.clearAllStudies=function(){var t,e=this.dataSources();for(t=0;t<e.length;t++)e[t].clearData&&e[t].clearData()},r.prototype.allStudies=function(){var t,e,i,o,n,s,r=[],a=this.m_panes,l=a.length;for(t=0;t<l;++t)for(e=a[t],i=e.dataSources(),o=i.length,n=0;n<o;++n)(s=i[n])instanceof P&&r.push(s);return r},r.prototype.allLineTools=function(){var t,e,i,o,n,s,r=[],a=this.m_panes,l=a.length;for(t=0;t<l;++t)for(e=a[t],i=e.dataSources(),o=i.length,n=0;n<o;++n)s=i[n],TradingView.isInherited(s.constructor,p)&&r.push(s);return r},r.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},r.prototype.backgroundCounterColor=function(){return h(l(this.backgroundColor()))},r.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},r.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&o.enabled("chart_zoom")},r.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&o.enabled("chart_zoom")},r.prototype.updateAllVolumeStudies=function(){var t,e,i,o,n,s,r=this.m_panes;for(t=r.length;t--;)for(e=!1,i=r[t],o=i.dataSources(),n=o.length;n--;)(s=o[n])instanceof P&&"Volume"===s.metaInfo().shortId&&(s.updateAllViews(),e||(this.updatePane(i),e=!0))},r.prototype.alertsList=function(){return this._alertsList},r.prototype._modelIntervals=[],r.prototype.setInterval=function(t,e){var i=setInterval(t,e);return this._modelIntervals.push(i),i},r.prototype.clearInterval=function(t){clearInterval(t);var e=this._modelIntervals.indexOf(t);e>-1&&this._modelIntervals.splice(e,1)},r.prototype.clearIntervals=function(){
for(var t=0;t<this._modelIntervals.length;t++)clearInterval(this._modelIntervals[t]);this._modelIntervals=[]},r.prototype.destroy=function(){this.clearIntervals()},r.prototype.countUserStudies=function(t){var e,i,o,n,s,r,a=0;for(t=t||{},e=0;e<this.m_panes.length;e++)for(i=this.m_panes[e].dataSources(),o=0;o<i.length;o++)if((n=i[o])instanceof P&&n.showInObjectTree()){if(s=n.metaInfo&&n.metaInfo()){if(r=s.id,t.dontCountVolume&&"Volume@tv-basicstudies"===r)continue;if(t.dontCountCompare&&"Compare@tv-basicstudies"===r)continue;if(t.dontCountOverlay&&"Overlay@tv-basicstudies"===r)continue}a++}return a},r.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},r.prototype.copyToOtherCharts=function(t){var e,i,o,n;t.linkKey=t.linkKey||N.randomHash(),e=this,i=t.state(),o=this.mainSeries(),(n=o.syncModel())&&(i.points=t._timePoint.map(function(t){var i=e.timeScale().timePointToIndex(t.time_t)+t.offset;return{price:t.price,timeStamp:e._externalTimeStamp(i)}}),i.linetool=t.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),O.copyLineTool(i))},r.prototype.restoreSource=function(t,e,i,o,n){var s,r,a,l,h,c,d,p;return s=t?this.createPane(e):this.panes()[e],a=o.type,r=a.toLowerCase().startsWith("study")?s._restoreStudy(o):s._restoreLineTool(o),l=r.ownerSource()?r.ownerSource().priceScale():s.priceScaleByName(n),l?(r.setPriceScale(l),l.addDataSource(r)):(l=new y(s._properties.overlayPropreties,this.properties().scalesProperties),l.setHeight(s.m_height),h=r.metaInfo&&"Volume@tv-basicstudies"===r.metaInfo().id,c=h?.75:s.m_rightPriceScale.topMargin(),d=h?0:s.m_rightPriceScale.bottomMargin(),l.setTopMargin(c),l.setBottomMargin(d),l.addDataSource(r),r.setPriceScale(l),r._isOverlay=!0),p=null,o.ownerSource&&(p=s.dataSourceForId(o.ownerSource)),r.setOwnerSource(p),r.setPriceScale(l),r.start(),r.restore&&r.restore(),t&&s.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new C(C.FULL_UPDATE,!0)),r.linkKey&&O.restoreLineTool({model:this,linkKey:r.linkKey,state:{restorePane:t,paneIndex:e,paneState:i,sourceState:o,priceScaleName:n}}),r},r.prototype.restoreLineToolState=function(t,e){t.restorePoints(e.points,e.indexes||[]),t.properties().merge(e.state),t.restoreData&&t.restoreData(e),t.createServerPoints(),this.invalidate(new C(C.FULL_UPDATE)),t.linkKey&&O.restoreLineToolState({model:this,linkKey:t.linkKey,state:e})},r.prototype.createBrandingSource=function(){this._brandingSource=new S(this)},r.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},r.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},t.exports=r}).call(e,i(15),i(3),i(40),i(107))},function(t,e,i){(function(t){"use strict";function o(e,i,o,n,s,r,a,l){this._chartWidget=l,this.m_model=new H(e,i,o,n,s,r,a,this,!!l._containsData),this.m_zoomStack=new ot,this._onRearrangePanes=new t,this._onSimpleZoomIn=new t,this._onSimpleZoomOut=new t}function n(t,e,i,o){st.call(this,i),this._targetObj=t,this._newValue=e,this._model=o}function s(t,e,i,o,n){st.call(this,o),
for(var t=0;t<this._modelIntervals.length;t++)clearInterval(this._modelIntervals[t]);this._modelIntervals=[]},r.prototype.destroy=function(){this.clearIntervals()},r.prototype.countUserStudies=function(t){var e,i,o,n,s,r,a=0;for(t=t||{},e=0;e<this.m_panes.length;e++)for(i=this.m_panes[e].dataSources(),o=0;o<i.length;o++)if((n=i[o])instanceof P&&n.showInObjectTree()){if(s=n.metaInfo&&n.metaInfo()){if(r=s.id,t.dontCountVolume&&"Volume@tv-basicstudies"===r)continue;if(t.dontCountCompare&&"Compare@tv-basicstudies"===r)continue;if(t.dontCountOverlay&&"Overlay@tv-basicstudies"===r)continue}a++}return a},r.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},r.prototype.copyToOtherCharts=function(t){var e,i,o,n;t.linkKey=t.linkKey||N.randomHash(),e=this,i=t.state(),o=this.mainSeries(),(n=o.syncModel())&&(i.points=t._timePoint.map(function(t){var i=e.timeScale().timePointToIndex(t.time_t)+t.offset;return{price:t.price,timeStamp:e._externalTimeStamp(i)}}),i.linetool=t.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),O.copyLineTool(i))},r.prototype.restoreSource=function(t,e,i,o,n){var s,r,a,l,h,c,d,p;return s=t?this.createPane(e):this.panes()[e],a=o.type,r=a.toLowerCase().startsWith("study")?s._restoreStudy(o):s._restoreLineTool(o),l=r.ownerSource()?r.ownerSource().priceScale():s.priceScaleByName(n),l?(r.setPriceScale(l),l.addDataSource(r)):(l=new y(s._properties.overlayPropreties,this.properties().scalesProperties),l.setHeight(s.m_height),h=r.metaInfo&&"Volume@tv-basicstudies"===r.metaInfo().id,c=h?.75:s.m_rightPriceScale.topMargin(),d=h?0:s.m_rightPriceScale.bottomMargin(),l.setTopMargin(c),l.setBottomMargin(d),l.addDataSource(r),r.setPriceScale(l),r._isOverlay=!0),p=null,o.ownerSource&&(p=s.dataSourceForId(o.ownerSource)),r.setOwnerSource(p),r.setPriceScale(l),r.start(),r.restore&&r.restore(),t&&s.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new C(C.FULL_UPDATE,!0)),r.linkKey&&O.restoreLineTool({model:this,linkKey:r.linkKey,state:{restorePane:t,paneIndex:e,paneState:i,sourceState:o,priceScaleName:n}}),r},r.prototype.restoreLineToolState=function(t,e){t.restorePoints(e.points,e.indexes||[]),t.properties().merge(e.state),t.restoreData&&t.restoreData(e),t.createServerPoints(),this.invalidate(new C(C.FULL_UPDATE)),t.linkKey&&O.restoreLineToolState({model:this,linkKey:t.linkKey,state:e})},r.prototype.createBrandingSource=function(){this._brandingSource=new S(this)},r.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},r.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},t.exports=r}).call(e,i(15),i(3),i(41),i(107))},function(t,e,i){(function(t){"use strict";function o(e,i,o,n,s,r,a,l){this._chartWidget=l,this.m_model=new H(e,i,o,n,s,r,a,this,!!l._containsData),this.m_zoomStack=new ot,this._onRearrangePanes=new t,this._onSimpleZoomIn=new t,this._onSimpleZoomOut=new t}function n(t,e,i,o){st.call(this,i),this._targetObj=t,this._newValue=e,this._model=o}function s(t,e,i,o,n){st.call(this,o),
this._property=t,this._priceScale=i,this._newValue=e,this._model=n}function r(t,e,i,o,n){st.call(this,o),this._percentage=t,this._priceScale=i,this._newValue=e,this._model=n}function a(t,e,i,o,n){st.call(this,o),this._log=t,this._priceScale=i,this._newValue=e,this._model=n}function l(t,e,i,o,n,s){st.call(this,o),this._style=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n,this._chartWidget=s}function h(t,e,i,o,n){st.call(this,o),this._property=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n}function c(t,e,i,o){st.call(this,"scale price",!1),this.m_model=t,this.m_pane=e,this.m_priceScale=i,this.m_state=o,this.m_newPriceScaleState=null}function d(t,e,i){st.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=t,this.m_state=e,this.m_newTimeScaleState=null}function p(t,e,i,o){this._model=t,this._series=e,this._oldSymbol=e.symbol(),this._oldInterval=e.interval(),this._symbol=i,this._interval=o}function u(t,e,i,o,n){st.call(this,"Insert "+e.id),this._model=t,this._studyMetaInfo=e,this._props=i,this._isOverlay=o,this._parentSource=n}function _(t,e){st.call(this,"Remove Source"),this._model=t,this._sourceId=e.id()}function f(t,e){st.call(this,"Remove Drawing(s)"),this._model=t,this._linetools=e,this._statesByPaneIndexes={}}function m(t,e,i,o){this._model=t,this._oldPane=this._model.paneForSource(e),st.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=e.id(),this._oldPaneIndex=t.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(e.priceScale()),this._pane=i,this._paneIndex=t.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(o):this._paneIndex=t.panes().length}function g(t,e,i){st.call(this,"Create line "+i,!1),this._model=t,this._paneIndex=t.panes().indexOf(e),this._lineTool=i}function v(t,e,i,o){st.call(this,"Change Drawing",!1),this._model=t,this._prevState=e.state(!0),this._nextState=this._prevState}function y(t,e,i,o){st.call(this,"Move Drawing",!1),this._model=t,this._sourceId=e.id(),i instanceof N.Point?this._origPoint=i.clone():this._origPoint=TradingView.clone(i),this._pointIndex=o}function b(t,e,i){st.call(this,"Change %1 Z order (%2)".format(e.title(),i>0?"Forward":"Backward")),this._model=t,this._sourceId=e.id(),this._shift=i}function w(t,e){st.call(this,"Send "+e.title()+" to back"),this._model=t,this._sourceId=e.id()}function S(t,e){st.call(this,"Bring "+e.title()+" to front"),this._model=t,this._sourceId=e.id()}function T(t,e,i){st.call(this,"Remove pane"),this._model=t,this._index=e,this._pane=this._model.panes()[e],this._chart=i}function C(t,e,i,o){st.call(this,"Rearrange panes"),this._model=t,this._index=e,this._direction=i,this._chart=o}function x(t,e,i,o,n,s){st.call(this,"Zoom"),this._model=t,this._startBar=e,this._endBar=i,this._startPrice=o,this._endPrice=n,this._pane=s}function P(t,e,i){st.call(this,"Zoom"),this._baseCmd=t,this._zoomStack=e,this._inOut=i}function L(t,e,i,o,n){
st.call(this,"",!1),this._model=t,this._paneA=e,this._paneB=i,this._prevStretchA=o,this._currStretchA=n}function k(t,e){st.call(this,"Restore Defaults"),this._model=t,this._defaultProperty=e,this._state=e.state(e._exclusions),this._chartWidget=t._undoModel._chartWidget}function I(t,e){st.call(this,"Apply Chart Theme"),this._model=t,this._newChartProps=TradingView.factoryDefaults("chartproperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){e.mainSourceProperties[t].wickUpColor=e.mainSourceProperties[t].wickUpColor||e.mainSourceProperties[t].wickColor,e.mainSourceProperties[t].wickDownColor=e.mainSourceProperties[t].wickDownColor||e.mainSourceProperties[t].wickColor}),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,e.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,this._newSeriesProps=e.mainSourceProperties,this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=t.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=t.properties().state().mainSeriesProperties}function A(t,e){st.call(this,"Apply Drawing Template"),this._source=t,this._oldProps=t.properties().state(),this._newProps=e}function E(t,e,i,o){var n;o=o||"",n=o+" Study template",st.call(this,n),this._model=t,this._oldProps=e,this._newProps=i}function M(t,e,i,o,n){st.call(this,t),this._property=e,this._value=i,this._forceSetProperty=n,this._prevValue=e.value(),this._cw=o}function D(t,e){var i,o,n,s,r,a=e.priceScale(),l=[];for(a.isPercent()&&(i=e.firstValue()),o=0;o<t.length;o++)n={offset:t[o].offset,time_t:t[o].time_t},s=t[o].price,a.isPercent()&&(s=a.priceRange().convertToPercent(s,i)),r=a.priceToCoordinate(s),r-=40,s=a.coordinateToPrice(r),a.isPercent()&&(s=a.priceRange().convertFromPercent(s,i)),n.price=s,l.push(n);return l}function O(t,e,i){st.call(this,"clone "+e.title()),this._model=t,this._originalSource=e,this._withoutShift=i}function V(t,e){st.call(this,"Stop Sincing Drawing"),this._model=t,this._sourceId=e.id(),
this._linkKey=e.linkKey}function B(t,e,i){st.call(this,"Paste Drawing"),this._model=t,this._clipboardData=e,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function R(t,e){st.call(this,"Paste Indicator"),this._model=t,this._clipboardData=e}var N=i(2),F=i(199),z=i(1).LineDataSource,W=i(3),H=i(153),U=i(41),j=i(21),q=i(731).doAnimate,Y=i(225),G=i(7),K=G.saveDefaultProperties,X=i(192),Z=i(42),J=i(31),Q=J.Study,tt=i(157),et=i(60),it=i(262).createTooManyStudiesNotice,ot=i(374).UndoStack,nt=i(53).UndoHistory,st=i(124).UndoCommand,rt=i(12).getLogger("Chart.ChartUndoModel");inherit(o,Y),o.prototype.version=function(){return this.m_model._version},o.prototype.onData=function(t){switch(t.method){case"timescale_update":var e=t.params;this.m_model.updateTimeScale(e.index,e.zoffset,e.changes,e.marks,e.clear)}},o.prototype.paneForSource=function(t){return this.m_model.paneForSource(t)},o.prototype.createPane=function(t){return this.m_model.createPane(t)},o.prototype.dumpViews=function(){return this.m_model.dumpViews()},o.prototype.readOnly=function(){return this.m_model.readOnly()},o.prototype.restart=function(){this.m_model.restart()},o.prototype.disconnect=function(){this.m_model.disconnect()},o.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},o.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},o.prototype.chartModel=function(){return this.m_model},o.prototype.pushUndoCommand=function(t){nt.pushUndoCommand(t)},o.prototype.startScalePrice=function(t,e,i){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().startScalePrice(t,e,i)},o.prototype.scalePriceTo=function(t,e,i){this.chartModel().scalePriceTo(t,e,i)},o.prototype.endScalePrice=function(t,e){this.chartModel().endScalePrice(t,e)},o.prototype.startScrollPrice=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollState=e.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(t,e,i))},o.prototype.scrollPriceTo=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new c(this.m_model,t,e,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(t,e,i))},o.prototype.endScrollPrice=function(t,e){e.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(t,e))},o.prototype.setPriceAutoScale=function(t,e,i){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().setPriceAutoScale(t,e,i)},o.prototype.resetPriceScale=function(t,e){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().resetPriceScale(t,e)},o.prototype.startScaleTime=function(t){this.pushUndoCommand(new d(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(t)},o.prototype.scaleTimeTo=function(t){this.chartModel().scaleTimeTo(t)},o.prototype.endScaleTime=function(){
this._linkKey=e.linkKey}function B(t,e,i){st.call(this,"Paste Drawing"),this._model=t,this._clipboardData=e,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function R(t,e){st.call(this,"Paste Indicator"),this._model=t,this._clipboardData=e}var N=i(2),F=i(199),z=i(1).LineDataSource,W=i(3),H=i(153),U=i(42),j=i(21),q=i(731).doAnimate,Y=i(225),G=i(7),K=G.saveDefaultProperties,X=i(192),Z=i(43),J=i(31),Q=J.Study,tt=i(157),et=i(60),it=i(262).createTooManyStudiesNotice,ot=i(374).UndoStack,nt=i(53).UndoHistory,st=i(124).UndoCommand,rt=i(12).getLogger("Chart.ChartUndoModel");inherit(o,Y),o.prototype.version=function(){return this.m_model._version},o.prototype.onData=function(t){switch(t.method){case"timescale_update":var e=t.params;this.m_model.updateTimeScale(e.index,e.zoffset,e.changes,e.marks,e.clear)}},o.prototype.paneForSource=function(t){return this.m_model.paneForSource(t)},o.prototype.createPane=function(t){return this.m_model.createPane(t)},o.prototype.dumpViews=function(){return this.m_model.dumpViews()},o.prototype.readOnly=function(){return this.m_model.readOnly()},o.prototype.restart=function(){this.m_model.restart()},o.prototype.disconnect=function(){this.m_model.disconnect()},o.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},o.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},o.prototype.chartModel=function(){return this.m_model},o.prototype.pushUndoCommand=function(t){nt.pushUndoCommand(t)},o.prototype.startScalePrice=function(t,e,i){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().startScalePrice(t,e,i)},o.prototype.scalePriceTo=function(t,e,i){this.chartModel().scalePriceTo(t,e,i)},o.prototype.endScalePrice=function(t,e){this.chartModel().endScalePrice(t,e)},o.prototype.startScrollPrice=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollState=e.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(t,e,i))},o.prototype.scrollPriceTo=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new c(this.m_model,t,e,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(t,e,i))},o.prototype.endScrollPrice=function(t,e){e.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(t,e))},o.prototype.setPriceAutoScale=function(t,e,i){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().setPriceAutoScale(t,e,i)},o.prototype.resetPriceScale=function(t,e){this.pushUndoCommand(new c(this.m_model,t,e,e.state())),this.chartModel().resetPriceScale(t,e)},o.prototype.startScaleTime=function(t){this.pushUndoCommand(new d(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(t)},o.prototype.scaleTimeTo=function(t){this.chartModel().scaleTimeTo(t)},o.prototype.endScaleTime=function(){
this.chartModel().endScaleTime()},o.prototype.startScrollTime=function(t){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=t,this.chartModel().startScrollTime(t)},o.prototype.scrollTimeTo=function(t){this._initialTimeScrollPos&&Math.abs(t-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new d(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(t)},o.prototype.gotoTime=function(t,e){var i,o,n=this.timeScale().visibleBars();if(!n)return $.Deferred().reject().promise();i=n.firstBar(),o=this.m_model.timeScale().state(),this.chartModel().gotoTime(t,e),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new d(this.m_model,o,"scroll time"))},o.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},o.prototype.resetTimeScale=function(){this.pushUndoCommand(new d(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},o.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},o.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},o.prototype.setWidth=function(t){this.m_model.setWidth(t)},o.prototype.setPaneHeight=function(t,e){this.m_model.setPaneHeight(t,e)},o.prototype.gridSource=function(){return this.m_model.gridSource()},o.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},o.prototype.brandingSource=function(){return this.m_model.brandingSource()},o.prototype.addAlertsSource=function(t){return this.m_model.addAlertsSource(t)},o.prototype.alertsSources=function(){return this.m_model.alertsSources()},o.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},o.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},o.prototype.model=function(){return this.m_model},o.prototype.mainSeries=function(){return this.m_model.m_mainSeries},o.prototype.panes=function(){return this.m_model.m_panes},o.prototype.timeScale=function(){return this.m_model.timeScale()},o.prototype.setSelectedSource=function(t,e){this.m_model.setSelectedSource(t,e)},o.prototype.setHoveredSource=function(t,e){this.m_model.setHoveredSource(t,e)},o.prototype.selectedSource=function(){return this.m_model.selectedSource()},o.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},o.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},o.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},o.prototype.invalidate=function(t){this.m_model.invalidate(t)},o.prototype.setCurrentPosition=function(t,e,i,o){this.m_model.setCurrentPosition(t,e,i,o)},o.prototype.modifySeries=function(t,e,i){var o=new p(this.m_model,t,e,i);this.pushUndoCommand(o)},o.prototype.canCreateStudy=function(t){return this.model().chartApi().chartApi().isCanCreateStudy(t)},o.prototype.checkIfFeatureAvailable=function(t,e){
var i=this.canCreateStudy(),o=e&&e instanceof Q;return!this.readOnly()&&o&&(i=this.canCreateStudy(!0)),!!i||void(o?goProDialog({feature:"studyOnStudy"}).open():it().open())},o.prototype._insertStudy=function(t,e,i,o){var n=new u(this.m_model,t,e,i,o);return this.pushUndoCommand(n),n.insertedStudy()},o.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},o.prototype.insertStudy=function(t,e,i,o){if(this.checkIfFeatureAvailable(t,o))return this._insertStudy(t,e,i,o)},o.prototype.setProperty=function(t,e,i){if(t&&t.value()!==e){var o=new n(t,e,i,this.m_model);this.pushUndoCommand(o),this.emitEvent("setProperty")}},o.prototype.setPercentProperty=function(t,e,i,o){if(t.value()!==e){var n=new r(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setLogProperty=function(t,e,i,o){if(t.value()!==e){var n=new a(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setAutoScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new s(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setChartStyleProperty=function(t,e,i){if(t.value()!==e){var o=new l(t,e,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(o),this.emitEvent("setChartStyleProperty")}},o.prototype.setLockScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new h(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setScreenChartProperty=function(t,e,i,o,n){if(n||t.value()!==e){var s=new M(o,t,e,i,n);this.pushUndoCommand(s)}},o.prototype.beginUndoMacro=nt.beginUndoMacro,o.prototype.endUndoMacro=nt.endUndoMacro,o.prototype.createUndoCheckpoint=nt.createUndoCheckpoint,o.prototype.undoToCheckpoint=nt.undoToCheckpoint,o.prototype._getSourcesTree=function(t){var e,i=[],o=this.m_model.children(t);for(e=0;e<o.length;e++)i=i.concat(this._getSourcesTree(o[e]));return i.push(t),i},o.prototype.removeSource=function(t,e){var i,o,n;if(t.isUserDeletable()){if(i=this._getSourcesTree(t),this.lineBeingCreated()===t)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),o=0;o<i.length;++o)n=new _(this.m_model,i[o]),this.pushUndoCommand(n);this.endUndoMacro()}e||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},o.prototype.removeSelectedSource=function(){var t,e=this.m_model.selectedSource();e&&e.isUserDeletable()&&(this.setSelectedSource(null),t=new _(this.m_model,e),this.pushUndoCommand(t),this.emitEvent("removeSource",[e]))},o.prototype.removeLineTools=function(t){var e,i,o=this.lineBeingCreated();o&&-1!==(e=t.indexOf(o))&&(this.cancelCreatingLine(),t.splice(e,1)),i=new f(this.m_model,t),this.pushUndoCommand(i),this.emitEvent("removeSources",[t])},o.prototype.move=function(t,e,i){var o=new m(this.m_model,t,e,i);this.pushUndoCommand(o),this.emitEvent("moveSource",[t])},o.prototype.createLineTool=function(t,e,i,o,n){var s,r;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new g(this.m_model,t,i),s=this._createLineCommand.startCreatingLine(e,o,n),r=this._createLineCommand.line(),
s&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),r):void it().open()},o.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},o.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},o.prototype.coninueCreatingLine=function(t,e,i){var o=this._createLineCommand.continueCreatingLine(t,e,i);return o&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),o},o.prototype.finishLineTool=function(t){this.m_model.finishLineTool(t)},o.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},o.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},o.prototype.startChangingLinetool=function(t,e,i,o){this._currentLineChangeCommand=new v(this.m_model,t,i,o),this.m_model.startChangingLinetool(t,e,i,o)},o.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},o.prototype.changeLinePoint=function(t,e){this._currentLineChangeCommand.setPoint(t,e),this.m_model.changeLinePoint(t,e)},o.prototype.endChangingLinetool=function(t){this.m_model.endChangingLinetool(t),this._currentLineChangeCommand.endChanging(),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},o.prototype.startMovingSource=function(t,e,i){this._currentLineMoveCommand=new y(this.m_model,t,e,i),this.m_model.startMovingSource(t,e,i)},o.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},o.prototype.moveSource=function(t){this._currentLineMoveCommand.setPoint(t),this.m_model.moveSource(t)},o.prototype.endMovingSource=function(t){this.m_model.endMovingSource(t),this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null)},o.prototype.dataSources=function(){return this.m_model.dataSources()},o.prototype.dataSourceForId=function(t){return this.m_model.dataSourceForId(t)},o.prototype.state=function(t,e){return this.m_model.state(t,e)},o.prototype.asyncState=function(t){return this.m_model.asyncState(t)},o.prototype.restoreState=function(t,e){return this.m_model.restoreState(t,e)},o.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()},o.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},o.prototype.changeZOrder=function(t,e){var i=new b(this.m_model,t,e);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[t,e])},o.prototype.sendToBack=function(t){var e=new w(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.bringToFront=function(t){var e=new S(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.removeAllStudies=function(){var t,e,i;for(this.beginUndoMacro("remove all studies"),t=this.m_model.dataSources(),e=0;e<t.length;e++)i=t[e],(TradingView.isInherited(i.constructor,Q)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,tt))&&this.removeSource(i);this.endUndoMacro()},o.prototype.removeAllDrawingTools=function(t){
@@ -703,12 +703,12 @@ this._model.moveSource(this._point),this._model.endMovingSource()},inherit(b,st)
var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=t-this._currStretchA,this._model.invalidate(new j(j.FULL_UPDATE))},L.prototype.undo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=t-this._prevStretchA,this._model.invalidate(new j(j.FULL_UPDATE))},inherit(k,st),k.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty)},k.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged()},inherit(I,st),I.prototype._merge=function(t,e){var i=this._model;K(!0),t&&(i.properties().paneProperties.merge(t.paneProperties),i.properties().scalesProperties.merge(t.scalesProperties),i.properties().symbolWatermarkProperties.merge(t.symbolWatermarkProperties)),i.mainSeries().properties().merge(e),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=e.version,i.recalculateAllPanes(),i.invalidate(new j(j.FULL_UPDATE)),i.properties().saveDefaults(),i.properties().listeners().fire(this._properties),i.properties().scalesProperties.textColor.listeners().fire(i.properties().scalesProperties.textColor),K(!1)},I.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},I.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(A,st),A.prototype._merge=function(t){var e=this._source;e.properties().merge(t),e.properties().saveDefaults(),e.propertiesChanged(),e.calcIsActualSymbol(),e.updateAllViews(),e._model.invalidate(new j(j.LIGHT_UPDATE))},A.prototype.undo=function(){this._merge(this._oldProps)},A.prototype.redo=function(){this._merge(this._newProps)},inherit(E,st),E.prototype._merge=function(t){var e,i,o,n,s,r,a,l,h,c,d,p,u=this._model.model(),_=u.mainSeries();for(_.properties().lockScale.setValue(!1),t.interval&&_.properties().interval.setValue(t.interval),e=[],i=u.panes(),o=i.length;o--;)for(n=i[o],s=n.containsMainSeries(),r=n.dataSources(),a=r.length;a--;)l=r[a],(!s||l instanceof Q)&&(l.isRemovedByStudyTemplates()||e.push(l),u.removeSource(l));for(h=t.panes,function(t,e){return t.dataSources().some(function(t){return t.alert&&t.alert().id===e.alert.id})},o=0;o<h.length;o++){for(c=!1,d=h[o],a=0;a<d.sources.length;a++)l=d.sources[a],"MainSeries"===l.type&&(delete l.state,c=!0);if(n=null,n=c?i[o]:u.createPane(o),n.restoreState(h[o],!1,t.version),c)for(p=0;p<e.length;p++)e[p].restore&&e[p].restore()}_.priceScale().setAutoScale(!0),u._version=t.version,u.startNotStartedStudies(),u.recalculateAllPanes(),u.invalidate(new j(j.FULL_UPDATE))},E.prototype.undo=function(){this._merge(this._oldProps),
this._model.model().mainSeries().onChartStyleChanged()},E.prototype.redo=function(){var t,e,i;this._merge(this._newProps),t=this._model.model(),t.mainSeries().onChartStyleChanged(),e=this._model.model().mainSeries().properties(),i=this._model.model().mainSeries().properties().priceAxisProperties,this._model._preparePriceAxisProperties(e,i),t._recalcVisibleRangeStudy(t.dataSources(),!0)},inherit(M,st),M.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))},M.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))},inherit(O,st),O.prototype.redo=function(){var t,e,i,o,n,s,r,a,l,h,c;if(this._lineState)s=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(t=this._originalSource,e=t.priceScale(),i=this._model.paneForSource(t),o=TradingView.className(t.constructor),n=t.properties().clone(),s=F.create(o,this._model,n,null,t.ownerSource()),s.setOwnerSource(t.ownerSource()),s.properties().visible._value=!0,s._fixedPoints=s._fixedPoints.concat(t._fixedPoints),r=0;r<s._fixedPoints.length;r++)s._fixedPoints[r]=s._fixedPoints[r].add(new N.Point(20,20));a=t._timePoint,l=this._withoutShift?TradingView.clone(a):D(a,t.ownerSource()),h=t._points,c=h,s.restorePoints(l,c),s.cloneData&&s.cloneData(t),i.addDataSource(s,e),this._model.updateSource(s),s.checkAlert&&s.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),U.drawOnAllCharts().value()&&this._model.copyToOtherCharts(s),this._lineState=s.state()}},O.prototype.undo=function(){this._lineState||rt.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(t)},O.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(V,st),V.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},V.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(B,st),B.prototype.redo=function(){var t,e,i,o,n,s,r,a,l,h=this._model.panes()[this._paneIndex],c=h.dataSourceForId(this._clipboardData.source.ownerSource)||h.mainDataSource();this._sourceState||(t=!0,e=this._clipboardData.source.state.symbol,i=h.mainDataSource(),o=i.symbol?i.symbol():"",n=e===o,n&&(c instanceof Z&&(t=!1),c instanceof Q&&(t=!c.metaInfo().is_price_study)),s=TradingView.clone(this._clipboardData.source),delete s.state.symbol,t?(r=this._model,a=function(t){var e=t.x*r.timeScale().width(),i=t.y*c.priceScale().height();return new N.Point(e,i)},s.points=this._clipboardData.geometry.map(function(t){var e,i=a(t),o=r.timeScale().coordinateToIndex(i.x),n=r.timeScale().normalizeBarIndex(o);return n.price=c.priceScale().coordinateToPrice(i.y),c.priceScale().isPercent()&&(e=c.firstValue(),n.price=c.priceScale().priceRange().convertFromPercent(n.price,e)),n
})):this._model._id===this._clipboardData.modelId&&c.id()===this._clipboardData.source.ownerSource&&(s.points=D(this._clipboardData.source.points,c)),s.id=et.guid(),this._sourceState=s),l=h._restoreLineTool(this._sourceState,null,!1),l.calcIsActualSymbol(),l.setOwnerSource(c),l.setPriceScale(c.priceScale()),c.priceScale().addDataSource(l),l.createServerPoints(),this._model.invalidate(new j(j.LIGHT_UPDATE,!0))},B.prototype.undo=function(){var t,e;this._sourceState||rt.logError("This command was never executed - nothing to undo"),t=this._model.panes()[this._paneIndex],e=t.dataSourceForId(this._sourceState.id),this._model.removeSource(e)},inherit(R,st),R.prototype.redo=function(){var t,e,i,o;this._sourceState||(t=TradingView.clone(this._clipboardData.source),t.id=et.guid(),this._sourceState=t),e=null,i=null,this._sourceState.metaInfo.is_price_study?(e=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(e=this._model.createPane(),i=e.defaultPriceScale()),o=e._restoreStudy(this._sourceState),o.start(),o.setPriceScale(i),e.move(o,i)},R.prototype.undo=function(){this._sourceState||rt.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(t)},e.ChartUndoModel=o}).call(e,i(15))},function(t,e,i){(function(e){"use strict";function i(t){e.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(t)}inherit(i,e),i.prototype.reloadProperties=function(t){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var e=0;e<t.length;++e)this._initValues.push(t[e].defaultValue),this.addChild(e,t[e].property);this.checkSelfColor()},i.prototype.setValue=function(t,i){if(this._value!==t||i){var o=this;this._childs.forEach(function(e){o[e].setValue(t||o._initValues[e])}),e.prototype.setValue.call(this,t,i)}},i.prototype.checkSelfColor=function(){var t,i=!0;for(t=0;t<this._initValues.length;++t)if(this[t].value()!==this[0].value()){i=!1;break}e.prototype.setValue.call(this,i?this[0].value():"")},t.exports=i}).call(e,i(24))},function(t,e,i){(function(e){"use strict";function o(t,i){var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new c(this,t),this._priceAxisView=new h(this,t),this._startMeasurePriceAxisView=new h(this,t,"measureStartY"),this._endMeasurePriceAxisView=new h(this,t,"measureEndY"),this._timeAxisView=new d(this,t),this._startMeasureTimeAxisView=new d(this,t,"measureStartX"),this._endMeasureTimeAxisView=new d(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(t){o.areLinesVisible="arrow"!==t},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._model.readOnly()&&(this.visibleTrap=!0)}function n(t,e){this._source=t,this._pane=e,this._rendererCache={}}function s(t,e,i){this.source=t,this.pane=e,this._horzVisible=i}function r(t,e,i){this.source=t,this.pane=e,this._axis=i||"x"}
var a=i(2),l=i(1).LineDataSource,h=i(680),c=i(679),d=i(681),p=i(11).TrendLineRenderer,u=i(16).TextRenderer,_=i(45).RectangleRenderer,f=i(48).DataSource,m=i(41),g=i(59),v=g.PaneRendererCrossHair,y=g.PaneRendererCrossHairLock,b=i(6),w=i(21),S=i(70).PercentageFormatter,T=i(123).TimeSpanFormatter,C=i(14);inherit(o,f),o.prototype.index=0,o.prototype.price=NaN,o.prototype.pane=null,o.prototype.color="white",o.prototype.style="",o.prototype.properties=function(){return this._properties},o.prototype.moved=function(){return this._movedDelegate},o.prototype.setPosition=function(t,e,i){if(this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,o.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.index=t,this.x=this._model.timeScale().indexToCoordinate(t),i&&!i.defaultPriceScale().isEmpty()){this.price=e;var n=i.defaultPriceScale();this.y=n.priceToCoordinate(e),this.pane=i}else this.price=NaN,this.y=NaN,this.pane=null;this.visible=!0,this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(t),price:this.price})},o.prototype.updateIndex=function(){var t=this.index;this.index=this._model.timeScale().coordinateToIndex(this.x),this.index!==t&&this.updateAllViews()},o.prototype.setLockedPosition=function(t){delete this.lockedIndex,delete this.lockedX,t!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},o.prototype.clearPosition=function(){this.visible=!1,this.index=parseInt(this._model.mainSeries().data().bars().last()),this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null},o.prototype.measureStartY=function(){var t,e=this._startMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},o.prototype.measureEndY=function(){var t,e=this._endMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},o.prototype.paneViews=function(t){var e=[new s(this,t,t===this.pane)];return t===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new n(this,t)),this._measurePaneView.update(),e.push(this._measurePaneView)),m.lockTimeAxis().value()&&e.push(this._timeLockPaneView=this._timeLockPaneView||new r(this,t)),e},o.prototype.dataWindowView=function(){return this._dataWindowView},o.prototype.priceAxisViews=function(t,e){if(!this.visibleTrap||!this.visible||this.pane!==t||e!==t.defaultPriceScale())return null;var i=[this._priceAxisView]
var a=i(2),l=i(1).LineDataSource,h=i(680),c=i(679),d=i(681),p=i(11).TrendLineRenderer,u=i(16).TextRenderer,_=i(45).RectangleRenderer,f=i(48).DataSource,m=i(42),g=i(59),v=g.PaneRendererCrossHair,y=g.PaneRendererCrossHairLock,b=i(6),w=i(21),S=i(70).PercentageFormatter,T=i(123).TimeSpanFormatter,C=i(14);inherit(o,f),o.prototype.index=0,o.prototype.price=NaN,o.prototype.pane=null,o.prototype.color="white",o.prototype.style="",o.prototype.properties=function(){return this._properties},o.prototype.moved=function(){return this._movedDelegate},o.prototype.setPosition=function(t,e,i){if(this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,o.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.index=t,this.x=this._model.timeScale().indexToCoordinate(t),i&&!i.defaultPriceScale().isEmpty()){this.price=e;var n=i.defaultPriceScale();this.y=n.priceToCoordinate(e),this.pane=i}else this.price=NaN,this.y=NaN,this.pane=null;this.visible=!0,this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(t),price:this.price})},o.prototype.updateIndex=function(){var t=this.index;this.index=this._model.timeScale().coordinateToIndex(this.x),this.index!==t&&this.updateAllViews()},o.prototype.setLockedPosition=function(t){delete this.lockedIndex,delete this.lockedX,t!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},o.prototype.clearPosition=function(){this.visible=!1,this.index=parseInt(this._model.mainSeries().data().bars().last()),this.price=NaN,this.x=NaN,this.y=NaN,this.pane=null},o.prototype.measureStartY=function(){var t,e=this._startMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},o.prototype.measureEndY=function(){var t,e=this._endMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},o.prototype.paneViews=function(t){var e=[new s(this,t,t===this.pane)];return t===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new n(this,t)),this._measurePaneView.update(),e.push(this._measurePaneView)),m.lockTimeAxis().value()&&e.push(this._timeLockPaneView=this._timeLockPaneView||new r(this,t)),e},o.prototype.dataWindowView=function(){return this._dataWindowView},o.prototype.priceAxisViews=function(t,e){if(!this.visibleTrap||!this.visible||this.pane!==t||e!==t.defaultPriceScale())return null;var i=[this._priceAxisView]
;return this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i},o.prototype.timeAxisView=function(){if(!this.visibleTrap||!this.visible&&!m.lockTimeAxis().value())return null;var t=[this._timeAxisView];return this._startMeasurePoint&&t.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&t.push(this._endMeasureTimeAxisView),t},o.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},o.prototype.startMeasurePoint=function(){return this._startMeasurePoint},o.prototype.startMeasuring=function(t,e){if(e.defaultPriceScale().isPercent()){var i=e.mainDataSource().firstValue();t.price=e.defaultPriceScale().priceRange().convertFromPercent(t.price,i)}this._startMeasurePoint=t,this._measurePane=e},o.prototype.finishMeasure=function(t){var e,i=this._measurePane;i.defaultPriceScale().isPercent()&&(e=i.mainDataSource().firstValue(),t.price=i.defaultPriceScale().priceRange().convertFromPercent(t.price,e)),this._endMeasurePoint=t},o.prototype.endMeasurePoint=function(){return this._endMeasurePoint},o.prototype.clearMeasure=function(t){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new w(w.LIGHT_UPDATE))},o.prototype.measurePoints=function(){var t,e,i,o,n;return this.updateAllViews(),t=[this._startMeasurePoint],this._endMeasurePoint?t.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e=this._lastValidMeasurePoint.rawPrice,i=this._measurePane,o=i.defaultPriceScale(),o.isPercent()&&!o.isEmpty()&&(n=i.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=o.priceRange().convertFromPercent(e,n)),t.push(this._lastValidMeasurePoint)),t},o.prototype.currentPoint=function(){return new a.Point(this.x,this.y)},o.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},o.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},n.prototype.update=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_,f,m,g,v;if(this._source._endMeasurePoint)t=this._source._endMeasurePoint.price,e=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)t=this._source.price,e=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;t=this._source._lastValidMeasurePoint.rawPrice,e=this._source._lastValidMeasurePoint.index}i=t-this._source._startMeasurePoint.price,o=e-this._source._startMeasurePoint.index,n=this._source._startMeasurePoint.price,s=this._source._measurePane,s.defaultPriceScale().isPercent()&&(r=s.mainDataSource().firstValue(),
this._source._endMeasurePoint&&(t=s.defaultPriceScale().priceRange().convertToPercent(t,r)),n=s.defaultPriceScale().priceRange().convertToPercent(n,r)),l=this._source._measurePane.defaultPriceScale().formatter().format(i),this._source._startMeasurePoint.price&&(h=i/this._source._startMeasurePoint.price,l+=" ("+(new S).format(100*h)+")"),this._label=l+"\n"+$.t("{0} bars").format(o),n=this._source._model._magnet.align(n,this._source._startMeasurePoint.index,this._source._measurePane),t=this._source._model._magnet.align(t,e,this._source._measurePane),c=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),d=this._source._model.timeScale().indexToCoordinate(e),p=this._source._measurePane.defaultPriceScale().priceToCoordinate(n),u=this._source._measurePane.defaultPriceScale().priceToCoordinate(t),this._p1=new a.Point(c,p),this._p2=new a.Point(d,u),_=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),f=this._source._model.timeScale().indexToUserTime(e),m=this._source._measurePane.mainDataSource().base(),(_&&f||m)&&(g=(f.valueOf()-_.valueOf())/1e3,v=Math.round(i*m),this._label=l+" , "+v+"\n"+$.t("{0} bars").format(o)+", "+(new T).format(g))},n.prototype.renderer=function(){var t,e,i,o,n,s,r,h,c,d,f,m,g,v=new b,y={};return y.points=[this._p1,this._p2],y.width=this._source._model.timeScale().width(),y.height=this._source._measurePane.defaultPriceScale().height(),y.color="#D3E7FF",y.linewidth=0,y.fillBackground=!0,y.transparency=60,y.backcolor="#BADAFF",v.append(new _(y)),t=this._p1.add(this._p2).scaled(.5),e=new a.Point(this._p1.x,t.y),i=new a.Point(this._p2.x,t.y),o={points:[e,i],width:y.width,height:y.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_ARROW},v.append(new p(o)),e=new a.Point(t.x,this._p1.y),i=new a.Point(t.x,this._p2.y),o={points:[e,i],width:y.width,height:y.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_ARROW},v.append(new p(o)),n={x:0,y:10},s=function(t,e){return{points:[e],text:t,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:n.x,offsetY:n.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:C.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},r=.5*(this._p1.x+this._p2.x),h=this._p2.y,c=new a.Point(r,h),d=s(this._label,c),f=new u(d,this._rendererCache),m=f.measure(),g={x:r+d.backgroundHorzInflate+m.textBgPadding-m.width/m.textBgPadding,y:this._p1.y>this._p2.y?c.y-m.height-2*m.textBgPadding-n.y>0?h-m.height-n.y+m.textBgPadding:n.y-2*m.textBgPadding:c.y+m.height+m.textBgPadding+n.y>y.height?y.height-m.height-n.y:h+m.textBgPadding},f.setPoints([new a.Point(g.x,g.y)]),v.append(f),v},s.prototype.update=function(){},s.prototype.renderer=function(){
var t,e,i,o,n,s={},r=this.source.visible&&this.source.areLinesVisible,a=m.lockTimeAxis().value();return s.horzLinesVisible=r&&this._horzVisible,s.vertLinesVisible=r||a,t=this.pane._model.readOnly(),e=t?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=TradingView.isMobile.any()&&l.isLineTool(this.source._model.currentTool()),o=i?"#a000a0":t?e.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),n=t?e.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!i&&n>0&&(o=C.generateColor(o,n)),s.color=o,s.lineWidth=t?e.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=t?e.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=i&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,new v(s)},r.prototype.update=function(){},r.prototype.renderer=function(){var t,e,i,o,n=this.source.visible&&this.source.areLinesVisible,s=m.lockTimeAxis().value(),r=n&&this._horzVisible,a=n||s;if(("y"!==this._axis||r)&&a)return t=9,e=11,i="y"===this._axis?this.pane.width()-t/2:this.source.lockedX+1,o="y"===this._axis?this.source.y:this.pane.height()-e/2-1,new y({x:i,y:o,width:t,height:e,bodyHeight:7})},t.exports=o}).call(e,i(15))},function(t,e,i){"use strict";function o(t,e){s.call(this),this._header=null,this._crossHair=t,this._model=e,this._items.push(new r("Date","")),this._items.push(new r("Time","")),this._items.push(new r("Price","")),this._defaultFormatter=new a(100)}var n=i(146),s=n.DataWindowView,r=n.DataWindowItem,a=i(27).PriceFormatter,l=i(162).DateFormatter,h=i(122).TimeFormatter;inherit(o,s),o.prototype.update=function(){var t,e,i,o,n,s,r=this._model.mainSeries().isDWM();this._items[1].setVisible(!r),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(t=this._crossHair.appliedIndex(),e=this._model.timeScale().indexToUserTime(t),null===e?(this._items[0].setValue("n/a"),r||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(e)),r||this._items[1].setValue((new h).format(e))),(i=this._crossHair.pane)&&(o=i.defaultPriceScale(),o.isEmpty()||(n=o.mainSource(),s=n?n.formatter():this._defaultFormatter,this._items[2].setValue(s.format(this._crossHair.price)))))},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._crossHair=t,this._model=e,this._rendererData={background:"#585858",color:"white",visible:!0},this._defaultFormatter=new r(100)}var n=i(67),s=i(66),r=i(27).PriceFormatter;inherit(o,s),o.prototype.update=function(){var t,e,i,o=this._rendererData,n=this._crossHair.pane;o.coordinate=this._crossHair.y,this.text="",n&&this._crossHair.visible&&(t=n.defaultPriceScale(),t.isEmpty()||(i=t.mainSource(),e=i?i.formatter():this._defaultFormatter,o.text=e.format(this._crossHair.price)))},o.prototype.renderer=function(){
return this._renderer||(this._renderer=new n(this._rendererData)),this._renderer},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this),this._crosshair=t,this._model=e,this._rendererData={visible:!1,background:"#585858",color:"white",text:""}}var n=i(212),s=i(213),r=i(121).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){var t,e=this._rendererData,i=this._model.timeScale();e.coordinate=this._crosshair.appliedX(),t=i.indexToUserTime(this._crosshair.appliedIndex()),t?(e.visible=!0,e.text=new r(this._model.mainSeries().isDWM()).format(t)):(e.visible=!1,e.text="")},o.prototype.renderer=function(){var t=this._rendererData;return this._renderer||(this._renderer=new s(t)),this._renderer},t.exports=o},function(t,e,i){"use strict";function o(t,e,o,s,r,a,l,h){var c=i(676).ChartUndoModel,d=new c(t,e,o,s,r,a,l,h);return d.model().invalidate(new n(n.FULL_UPDATE)),d}var n=i(21),s=i(25);TradingView.MAMetaInfo=function(){return new s({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var t={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new s(t)},TradingView.DMMetaInfo=function(){return new s({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new s({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},t.exports=o},function(t,e,i){(function(t){"use strict";function o(t,e,i,o,n){function s(t,i,o,n){var r,a=i.split("."),l=a[0];if(e&&e[l]&&(l=e[l]),!t.hasOwnProperty(l)&&n&&n===l)return r=a.splice(1).join("."),void s(t,r,o);if(!t.hasOwnProperty(l))throw Error("illegal path");a.length>1?(r=a.splice(1).join("."),s(t[l],r,o)):t[l]&&t[l].setValue?t[l].setValue(o):t[l]=o}if(void 0!==o&&o)for(var r in o)try{s(t,r,o[r],n)}catch(t){void 0!==i&&i||v.logWarn("Path `"+r+"` does not exist.")}}function n(t,e,i,n){"undefined"!=typeof __defaultsOverrides&&__defaultsOverrides&&o(t,e,i,__defaultsOverrides,n)}function s(){var t=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach(function(e){t.test(e)&&n(TradingView.defaultProperties[e],null,!1,e)})}function r(t,e){var i;/^study_.+/.test(t)&&(i=f.parseIdString(t),y[i.id]=y[i.id]||{},TradingView.merge(y[i.id],e))}function a(t,e){
return e?h(t,e):l(t)}function l(t){var e,i=b(t);return window._UNIT_TESTS||(e=TradingView.clone(TVSettings.getJSON(t,null)))&&TradingView.merge(i,e),i}function h(t,e){var i,o,n=b(t);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(t,null)),t.startsWith("study_")&&i&&_.isVersionHead(i.version)&&(o=e.updateStudyState(i,i),i=o),TradingView.merge(n,i)),n}var c=i(1).LineDataSource,d=i(42),p=i(147),u=i(52).LineToolPitchfork,_=i(80),f=i(25),m=i(81).PlotType,g=i(221),v=i(12).getLogger("Chart.Defaults"),y={},b=function(e){var i,o,r,a,l,h,_,f,v,b={a:function(t,e){return{color:t,visible:e}},b:function(t,e,i){return{coeff:t,color:e,visible:i}},c:function(t,e,i,o,n){return{coeff:t,color:e,visible:i,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===n?1:n}},d:function(t,e,i){return{color:t,width:i,visible:e}},e:function(t,e,i,o,n){return{color:t,visible:e,width:i,x:o,y:n}},f:function(t,e,i,o,n,s){return{coeff1:t,coeff2:e,color:i,visible:o,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===s?1:s}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"au":i="Australia/Sydney";break;case"br":i="America/Sao_Paulo";break;case"ca":i="America/Toronto";break;case"es":i="Europe/Madrid";break;case"fr":i="Europe/Paris";break;case"in":i="Asia/Kolkata";break;case"it":i="Europe/Berlin";break;case"ja":case"kr":i="Asia/Tokyo";break;case"pl":i="Europe/Warsaw";break;case"ru":i="Europe/Moscow";break;case"tr":i="Europe/Athens";break;case"uk":i="Europe/London";break;default:i="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:i,timeScale:{barSpacing:g.DEFAULT_BAR_SPACING,rightOffset:g.DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"rgba( 255, 255, 255, 1)",gridProperties:{color:"#E6E6E6",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"rgba( 152, 152, 152, 1)",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"rgba( 255, 255, 255, 1)",lineColor:"rgba( 85, 85, 85, 1)",textColor:"rgba( 85, 85, 85, 1)",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},
return e?h(t,e):l(t)}function l(t){var e,i=b(t);return window._UNIT_TESTS||(e=TradingView.clone(TVSettings.getJSON(t,null)))&&TradingView.merge(i,e),i}function h(t,e){var i,o,n=b(t);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(t,null)),t.startsWith("study_")&&i&&_.isVersionHead(i.version)&&(o=e.updateStudyState(i,i),i=o),TradingView.merge(n,i)),n}var c=i(1).LineDataSource,d=i(43),p=i(147),u=i(52).LineToolPitchfork,_=i(80),f=i(25),m=i(81).PlotType,g=i(221),v=i(12).getLogger("Chart.Defaults"),y={},b=function(e){var i,o,r,a,l,h,_,f,v,b={a:function(t,e){return{color:t,visible:e}},b:function(t,e,i){return{coeff:t,color:e,visible:i}},c:function(t,e,i,o,n){return{coeff:t,color:e,visible:i,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===n?1:n}},d:function(t,e,i){return{color:t,width:i,visible:e}},e:function(t,e,i,o,n){return{color:t,visible:e,width:i,x:o,y:n}},f:function(t,e,i,o,n,s){return{coeff1:t,coeff2:e,color:i,visible:o,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===s?1:s}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"au":i="Australia/Sydney";break;case"br":i="America/Sao_Paulo";break;case"ca":i="America/Toronto";break;case"es":i="Europe/Madrid";break;case"fr":i="Europe/Paris";break;case"in":i="Asia/Kolkata";break;case"it":i="Europe/Berlin";break;case"ja":case"kr":i="Asia/Tokyo";break;case"pl":i="Europe/Warsaw";break;case"ru":i="Europe/Moscow";break;case"tr":i="Europe/Athens";break;case"uk":i="Europe/London";break;default:i="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:i,timeScale:{barSpacing:g.DEFAULT_BAR_SPACING,rightOffset:g.DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"rgba( 255, 255, 255, 1)",gridProperties:{color:"#E6E6E6",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"rgba( 230, 230, 230, 1)",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"rgba( 152, 152, 152, 1)",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"rgba( 255, 255, 255, 1)",lineColor:"rgba( 85, 85, 85, 1)",textColor:"rgba( 85, 85, 85, 1)",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},
mainSeriesProperties:{style:d.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 226, 116, 91, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,lockScale:!1,minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)"},haStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:d.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",borderUpColorProjection:"rgba( 34, 84, 55, 1)",borderDownColorProjection:"rgba( 91, 26, 19, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},pbStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",borderUpColorProjection:"rgba( 34, 84, 55, 1)",borderDownColorProjection:"rgba( 91, 26, 19, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{
upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",upColorProjection:"rgba( 74, 214, 190, 1)",downColorProjection:"rgba( 214, 73, 207, 1)",inputs:{sources:"HL",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0)",transparency:100},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"rgba( 183, 183, 183, 1)",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,
bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:9786,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:c.LINEEND_NORMAL,rightEnd:c.LINEEND_NORMAL,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,
@@ -728,8 +728,8 @@ e.applyDefaultOverridesToLinetools=s,e.defaults=a}).call(e,i(3))},function(t,e,i
return!0},o.prototype.renderer=function(){var t,e,i,o,l,c,d,p,u;this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new h;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(i=this._lollipops[e],o=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-o-(l.lollipop.incHeight||0)),style:l,createText:this.createText},i),d=this.getTemplate(i.hovered?"hovered":"default",i),p={circlePoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:d,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},t.append(new s(p)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(u={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},startPoint:new a.Point(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a.Point(i.basePoint.x,i.barY)},t.append(new n(u))),t.append(new r(c,this))));return t},o.prototype.getTemplate=function(t,e){var i=t;return e.stack&&(i+="_stack:"+e.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(t,e))),this.templatesCache[i]},o.prototype.createTemplate=function(t){var e=document.createElement("canvas"),i=e.getContext("2d"),o=new a.Point(t.lollipop.width/2,t.lollipop.height-t.lollipop.circleHeight-(t.lollipop.incHeight||0));return this.drawCircle(i,t,o),this.drawLabel(i,t,o),e},o.prototype.drawCircle=function(t,e,i){t.strokeStyle=e.strokeStyle,t.fillStyle=e.lollipop.fillStyle,t.lineWidth=e.lollipop.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_SOLID),t.beginPath(),t.arc(i.x,i.y,e.lollipop.radius,0,2*Math.PI,!1),t.closePath(),t.stroke(),e.lollipop.fillCircle&&t.fill()},o.prototype.drawLabel=function(t,e,i){t.textAlign="center",t.textBaseline="middle",t.fillStyle=e.lollipop.text.strokeStyle,t.font=e.lollipop.text.font,t.fillText(e.lollipop.text.label,i.x,i.y)},o.prototype._lollipopMouseClickHandler=function(t){this._lastClickedId=this._lastClickedId===t?null:t},n.prototype.draw=function(t){t.strokeStyle=this.data.style.strokeStyle,t.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(t,this.data.style.lineStyle),CanvasEx.drawLine(t,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},n.prototype.hitTest=function(t){return null},s.prototype.hitTest=function(t){return a.isInCircle(this.data.circlePoint,this.data.style.lollipop.radius,t)?this._hittest:null},s.prototype.draw=function(t){var e=this.data.template;t.drawImage(e,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},r.prototype.draw=function(t){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,
y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:t.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},r.prototype.hitTest=function(t){return null},r.TextRenderer=function(t){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",t&&(this.importance=t)},r.TextRenderer.prototype.draw=function(t,e){var i,o,n=e.y;for(i=0;i<this.lines.length;i++)o=this.lines[i],t.font=this.font,o.options.fontWeight&&(t.font=o.options.fontWeight+" "+this.font),t.fillStyle=this.fillStyle,o.renderer(t,o.line,{x:e.x,y:n}),n+=this.lineSpacing+this.fontHeight},r.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},r.TextRenderer.prototype.basicRenderer=function(t,e,i){t.fillText(e,i.x,i.y)},r.TextRenderer.prototype.addMulticolorTextLine=function(t,e){this.addTextLine(t,e,this.multicolorRenderer)},r.TextRenderer.prototype.addTextLine=function(t,e,i){i||(i=this.basicRenderer),e||(e={}),this.lines.push({line:t,renderer:i,options:e})},r.TextRenderer.prototype.multicolorRenderer=function(t,e,i){var o,n,s=i.x;for(o=0;o<e.length;++o)n=e[o],t.fillStyle=n.color,t.fillText(n.text,s,i.y),s+=t.measureText(n.text).width},e.ESDPaneView=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._series=t,this._invalidated=!0}var s=i(2),r=i(6),a=i(162).DateFormatter,l=i(122).TimeFormatter;o.prototype.hittest=function(){},o.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d=5,p=12,u=5,_=8,f=13,m=0;t.save(),t.setFont(f+"px Arial"),o=$.t("Last available bar"),this._data.eod?m=t.measureText(o).width:(e=t.measureText(this._data.dateString||"").width,i=t.measureText(this._data.timeString||"").width,m=Math.max(e,i)),n=this._data.timeString?2:1,t.fillStyle=this._data.eod?"#FF4040":"#58A3CD",t.translate(this._data.point.x+.5,this._data.point.y+.5),s=Math.round(-m/2)-_,r=-(f+d)*n-d-p-u,a=Math.round(s+m+2*_),l=-p-u,t.beginPath(),t.moveTo(s,r),t.lineTo(a,r),t.lineTo(a,l),t.lineTo(p,l),t.lineTo(0,l+p),t.lineTo(-p,l),t.lineTo(s,l),t.fill(),t.fillStyle="#FFFFFF",t.textBaseline="top",this._data.eod?t.fillText(o,s+_,r+d):(h=s+_+(m-e)/2,t.fillText(this._data.dateString,h,r+d),this._data.timeString&&(c=s+_+(m-i)/2,t.fillText(this._data.timeString,c,r+2*d+f))),t.restore()},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,r;delete this._point,delete this._dateString,delete this._timeString,delete this._eod,void 0!==(t=this._series.gotoDateResult())&&(e=t.index,(i=this._series.bars().valueAt(e))&&(o=this._series.priceScale().priceToCoordinate(i[TradingView.HIGH_PLOT]),n=this._series.model().timeScale().indexToCoordinate(e),this._point=new s.Point(n,o),t.eod?this._eod=!0:(r=this._series.model().timeScale().indexToUserTime(e),this._dateString=(new a).format(r),this._series.isDWM()||(this._timeString=(new l).format(r)))))},
n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._point?new o({point:this._point,dateString:this._dateString,timeString:this._timeString,eod:this._eod}):new r},t.exports=n},function(t,e){"use strict";function i(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function o(t,e){this.source=t,this.pane=e}function n(t){this.data=t}i.prototype.paneViews=function(t){return[new o(this,t)]},o.prototype.update=function(){},o.prototype.renderer=function(){var t={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(t.horzLinesVisible=!0,t.vertLinesVisible=!0,t.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),t.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),t.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),t.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),t.priceMarks=this.pane.defaultPriceScale().marks(),t.timeMarks=this.pane.timeScale().marks(),t.w=this.pane.width(),t.h=this.pane.height(),new n(t))},n.prototype.draw=function(t){var e;if(t.lineWidth=1,this.data.vertLinesVisible){for(t.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(t,this.data.vertLineStyle),t.beginPath(),e=0;e<this.data.timeMarks.length;e++)t.moveTo(this.data.timeMarks[e].coord+1,0),t.lineTo(this.data.timeMarks[e].coord+1,this.data.h);t.stroke()}if(this.data.horzLinesVisible){for(t.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(t,this.data.horzLineStyle),t.beginPath(),e=0;e<this.data.priceMarks.length;e++)t.moveTo(0,this.data.priceMarks[e].coord),t.lineTo(this.data.w,this.data.priceMarks[e].coord);t.stroke()}},t.exports=i},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArrow";var i=e||new s("linetoolarrow");n.call(this,t,i)}var n=i(11).LineToolTrendLine,s=i(7).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Arrow"},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolExtended";var i=e||new s("linetoolextended");n.call(this,t,i)}var n=i(11).LineToolTrendLine,s=i(7).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Extended Line"},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlagMark";var i=e||new a("linetoolflagmark");s.call(this,t,new r(this,t,this.image,25,25,-8,-21),i),this._paneViews[0].setAnchors(new n.Point(0,0))}var n=i(2),s=i(1).LineDataSource,r=i(342),a=i(7).DefaultProperty;inherit(o,s),o.prototype.image=new Image,
o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Flag Mark"},o.prototype.version=2,o.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new n.Point(9,21)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolinsidepitchfork");s.call(this,t,i),this._constructor="LineToolInsidePitchfork"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Inside Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRay";var i=e||new s("linetoolray");n.call(this,t,i)}var n=i(11).LineToolTrendLine,s=i(7).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Ray"},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork2");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork2"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(2);o.prototype._locationToY=function(t,e,i){var o,s,r,a,l,h,c;switch(i||(i=0),o=[],s=this._study.priceScale(),t){case CanvasEx.MARKLOC_ABOVEBAR:r=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:r=TradingView.LOW_PLOT}for(a=this._study.firstValue(),i>=1&&(i-=1),l=-i;l<=i;l++)(h=this._study.series().bars().valueAt(e+l))&&(c=h[r],s.isPercent()&&(c=s.priceRange().convertToPercent(c,a)),o.push(s.priceToCoordinate(c)));switch(t){case CanvasEx.MARKLOC_ABOVEBAR:return n.min(o)-15;case CanvasEx.MARKLOC_BELOWBAR:return n.max(o)+15}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._magnetProperty=t,this._timeScale=e}var n=i(42);o.prototype.align=function(t,e,i){var o,s,r,a,l,h,c,d,p,u=50,_=i.defaultPriceScale(),f=_.priceToCoordinate(t),m=t;if(!this._magnetProperty.value())return m;for(o=_.dataSources(),s=null,r=0;r<o.length;r++)if(o[r]instanceof n){s=o[r];break}if(s&&(a=s.bars(),a.contains(e)&&(l=a.valueAt(e),
h=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],_=s.priceScale(),!_.isEmpty()))){if(c=[],_.isPercent())for(d=s.firstValue(),r=0;r<h.length;r++)h[r]=_.priceRange().convertToPercent(h[r],d);for(r=0;r<h.length;r++)c.push({y:_.priceToCoordinate(h[r]),price:h[r]});c.sort(function(t,e){return Math.abs(t.y-f)-Math.abs(e.y-f)}),p=c[0],Math.abs(p.y-f)<u&&(m=p.price)}return m},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e){n.call(this,t,e)}var n=i(347);inherit(o,n),o.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice},o.prototype._updateImpl=function(t){var i,o,n,s,r,a,l,h,c,d,p,u=this._rendererData;u.visible=!1,u.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(this._model.timeScale().isEmpty()||this._series.priceScale().isEmpty()||!this.lastPrice()||(t=this._model.timeScale().visibleBars(),t.isEmpty()||void 0!==(i=this._series.data().search(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT))&&(u.visible=!0,o=this._series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this._series.data().valueAt(o)[TradingView.CLOSE_PLOT],s=this.lastPrice(),this._series.priceScale().properties().percentage.value()&&(s=100*(s-n)/n),u.text=this._series.priceScale().formatter().format(s),r=this._series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,r?this._series.properties().haStyle.showRealLastPrice.value()?(a=this._series.lastValueData(TradingView.CLOSE_PLOT,!0),a.noData||a.color===this._background||(this._background=a.color),e.enabled("countdown")&&this._series.properties().showCountdown.value()?u.secondLine=this._countdownInfo():u.secondLine=null,l=this._series.lastValueData(TradingView.CLOSE_PLOT,!1).index,h=a.index,c=l===h,u.visible=c):u.visible=!1:(d=this._series.barColorer(),p=d.barStyle(i.index,!0),this._background=p.barColor),this._background!==u.background&&(u.background=this._background,u.color=this.color()),u.coordinate=this._series.priceScale().priceToCoordinate(s))))},t.exports=o}).call(e,i(3))},function(t,e){t.exports={STATUS_OFFLINE:0,STATUS_RESOLVING:1,STATUS_LOADING:2,STATUS_READY:3,STATUS_INVALID_SYMBOL:4,STATUS_SNAPSHOT:5,STATUS_EOD:6,STATUS_PULSE:7,STATUS_DELAYED:8,STATUS_DELAYED_STREAMING:9,STATUS_NO_BARS:10}},function(t,e,i){"use strict";function o(t,e){c.call(this),this._series=t,this._model=e,this._items.push(new d($.t("O",{context:"in_legend"}),"")),this._items.push(new d($.t("H",{context:"in_legend"}),"")),this._items.push(new d($.t("L",{context:"in_legend"}),"")),this._items.push(new d($.t("C",{context:"in_legend"}),"")),this._invalidated=!0,this.update()}var n=i(36),s=n.parseRgb,r=n.distanceRgb,a=n.invertRgb,l=n.rgbToHexString,h=i(146),c=h.DataWindowView,d=h.DataWindowItem,p=i(164).translatedIntervalString;inherit(o,c),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,h,c,d,u,_,f,m,g
o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Flag Mark"},o.prototype.version=2,o.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new n.Point(9,21)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolinsidepitchfork");s.call(this,t,i),this._constructor="LineToolInsidePitchfork"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Inside Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRay";var i=e||new s("linetoolray");n.call(this,t,i)}var n=i(11).LineToolTrendLine,s=i(7).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Ray"},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork2");s.call(this,t,i),this._constructor="LineToolSchiffPitchfork2"}var n=i(23),s=i(52).LineToolPitchfork;inherit(o,s),o.prototype.title=function(){return $.t("Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(2);o.prototype._locationToY=function(t,e,i){var o,s,r,a,l,h,c;switch(i||(i=0),o=[],s=this._study.priceScale(),t){case CanvasEx.MARKLOC_ABOVEBAR:r=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:r=TradingView.LOW_PLOT}for(a=this._study.firstValue(),i>=1&&(i-=1),l=-i;l<=i;l++)(h=this._study.series().bars().valueAt(e+l))&&(c=h[r],s.isPercent()&&(c=s.priceRange().convertToPercent(c,a)),o.push(s.priceToCoordinate(c)));switch(t){case CanvasEx.MARKLOC_ABOVEBAR:return n.min(o)-15;case CanvasEx.MARKLOC_BELOWBAR:return n.max(o)+15}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._magnetProperty=t,this._timeScale=e}var n=i(43);o.prototype.align=function(t,e,i){var o,s,r,a,l,h,c,d,p,u=50,_=i.defaultPriceScale(),f=_.priceToCoordinate(t),m=t;if(!this._magnetProperty.value())return m;for(o=_.dataSources(),s=null,r=0;r<o.length;r++)if(o[r]instanceof n){s=o[r];break}if(s&&(a=s.bars(),a.contains(e)&&(l=a.valueAt(e),
h=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],_=s.priceScale(),!_.isEmpty()))){if(c=[],_.isPercent())for(d=s.firstValue(),r=0;r<h.length;r++)h[r]=_.priceRange().convertToPercent(h[r],d);for(r=0;r<h.length;r++)c.push({y:_.priceToCoordinate(h[r]),price:h[r]});c.sort(function(t,e){return Math.abs(t.y-f)-Math.abs(e.y-f)}),p=c[0],Math.abs(p.y-f)<u&&(m=p.price)}return m},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e){n.call(this,t,e)}var n=i(347);inherit(o,n),o.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice},o.prototype._updateImpl=function(t){var i,o,n,s,r,a,l,h,c,d,p,u=this._rendererData;u.visible=!1,u.text="",this._model.properties().scalesProperties.showSeriesLastValue.value()&&(this._model.timeScale().isEmpty()||this._series.priceScale().isEmpty()||!this.lastPrice()||(t=this._model.timeScale().visibleBars(),t.isEmpty()||void 0!==(i=this._series.data().search(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT))&&(u.visible=!0,o=this._series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),n=this._series.data().valueAt(o)[TradingView.CLOSE_PLOT],s=this.lastPrice(),this._series.priceScale().properties().percentage.value()&&(s=100*(s-n)/n),u.text=this._series.priceScale().formatter().format(s),r=this._series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,r?this._series.properties().haStyle.showRealLastPrice.value()?(a=this._series.lastValueData(TradingView.CLOSE_PLOT,!0),a.noData||a.color===this._background||(this._background=a.color),e.enabled("countdown")&&this._series.properties().showCountdown.value()?u.secondLine=this._countdownInfo():u.secondLine=null,l=this._series.lastValueData(TradingView.CLOSE_PLOT,!1).index,h=a.index,c=l===h,u.visible=c):u.visible=!1:(d=this._series.barColorer(),p=d.barStyle(i.index,!0),this._background=p.barColor),this._background!==u.background&&(u.background=this._background,u.color=this.color()),u.coordinate=this._series.priceScale().priceToCoordinate(s))))},t.exports=o}).call(e,i(3))},function(t,e){t.exports={STATUS_OFFLINE:0,STATUS_RESOLVING:1,STATUS_LOADING:2,STATUS_READY:3,STATUS_INVALID_SYMBOL:4,STATUS_SNAPSHOT:5,STATUS_EOD:6,STATUS_PULSE:7,STATUS_DELAYED:8,STATUS_DELAYED_STREAMING:9,STATUS_NO_BARS:10}},function(t,e,i){"use strict";function o(t,e){c.call(this),this._series=t,this._model=e,this._items.push(new d($.t("O",{context:"in_legend"}),"")),this._items.push(new d($.t("H",{context:"in_legend"}),"")),this._items.push(new d($.t("L",{context:"in_legend"}),"")),this._items.push(new d($.t("C",{context:"in_legend"}),"")),this._invalidated=!0,this.update()}var n=i(37),s=n.parseRgb,r=n.distanceRgb,a=n.invertRgb,l=n.rgbToHexString,h=i(146),c=h.DataWindowView,d=h.DataWindowItem,p=i(164).translatedIntervalString;inherit(o,c),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,h,c,d,u,_,f,m,g
;if(this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,p(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol(),this._items[0].setValue($.t("n/a")),this._items[1].setValue($.t("n/a")),this._items[2].setValue($.t("n/a")),this._items[3].setValue($.t("n/a")),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()&&(t=this._series.data().size()-1,e=this._model.crossHairSource().appliedIndex(),void 0!==(i=isNumber(e)?this._series.nearestIndex(e,TradingView.SEARCH_NEAREST_LEFT):this._series.nearestIndex(t,TradingView.SEARCH_NEAREST_LEFT))))for(o=this._series.data().valueAt(i),n=this._series.formatter(),this._items[0].setValue(n.format(o[TradingView.OPEN_PLOT])),this._items[1].setValue(n.format(o[TradingView.HIGH_PLOT])),this._items[2].setValue(n.format(o[TradingView.LOW_PLOT])),this._items[3].setValue(n.format(o[TradingView.CLOSE_PLOT])),h=this._series.barColorer(),c=h.barStyle(i,!1),d=null!=c.barBorderColor?c.barBorderColor:c.barColor,u=this._series.model().paneForSource(this._series),_=u._properties.background.value(),f=s(d),m=s(_),r(f,m)<70&&(d=l(a(f))),g=0;g<4;g++)this._items[g].setColor(d)},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},o.prototype.dump=function(){return{header:this._header,items:this._items}},o.prototype.additional=function(){if(this._series.dataPoweredBy)return"(Data Provided by "+this._series.dataPoweredBy+")"},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._series=t,this._series.onRestarted().subscribe(this,o.prototype.invalidate),this._series.onSymbolResolved().subscribe(this,o.prototype.invalidate),this._series.onCompleted().subscribe(this,o.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,o.prototype.invalidate)}var n=i(348);inherit(o,n),o.prototype.invalidate=function(){delete this._text,this.update()},o.prototype.getSeriesPrecision=function(){var t=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(t=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),t},o.prototype.round=function(t){var e=this.getSeriesPrecision(),i=Math.round(t*Math.pow(10,e))/Math.pow(10,e);return i||""},o.prototype.update=function(){if(!("_text"in this)){var t=this._series.symbolInfo()||{};this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=this._series.constructor.generateTitleForGui({description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?t.name:t.description,exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?t.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,
reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()})}},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._data=t,this._colors=this.getBackgroundColor(e)}function n(t,e,i){this._series=t,this._lastBar=e,this._direction=i}i(282),i(12).getLogger("Chart.Snapshot");o.prototype.hitTest=function(){return null},o.prototype.getBackgroundColor=function(t){return[{background:"rgba(255, 158, 171, 0.3)",line:"#7E202F"},{background:"rgba(244, 255, 158, 0.3)",line:"#EBFF3F"},{background:"rgba(195, 255, 160, 0.3)",line:"#308020"}][t+1]},o.prototype.draw=function(t){t.fillStyle=this._colors.background,t.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height),t.strokeStyle=this._colors.line,t.beginPath(),t.lineWidth=1;var e=Math.round(this._data.x);t.moveTo(e,0),t.lineTo(e,this._data.height),t.stroke()},n.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)+.5*this._series.m_model.timeScale().barSpacing()+1},n.prototype.renderer=function(){var t={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()},e=this._series.data().bars(),i=e.last().value[TradingView.CLOSE_PLOT]>e.valueAt(this._lastBar)[TradingView.CLOSE_PLOT]?1:-1,n=0;return 1===this._direction?n=i:2===this._direction&&(n=-1*i),new o(t,n)},e.FutureBarsPaneView=n},function(t,e,i){"use strict";function o(t){this._data=t}function n(t){this._data=t}function s(t,e){for(var i,o,n,s=0,r=t.length-1;s<=r;)if(i=s+r>>>1,o=t[i].y1,n=t[i].y2,o>e)s=i+1;else{if(!(n<e))return t[i+1]&&o===t[i+1].y1?i+1:i;r=i-1}return-1}var r=i(2),a=i(16).TextRenderer,l=i(89).HorzLineRenderer,h=i(11).TrendLineRenderer,c=i(66),d=i(67),p=i(92),u=TradingView.Study,_=i(694),f=i(8),m=i(6),g=i(120).clearRect,v=i(14),y=i(12).getLogger("Chart.StudyGraphicsPaneViews");u.graphicsZOrderPriority=function(t){switch(t){case"polygons":return-100;case"trendchannels":return-90;default:return 0}},u.StudyPaneView_horizlines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_horizlines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_horizlines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;if(this._data=[],(t=this._study.graphics().horizlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.horizlines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u=o[p.startIndex],_=o[p.endIndex],!p.extendRight&&Math.max(u,_)<s||!p.extendLeft&&Math.min(u,_)>a||(f={},m=i.indexToCoordinate(u),g=i.indexToCoordinate(_),v=p.level,
e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),w=new r.Point(m,b),S=new r.Point(g,b),f.points=[w,S],f.extendleft=p.extendLeft,f.extendright=p.extendRight,f.width=i.width(),f.height=e.height(),f.color=c.color.value(),f.linewidth=c.width.value(),f.linestyle=c.style.value(),this._data.push(f))},u.StudyPaneView_vertlines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_vertlines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_vertlines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w;if(this._data=[],(t=this._study.graphics().vertlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.vertlines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u={},o[p.index]<s||o[p.index]>a||(_=i.indexToCoordinate(o[p.index])+1,f=null,p.extendBottom?m=e.height():(v=p.startPrice,e.isPercent()&&(f=f||this._study.firstValue(),v=e.priceRange().convertToPercent(v,f)),m=e.priceToCoordinate(v)),p.extendTop?g=0:(y=p.endPrice,e.isPercent()&&(f=f||this._study.firstValue(),y=e.priceRange().convertToPercent(y,f)),g=e.priceToCoordinate(y)),b=new r.Point(_,m),w=new r.Point(_,g),u.points=[b,w],u.extendleft=p.extendBottom,u.extendright=p.extendTop,u.width=i.width(),u.height=e.height(),u.color=c.color.value(),u.linewidth=c.width.value(),u.linestyle=c.style.value(),this._data.push(u))},u.StudyPaneView_lines=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_lines.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)t.append(new h(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_lines.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S,T,C;if(this._data=[],(t=this._study.graphics().lines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(h=t[l],h.data&&(c=this._study.properties().graphics.lines[h.styleId],c.visible.value()))for(d=0;d<h.data.length;d++)p=h.data[d],u=o[p.startIndex]+(p.startOffset||0),_=o[p.endIndex]+(p.endOffset||0),!p.extendRight&&Math.max(u,_)<s||!p.extendLeft&&Math.min(u,_)>a||(f={},m=i.indexToCoordinate(u),g=i.indexToCoordinate(_),v=p.startPrice,y=p.endPrice,e.isPercent()&&(b=this._study.firstValue(),
@@ -748,8 +748,8 @@ var t,e=this.maxIndex-this.minIndex;if(0!==e)return t=this._marksByIndex[this.ma
var e,i,o,n,s=this._properties.rightOffset.value();if(t)return e=this,i=this.m_rightOffset,o=this.m_width/this.m_barSpacing-10,o>0&&s>o&&(s=o),n=this._model,void $({offset:i}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",step:function(t){e._visibleBarsCache=null,e.m_rightOffset=t,n.recalculateAllPanes(),n.invalidate(new c(c.LIGHT_UPDATE)),n.recalcVisibleRangeStudy(n.dataSources())}});this._visibleBarsCache=null,this.m_rightOffset=s,this._correctOffset()},s.prototype.points=function(){return this.m_points},s.prototype.width=function(){return this.m_width},s.prototype.barSpacing=function(){return this.m_barSpacing},s.prototype.setWidth=function(t){this._visibleBarsCache=null,!isFinite(t)||t<=0||(this._locked&&this.m_width&&(this.m_barSpacing*=t/this.m_width),this.m_width=t,this._correctOffset())},s.prototype.visibleBars=function(){var t,e,i,o;if(this._visibleBarsCache)return this._visibleBarsCache;if(!this.isEmpty())return t=Math.ceil(this.m_width/this.m_barSpacing)-1,e=Math.round(this.m_rightOffset+this.m_points.lastTimePointIndex()),i=e-t,o=new a(i,e),this._visibleBarsCache=o,o},s.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},s.prototype.indexToCoordinate=function(t,e){var i,o;return this.isEmpty()?0:TradingView.isInteger(t)?(i=this.m_points.lastTimePointIndex()+this.m_rightOffset-t,o=this.m_width-(i+.5)*this.m_barSpacing,e?o:Math.round(o)):0},s.prototype.barIndexesToCoordinates=function(t){var e,i,o,n;for(e=0;e<t.length;e++)i=t[e].time,o=this.m_points.lastTimePointIndex()+this.m_rightOffset-i,n=this.m_width-(o+.5)*this.m_barSpacing,t[e].time=Math.round(n),t[e].exactTime=n},s.prototype.indexesToCoordinates=function(t){var e,i,o,n=this.m_points.lastTimePointIndex()+this.m_rightOffset,s=this.m_width-n*this.m_barSpacing-.5*this.m_barSpacing;for(e=0;e<t.length;e++)i=t[e].x,o=s+i*this.m_barSpacing,t[e].x=Math.round(o)},s.prototype.coordinateToIndex=function(t){var e=(this.m_width+1-t)/this.m_barSpacing,i=this.m_points.lastTimePointIndex(),o=i+this.m_rightOffset-e,n=Math.round(1e6*o)/1e6;return Math.ceil(n)},s.prototype.timeToCoordinate=function(t){function e(t){return t<=0||t>=l.m_width}var i,o,n,s=this.m_points.closestIndexLeft(t),r=this.m_points.valueAt(s),a=this.indexToCoordinate(s,!0),l=this;return e(a)?null:(i=this.barSpacing(),o=function(){var t=this.m_points.lastTimePointIndex();return this.m_points.valueAt(t)-this.m_points.valueAt(t-1)}.bind(this)(),n=Math.round(a+(t-r)/o*i)+1,e(n)?null:n)},s.prototype.alignCoordinate=function(t){if(this.isEmpty())return t;var e=this.coordinateToIndex(t);return this.indexToCoordinate(e)},s.prototype.timePointToIndex=function(t){return this.m_points.indexOf(t,!0)},s.prototype.indexToTimePoint=function(t){var e=this.m_points.valueAt(t);return e?new Date(1e3*e):null},s.prototype.indexToUserTime=function(t){return this.m_tickmarks.indexToTime(t)},s.prototype.marks=function(){var t,e,i,o,n,s,r,a,l,h,c,d;if(this.isEmpty())return null;for(t=this.m_barSpacing,e=this._scalesProperties.fontSize.value()||0,i=5*(e+4),o=Math.round(i/t),
n=this.visibleBars(),s=Math.max(n.firstBar(),n.firstBar()-o),r=Math.max(n.lastBar(),n.lastBar()-o),a=this.m_tickmarks.build(t,i),l=[],h=0;h<a.length;++h)c=a[h],s<=c.index&&c.index<=r&&null!==(d=this.m_tickmarks.indexToTime(c.index))&&l.push({coord:this.indexToCoordinate(c.index),label:this.formatLabel(d,c.span),span:c.span,major:c.label>=_.DAY_SPAN?1:0});return l},s.prototype.state=function(t){var e={};return e.m_barSpacing=this.barSpacing(),e.m_rightOffset=this.m_rightOffset,t&&(this.m_points.size()>0&&(e.m_lastVisibleBar=this.m_points.valueAt(this.m_points.lastTimePointIndex())),e.points=this.m_points.state(),e.tickmarks=this.m_tickmarks.state(),e.width=this.m_width),e},s.prototype.restoreState=function(t,e,i){var o,n,s;return this._visibleBarsCache=null,void 0===t.m_barSpacing?void f.logDebug("TimeScale.restoreState: invalid state"):void 0===t.m_rightOffset?void f.logDebug("TimeScale.restoreState: invalid state"):(this.m_barSpacing=t.m_barSpacing,this.m_rightOffset=t.m_rightOffset,this.m_restoredLastTimePoint=t.m_lastVisibleBar,i&&this.m_restoredLastTimePoint&&(o=this.m_points.indexOf(this.m_restoredLastTimePoint),n=this.m_points.lastTimePointIndex(),s=n-o,this.m_rightOffset=-s+t.m_rightOffset),e&&(this.m_points.restoreState(t.points),this.m_tickmarks.restoreState(t.tickmarks),t.width&&(this._locked=!0,this.m_width>0&&(this.m_barSpacing*=this.m_width/t.width))),void this._correctOffset())},s.prototype.setOffset=function(t){if(this._visibleBarsCache=null,void 0===t)return void f.logDebug("TimeScale.setOffset: invalid state");this.m_rightOffset=t,this._correctOffset()},s.prototype.setBarSpacing=function(t){if(this._visibleBarsCache=null,void 0===t)return void f.logDebug("TimeScale.setBarSpacing: invalid state");this.m_barSpacing=t},s.prototype._correctOffset=function(){if(!this.isEmpty()){var t=this.m_width/this.m_barSpacing-10;t>0&&this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsCache=null),t=this.m_points.size()-10,this.m_rightOffset<-t&&(this.m_rightOffset=-t,this._visibleBarsCache=null)}},s.prototype.maxOffset=function(){return this.m_width/this.m_barSpacing-10},s.prototype.startScale=function(t){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=t,this.m_stateSnapshot=this.state()))},s.prototype.scaleTo=function(t){var e,i;this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_stateSnapshot&&(e=r.clamp(this.m_width-t,0,this.m_width),i=r.clamp(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==e&&0!==i&&(this.m_barSpacing=this.m_stateSnapshot.m_barSpacing*e/i,this.m_barSpacing<y?this.m_barSpacing=y:this.m_barSpacing>v&&(this.m_barSpacing=v),this._correctOffset(),this.recalcLockedScale()))},s.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.saveDefault("barSpacing"))},s.prototype.saveDefault=function(t){d(!0),this._properties[t].setValue(this["m_"+t]),d(!1)},s.prototype.startScroll=function(t){
null===this.m_scrollStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_stateSnapshot=this.state()))},s.prototype.scrollTo=function(t){if(this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_scrollStartPoint){var e=(this.m_scrollStartPoint-t)/this.barSpacing();this.m_rightOffset=this.m_stateSnapshot.m_rightOffset+e,this._correctOffset(),this._model.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale(),this._onScroll.fire()}},s.prototype.scrollToOffsetAnimated=function(t,e){var i,o,n,s;if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(void 0===e&&(e=400),!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,o=this.m_rightOffset,n=+new Date,s=this._model,function r(){i._visibleBarsCache=null;var a=(new Date-n)/e;if(a>=1)return i.m_rightOffset=t,i._visibleBarsCache=null,s.recalculateAllPanes(),void s.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=o+(t-o)*a,s.recalculateAllPanes(),setTimeout(r,20)}()},s.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_stateSnapshot=null)},s.prototype._currentSavedPosition=function(){var t,e,i;this.isEmpty()||(t=this.m_points.indexOf(this.m_restoredLastTimePoint,!0),TradingView.isInteger(t)&&(e=this.m_points.lastTimePointIndex(),i=e-t,this.m_rightOffset-=i),delete this.m_restoredLastTimePoint)},s.prototype.update=function(t,e,i,o){this._visibleBarsCache=null,this.m_tickmarks.merge(o),this.m_points.merge(t,e,i),this.m_restoredLastTimePoint&&this._currentSavedPosition()},s.prototype.addTail=function(t,e,i){var o,n,s;for(this.m_tickmarks.removeTail(e),o=t.params,n=this.m_tickmarks.maxIndex+(i?0:1),s=0;s<o.marks.length;s++)o.marks[s].index=n+s;this.m_tickmarks.addTail(o.marks),this.m_points.addTail(o.changes,i),this.m_rightOffset-=o.changes.length},s.prototype.formatLabel=function(t,e){if(this._formattedBySpan[e])return this._formattedBySpan[e].format(t.valueOf());var i=this;return this._formattedBySpan[e]=new l(function(t){return i.formatLabelImpl(new Date(t),e)}),this._formattedBySpan[e].format(t)},s.prototype.formatLabelImpl=function(t,e){if(!(t&&t instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return e<_.MINUTE_SPAN&&!i?p(t.getUTCHours(),2)+":"+p(t.getUTCMinutes(),2)+":"+p(t.getUTCSeconds(),2):e<_.DAY_SPAN&&!i?p(t.getUTCHours(),2)+":"+p(t.getUTCMinutes(),2):e<_.WEEK_SPAN?t.getUTCDate():e<_.MONTH_SPAN?t.getUTCDate():e<_.YEAR_SPAN?(g||(g=n()),g[t.getUTCMonth()]):t.getUTCFullYear()},s.prototype.normalizeBarIndex=function(t){var e=0,i=0;return t<this.m_points.firstTimePointIndex()?(e=this.m_points.valueAt(this.m_points.firstTimePointIndex()),i=t-this.m_points.firstTimePointIndex()):t>this.m_points.lastTimePointIndex()?(e=this.m_points.valueAt(this.m_points.lastTimePointIndex()),i=t-this.m_points.lastTimePointIndex()):(e=this.m_points.valueAt(t),i=0),{time_t:e,offset:i}},s.prototype.denormalizeTimePoint=function(t){
var e=this.m_points.indexOf(t.time_t);if(void 0!==e)return e+t.offset},s.prototype.zoomToBarsRange=function(t,e){if(!(e<=t)){var i=this.m_points.lastTimePointIndex();i&&(this.m_rightOffset=e-i),this.m_barSpacing=this.width()/(e-t+1),this._visibleBarsCache=null}},s.prototype.recalcLockedScale=function(){var t,e,i,n,s,r,a,l;this._model.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()&&(t=this._model.m_mainSeries.priceScale(),e=this._model.m_mainSeries,i=e.data().boxSize,i||(e.fixBoxSize(),i=e.data().boxSize),i&&(t.properties().percentage.value()&&(n=e.data().search(e.getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),s=t.internalHeight()/(this.barSpacing()/i),(r=e.priceScale().priceRange())&&s===r.length()||(!r||r.isEmpty()?(a=this.visibleBars(),r=e.priceRange(a.firstBar(),a.lastBar())):(l=(s-r.length())/2,r.set(r.minValue()-l,r.maxValue()+l)),e.priceScale().setPriceRange(r))))},s.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(_.DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),v)))},s.prototype.canZoomIn=function(){return this.m_barSpacing<v},s.prototype.canZoomOut=function(){return this.m_barSpacing>y},s.prototype.onScroll=function(){return this._onScroll},t.exports=s}).call(e,i(15),i(107))},function(t,e,i){"use strict";function o(t){r.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())})}function n(t){a.call(this)}var s=i(102),r=s.BarsMarksContainer,a=s.BarMarkTooltip,l=i(41);inherit(o,r),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedBarsMarks",o.prototype._plateViewData=function(t){var e={text:t.text};return"object"==typeof t.color&&(e.theme="user_defined_theme",e.overridedTheme={},e.overridedTheme.border=t.color.border,e.overridedTheme.background=t.color.background),e},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;this._marks[t].onClicked()},o.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype._createTooltip=function(){return new n},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},inherit(n,a),n.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),
this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},n.prototype._updatePlate=function(t){this._currentId=t.id,this._layout.css("border-color",t.theme.border),this._layout.css("margin-top",t.tooltipMargin+"px"),this._layout_text.html(t.text),this._layout.append(this._layout_text)},t.exports=o},function(t,e,i){"use strict";function o(t){a.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new n(this)}function n(t,e){this.source=t,this._rendererFactory=e,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var s=i(2),r=i(684).ESDPaneView,a=i(102).BarsMarksContainer,l=i(41),h=i(34),c=i(260).Tooltip;inherit(o,a),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedTimescaleMarks",o.prototype._plateViewData=function(t){return{text:t.text}},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;h.emit("onTimescaleMarkClick",t)},o.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},o.prototype.paneViews=function(t){return this._properties.visible.value()?[this._paneView]:[]},o.prototype.onClickOutside=function(t){this._paneView.onClickOutside(t)},inherit(n,r),n.prototype._createLollipops=function(){var t=this.source._model.timeScale(),e=r.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this;$.each(this.source._marks,function(n,r){var a=r.id;o._lollipops[a]={id:a,basePoint:new s.Point(t.indexToCoordinate(t.timePointToIndex(r.tickmark))+1,e),hovered:i&&i.id===a||a===o.getLastClickedLollipopId(),barY:null,label:r.label,color:r.color,items:r.tooltip,tooltip:o._lollipops.hasOwnProperty(a)?o._lollipops[a].tooltip:new c,visible:!0}})},n.prototype.update=function(){this._createLollipops()},n.prototype.renderer=function(){return this.update(),r.prototype.renderer.call(this)},n.prototype._generateTemplateStyle=function(t,e,i){var o,n,s=t+e+i;return s in this.stylesCache||(o={strokeStyle:e,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:e,font:"normal 12px Verdana, Arial, sans-serif"}}},n={strokeStyle:e,lollipop:{fillStyle:e,fillCircle:!0,text:{strokeStyle:"white"}}},
var e=this.m_points.indexOf(t.time_t);if(void 0!==e)return e+t.offset},s.prototype.zoomToBarsRange=function(t,e){if(!(e<=t)){var i=this.m_points.lastTimePointIndex();i&&(this.m_rightOffset=e-i),this.m_barSpacing=this.width()/(e-t+1),this._visibleBarsCache=null}},s.prototype.recalcLockedScale=function(){var t,e,i,n,s,r,a,l;this._model.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()&&(t=this._model.m_mainSeries.priceScale(),e=this._model.m_mainSeries,i=e.data().boxSize,i||(e.fixBoxSize(),i=e.data().boxSize),i&&(t.properties().percentage.value()&&(n=e.data().search(e.getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),s=t.internalHeight()/(this.barSpacing()/i),(r=e.priceScale().priceRange())&&s===r.length()||(!r||r.isEmpty()?(a=this.visibleBars(),r=e.priceRange(a.firstBar(),a.lastBar())):(l=(s-r.length())/2,r.set(r.minValue()-l,r.maxValue()+l)),e.priceScale().setPriceRange(r))))},s.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(_.DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),v)))},s.prototype.canZoomIn=function(){return this.m_barSpacing<v},s.prototype.canZoomOut=function(){return this.m_barSpacing>y},s.prototype.onScroll=function(){return this._onScroll},t.exports=s}).call(e,i(15),i(107))},function(t,e,i){"use strict";function o(t){r.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())})}function n(t){a.call(this)}var s=i(102),r=s.BarsMarksContainer,a=s.BarMarkTooltip,l=i(42);inherit(o,r),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedBarsMarks",o.prototype._plateViewData=function(t){var e={text:t.text};return"object"==typeof t.color&&(e.theme="user_defined_theme",e.overridedTheme={},e.overridedTheme.border=t.color.border,e.overridedTheme.background=t.color.background),e},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;this._marks[t].onClicked()},o.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype._createTooltip=function(){return new n},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},inherit(n,a),n.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),
this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},n.prototype._updatePlate=function(t){this._currentId=t.id,this._layout.css("border-color",t.theme.border),this._layout.css("margin-top",t.tooltipMargin+"px"),this._layout_text.html(t.text),this._layout.append(this._layout_text)},t.exports=o},function(t,e,i){"use strict";function o(t){a.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new n(this)}function n(t,e){this.source=t,this._rendererFactory=e,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var s=i(2),r=i(684).ESDPaneView,a=i(102).BarsMarksContainer,l=i(42),h=i(34),c=i(260).Tooltip;inherit(o,a),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedTimescaleMarks",o.prototype._plateViewData=function(t){return{text:t.text}},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;h.emit("onTimescaleMarkClick",t)},o.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},o.prototype.paneViews=function(t){return this._properties.visible.value()?[this._paneView]:[]},o.prototype.onClickOutside=function(t){this._paneView.onClickOutside(t)},inherit(n,r),n.prototype._createLollipops=function(){var t=this.source._model.timeScale(),e=r.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this;$.each(this.source._marks,function(n,r){var a=r.id;o._lollipops[a]={id:a,basePoint:new s.Point(t.indexToCoordinate(t.timePointToIndex(r.tickmark))+1,e),hovered:i&&i.id===a||a===o.getLastClickedLollipopId(),barY:null,label:r.label,color:r.color,items:r.tooltip,tooltip:o._lollipops.hasOwnProperty(a)?o._lollipops[a].tooltip:new c,visible:!0}})},n.prototype.update=function(){this._createLollipops()},n.prototype.renderer=function(){return this.update(),r.prototype.renderer.call(this)},n.prototype._generateTemplateStyle=function(t,e,i){var o,n,s=t+e+i;return s in this.stylesCache||(o={strokeStyle:e,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:e,font:"normal 12px Verdana, Arial, sans-serif"}}},n={strokeStyle:e,lollipop:{fillStyle:e,fillCircle:!0,text:{strokeStyle:"white"}}},
this.stylesCache[s]="default"===t?o:$.extend(!0,{},o,n)),this.stylesCache[s]},n.prototype.getTemplate=function(t,e){var i=t+e.color+e.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(t,e.color,e.label))),this.templatesCache[i]},n.prototype.getStyle=function(t,e){return this._generateTemplateStyle(t,e.color,e.label)},n.prototype.createText=function(t,e){"string"==typeof t.items?e.addTextLine(t.items):Array.isArray(t.items)&&t.items.forEach(function(t){e.addTextLine(t)})},n.prototype.hasTooltip=function(t){return!!t.tooltip&&t.tooltip.length},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t){function i(t,e){var i=t.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(e)||(a[i][e]=t.measureText(e).width),a[i][e]}function o(){var o=r.width(),a=r.height();return{draw:function(r){var h,c,d,p,u,_,f,m=t.symbolInfo();if(m&&!e.enabled("fundamental_widget")){for(r.fillStyle=n.generateColor(l.color.value(),l.transparency.value()),h=m.name,/QUANDL/.test(m.exchange)&&(c=h.split(/\//),c.length&&(h=c[c.length-1])),d=[{text:h?h+", "+s(t.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:m.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],p=0,u=0;u<d.length;u++)_=d[u],_.text&&(r.font=_.font,f=i(r,_.text),f>o?(_.zoom=o/f,f=o):_.zoom=1,_.offsetLeft=(o-f)/2,p+=_.lineHeight*_.zoom);for(p=Math.max((a-p)/2,0),u=0;u<d.length;u++)_=d[u],_.text&&(r.save(),r.font=_.font,r.translate(_.offsetLeft,p),r.scale(_.zoom,_.zoom),r.fillText(_.text,0,_.baselineOffset),r.restore(),p+=_.lineHeight*_.zoom)}}}}var r=null,a={},l=t.model().properties().symbolWatermarkProperties,h={renderer:o,update:function(){}};this.paneViews=function(t){return t.containsMainSeries()?(r=t,[h]):[]}}var n=i(14),s=i(164).translatedIntervalString;t.exports=o}).call(e,i(3))},function(t,e,i){"use strict";function o(t){return t.keys().map(t)}window.TradingView=window.TradingView||{},window.requireAll=o,i(720),i(589),i(593),i(565),i(284),i(592),i(591),i(287),i(35),i(585),i(117),i(571),i(216),i(357),i(712),i(69),i(713),i(214),i(358),i(362)},function(module,exports,__webpack_require__){(function(Delegate,_,Featuresets){"use strict";function loginUser(t,e){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),user=$.extend(!0,{},t),TradingView.changeLoginState(!0),"function"==typeof e&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",function(){e()}):"function"==typeof e&&e()}function onLoginStateChange(is_initial){window.iframeAuthWidget&&user.is_first_login&&(window.iframeAuthWidget.preventClose=!0),
$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&!!user.is_trial).toggleClass("is-not-trial",!(is_authenticated&&user&&user.is_trial)).toggleClass("is-not-trial-available",!user.trial_availiable).toggleClass("is-trial-available",!!user.trial_availiable),TVSettings.sync(user.settings),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?($(".saved_charts_count").html(user.saved_charts),$(".treated_charts_count").html(user.treated_charts_count),$(".js-trial-days-left").html(user.trial_days_left_text||""),$(".js-header-gopro-button").attr("href","/gopro/"),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&($(function(){}),trackEvent("Conversion","First login"),user.prort_trial_started&&delete user.prort_trial_started,delete user.is_first_login),TradingView.setTrialAvailiable(user.trial_availiable)):(user={username:"Guest",following:"0",followers:"0",ignore_list:{}},$(".user-info-username").html(user.username),TVLocalStorage.removeItem("trial_availiable"))}var loginStateChange,TVXWindowEvents=__webpack_require__(128).TVXWindowEvents,trackEvent=__webpack_require__(33).trackEvent;__webpack_require__(743),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.locale?e.setRequestHeader("X-Language",window.locale):console.warn("window.locale is not defined"))}),loginStateChange=window.loginStateChange=new Delegate,loginStateChange.subscribe(null,onLoginStateChange),TVXWindowEvents.on("loginStateChange",function(){var t=JSON.parse(this);window.user=t.user,window.is_authenticated=!!t.is_authenticated,loginStateChange.fire()}),function(){var t="user-obj-changed",e={};window.crossTabSyncUserAttr=function(e){var i={};e instanceof Array?e.forEach(function(t){i[t]=window.user[t]}):i[e]=window.user[e],TVXWindowEvents.emit(t,JSON.stringify(i))},window.onChangeUserAttrInAnotherTab=function(t){var i=new Delegate;return e[t]||(e[t]=[]),e[t].push(i),i},TVXWindowEvents.on(t,function(t){var i,o;t=JSON.parse(t);for(i in t)if(window.user[i]=t[i],e[i])for(o=0;o<e[i].length;o++)e[i][o].fire(t[i])})}(),TradingView.changeLoginState=function(t){window.is_authenticated=!!t,TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),loginStateChange.fire()},window.loginUser=loginUser,TradingView.signOut=function(){var t=_.clone(window.user);TradingView.changeLoginState(!1),$.ajax({type:"POST",url:"/accounts/logout/",dataType:"html"}).fail(function(){window.user=t,TradingView.changeLoginState(!0)})},window.loginRequiredDelegate=new Delegate,window.runOrSignIn=function(t,e){e||(e={}),e.verifiedPhoneRequired,(is_authenticated||Featuresets.enabled("charting_library_base"))&&t()},
TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.setTrialAvailiable=function(t){TVLocalStorage.setItem("trial_availiable",t?1:0)},$.fn.reverse=[].reverse,$(window).load(function(){window.loaded=!0}),TradingView.notificationsChanged=new Delegate,loginStateChange.subscribe(null,function(t){t||$(".js-billing-link").each(function(){var t=$(this),e=window.is_authenticated;t.toggleClass("i-hidden",!e),"A"!==this.tagName&&(t=t.find("a")),t.attr("href",e?"/u/"+user.username+"/#billing":"")})})}).call(exports,__webpack_require__(15),__webpack_require__(130),__webpack_require__(3))},function(t,e,i){(function(t,e,o){"use strict";var n,s,r,a=i(2),l=i(138).createNoticeDialog;i(126),n=null,s=function(t){n||(n=l({type:"modal",title:t.title,content:t.content}).open(),n.on("beforeClose",function(){n=null}))},r=window.TVDialogs={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4e3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(e){return t.enabled("constraint_dialogs_movement")&&(e.containment=".chart-page"),e},validateHelpers:{isErrorListening:function(t){t.on("keyup.error-checker",r.validateHelpers.isError(t.val(),t))},isError:function(t,e){return function(){e.val()!==t&&(e.removeClass("error"),e.off("keyup.error-checker"))}},makeValidator:function(t,e,i,o,n){return function(s){var a,l,h;if(t.removeClass("error"),$("._tv-dialog-field-error").hide(),""!==s.errors)if("object"==typeof s.errors){for(a in s.errors)l=t.filter("input[name^="+a+"]"),l.addClass("error").data("error",s.errors[a][0]),r.validateHelpers.isErrorListening(l);h=t.filter(".error").first().focus(),r.showError(h.data("error"),n)}else r.showError($.t("Error:")+s.errors,n);else"function"==typeof o&&o(s,i);e.removeClass("process")}}},applyMQMatcher:function(t){var e,i;t||(t=r.modalDialog),e=function(){r.positionDialog()},window.matchMedia&&(i=["(max-height: 645px)","(max-width: 460px)"].map(function(t){var i=matchMedia(t);return i.addListener(e),i}),t.on("destroy",function(){i.forEach(function(t){t.removeListener(e)})}))},showBrowserExtensionDialog:function(t){var o,n;if(t)return o={chrome:{logo:"images/svg/google-chrome-logo.svg",name:"Google Chrome",href:"https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj"}},n=i(160),r.createModalDialog("Browser Extension",{noHeader:!0,width:"730px",content:e.render(n.dialogs.browserExtension,{browser:o[t]})}),r.modalDialog.find(".install-extension, ._tv-dialog-title-close").click(function(t){r.destroy()}),r.positionDialog(),r.modalDialog},showIntervalMismatchDialog:function(t){var e,i,o,n,s,a,l=!1;l=l||!1,r.createModalDialog($.t("Interval is not applicable"),{addClass:"tv-interval-is-not-applicable-dialog"}),e=r.modalDialog,e.css({zIndex:1e3}),e.find("._tv-dialog").css("width","400px"),i=r.modalDialog.find("._tv-dialog-content"),
@@ -758,14 +758,14 @@ c=o.customButtonCaption?o.customButtonCaption:$.t("OK"),r.modalDialog.find("._tv
r.positionDialog(),r.applyHandlers(),setTimeout(function(){c.focus().select()},0)},showCustomDialog:function(t){function e(e){var i=t.action(r.modalDialog),o=i&&!i.error,n=void 0===i,s=i&&i.notClose;!o&&!n||s?i.error&&r.showError(i.error):r.destroy(),e.preventDefault()}function i(e){"function"==typeof t.onCancel?t.onCancel():r.destroy()}return r.createModalDialog(t.title||$.t("Dialog"),{addClass:t.addClass||""}),r.modalDialog.find("._tv-dialog").css("width",t.width||"400px"),r.modalDialog.find("._tv-dialog-content").html('<div class="main">'+(t.html||$.t("Content"))+"</div>"+(t.noButtons?"":'<div class="_tv-dialogs-bottom _tv-dialog-center">'+(t.noButtonOk?"":'<input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/>')+(t.noButtonCancel?"":'<input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/>')+"</div>")),t.okButtonText&&r.modalDialog.find(".ok").val(t.okButtonText),t.cancelButtonText&&r.modalDialog.find(".cancel").val(t.cancelButtonText),r.modalDialog.find(".ok").click(e),r.modalDialog.find("form").submit(e),r.modalDialog.find(".cancel").click(i),r.modalDialog.find("._tv-dialog-title-close").click(i),r.positionDialog(),r.applyHandlers(),r.modalDialog},createModalDialog:function(t,e){var i,o;return e=e||{},null!==r.modalDialog&&r.destroy(),r.modalDialog=$('<div class="_tv-dialog-shadowbox"><div class="_tv-dialog _tv-dialog-modal'+(e.addClass?" "+e.addClass:"")+'">'+(e.noHeader?"":'<div class="_tv-dialog-title">'+(e.noClose?"":'<a class="_tv-dialog-title-close"></a>')+'<span class="_tv-dialog-title-text">'+t+"</span></div>")+'<div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",t),r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-error")),r._addMessageCloseButton(r.modalDialog.find("._tv-dialog-message")),e.noShadowBox&&r.modalDialog.addClass("transparent"),e.addClass&&r.modalDialog.addClass(e.addClass),e.width&&r.modalDialog.find("._tv-dialog").css({width:e.width}),e.content&&r.modalDialog.find("._tv-dialog-content").html(e.content),i=$(".fancybox-overlay"),i.length&&(o=i.css("z-index"),$("._tv-dialog-shadowbox").css("z-index",o+1)),e.draggable&&r.modalDialog.draggable(r._constrainDraggableOptionsIfNeeded({handle:r.modalDialog.find("._tv-dialog-title")})),e.zIndex&&r.modalDialog.css("z-index",e.zIndex),r.modalDialog},_addMessageCloseButton:function(t){var e=$(i(903)).attr({class:"close",title:$.t("Close message")});t.append(e),$(e).on("click",function(){t.animate({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){t.hide()})})},createDialog:function(t,i){var o,n,s;return r.isOpen(t)?(o=r.get(t),o.find("._tv-dialog-content").html(""),o.data("new",!1),o):(i=i||{},
o=$(e.render('<div class="_tv-dialog _tv-dialog-nonmodal {{&addClass}}"><div class="_tv-dialog-title{{#hideTitle}} _tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} _tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="_tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div>',{addClass:i.addClass||"",hideTitle:i.hideTitle,hideCloseCross:i.hideCloseCross,title:t})).appendTo($("body")),r._addMessageCloseButton(o.find("._tv-dialog-error")),r._addMessageCloseButton(o.find("._tv-dialog-message")),i.width&&o.css({width:i.width}),i.content&&o.find("._tv-dialog-content").html(i.content),n=0,n=i.zIndex?i.zIndex:r.dialogs&&r.dialogs.length?a.max($.map(r.dialogs,function(t){return parseInt((t.dialog||t).css("z-index"),10)}))+1:110,o.css("z-index",n),o.data("new",!0),o.data("title",t),o.data("id",r.dialogs.length+1),r.dialogs.push({title:t,dialog:o,id:r.dialogs.length+1}),s={start:function(t,e){var i,o,n=e.helper.css("z-index"),s=0,a=null;for(i=0;i<r.dialogs.length;i++)(o=r.dialogs[i].dialog.css("z-index"))>s&&(s=o,a=r.dialogs[i].dialog);e.helper.css("z-index",s),a.css("z-index",n)}},i.dragHandle?s.handle=i.dragHandle:i.hideTitle||(s.handle="._tv-dialog-title"),i.dragOptions&&$.extend(s,i.dragOptions),o.draggable(r._constrainDraggableOptionsIfNeeded(s)),o)},positionDialog:function(t,e,i){function o(){n.css("margin-left",-Math.round(n.outerWidth()/2)+"px"),n.css("margin-top",-Math.round(n.outerHeight()/2)+"px")}var n,s,a,l,h,c,d,p;i=i||{},e=e||i.position,t?(s=t.width(),a=t.height(),l=$(window).width(),h=$(window).height(),e&&e.top&&e.left?(d=i.forcePosition?e.left:Math.max(2,Math.min(l-s-4,e.left))+"px",c=i.forcePosition?e.top:Math.max(2,Math.min(h-a-4,e.top))+"px"):e&&e.considerScroll?(p=$(document),d=Math.round((l-s)/2+p.scrollLeft())+"px",c=Math.round((h-a)/2+p.scrollTop())+"px"):(d=Math.round((l-s)/2)+"px",c=Math.round((h-a)/2)+"px"),i.fadeIn?t.css({left:d,top:c}).hide().fadeIn("fast"):i.smooth?t.animate({left:d,top:c}):t.css({left:d,top:c})):(t=r.modalDialog,n=t.find("._tv-dialog"),o(),n.resize(o))},applyHandlers:function(t,e){var i,o,n=!t||t===this.modalDialog;e=e||{},i=n?function(){r.destroy()}:function(){r.destroy(t.data("title"))},t=t||r.modalDialog.find("._tv-dialog"),e.beforeDestroy&&t.on("destroy",e.beforeDestroy),t.find("._tv-dialog-title ._tv-dialog-title-close, .js-dialog-close").on("click",function(t){e.closeHandler&&"function"==typeof e.closeHandler?e.closeHandler(t):i()}),e.doNotCloseOnBgClick||setTimeout(function(){t.on("mousedownoutside",function(o){var n=$(o.target).parents().andSelf();e.doNotCloseOnBgClickIfShadowbox&&n.is("._tv-dialog-shadowbox")||n.is(".colorpicker, .charts-popup-list, ._tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container")||(t.unbind("mousedownoutside"),i())})},0),
t.find('input[type="checkbox"]').change(function(){var t=$(this);t.next("._tv-dialog-checkbox-mask").toggleClass("disabled",t.prop("disabled")).toggleClass("_tv-dialog-checkbox-mask-active",t.is(":checked"))}),o=t.find('input[type="text"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}).first(),Modernizr.touch||e.notFocusFirst||o.focus(),t.find('input[type="password"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}),t.find("textarea").focus(function(){$(this).addClass("_tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textareaactive")}),t.find("._tv-dialog-checkbox-mask").click(function(){var t=$(this).prev();t.prop("disabled")||(t.prop("checked",!t[0].checked),t.change())}),e.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(e){if(27===e.keyCode)return t?r.destroy(t.data("title")):r.destroy(),!1}),e.processEnterButton&&$(window).bind("keyup.confirmAndCloseDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(e.processEnterButton.click(),$(window).unbind("keyup.confirmAndCloseDialog"))})},showError:function(t,e,i){r.showMessage(t,e,$.extend(i||{},{isError:!0}))},showMessage:function(t,e,i){var o,n,s;e||(e=$("._tv-dialog")),i=i||{},o=i.isError&&"_tv-dialog-error"||"_tv-dialog-message",n=e.find("."+o),s=n.find(".message"),i.html?s.html("string"==typeof i.html?i.html:t):s.text(t),s.css("width",e.width()).toggleClass("selectable",!!i.selectable),n.toggleClass("with-close",!!i.withClose).css({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast"),i.withClose||(i.hideWithoutAnimation?n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.hide(),n.off("touchstartoutside mousedownoutside keydownoutside",t)}):n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.animate({marginTop:r.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){n.hide()}),n.off("touchstartoutside mousedownoutside keydownoutside",t)}))},isOpen:function(t){for(var e=0;e<r.dialogs.length;e++)if(r.dialogs[e].title===t)return!0;return!1},get:function(t){for(var e=0;e<r.dialogs.length;e++)if(r.dialogs[e].title===t)return r.dialogs[e].dialog},submit:function(t,e){var i=e?$(e):$("._tv-dialog form").first(),o=i.serialize(),n=i.attr("action");$.post(n,o,function(e){void 0!==t&&t(e)},"json")},destroy:function(t,e){if(void 0!==r.chart&&(r.chart.destroy(),delete r.chart),$(window).unbind("keyup.hideDialog"),$(window).unbind("keyup.confirmAndCloseDialog"),t&&"string"==typeof t)for(var i=0;i<r.dialogs.length;i++)r.dialogs[i].title===t&&(r.dialogs[i].dialog.find(".apply-common-tooltip").mouseout(),r.dialogs[i].dialog.trigger("destroy",e),$(document).unbind("mouseup.hideDialog"+r.dialogs[i].id),$("input",r.dialogs[i].dialog).blur(),r.dialogs[i].dialog.remove(),
r.dialogs.splice(i,1));else r.modalDialog&&(r.modalDialog.find(".apply-common-tooltip").mouseout(),r.modalDialog.find("._tv-dialog").trigger("destroy"),r.modalDialog.remove(),r.modalDialog=null)},changeTitle:function(t,e){t&&r.dialogs.forEach(function(i){var o,n;if(i.title===t)return o=i.dialog,n=o.find("._tv-dialog-title"),i.title=e,o.data("title",e),n.html(n.html().replace(t,e)),n.find("a").on("click",function(){r.destroy(e)}),!0})},toggleTitleEl:function(t,e){r.dialogs.filter(function(e){return e.title===t}).map(function(t){return t.dialog}).forEach(function(t){var i=t.find("._tv-dialog-title");"boolean"!=typeof e&&(e=i.hasClass("_tv-dialog-title-hidden")),i.toggleClass("_tv-dialog-title-hidden",!e)})},calcHeight:function(t,e,i){null==i&&(i=20),t+=i;var o=parseInt($("body").height(),10);return t>o&&(e-=t-o,e=Math.max(0,e)),e},resizeContent:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($("body").height(),10),n=e.height(),t>o&&(n-=t-o,n=Math.max(0,n),e.height(n))},resizeContentWidth:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($(window).width(),10),n=e.width(),t>o&&(n-=t-o,n=Math.max(0,n),e.width(n))}},r.ideaDialogs={dialogs:[],add:function(t){r.ideaDialogs.dialogs.push(t)},remove:function(t){r.ideaDialogs.dialogs=$.grep(r.ideaDialogs.dialogs,function(e){return""+e!=""+t})},clear:function(){r.ideaDialogs.dialogs.forEach(function(t){r.destroy(t)})},getDraggableEmptyTitle:function(){return $(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"})}},void 0!==o&&o&&o.exports&&(o.exports=r)}).call(e,i(3),i(30),i(50)(t))},,,,,,,function(t,e,i){"use strict";var o=i(39);window.language&&(o.locale(window.language,{months:[$.t("January"),$.t("February"),$.t("March"),$.t("April"),$.t("May"),$.t("June"),$.t("July"),$.t("August"),$.t("September"),$.t("October"),$.t("November"),$.t("December")],monthsShort:[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")],weekdays:[$.t("Sunday"),$.t("Monday"),$.t("Tuesday"),$.t("Wednesday"),$.t("Thursday"),$.t("Friday"),$.t("Saturday")],weekdaysShort:[$.t("Sun"),$.t("Mon"),$.t("Tue"),$.t("Wed"),$.t("Thu"),$.t("Fri"),$.t("Sat")],weekdaysMin:[$.t("Su",{context:"day_of_week"}),$.t("Mo",{context:"day_of_week"}),$.t("Tu",{context:"day_of_week"}),$.t("We",{context:"day_of_week"}),$.t("Th",{context:"day_of_week"}),$.t("Fr",{context:"day_of_week"}),$.t("Sa",{context:"day_of_week"})],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D MMM",l:"M/D/YYYY",LL:"D MMM YYYY",ll:"D MMM LT",LLL:"LT - LL",lll:"D MMM YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{sameDay:$.t("__specialSymbolOpen__Today at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:$.t("__specialSymbolOpen__Tomorrow at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:$.t("__dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",
r.dialogs.splice(i,1));else r.modalDialog&&(r.modalDialog.find(".apply-common-tooltip").mouseout(),r.modalDialog.find("._tv-dialog").trigger("destroy"),r.modalDialog.remove(),r.modalDialog=null)},changeTitle:function(t,e){t&&r.dialogs.forEach(function(i){var o,n;if(i.title===t)return o=i.dialog,n=o.find("._tv-dialog-title"),i.title=e,o.data("title",e),n.html(n.html().replace(t,e)),n.find("a").on("click",function(){r.destroy(e)}),!0})},toggleTitleEl:function(t,e){r.dialogs.filter(function(e){return e.title===t}).map(function(t){return t.dialog}).forEach(function(t){var i=t.find("._tv-dialog-title");"boolean"!=typeof e&&(e=i.hasClass("_tv-dialog-title-hidden")),i.toggleClass("_tv-dialog-title-hidden",!e)})},calcHeight:function(t,e,i){null==i&&(i=20),t+=i;var o=parseInt($("body").height(),10);return t>o&&(e-=t-o,e=Math.max(0,e)),e},resizeContent:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($("body").height(),10),n=e.height(),t>o&&(n-=t-o,n=Math.max(0,n),e.height(n))},resizeContentWidth:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($(window).width(),10),n=e.width(),t>o&&(n-=t-o,n=Math.max(0,n),e.width(n))}},r.ideaDialogs={dialogs:[],add:function(t){r.ideaDialogs.dialogs.push(t)},remove:function(t){r.ideaDialogs.dialogs=$.grep(r.ideaDialogs.dialogs,function(e){return""+e!=""+t})},clear:function(){r.ideaDialogs.dialogs.forEach(function(t){r.destroy(t)})},getDraggableEmptyTitle:function(){return $(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"})}},void 0!==o&&o&&o.exports&&(o.exports=r)}).call(e,i(3),i(30),i(50)(t))},,,,,,,function(t,e,i){"use strict";var o=i(40);window.language&&(o.locale(window.language,{months:[$.t("January"),$.t("February"),$.t("March"),$.t("April"),$.t("May"),$.t("June"),$.t("July"),$.t("August"),$.t("September"),$.t("October"),$.t("November"),$.t("December")],monthsShort:[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")],weekdays:[$.t("Sunday"),$.t("Monday"),$.t("Tuesday"),$.t("Wednesday"),$.t("Thursday"),$.t("Friday"),$.t("Saturday")],weekdaysShort:[$.t("Sun"),$.t("Mon"),$.t("Tue"),$.t("Wed"),$.t("Thu"),$.t("Fri"),$.t("Sat")],weekdaysMin:[$.t("Su",{context:"day_of_week"}),$.t("Mo",{context:"day_of_week"}),$.t("Tu",{context:"day_of_week"}),$.t("We",{context:"day_of_week"}),$.t("Th",{context:"day_of_week"}),$.t("Fr",{context:"day_of_week"}),$.t("Sa",{context:"day_of_week"})],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D MMM",l:"M/D/YYYY",LL:"D MMM YYYY",ll:"D MMM LT",LLL:"LT - LL",lll:"D MMM YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{sameDay:$.t("__specialSymbolOpen__Today at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:$.t("__specialSymbolOpen__Tomorrow at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:$.t("__dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",
specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),lastDay:$.t("__specialSymbolOpen__Yesterday at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),lastWeek:$.t("__specialSymbolOpen__Last__specialSymbolClose__ __dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),sameElse:"L"},relativeTime:{future:function(t){return t===$.t("just now")?t:$.t("in %s",{context:"time_range"}).replace("%s",t)},past:function(t){return t===$.t("just now")?t:$.t("%s ago",{context:"time_range"}).replace("%s",t)},s:$.t("just now"),m:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{plural:"%d hours",count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{plural:"%d days",count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{plural:"%d months",count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{plural:"%d years",count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.language))},,function(t,e,i){(function(t){"use strict";var e=function(){this.type="test_call",this.content=""},i={wrapValue:function(t){return""+t},sendEvent:function(t,i){var o=new e;o.type=i||"event",o.content=t,window.external.notify(JSON.stringify(o))}};void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(50)(t))},function(t,e){t.exports='<div class="tv-dropdown-behavior tv-autocomplete__wrapper">\n\t<input class="tv-control-input tv-dropdown-behavior__button" type="text" {{#maxLength}}maxlength="{{ maxLength }}"{{/maxLength}}>\n\t<tv-menu class="tv-dropdown-behavior__body tv-autocomplete__dropdown i-hidden">\n\t</tv-menu>\n</div>\n'},,,function(t,e,i){"use strict";var o,n,s,r,a,l,h,c,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),i(28),i(117),i(488),n=i(363),s={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading"},r={connecting:$.t("Connecting"),delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("EOD"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Realtime"),snapshot:$.t("Snapshot"),loading:""},a={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:""},l=600,h={streaming:"realtime"},c={classMap:s,classSuffix:"",data:{values:{update_mode:"connecting"}},
labelMap:r,modeInterval:l,short:!1,shortLabelMap:a,showTooltip:!0},d=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(e),i}return o.__extends(e,t),e.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":t.prototype.getLabel.call(this)},e.prototype.setMode=function(t,e){this.update({values:{update_mode:t}})},e.prototype.hide=function(){this._el.classList.add("i-hidden")},e.prototype.show=function(){this._el.classList.remove("i-hidden")},e.prototype.getTooltipText=function(){var t="",e=this.getValue();if(""===e)return t;switch(e){case"delayed":t=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":t=$.t("Quotes are delayed by {0} min");break;default:t=this._labelMap[e]||t}return["delayed","delayed_streaming"].includes(e)&&(t=t.format(Math.round(this._modeInterval/60))),t},e.prototype._init=function(e){void 0===e&&(e={});var i=Object.assign({},c,e);this._modeInterval=i.modeInterval||l,this._shortLabelMap=i.shortLabelMap||a,t.prototype._init.call(this,i),this._render()},e.prototype._getValueFromData=function(t){var e;return e=void 0!==t.values&&void 0!==t.values.update_mode?t.values.update_mode:this.getValue(),h[e]||e},e}(n.AbstractIndicator),e.DataModeIndicator=d},function(t,e,i){"use strict";var o,n,s,r,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),i(28),i(489),n=i(363),s={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading"},r={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading")},a={classMap:s,classSuffix:"",data:{},extraTitle:"",labelMap:r,short:!1,showTooltip:!0},l=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(e),i}return o.__extends(e,t),e.prototype.setStatus=function(t,e){var i={values:{current_session:t}};this.update(i,e)},e.prototype.getTooltipText=function(){var e=t.prototype.getTooltipText.call(this);return""===e?e:(""!==this._extraTitle&&(e=e+", "+this._extraTitle),e)},e.prototype.setExtraTitle=function(t){this._extraTitle=t},e.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},e.prototype.enableShortMode=function(e){void 0===e&&(e=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),t.prototype.enableShortMode.call(this)},e.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),t.prototype.disableShortMode.call(this)},e.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},
e.prototype._getValueFromData=function(t){return void 0!==t.values&&void 0!==t.values.current_session?t.values.current_session:this.getValue()},e.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),t.prototype._render.call(this)},e.prototype._init=function(e){var i=Object.assign({},a,e);t.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},e.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},e.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},e}(n.AbstractIndicator),e.MarketStatusIndicator=l},function(t,e,i){"use strict";function o(t,e){return t.ticker+"_"+e}function n(t){return new Date(t).toISOString()}var s,r,a,l,h,c;Object.defineProperty(e,"__esModule",{value:!0}),s=i(43),r=i(364),a=i(56),l=i(3),i(117),h=function(){function t(t,e,i,o){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=t,this._symbolInfo=e,this._resolution=i,this._dwmAligner=o}return t.prototype.addSubscription=function(t,e,i){var o=this,n=this._getNextSubscriptionId(),s=Math.floor(t.from/1e3),r=Math.floor(t.to/1e3);return this._pendingSubscribers.push({key:n,range:{from:s,to:r},onHistoryCallback:e,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return o._processNextPendingSubscriber()},0),n},t.prototype.removeSubscription=function(t){var e,i=this,o=this._pendingSubscribers.find(function(e){return e.key===t});return o?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o),1):(e=this._subscribers.find(function(e){return e.key===t}))?(this._subscribers.splice(this._subscribers.indexOf(e),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i.purgeCache(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype.purgeCache=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},t.prototype._logMessage=function(t,e){(l.enabled("charting_library_debug_mode")||e)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},
e.prototype._getValueFromData=function(t){return void 0!==t.values&&void 0!==t.values.current_session?t.values.current_session:this.getValue()},e.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),t.prototype._render.call(this)},e.prototype._init=function(e){var i=Object.assign({},a,e);t.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},e.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},e.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},e}(n.AbstractIndicator),e.MarketStatusIndicator=l},function(t,e,i){"use strict";function o(t,e){return t.ticker+"_"+e}function n(t){return new Date(t).toISOString()}var s,r,a,l,h,c;Object.defineProperty(e,"__esModule",{value:!0}),s=i(36),r=i(364),a=i(56),l=i(3),i(117),h=function(){function t(t,e,i,o){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=t,this._symbolInfo=e,this._resolution=i,this._dwmAligner=o}return t.prototype.addSubscription=function(t,e,i){var o=this,n=this._getNextSubscriptionId(),s=Math.floor(t.from/1e3),r=Math.floor(t.to/1e3);return this._pendingSubscribers.push({key:n,range:{from:s,to:r},onHistoryCallback:e,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return o._processNextPendingSubscriber()},0),n},t.prototype.removeSubscription=function(t){var e,i=this,o=this._pendingSubscribers.find(function(e){return e.key===t});return o?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o),1):(e=this._subscribers.find(function(e){return e.key===t}))?(this._subscribers.splice(this._subscribers.indexOf(e),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i.purgeCache(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype.purgeCache=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},t.prototype._logMessage=function(t,e){(l.enabled("charting_library_debug_mode")||e)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},
t.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},t.prototype._processNextPendingSubscriber=function(){var t,e,i,o,r,a;if(this._pendingSubscribers.length&&!this._requesting){if(this._needPurgeCache&&this._purgeCache(),t=this._pendingSubscribers.pop(),this._logMessage("Processing bars request {0} from {1} to {2} ".format(t.key,n(1e3*t.range.from),n(1e3*t.range.to))),this._errorMessage)return this._logMessage("Return error:"+this._errorMessage),t.onErrorCallback(this._errorMessage),void this._processNextPendingSubscriber();if((!this._leftDate||t.range.from<this._leftDate)&&(e=new s.Interval(this._resolution),i=(e.inMilliseconds()||0)/1e3,o=!this._leftDate,r=!o&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t.range.from<i,(o||!r)&&!this._endOfData))return this._pendingSubscribers.push(t),void this._ensureRequestedTo(t.range.from);a=this._moveSubscriberToRealtime(t),this._returnHistoryDataToSubscriber(t,a),this._subscribeRealtimeIfNeeded(),this._processNextPendingSubscriber()}},t.prototype._moveSubscriberToRealtime=function(t){var e={key:t.key,onHistoryCallback:t.onHistoryCallback,barset:null};return this._subscribers.push(e),e},t.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},t.prototype._subscribeRealtime=function(){var t,e,i=this;this._symbolInfo.expired||this._realtimeOn||(t=function(t){i._dwmAligner&&(t.time=i._dwmAligner.tradingDayToSessionStart(t.time)),i._putToCacheNewBar(t),i._subscribers.forEach(function(e){var i=e.barset;if(null===i)throw Error("subscirber.barset is null");i.add(t),e.onHistoryCallback(i)})},e=function(){i._unsubscribeRealtime();var t=i._leftDate;i._purgeCache(),t&&i._ensureRequestedTo(t)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,t,o(this._symbolInfo,this._resolution),e),this._logMessage("Subscribed to realtime"))},t.prototype._unsubscribeRealtime=function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(o(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},t.prototype._returnHistoryDataToSubscriber=function(t,e){var i,o,s=t.range,r=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||s.from):this._createBarset(s.from);r.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(t.key,r.count(),n(r.bars[0].time),n(r.bars[r.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(t.key)),e.barset=r,i=this._inGapNextTime(s.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*i))),r.nextTime=i):0===r.count()&&(o=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&s.from>o&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*o))),r.nextTime=o||void 0),
this._endOfData&&null!==this._leftDate&&t.range.from<=this._leftDate&&(r.endOfData=!0),t.onHistoryCallback(r)},t.prototype._createBarset=function(t){var e=r.lowerbound(this._cache.bars,1e3*t,function(t,e){return t.time<e});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(e))},t.prototype._ensureRequestedTo=function(e){var i,o,s,r=this;if(this._leftDate&&this._leftDate<e)return void this._processNextPendingSubscriber();i=!this._leftDate,this._requesting=!0,o=e,s=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(t._now()/1e3),this._leftDate=e,this._logMessage("Requesting data: [{0} ... {1}] ".format(n(1e3*o),n(1e3*s))),this._datafeed.getBars(this._symbolInfo,this._resolution,o,s,function(t,e){r._requesting=!1,r._processBars(t,e)},function(t){r._requesting=!1,r._errorMessage=t||null,r._processNextPendingSubscriber()},i)},t.prototype._processBars=function(t,e){this._checkBars(t),this._alignBarsTime(t),t.length>0?this._processFullBarset(t,e):this._processEmptyBarset(e),this._processNextPendingSubscriber()},t.prototype._processEmptyBarset=function(e){this._logMessage("Receiving bars: barset is empty"),e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(n(1e3*e.nextTime))),this._addGap(e.nextTime),this._leftDate=Math.min(this._leftDate||t._now()/1e3,e.nextTime+1)):e&&e.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},t.prototype._processFullBarset=function(t,e){var i=t[0].time,o=t[t.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(t.length,n(i),n(o))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),this._putToCache(t)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),e&&e.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):e&&e.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},t.prototype._addGap=function(e){var i;this._gaps.find(function(t){return t.from===e})||(i=(this._cache.bars.length?this._cache.bars[0].time:t._now())/1e3,this._gaps.push({from:e,to:i}))},t.prototype._inGapNextTime=function(t){var e=this._gaps.find(function(e){return e.from<t&&e.to>t});return e?e.from:null},t.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},t.prototype._checkBars=function(t,e){var i,o;if(void 0===e&&(e=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<t.length;i++)t[i].time<=t[i-1].time&&(o="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(t[i].time,i,t[i-1].time,i-1),
e&&this._dwmAligner&&(o+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(o))},t.prototype._putToCache=function(t){if(0===t.length)return!0;if(this._cache.bars.length===t.length&&this._cache.bars[0].time===t[0].time&&this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&t[t.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&t[t.length-1].time>=this._cache.bars[0].time){var e=this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time;if(this._cache.bars=[],!e)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return Array.prototype.unshift.apply(this._cache.bars,t),this._checkBars(this._cache.bars,!0),!0},t.prototype._putToCacheNewBar=function(t){var e=this._cache.bars.length,i=t.time,o=0===e?NaN:this._cache.bars[e-1].time;0===e||o<i?this._cache.bars.push(t):o===i?this._cache.bars[e-1]=t:console.error("putToCacheNewBar: time violation, previous bar time: "+n(o)+" should be less or equal to new time: "+n(i))},t.prototype._alignBarsTime=function(t){if(this._dwmAligner)for(var e=0;e<t.length;e++)t[e].time=this._dwmAligner.tradingDayToSessionStart(t[e].time)},t._now=function(){return Date.now()+6e4},t}(),c=function(){function t(t,e){this._threads={},this._datafeed=t,this._dwmAlignerCreator=e}return t.prototype.purgeCache=function(){this._forEachThread(function(t,e){return e.purgeCache()})},t.prototype.subscribe=function(t,e,i,n,s){var r,a=o(t,e);return this._threads[a]||(this._threads[a]=this._createThread(t,e)),r=this._threads[a].addSubscription(i,n,s),a+'"'+r},t.prototype.unsubscribe=function(t){var e,i,o=t.split('"');if(2!==o.length)return void console.warn("Wrong guid format");e=o[0],i=parseInt(o[1]),this._threads[e].removeSubscription(i)},t.prototype._createThread=function(t,e){return new h(this._datafeed,t,e,this._dwmAlignerCreator(e,t))},t.prototype._forEachThread=function(t){var e=this;Object.keys(this._threads).forEach(function(i){return t(i,e._threads[i])})},t}(),e.DatafeedRequestsCachedProcessor=c},function(t,e){"use strict";function i(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(),200===e.status?JSON.parse(e.responseText):null}if(Object.defineProperty(e,"__esModule",{value:!0}),window.language){if(!window._tv_languages){var o="localization/translations/"+window.language+".json";window._tv_languages={},window._tv_languages[window.language]=i(o)||{}}}else window.language="en"},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(56),n=function(){function t(){}return t.prototype.main=function(t){var e,i,n,s,r=t.new_var(o.Std.open(t)),a=t.new_var(o.Std.close(t)),l=r.get(1),h=a.get(1),c=o.Std.ohlc4(t),d=o.Std.na(r.get(1))?(o.Std.open(t)+o.Std.close(t))/2:(l+h)/2;return r.set(d),a.set(c),e=o.Std.max(o.Std.high(t),o.Std.max(d,c)),
i=o.Std.min(o.Std.low(t),o.Std.min(d,c)),n=o.Std.volume(t),s=t.symbol,[s.time,d,e,i,c,n,s.updatetime,s.isBarClosed]},t}(),e.HeikenAshi=n},function(t,e,i){"use strict";function o(t,e,i,n){var s,r,a;if(n=!n||n<1e12?Date.now():n,s=n-t,r=Math.min(i.endValue,i.endValue*i.easing(s/i.duration)),a=r-e,i.onStep(a,r),s>=i.duration)return void(i.onComplete&&i.onComplete());requestAnimationFrame(o.bind(null,t,r,i))}function n(t){t.duration=t.duration||250,t.easing=t.easing||s.easingFunc.easeOutCubic,requestAnimationFrame(o.bind(null,Date.now(),0,t))}Object.defineProperty(e,"__esModule",{value:!0});var s=i(54);e.doAnimate=n},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(44),n=function(){function t(t,e){this._major=t,this._minor=e}return t.prototype.major=function(){return this._major},t.prototype.minor=function(){return this._minor},t.prototype.isZero=function(){return 0===this._major&&0===this._minor},t.prototype.toString=function(){return this._major+"."+this._minor},t.prototype.compareTo=function(t){return this._major<t._major?-1:this._major>t._major?1:this._minor<t._minor?-1:this._minor>t._minor?1:0},t.prototype.isLess=function(t){return this.compareTo(t)<0},t.prototype.isLessOrEqual=function(t){return this.compareTo(t)<=0},t.prototype.isEqual=function(t){return 0===this.compareTo(t)},t.prototype.isGreater=function(t){return this.compareTo(t)>0},t.prototype.isGreaterOrEqual=function(t){return this.compareTo(t)>=0},t.parse=function(e){var i,n,s;if(e instanceof t)return new t(e.major(),e.minor());if("number"==typeof e)return o.assert(Math.floor(e)===e,"Version should not be a float number"),new t(e,0);if("string"==typeof e){if(i=e.split("."),1===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),new t(n,0);if(2===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),s=parseInt(i[1],10),o.assert(!isNaN(s),"Bad version string: "+e),new t(n,s);throw Error("Bad version string (one dot expected): "+e)}throw Error("Bad version: "+e)},t}(),n.ZERO=new n(0,0),e.Version=n},function(t,e,i){(function(t){"use strict";var o,n,s,r,a,l,h,c,d,p,u,_;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),i(17),i(30),i(105),i(28),n=i(368),s=i(372),r=i(47),a=i(101),l=i(15),h=i(41),c=i(217),d=i(69),p=i(40),i(499),u='<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>',_=function(e){function i(t){var i=e.call(this,{allowSortable:!Modernizr.touch,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition"})||this;return i._linetoolsWidgets={},i._onButtonClicked=new l,i._canBeShownValue=new p(!1),i._attachHandlers(),i._loadVisibilityState(),i}return o.__extends(i,e),i.prototype.show=function(){this._canBeShownValue.value()&&(d.setValue(i._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this))},i.prototype.hide=function(){d.setValue(i._visibilitySettingsKey,!1),e.prototype.hide.call(this)},
i=o.Std.min(o.Std.low(t),o.Std.min(d,c)),n=o.Std.volume(t),s=t.symbol,[s.time,d,e,i,c,n,s.updatetime,s.isBarClosed]},t}(),e.HeikenAshi=n},function(t,e,i){"use strict";function o(t,e,i,n){var s,r,a;if(n=!n||n<1e12?Date.now():n,s=n-t,r=Math.min(i.endValue,i.endValue*i.easing(s/i.duration)),a=r-e,i.onStep(a,r),s>=i.duration)return void(i.onComplete&&i.onComplete());requestAnimationFrame(o.bind(null,t,r,i))}function n(t){t.duration=t.duration||250,t.easing=t.easing||s.easingFunc.easeOutCubic,requestAnimationFrame(o.bind(null,Date.now(),0,t))}Object.defineProperty(e,"__esModule",{value:!0});var s=i(54);e.doAnimate=n},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(44),n=function(){function t(t,e){this._major=t,this._minor=e}return t.prototype.major=function(){return this._major},t.prototype.minor=function(){return this._minor},t.prototype.isZero=function(){return 0===this._major&&0===this._minor},t.prototype.toString=function(){return this._major+"."+this._minor},t.prototype.compareTo=function(t){return this._major<t._major?-1:this._major>t._major?1:this._minor<t._minor?-1:this._minor>t._minor?1:0},t.prototype.isLess=function(t){return this.compareTo(t)<0},t.prototype.isLessOrEqual=function(t){return this.compareTo(t)<=0},t.prototype.isEqual=function(t){return 0===this.compareTo(t)},t.prototype.isGreater=function(t){return this.compareTo(t)>0},t.prototype.isGreaterOrEqual=function(t){return this.compareTo(t)>=0},t.parse=function(e){var i,n,s;if(e instanceof t)return new t(e.major(),e.minor());if("number"==typeof e)return o.assert(Math.floor(e)===e,"Version should not be a float number"),new t(e,0);if("string"==typeof e){if(i=e.split("."),1===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),new t(n,0);if(2===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),s=parseInt(i[1],10),o.assert(!isNaN(s),"Bad version string: "+e),new t(n,s);throw Error("Bad version string (one dot expected): "+e)}throw Error("Bad version: "+e)},t}(),n.ZERO=new n(0,0),e.Version=n},function(t,e,i){(function(t){"use strict";var o,n,s,r,a,l,h,c,d,p,u,_;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),i(17),i(30),i(105),i(28),n=i(368),s=i(372),r=i(47),a=i(101),l=i(15),h=i(42),c=i(217),d=i(69),p=i(41),i(499),u='<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>',_=function(e){function i(t){var i=e.call(this,{allowSortable:!Modernizr.touch,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition"})||this;return i._linetoolsWidgets={},i._onButtonClicked=new l,i._canBeShownValue=new p(!1),i._attachHandlers(),i._loadVisibilityState(),i}return o.__extends(i,e),i.prototype.show=function(){this._canBeShownValue.value()&&(d.setValue(i._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this))},i.prototype.hide=function(){d.setValue(i._visibilitySettingsKey,!1),e.prototype.hide.call(this)},
i.prototype.onButtonClicked=function(){return this._onButtonClicked},i.prototype.canBeShown=function(){return this._canBeShownValue.readonly()},i.prototype._onFavoriteAdded=function(t){this._canBeShownValue.setValue(!0),this.addWidget(this._createLinetoolWidget(t)),this.show()},i.prototype._onFavoriteRemoved=function(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===s.LinetoolsFavoritesStore.favoritesCount()&&(this._canBeShownValue.setValue(!1),this.hide())},i.prototype._onFavoriteMoved=function(){this._renderAllLinetools()},i.prototype._onSelectedLinetoolChanged=function(t){var e=this;Object.keys(this._linetoolsWidgets).forEach(function(i){e._linetoolsWidgets[i].classList.toggle("i-active",t===i)})},i.prototype._createLinetoolWidget=function(e){var i=this,o=$(t.render(u,{icon:c.lineToolsInfo[e].icon,isActive:e===h.tool.value(),title:c.lineToolsInfo[e].localizedName}))[0];return o.addEventListener("click",function(t){t.preventDefault(),i._onButtonClicked.fire(e)}),this._linetoolsWidgets[e]=o,o},i.prototype._renderAllLinetools=function(){var t=this;this._linetoolsWidgets={},this.removeWidgets(),s.LinetoolsFavoritesStore.favorites().forEach(function(e){t.addWidget(t._createLinetoolWidget(e))})},i.prototype._attachHandlers=function(){var t=this;s.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),s.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),s.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),s.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,function(){t._loadVisibilityState(),t._renderAllLinetools()}),this.onWidgetsReordered().subscribe(this,function(e,i){if(s.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(t,t._onFavoriteMoved),!s.LinetoolsFavoritesStore.moveFavorite(s.LinetoolsFavoritesStore.favorite(e),i))throw Error("Something went wrong");s.LinetoolsFavoritesStore.favoriteMoved.subscribe(t,t._onFavoriteMoved)}),this.onContextMenu(function(e){e.preventDefault();var i=new r.Action({text:$.t("Hide Favorite Drawings Toolbar")});i.callbacks().subscribe(null,function(){t.hide()}),a.createMenu([i]).show(e)}),h.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))},i.prototype._loadVisibilityState=function(){var t,e=s.LinetoolsFavoritesStore.favoritesCount()>0;this._canBeShownValue.setValue(e),t=d.getBool(i._visibilitySettingsKey,!0),t&&e?this.show():this.hide()},i}(n.FloatingToolbar),_._visibilitySettingsKey="ChartFavoriteDrawingToolbarWidget.visible",e.FavoriteDrawingToolbar=_}).call(e,i(30))},function(t,e,i){"use strict";var o,n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(73),n=i(368),s=i(15),i(137),i(501),r=function(t){function e(i){var o=t.call(this,e._prepareOptions(i))||this;return o._onWidgetStateChangedDelegate=new s,o._statedWidgets=[],o._currentPopup=null,o._onWindowClickedListener=o._onWindowClicked.bind(o),o}return o.__extends(e,t),e.prototype.show=function(){t.prototype.show.call(this),document.addEventListener("mousedown",this._onWindowClickedListener)},
e.prototype.hide=function(){t.prototype.hide.call(this),document.removeEventListener("mousedown",this._onWindowClickedListener)},e.prototype.destroy=function(){this._closePopup(),t.prototype.destroy.call(this)},e.prototype.addGroupedWidget=function(t,i){var o,n,s;if(void 0===i&&(i={}),t.states.length<=0||-1===e._getStateIndexById(t,t.currentStateId))throw Error("Argument is invalid (count: "+t.states.length+", state: "+t.currentStateId+")");o=document.createElement("div"),o.className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&o.classList.add(t.widgetAddClass),o.setAttribute("title",t.tooltip),n={statedWidget:t,toolbarWidget:o},s=this._onWidgetClicked.bind(this,n),n.clickListener=s,o.addEventListener("click",s),this._updateWidgetPreview(n),this.addWidget(o,i),this._statedWidgets.push(n)},e.prototype.removeGroupedWidget=function(t){var e,i,o=this._statedWidgets.length;for(e=0;e<o;++e)if(i=this._statedWidgets[e],i.statedWidget.id===t)return this._isPopupCreatedForWidget(t)&&this._closePopup(),i.toolbarWidget.removeEventListener("click",i.clickListener),this.removeWidget(i.toolbarWidget),this._statedWidgets.splice(e,1),void this._updatePopupPosition();throw Error("Unknown groupdId("+t+")")},e.prototype.setGroupedWidgetState=function(t,i){var o,n;for(o=0;o<this._statedWidgets.length;++o)if(n=this._statedWidgets[o],n.statedWidget.id===t){if(-1===e._getStateIndexById(n.statedWidget,i))throw Error("Unknown stateId ("+i+")");return n.statedWidget.currentStateId=i,this._updateSubWidgetsState(n.statedWidget),void this._updateWidgetPreview(n)}},e.prototype.onWidgetStateChanged=function(){return this._onWidgetStateChangedDelegate},e.prototype._onVerticalChanged=function(t,e){this._updatePopupPosition()},e.prototype._onWidgetClicked=function(t,e){var i=this._currentPopup&&this._isPopupCreatedForWidget(t.statedWidget.id);this._closePopup(),i||this._createPopup(t)},e.prototype._createPopup=function(t){var e,i=this,o={createdFor:t.toolbarWidget,element:document.createElement("div"),stateWidgetId:t.statedWidget.id,widgets:[]};o.element.className+="tv-grouped-floating-toolbar__popup js-popup",e=t.statedWidget.states.length,t.statedWidget.states.forEach(function(n,s){var r=i._createSubWidget(t,n),a=i._onSubWidgetClicked.bind(i,t,n.id);r.addEventListener("click",a),o.widgets.push({clickListener:a,stateWidget:n,widget:r}),r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-right-"+s),r.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-"+(e-s+1)),o.element.appendChild(r)}),this._currentPopup=o,this._updateSubWidgetsState(t.statedWidget),t.toolbarWidget.classList.add("i-dropped"),this._getWidget().appendChild(this._currentPopup.element),Promise.resolve().then(function(){i._currentPopup&&i._currentPopup.element.classList.add("i-opened")}),this._updatePopupPosition()},e.prototype._closePopup=function(){var t,e,i=this;this._statedWidgets.forEach(function(t){t.toolbarWidget.classList.remove("i-dropped")}),this._currentPopup&&(t=this._currentPopup.widgets,
e=this._currentPopup.element,this._currentPopup=null,t.forEach(function(t){t.widget.removeEventListener("click",t.clickListener)}),e.classList.remove("i-opened"),e.addEventListener("transitionend",function(t){t.target===e&&i._getWidget().removeChild(e)}))},e.prototype._updateWidgetPreview=function(t){var i,o=e._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);if(-1===o)throw Error("Unknown state id: "+t.statedWidget.currentStateId);i=t.statedWidget.states[o].widget.cloneNode(!0),t.toolbarWidget.firstChild?t.toolbarWidget.replaceChild(i,t.toolbarWidget.firstChild):(t.toolbarWidget.appendChild(i),t.toolbarWidget.appendChild(e._createCaret()))},e.prototype._updateSubWidgetsState=function(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach(function(i){i.widget.classList.toggle(e._activeSubWidgetClass,i.stateWidget.id===t.currentStateId)})},e.prototype._updatePopupPosition=function(){var t,e,i,o,n,s,r,a;if(this._currentPopup){if(t=this._currentPopup.createdFor,e=this._getWidget().getBoundingClientRect(),!(i=this._findWrapperForWidget(t))||!this._currentPopup)throw Error("Toolbar has no wrapper for preview's widget or there is no popup");o=i.getBoundingClientRect(),n=this._currentPopup.element.getBoundingClientRect(),s=this._currentPopup.element,this.isVertical()?(s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top=o.top-e.top-1+"px",s.style.left="",e.left>window.innerWidth-e.right?s.classList.add("tv-grouped-floating-toolbar__popup--at-left"):s.classList.remove("tv-grouped-floating-toolbar__popup--at-left")):(s.classList.remove("tv-grouped-floating-toolbar__popup--at-left"),r=o.left+n.width,a=0,a=r>window.innerWidth?e.left+n.width<=window.innerWidth?-1:e.width-n.width-1:o.left-e.left-1,s.style.left=a+"px",e.bottom+n.height>window.innerHeight?s.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(s.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),s.style.top=""))}},e.prototype._isPopupCreatedForWidget=function(t){return!(!this._currentPopup||this._currentPopup.stateWidgetId!==t)},e.prototype._createSubWidget=function(t,e){var i=document.createElement("div");return i.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&i.classList.add(t.statedWidget.stateWidgetAddClass),i.appendChild(e.widget),i},e.prototype._onSubWidgetClicked=function(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))},e.prototype._onWindowClicked=function(t){if(this.isVisible()&&this._currentPopup&&!e._isEventInElement(t,this._currentPopup.element)){for(var i=0;i<this._statedWidgets.length;++i)if(e._isEventInElement(t,this._statedWidgets[i].toolbarWidget))return;this._closePopup()}},e._getStateIndexById=function(t,e){for(var i=0;i<t.states.length;++i)if(t.states[i].id===e)return i;return-1},e._createCaret=function(){var t=document.createElement("div")

View File

@@ -3,7 +3,7 @@ this._scroll=new s(this._$tabContainer,this._$contentWrapper,{showTopShadow:!1,s
this._listAccessor().setNodeRemoveCallback(this._onNodeRemoveClick.bind(this)),s.prototype.initView.call(this)},i.prototype._clearRemoveNodeTimer=function(){clearInterval(this._clearRemoveNodeTimerId),this._clearRemoveNodeTimerId=null},i.prototype._renderViewForSymbol=function(t,e,o){var i,s,r,n,a,l="tv-manage-drawings-tab__symbol-drawings";if(t.next().hasClass(l))return t.next().toggleClass("i-expanded",o),void this._scroll.updateScrollBar();for(i=$('<div class="i-expanded '+l+'">'),s=this._symbolDrawingsMap[e],r=0;r<s.length;++r)n=s[r],a=this._listAccessor().createItem(n,{showHide:!1,lockUnlock:!1,draggable:!1,largeLeftPadding:!0,addContextMenu:!1}),this._markItemForSource(a,n.datasource),i.append(a);i.insertAfter(t),this._scroll.updateScrollBar()},i.prototype._createSymbolItem=function(t){var e=this._list.createTreeNodeItem(t,this._symbolDrawingsMap[t],{isCurrent:this._getItems().currentSymbol===t});e.attr("data-symbol",t),this._$contentWrapper.append(e)},i.prototype._renderViewInternal=function(t){var e,o,i;for(this._symbolDrawingsMap={},e=this._getItems().drawings,o=0;o<e.length;o++)i=e[o],this._symbolDrawingsMap[i.symbol]=this._symbolDrawingsMap[i.symbol]||[],this._symbolDrawingsMap[i.symbol].push(i);Object.keys(this._symbolDrawingsMap).sort(function(t,e){return this._symbolDrawingsMap[t].length<this._symbolDrawingsMap[e].length?1:-1}.bind(this)).forEach(this._createSymbolItem.bind(this)),this._renderEmptyListMessageIfNeeded(),this._updateTotalCounter(),t()},i.prototype._updateTotalCounter=function(){var t=0;Object.keys(this._symbolDrawingsMap).forEach(function(e){t+=0|this._symbolDrawingsMap[e].length}.bind(this)),this._$totalValueContainer.text($.t("Total")+": "+t),this._$totalValueContainer.toggleClass("i-hidden",0===t)},i.prototype._renderEmptyListMessageIfNeeded=function(){this._$emptyListMessage.toggleClass("js-hidden",0!==Object.keys(this._symbolDrawingsMap).length)},i.prototype._removeSourceFromView=function(t){var e,o,i,s=this._getItemForSourceId(t.id());if(0===s.length)return void this._renderView(null);t.id()===this._selectedSourceId()&&this._listAccessor().activateItem(null,null),e=s.parent(),o=e.prev(),i=o.attr("data-symbol"),this._symbolDrawingsMap[i]=this._symbolDrawingsMap[i].filter(function(e){return e.datasource!==t}),0===this._symbolDrawingsMap[i].length?(e.remove(),o.remove(),delete this._symbolDrawingsMap[i],this._renderEmptyListMessageIfNeeded()):(s.remove(),this._listAccessor().updateNodeItem(o,i,this._symbolDrawingsMap[i],{isCurrent:this._getItems().currentSymbol===i})),this._updateTotalCounter()},i.prototype._onNodeRemoveClick=function(t,e){if(!this._clearRemoveNodeTimerId){var e=t.attr("data-symbol");this._chartModel.beginUndoMacro($.t("Remove all line tools for ")+e),this._clearRemoveNodeTimerId=setInterval(function(){var t=this._symbolDrawingsMap[e],o=t.splice(0,200).map(function(t){return t.datasource});this._chartModel.removeLineTools(o),0===t.length&&(this._chartModel.endUndoMacro(),this._clearRemoveNodeTimer())}.bind(this),50)}},i.prototype._removeSourcesFromView=function(t){
this._renderView(function(){this._scroll.scrollToStart()}.bind(this))},t.exports=i},654:function(t,e,o){(function(e,i){"use strict";function s(t,e){this._chartWidget=e,this._chartModel=t,this._$activeItem=null,this._nodeExpandCollapseCallback=null,this._nodeRemoveCallback=null,this._itemActivateCallback=null}var r,n,a,l,c,d,h,p,u=o(1).LineDataSource,_=o(118),m=o(195),v=o(76),b=o(217).lineToolsInfo,g=o(290);o(508),o(287),r=o(379),n=o(844),a=o(843),l=o(377),c=o(841),d=o(842),h=o(840),p='<div class="tv-objects-tree-item {{#largeLeftPadding}}tv-objects-tree-item--large-left-padding{{/largeLeftPadding}}">{{#draggable}}<div class="tv-objects-tree-item__drag-icon js-drag-icon">'+r+'</div>{{/draggable}}{{#treeNode}}<div class="tv-objects-tree-item__control-buttons tv-objects-tree-item__control-buttons--left"><span class="tv-objects-tree-item__button tv-objects-tree-item__button--expand">'+n+'</span><span class="tv-objects-tree-item__button tv-objects-tree-item__button--collapse">'+a+'</span></div>{{/treeNode}}{{^treeNode}}<div class="tv-objects-tree-item__icon js-icon-container"></div>{{/treeNode}}<div class="tv-objects-tree-item__title {{#wideTitle}}tv-objects-tree-item__title--wide{{/wideTitle}} js-title-container"></div><div class="tv-objects-tree-item__control-buttons">{{#lockUnlockIcon}}<span class="tv-objects-tree-item__button tv-objects-tree-item__button--lock js-lock-unlock-btn">'+l+'</span>{{/lockUnlockIcon}}{{#showHideIcon}}<span class="tv-objects-tree-item__button js-show-hide-btn">'+c+"</span>{{/showHideIcon}}{{^treeNode}}"+(e.enabled("property_pages")?'<span class="tv-objects-tree-item__button js-format-btn">'+d+"</span>":"")+'{{/treeNode}}<span class="tv-objects-tree-item__button js-remove-btn">'+h+"</span></div></div>",s.prototype.setItemActivateListener=function(t){this._itemActivateCallback=t},s.prototype.setNodeExpandCollapseCallback=function(t){this._nodeExpandCollapseCallback=t},s.prototype.setNodeRemoveCallback=function(t){this._nodeRemoveCallback=t},s.prototype.activateItem=function(t,e,o){o&&o.originalEvent.defaultPrevented||(this._$activeItem&&0!==this._$activeItem.length&&this._$activeItem.removeClass("i-active"),this._$activeItem=t,this._$activeItem&&0!==this._$activeItem.length&&this._$activeItem.addClass("i-active"),this._itemActivateCallback&&this._itemActivateCallback(e))},s.prototype.createSortableForItemsList=function(t,e,o){t.sortable({scroll:!0,scrollSensitivity:100,scrollSpeed:100,axis:"y",handle:".js-drag-icon",placeholder:"tv-objects-tree-item tv-objects-tree-item--placeholder",start:e,stop:o})},s.prototype.createTreeNodeItem=function(t,e,o){var s,r=$(i.render(p,{draggable:!1,lockUnlockIcon:!1,formatIcon:!1,showHideIcon:!1,treeNode:!0,title:t,wideTitle:!0}));return this.updateNodeItem(r,t,e,o),r.click(this._onNodeToggleExpandCollapse.bind(this,r,t)),s=r.find(".js-remove-btn").attr("title",$.t("Delete all drawing for this symbol")),s.click(function(e){e.preventDefault(),this._nodeRemoveCallback&&this._nodeRemoveCallback(r,t)}.bind(this)),r},s.prototype.createItem=function(t,e){var o,s
;return e=e||{},o=$(i.render(p,{draggable:e.draggable,lockUnlockIcon:e.lockUnlock,showHideIcon:e.showHide,treeNode:!1,largeLeftPadding:e.largeLeftPadding})),this.updateItem(o,t),s=t.datasource,o.click(this.activateItem.bind(this,o,s)),s.userEditEnabled()&&(e.lockUnlock&&this._setupLockUnlockButton(o.find(".js-lock-unlock-btn"),s),e.showHide&&this._setupItemPropertyButton(o.find(".js-show-hide-btn"),s,"visible",$.t("Show/Hide"),"Show/Hide ",!0),this._setupFormatButton(o.find(".js-format-btn"),s),this._canShowEditObjectDialog(s)&&(o.dblclick(this._showEditObjectDialog.bind(this,s)),e.addContextMenu&&o.on("contextmenu",function(t){this._showContextMenu(t,s),t.preventDefault()}.bind(this))),this._setupItemRemoveButton(o.find(".js-remove-btn"),s)),o},s.prototype.updateNodeItem=function(t,e,o,i){var s=t.find(".js-title-container");s.toggleClass("i-bold",i.isCurrent),s[0].innerHTML=e+" ("+o.length+")"},s.prototype.updateItem=function(t,e){t.find(".js-title-container")[0].innerHTML=TradingView.clean($.t(e.name)),this._setDataSourceIcon(t,e.datasource),this._setItemVisible(t,e.datasource)},s.prototype._showContextMenu=function(t,o){if(e.enabled("objects_tree_context_menu")){this._chartWidget.paneByState(this._chartModel.paneForSource(o)).showContextMenuForSource(o,t)}},s.prototype._canShowEditObjectDialog=function(t){return!(t instanceof u&&!t.isActualSymbol())&&((t!==this._chartModel.mainSeries()||!this._chartWidget||!this._chartWidget.onWidget())&&(m.hasStylesPropertyPage(t)||m.hasInputsPropertyPage(t)))},s.prototype._showEditObjectDialog=function(t){new v(t,this._chartModel).show()},s.prototype._setupLockUnlockButton=function(t,e){TradingView.isInherited(e.constructor,u)?this._setupItemPropertyButton(t,e,"frozen",$.t("Lock/Unlock"),"Lock/Unlock ",!1):t.addClass("i-hidden")},s.prototype._setupFormatButton=function(t,e){if(!this._canShowEditObjectDialog(e))return void t.addClass("i-hidden");t.attr("title",$.t("Format")).click(this._showEditObjectDialog.bind(this,e))},s.prototype._setItemVisible=function(t,e){var o=e.properties().visible.value();t.toggleClass("i-prop-hidden",!o)},s.prototype._setDataSourceIcon=function(t,e){var o,i,s,r,n,a,l=t.find(".js-icon-container").empty();l.removeClass("i-text-icon i-empty"),o=e instanceof u,i=e instanceof _,s=e===this._chartModel.mainSeries(),o&&!i||s?(r=null,s?r=g[e.properties().style.value()]:(n=b[e.getType()])&&(r=n.icon),r?$(r).attr({width:20,height:20}).appendTo(l):l.addClass("i-empty")):i?(a=e.properties().icon.value(),l.addClass("i-text-icon"),l.text(String.fromCharCode(a))):l.addClass("i-empty"),t.prepend(l)},s.prototype._onItemPropertyButtonClicked=function(t,e){this._chartModel.setProperty(t,!t.value(),e)},s.prototype._onItemPropertyChanged=function(t,e,o){t.toggleClass("i-active",e?!o.value():o.value())},s.prototype._syncStateAndSubscribe=function(t,e,o){e.subscribe(null,this._onItemPropertyChanged.bind(this,t,o)),this._onItemPropertyChanged(t,o,e)},s.prototype._setupItemPropertyButton=function(t,e,o,i,s,r){t.attr("title",i).click(function(t){
this._onItemPropertyButtonClicked(e.properties()[o],s+e.title())}.bind(this)),this._syncStateAndSubscribe(t,e.properties()[o],r)},s.prototype._setupItemRemoveButton=function(t,e){e!==this._chartModel.mainSeries()&&e.isUserDeletable()?t.attr("title",$.t("Delete")).click(function(t){t.preventDefault(),this._chartModel.removeSource(e)}.bind(this)):t.addClass("i-transparent")},s.prototype._onNodeToggleExpandCollapse=function(t,e){var o="i-expanded",i=t.hasClass(o);t.toggleClass(o,!i),this._nodeExpandCollapseCallback&&this._nodeExpandCollapseCallback(t,e,!i)},t.exports.ObjectTreeItemsController=s}).call(e,o(3),o(30))},655:function(t,e,o){(function(e,i){"use strict";function s(t){this._$filter=$(e.render(r,{filters:this._getActions()})).appendTo(t).tvDropdown();var o=this;this._$filter.on(Modernizr.touch?"touchend":"click",".js-dropdown-item",function(t){o._$filter.tvDropdown("close"),o._$filter.find(".js-dropdown-item.i-active").removeClass("i-active"),$(this).addClass("i-active")}),this._$filter.on("afterCloseMenu",function(){o.setValue(o._$filter.find(".js-dropdown-item.i-active").attr("data-name"))}),this._$filter.on("beforeOpenMenu",function(){o._$filter.find(".js-dropdown-item").each(function(){var t=$(this);t.toggleClass("i-active",t.attr("data-name")===o._value)})}),this.onChange=new i,this.setValue("all"),this._$filter.find('.js-dropdown-item[data-name="'+this._value+'"]').addClass("i-active")}var r,n=o(31).Study,a=o(42),l=o(1).LineDataSource;o(137),o(518),o(509),o(261),r='<div class="tv-dropdown tv-dropdown-behavior"><div class="tv-dropdown-behavior__button js-dropdown-toggle tv-objects-tree-tab-filter__button"><span class="js-filter-title"></span><span class="tv-caret"></span></div><div class="tv-dropdown__body tv-dropdown-behavior__body i-hidden">{{#filters}}<div class="tv-dropdown-behavior__item"><div class="tv-dropdown__item js-dropdown-item" data-name="{{name}}">{{title}}</div></div>{{/filters}}</div></div>',s.prototype.value=function(){return this._value},s.prototype.setValue=function(t){if(t!==this._value){this._value=t;var e=this._getActions().filter(function(e){return e.name===t})[0];this._$filter.find(".js-filter-title").text(e.title),this.onChange.fire(t)}},s.prototype.applyToGroup=function(t){var e,o,i,s,r;if("all"===this._value)return t;for(e=[],o=0;o<t.length;o++)i=t[o],s=TradingView.isInherited(i.datasource.constructor,a),r=TradingView.isInherited(i.datasource.constructor,"drawings"===this._value?n:l),!s&&r||e.push(i);return e},s.prototype._getActions=function(){return[{name:"all",title:$.t("All")},{name:"drawings",title:$.t("Drawings")},{name:"studies",title:$.t("Studies")}]},t.exports.ObjectsTreeTabFilter=s}).call(e,o(30),o(15))},656:function(t,e,o){"use strict";function i(t,e,o,i,s){r.call(this,t,e,o,i),this._delayedRenderIntervals={},this._$filterContainer=s,this._boundUpdateView=this._updateView.bind(this),this._boundRenderView=this._renderView.bind(this,null),this._zorderChangedHandler=this._onZorderChanged.bind(this)}var s=o(655).ObjectsTreeTabFilter,r=o(299);o(510),inherit(i,r),
this._onItemPropertyButtonClicked(e.properties()[o],s+e.title())}.bind(this)),this._syncStateAndSubscribe(t,e.properties()[o],r)},s.prototype._setupItemRemoveButton=function(t,e){e!==this._chartModel.mainSeries()&&e.isUserDeletable()?t.attr("title",$.t("Delete")).click(function(t){t.preventDefault(),this._chartModel.removeSource(e)}.bind(this)):t.addClass("i-transparent")},s.prototype._onNodeToggleExpandCollapse=function(t,e){var o="i-expanded",i=t.hasClass(o);t.toggleClass(o,!i),this._nodeExpandCollapseCallback&&this._nodeExpandCollapseCallback(t,e,!i)},t.exports.ObjectTreeItemsController=s}).call(e,o(3),o(30))},655:function(t,e,o){(function(e,i){"use strict";function s(t){this._$filter=$(e.render(r,{filters:this._getActions()})).appendTo(t).tvDropdown();var o=this;this._$filter.on(Modernizr.touch?"touchend":"click",".js-dropdown-item",function(t){o._$filter.tvDropdown("close"),o._$filter.find(".js-dropdown-item.i-active").removeClass("i-active"),$(this).addClass("i-active")}),this._$filter.on("afterCloseMenu",function(){o.setValue(o._$filter.find(".js-dropdown-item.i-active").attr("data-name"))}),this._$filter.on("beforeOpenMenu",function(){o._$filter.find(".js-dropdown-item").each(function(){var t=$(this);t.toggleClass("i-active",t.attr("data-name")===o._value)})}),this.onChange=new i,this.setValue("all"),this._$filter.find('.js-dropdown-item[data-name="'+this._value+'"]').addClass("i-active")}var r,n=o(31).Study,a=o(43),l=o(1).LineDataSource;o(137),o(518),o(509),o(261),r='<div class="tv-dropdown tv-dropdown-behavior"><div class="tv-dropdown-behavior__button js-dropdown-toggle tv-objects-tree-tab-filter__button"><span class="js-filter-title"></span><span class="tv-caret"></span></div><div class="tv-dropdown__body tv-dropdown-behavior__body i-hidden">{{#filters}}<div class="tv-dropdown-behavior__item"><div class="tv-dropdown__item js-dropdown-item" data-name="{{name}}">{{title}}</div></div>{{/filters}}</div></div>',s.prototype.value=function(){return this._value},s.prototype.setValue=function(t){if(t!==this._value){this._value=t;var e=this._getActions().filter(function(e){return e.name===t})[0];this._$filter.find(".js-filter-title").text(e.title),this.onChange.fire(t)}},s.prototype.applyToGroup=function(t){var e,o,i,s,r;if("all"===this._value)return t;for(e=[],o=0;o<t.length;o++)i=t[o],s=TradingView.isInherited(i.datasource.constructor,a),r=TradingView.isInherited(i.datasource.constructor,"drawings"===this._value?n:l),!s&&r||e.push(i);return e},s.prototype._getActions=function(){return[{name:"all",title:$.t("All")},{name:"drawings",title:$.t("Drawings")},{name:"studies",title:$.t("Studies")}]},t.exports.ObjectsTreeTabFilter=s}).call(e,o(30),o(15))},656:function(t,e,o){"use strict";function i(t,e,o,i,s){r.call(this,t,e,o,i),this._delayedRenderIntervals={},this._$filterContainer=s,this._boundUpdateView=this._updateView.bind(this),this._boundRenderView=this._renderView.bind(this,null),this._zorderChangedHandler=this._onZorderChanged.bind(this)}var s=o(655).ObjectsTreeTabFilter,r=o(299);o(510),inherit(i,r),
i.prototype.destroy=function(){Object.keys(this._delayedRenderIntervals).forEach(function(t){clearInterval(t)}),this._delayedRenderIntervals=null,r.prototype.destroy.call(this)},i.prototype.initView=function(){this._filter=new s(this._$filterContainer),this._filter.onChange.subscribe(this,function(){this._renderView(this._scroll.scrollToStart.bind(this._scroll))}.bind(this)),r.prototype.initView.call(this)},i.prototype._addSortableToList=function(t,e){var o=0;this._listAccessor().createSortableForItemsList(t,function(t,e){o=e.item.index()},function(t,i){var s,r,n,a,l,c,d,h,p,u=i.item.index();if(o!==u){for(s=o>u?i.item.next():i.item.prev(),r=this._getSourceIdForItem(i.item),n=this._getSourceIdForItem(s),a=-1,l=-1,c=0;c<e.length;++c)d=e[c],d.datasource.id()===r?a=c:d.datasource.id()===n&&(l=c);for(h=this._chartModel.dataSourceForId(r),this._chartModel.removeListener("changeZOrder",this._zorderChangedHandler),this._chartModel.beginUndoMacro("Change "+h.title()+" Z order"),p=a>l?1:-1,c=0;c<Math.abs(a-l);c++)this._chartModel.changeZOrder(h,p);this._chartModel.endUndoMacro(),this._chartModel.on("changeZOrder",this._zorderChangedHandler)}}.bind(this))},i.prototype._getNewSelectedIdOnRemoval=function(t){var e=t.next();0===e.length&&(e=t.prev()),this._listAccessor().activateItem(e,this._getSourceForItem(e))},i.prototype._moveItemUp=function(t){var e=t.prev();e.length&&(t.insertBefore(e),this._scroll.scrollTo(t))},i.prototype._moveItemDown=function(t){var e=t.next();e.length&&(t.insertAfter(e),this._scroll.scrollTo(t))},i.prototype._removeSourceFromView=function(t){var e,o=this._getItemForSourceId(t.id()),i=t.id()===this._selectedSourceId();i&&this._getNewSelectedIdOnRemoval(o),e=o.parent(),1===e.children().length?e.remove():o.remove(),this._selectedSourceId()&&i&&this._scroll.scrollTo(this._getItemForSourceId(this._selectedSourceId()))},i.prototype._removeSourcesFromView=function(t){this._renderView(function(){this._scroll.scrollToStart()}.bind(this))},i.prototype._onZorderChanged=function(t,e){if(t)if(e){var o=this._getItemForSourceId(t.id());1===e?this._moveItemUp(o):this._moveItemDown(o)}else this._renderView(function(){this._scroll.scrollTo(this._getItemForSourceId(t.id()))}.bind(this))},i.prototype._subscribeListeners=function(){r.prototype._subscribeListeners.call(this),this._chartModel.on("setProperty",this._boundUpdateView),this._chartModel.on("cloneLineTool",this._boundRenderView),this._chartModel.on("setChartStyleProperty",this._boundUpdateView),this._chartModel.on("changeZOrder",this._zorderChangedHandler),this._chartModel.on("moveSource",this._boundRenderView)},i.prototype._unsubscribeListeners=function(){r.prototype._unsubscribeListeners.call(this),this._chartModel.removeListener("setProperty",this._boundUpdateView),this._chartModel.removeListener("cloneLineTool",this._boundRenderView),this._chartModel.removeListener("setChartStyleProperty",this._boundUpdateView),this._chartModel.removeListener("changeZOrder",this._zorderChangedHandler),this._chartModel.removeListener("moveSource",this._boundRenderView)},
i.prototype._updateView=function(){var t,e,o,i,s,r;for(this._reloadItems(),t=this._getItems().groups,e=0;e<t.length;++e)if(o=t[e],o.children.length)for(i=o.children.length-1;i>=0;--i)s=o.children[i],r=this._getItemForSourceId(s.datasource.id()),0!==r.length&&this._listAccessor().updateItem(r,s)},i._groupRenderSize=50,i.prototype._renderGroup=function(t){var e,o;t=t||{},e=0,o=setInterval(function(){var s=t.items.slice(e,e+i._groupRenderSize);s.forEach(function(e){var o=this._list.createItem(e,{lockUnlock:t.showLocks,showHide:!0,draggable:!0,addContextMenu:!0});this._markItemForSource(o,e.datasource),e.datasource.id()===this._selectedSourceId()&&this._listAccessor().activateItem(o,e.datasource),t.$group.append(o)}.bind(this)),e+=i._groupRenderSize,s.length||(clearInterval(o),delete this._delayedRenderIntervals[o],0===--this._fillListGroupsCount&&t.callback())}.bind(this),100),this._delayedRenderIntervals[o]=!0},i.prototype._renderViewInternal=function(t){var e,o,i,s,r="studies"!==this._filter.value()&&this._items.drawings.length;for(this._fillListGroupsCount=0,e=this._getItems().groups,o=0;o<e.length;o++)i=this._filter.applyToGroup(e[o].children),i.length&&(s=$('<div class="tv-objects-tree-tab__group">').appendTo(this._$contentWrapper),this._addSortableToList(s,e[o].children),i.reverse(),this._renderGroup({showLocks:r,callback:t,items:i,$group:s}),this._fillListGroupsCount++)},t.exports=i},840:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill-rule="evenodd" d="M0 2.006C0 .898.897 0 2.006 0h9.988C13.102 0 14 .897 14 2.006v9.988A2.005 2.005 0 0 1 11.994 14H2.006A2.005 2.005 0 0 1 0 11.994V2.006zM5.586 7L3.293 4.707 2.586 4 4 2.586l.707.707L7 5.586l2.293-2.293.707-.707L11.414 4l-.707.707L8.414 7l2.293 2.293.707.707L10 11.414l-.707-.707L7 8.414l-2.293 2.293-.707.707L2.586 10l.707-.707L5.586 7z"/></svg>'},841:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill-rule="evenodd" d="M0 2.006C0 .898.897 0 2.006 0h9.988C13.102 0 14 .897 14 2.006v9.988A2.005 2.005 0 0 1 11.994 14H2.006A2.005 2.005 0 0 1 0 11.994V2.006zM7 11c3.314 0 6-4 6-4s-2.686-4-6-4-6 4-6 4 2.686 4 6 4zm0-2c-1.111 0-2-.889-2-2s.889-2 2-2 2 .889 2 2-.906 2-2 2z"/></svg>'},842:function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill-rule="evenodd" d="M0 2.006C0 .898.897 0 2.006 0h9.988C13.102 0 14 .897 14 2.006v9.988A2.005 2.005 0 0 1 11.994 14H2.006A2.005 2.005 0 0 1 0 11.994V2.006zm11.119 4.28s-.357 0-.452-.334a3.415 3.415 0 0 0-.334-.81c-.143-.309.096-.547.096-.547l.357-.357c.143-.143.143-.38 0-.548l-.476-.476c-.143-.143-.381-.143-.548 0l-.357.357s-.238.239-.548.096a3.415 3.415 0 0 0-.81-.334c-.333-.095-.333-.452-.333-.452v-.5A.376.376 0 0 0 7.334 2h-.667a.376.376 0 0 0-.381.381v.5s0 .357-.334.452c-.285.072-.547.19-.81.334-.309.143-.547-.096-.547-.096l-.357-.357c-.143-.143-.38-.143-.548 0l-.476.476c-.143.143-.143.381 0 .548l.357.357s.239.238.096.548a3.415 3.415 0 0 0-.334.81c-.095.309-.452.333-.452.333h-.5a.376.376 0 0 0-.381.38v.667c0 .215.167.381.381.381h.5s.357 0 .452.334c.072.285.19.547.334.81.143.309-.096.547-.096.547l-.357.357c-.143.143-.143.38 0 .548l.476.476c.143.143.381.143.548 0l.357-.357s.238-.239.548-.096c.262.143.524.262.81.334.309.095.333.452.333.452v.5c0 .214.166.381.38.381h.667a.376.376 0 0 0 .381-.381v-.5s0-.357.334-.452c.285-.072.547-.19.81-.334.309-.143.547.096.547.096l.357.357c.143.143.38.143.548 0l.476-.476c.143-.143.143-.381 0-.548l-.357-.357s-.239-.238-.096-.548c.143-.262.262-.524.334-.81.095-.309.452-.333.452-.333h.5a.376.376 0 0 0 .381-.38v-.667a.376.376 0 0 0-.381-.381h-.5zM7 9c-1.111 0-2-.889-2-2s.889-2 2-2 2 .889 2 2-.906 2-2 2z"/></svg>'},843:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill-rule="evenodd" d="M0 2.006C0 .898.897 0 2.006 0h9.988C13.102 0 14 .897 14 2.006v9.988A2.005 2.005 0 0 1 11.994 14H2.006A2.005 2.005 0 0 1 0 11.994V2.006zM6 6H3v2h8V6H6z"/></svg>'},844:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill-rule="evenodd" d="M0 2.006C0 .898.897 0 2.006 0h9.988C13.102 0 14 .897 14 2.006v9.988A2.005 2.005 0 0 1 11.994 14H2.006A2.005 2.005 0 0 1 0 11.994V2.006zm8 1.19H6v3H3v2h3v3h2v-3h3v-2H8v-3z"/></svg>'}});

View File

@@ -1,4 +1,4 @@
!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n,i,r=window.webpackJsonp;window.webpackJsonp=function(o,s){for(var a,l,u=0,c=[];u<o.length;u++)l=o[u],i[l]&&c.push.apply(c,i[l]),i[l]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(t[a]=s[a]);for(r&&r(o,s);c.length;)c.shift().call(null,e);if(s[0])return n[0]=0,e(0)},n={},i={1:0},e.e=function(t,n){var r,o;if(0===i[t])return n.call(null,e);void 0!==i[t]?i[t].push(n):(i[t]=[n],r=document.getElementsByTagName("head")[0],o=document.createElement("script"),o.type="text/javascript",o.charset="utf-8",o.async=!0,o.src=e.p+""+({0:"objecttreedialog",3:"ie-fallback-logos",4:"library"}[t]||t)+"."+{0:"e507dbe7b836760cf959",2:"1241f4b3f95dd7677a3c",3:"01acaeb21cf903de7d89",4:"5b9e0d4f842989964d56"}[t]+".js",r.appendChild(o))},e.m=t,e.c=n,e.p="bundles/",e.p=window.WEBPACK_PUBLIC_PATH||e.p,e(0)}([function(t,e,n){n(166),n(914),n(758),n(17),n(286),n(590),n(130),n(30),n(39),n(721),n(566),n(359),n(717),n(718),n(105),n(360),n(714),n(715),n(567),n(384),n(716),n(719),t.exports=n(267)},,,,function(t,e,n){var i=n(20),r=n(96),o=n(84),s=n(99),a=n(74),l="prototype",u=function(t,e,n){var c,h,f,d,p=t&u.F,g=t&u.G,m=t&u.S,y=t&u.P,v=t&u.B,b=g?i:m?i[e]||(i[e]={}):(i[e]||{})[l],_=g?r:r[e]||(r[e]={}),w=_[l]||(_[l]={});g&&(n=e);for(c in n)h=!p&&b&&void 0!==b[c],f=(h?b:n)[c],d=v&&h?a(f,i):y&&"function"==typeof f?a(Function.call,f):f,b&&s(b,c,f,t&u.U),_[c]!=f&&o(_,c,d),y&&w[c]!=f&&(w[c]=f)};i.core=r,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},,,,,,,,,,,,,function(t,e,n){var i,r;!function(o,s){function a(t){var e,n,i=Ce[t]={};for(t=t.split(/\s+/),e=0,n=t.length;e<n;e++)i[t[e]]=!0;return i}function l(t,e,n){if(n===s&&1===t.nodeType){var i="data-"+e.replace(Y,"-$1").toLowerCase();if("string"==typeof(n=t.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:Te.isNumeric(n)?+n:H.test(n)?Te.parseJSON(n):n)}catch(t){}Te.data(t,e,n)}else n=s}return n}function u(t){for(var e in t)if(("data"!==e||!Te.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function c(t,e,n){var i=e+"defer",r=e+"queue",o=e+"mark",s=Te._data(t,i);!s||"queue"!==n&&Te._data(t,r)||"mark"!==n&&Te._data(t,o)||setTimeout(function(){Te._data(t,r)||Te._data(t,o)||(Te.removeData(t,i,!0),s.fire())},0)}function h(){return!1}function f(){return!0}function d(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function p(t,e,n){if(e=e||0,Te.isFunction(e))return Te.grep(t,function(t,i){return!!e.call(t,i,t)===n});if(e.nodeType)return Te.grep(t,function(t,i){return t===e===n});if("string"==typeof e){var i=Te.grep(t,function(t){return 1===t.nodeType});if(ct.test(e))return Te.filter(e,i,!n);e=Te.filter(e,i)}return Te.grep(t,function(t,i){return Te.inArray(t,e)>=0===n})}function g(t){var e=pt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function m(t,e){
!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n,i,r=window.webpackJsonp;window.webpackJsonp=function(o,s){for(var a,l,u=0,c=[];u<o.length;u++)l=o[u],i[l]&&c.push.apply(c,i[l]),i[l]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(t[a]=s[a]);for(r&&r(o,s);c.length;)c.shift().call(null,e);if(s[0])return n[0]=0,e(0)},n={},i={1:0},e.e=function(t,n){var r,o;if(0===i[t])return n.call(null,e);void 0!==i[t]?i[t].push(n):(i[t]=[n],r=document.getElementsByTagName("head")[0],o=document.createElement("script"),o.type="text/javascript",o.charset="utf-8",o.async=!0,o.src=e.p+""+({0:"objecttreedialog",3:"ie-fallback-logos",4:"library"}[t]||t)+"."+{0:"b80d27d173fb6f8bb0a3",2:"1241f4b3f95dd7677a3c",3:"01acaeb21cf903de7d89",4:"52f448f933885e5e0fed"}[t]+".js",r.appendChild(o))},e.m=t,e.c=n,e.p="bundles/",e.p=window.WEBPACK_PUBLIC_PATH||e.p,e(0)}([function(t,e,n){n(166),n(914),n(758),n(17),n(286),n(590),n(130),n(30),n(40),n(721),n(566),n(359),n(717),n(718),n(105),n(360),n(714),n(715),n(567),n(384),n(716),n(719),t.exports=n(267)},,,,function(t,e,n){var i=n(20),r=n(96),o=n(84),s=n(99),a=n(74),l="prototype",u=function(t,e,n){var c,h,f,d,p=t&u.F,g=t&u.G,m=t&u.S,y=t&u.P,v=t&u.B,b=g?i:m?i[e]||(i[e]={}):(i[e]||{})[l],_=g?r:r[e]||(r[e]={}),w=_[l]||(_[l]={});g&&(n=e);for(c in n)h=!p&&b&&void 0!==b[c],f=(h?b:n)[c],d=v&&h?a(f,i):y&&"function"==typeof f?a(Function.call,f):f,b&&s(b,c,f,t&u.U),_[c]!=f&&o(_,c,d),y&&w[c]!=f&&(w[c]=f)};i.core=r,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},,,,,,,,,,,,,function(t,e,n){var i,r;!function(o,s){function a(t){var e,n,i=Ce[t]={};for(t=t.split(/\s+/),e=0,n=t.length;e<n;e++)i[t[e]]=!0;return i}function l(t,e,n){if(n===s&&1===t.nodeType){var i="data-"+e.replace(Y,"-$1").toLowerCase();if("string"==typeof(n=t.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:Te.isNumeric(n)?+n:H.test(n)?Te.parseJSON(n):n)}catch(t){}Te.data(t,e,n)}else n=s}return n}function u(t){for(var e in t)if(("data"!==e||!Te.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function c(t,e,n){var i=e+"defer",r=e+"queue",o=e+"mark",s=Te._data(t,i);!s||"queue"!==n&&Te._data(t,r)||"mark"!==n&&Te._data(t,o)||setTimeout(function(){Te._data(t,r)||Te._data(t,o)||(Te.removeData(t,i,!0),s.fire())},0)}function h(){return!1}function f(){return!0}function d(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function p(t,e,n){if(e=e||0,Te.isFunction(e))return Te.grep(t,function(t,i){return!!e.call(t,i,t)===n});if(e.nodeType)return Te.grep(t,function(t,i){return t===e===n});if("string"==typeof e){var i=Te.grep(t,function(t){return 1===t.nodeType});if(ct.test(e))return Te.filter(e,i,!n);e=Te.filter(e,i)}return Te.grep(t,function(t,i){return Te.inArray(t,e)>=0===n})}function g(t){var e=pt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function m(t,e){
return Te.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function y(t,e){if(1===e.nodeType&&Te.hasData(t)){var n,i,r,o=Te._data(t),s=Te._data(e,o),a=o.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,r=a[n].length;i<r;i++)Te.event.add(e,n,a[n][i])}s.data&&(s.data=Te.extend({},s.data))}}function v(t,e){var n;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),n=e.nodeName.toLowerCase(),"object"===n?e.outerHTML=t.outerHTML:"input"!==n||"checkbox"!==t.type&&"radio"!==t.type?"option"===n?e.selected=t.defaultSelected:"input"===n||"textarea"===n?e.defaultValue=t.defaultValue:"script"===n&&e.text!==t.text&&(e.text=t.text):(t.checked&&(e.defaultChecked=e.checked=t.checked),e.value!==t.value&&(e.value=t.value)),e.removeAttribute(Te.expando),e.removeAttribute("_submit_attached"),e.removeAttribute("_change_attached"))}function b(t){return s!==t.getElementsByTagName?t.getElementsByTagName("*"):s!==t.querySelectorAll?t.querySelectorAll("*"):[]}function _(t){"checkbox"!==t.type&&"radio"!==t.type||(t.defaultChecked=t.checked)}function w(t){var e=(t.nodeName||"").toLowerCase();"input"===e?_(t):"script"!==e&&s!==t.getElementsByTagName&&Te.grep(t.getElementsByTagName("input"),_)}function x(t){var e=Se.createElement("div");return Ct.appendChild(e),e.innerHTML=t.outerHTML,e.firstChild}function k(t,e,n){var i="width"===e?t.offsetWidth:t.offsetHeight,r="width"===e?1:0,o=4;if(i>0){if("border"!==n)for(;r<o;r+=2)n||(i-=parseFloat(Te.css(t,"padding"+Ft[r]))||0),"margin"===n?i+=parseFloat(Te.css(t,n+Ft[r]))||0:i-=parseFloat(Te.css(t,"border"+Ft[r]+"Width"))||0;return i+"px"}if(i=Ht(t,e),(i<0||null==i)&&(i=t.style[e]),Lt.test(i))return i;if(i=parseFloat(i)||0,n)for(;r<o;r+=2)i+=parseFloat(Te.css(t,"padding"+Ft[r]))||0,"padding"!==n&&(i+=parseFloat(Te.css(t,"border"+Ft[r]+"Width"))||0),"margin"===n&&(i+=parseFloat(Te.css(t,n+Ft[r]))||0);return i+"px"}function S(t){return function(e,n){if("string"!=typeof e&&(n=e,e="*"),Te.isFunction(n))for(var i,r,o,s=e.toLowerCase().split(Zt),a=0,l=s.length;a<l;a++)i=s[a],o=/^\+/.test(i),o&&(i=i.substr(1)||"*"),r=t[i]=t[i]||[],r[o?"unshift":"push"](n)}}function M(t,e,n,i,r,o){r=r||e.dataTypes[0],o=o||{},o[r]=!0;for(var a,l=t[r],u=0,c=l?l.length:0,h=t===ie;u<c&&(h||!a);u++)"string"==typeof(a=l[u](e,n,i))&&(!h||o[a]?a=s:(e.dataTypes.unshift(a),a=M(t,e,n,i,a,o)));return!h&&a||o["*"]||(a=M(t,e,n,i,"*",o)),a}function D(t,e){var n,i,r=Te.ajaxSettings.flatOptions||{};for(n in e)e[n]!==s&&((r[n]?t:i||(i={}))[n]=e[n]);i&&Te.extend(!0,t,i)}function T(t,e,n,i){if(Te.isArray(e))Te.each(e,function(e,r){n||Wt.test(t)?i(t,r):T(t+"["+("object"==typeof r?e:"")+"]",r,n,i)});else if(n||"object"!==Te.type(e))i(t,e);else for(var r in e)T(t+"["+r+"]",e[r],n,i)}function C(t,e,n){var i,r,o,a,l=t.contents,u=t.dataTypes,c=t.responseFields;for(r in c)r in n&&(e[c[r]]=n[r]);for(;"*"===u[0];)u.shift(),i===s&&(i=t.mimeType||e.getResponseHeader("content-type"));if(i)for(r in l)if(l[r]&&l[r].test(i)){u.unshift(r);break}
if(u[0]in n)o=u[0];else{for(r in n){if(!u[0]||t.converters[r+" "+u[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function P(t,e){t.dataFilter&&(e=t.dataFilter(e,t.dataType));var n,i,r,o,a,l,u,c,h=t.dataTypes,f={},d=h.length,p=h[0];for(n=1;n<d;n++){if(1===n)for(i in t.converters)"string"==typeof i&&(f[i.toLowerCase()]=t.converters[i]);if(o=p,"*"===(p=h[n]))p=o;else if("*"!==o&&o!==p){if(a=o+" "+p,!(l=f[a]||f["* "+p])){c=s;for(u in f)if(r=u.split(" "),(r[0]===o||"*"===r[0])&&(c=f[r[1]+" "+p])){u=f[u],!0===u?l=c:!0===c&&(l=u);break}}l||c||Te.error("No conversion from "+a.replace(" "," to ")),!0!==l&&(e=l?l(e):c(u(e)))}}return e}function O(){try{return new o.XMLHttpRequest}catch(t){}}function E(){try{return new o.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function N(){return setTimeout(L,0),_e=Te.now()}function L(){_e=s}function A(t,e){var n={};return Te.each(be.concat.apply([],be.slice(0,e)),function(){n[this]=t}),n}function I(t){if(!de[t]){var e=Se.body,n=Te("<"+t+">").appendTo(e),i=n.css("display");n.remove(),"none"!==i&&""!==i||(pe||(pe=Se.createElement("iframe"),pe.frameBorder=pe.width=pe.height=0),e.appendChild(pe),ge&&pe.createElement||(ge=(pe.contentWindow||pe.contentDocument).document,ge.write((Te.support.boxModel?"<!doctype html>":"")+"<html><body>"),ge.close()),n=ge.createElement(t),ge.body.appendChild(n),i=Te.css(n,"display"),e.removeChild(pe)),de[t]=i}return de[t]}function j(t){return Te.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}var F,H,Y,z,R,W,V,B,U,q,$,G,X,K,Q,J,Z,tt,et,nt,it,rt,ot,st,at,lt,ut,ct,ht,ft,dt,pt,gt,mt,yt,vt,bt,_t,wt,xt,kt,St,Mt,Dt,Tt,Ct,Pt,Ot,Et,Nt,Lt,At,It,jt,Ft,Ht,Yt,zt,Rt,Wt,Vt,Bt,Ut,qt,$t,Gt,Xt,Kt,Qt,Jt,Zt,te,ee,ne,ie,re,oe,se,ae,le,ue,ce,he,fe,de,pe,ge,me,ye,ve,be,_e,we,xe,ke,Se=o.document,Me=o.navigator,De=o.location,Te=function(){function t(){if(!a.isReady){try{Se.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}a.ready()}}var e,n,i,r,a=function(t,n){return new a.fn.init(t,n,e)},l=o.jQuery,u=o.$,c=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,h=/\S/,f=/^\s+/,d=/\s+$/,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,g=/^[\],:{}\s]*$/,m=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,b=/(webkit)[ \/]([\w.]+)/,_=/(opera)(?:.*version)?[ \/]([\w.]+)/,w=/(msie) ([\w.]+)/,x=/(mozilla)(?:.*? rv:([\w.]+))?/,k=/-([a-z]|[0-9])/gi,S=/^-ms-/,M=function(t,e){return(e+"").toUpperCase()},D=Me.userAgent,T=Object.prototype.toString,C=Object.prototype.hasOwnProperty,P=Array.prototype.push,O=Array.prototype.slice,E=String.prototype.trim,N=Array.prototype.indexOf,L={};return a.fn=a.prototype={constructor:a,init:function(t,e,n){var i,r,o,l;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("body"===t&&!e&&Se.body)return this.context=Se,this[0]=Se.body,this.selector=t,this.length=1,this;if("string"==typeof t){
if(!(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:c.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1])return e=e instanceof a?e[0]:e,l=e?e.ownerDocument||e:Se,o=p.exec(t),o?a.isPlainObject(e)?(t=[Se.createElement(o[1])],a.fn.attr.call(t,e,!0)):t=[l.createElement(o[1])]:(o=a.buildFragment([i[1]],[l]),t=(o.cacheable?a.clone(o.fragment):o.fragment).childNodes),a.merge(this,t);if((r=Se.getElementById(i[2]))&&r.parentNode){if(r.id!==i[2])return n.find(t);this.length=1,this[0]=r}return this.context=Se,this.selector=t,this}return a.isFunction(t)?n.ready(t):(t.selector!==s&&(this.selector=t.selector,this.context=t.context),a.makeArray(t,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return O.call(this,0)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,n){var i=this.constructor();return a.isArray(t)?P.apply(i,t):a.merge(i,t),i.prevObject=this,i.context=this.context,"find"===e?i.selector=this.selector+(this.selector?" ":"")+n:e&&(i.selector=this.selector+"."+e+"("+n+")"),i},each:function(t,e){return a.each(this,t,e)},ready:function(t){return a.bindReady(),i.add(t),this},eq:function(t){return t=+t,-1===t?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(O.apply(this,arguments),"slice",O.call(arguments).join(","))},map:function(t){return this.pushStack(a.map(this,function(e,n){return t.call(e,n,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:P,sort:[].sort,splice:[].splice},a.fn.init.prototype=a.fn,a.extend=a.fn.extend=function(){var t,e,n,i,r,o,l=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof l&&(h=l,l=arguments[1]||{},u=2),"object"==typeof l||a.isFunction(l)||(l={}),c===u&&(l=this,--u);u<c;u++)if(null!=(t=arguments[u]))for(e in t)n=l[e],i=t[e],l!==i&&(h&&i&&(a.isPlainObject(i)||(r=a.isArray(i)))?(r?(r=!1,o=n&&a.isArray(n)?n:[]):o=n&&a.isPlainObject(n)?n:{},l[e]=a.extend(h,o,i)):i!==s&&(l[e]=i));return l},a.extend({noConflict:function(t){return o.$===a&&(o.$=u),t&&o.jQuery===a&&(o.jQuery=l),a},isReady:!1,readyWait:1,holdReady:function(t){t?a.readyWait++:a.ready(!0)},ready:function(t){if(!0===t&&!--a.readyWait||!0!==t&&!a.isReady){if(!Se.body)return setTimeout(a.ready,1);if(a.isReady=!0,!0!==t&&--a.readyWait>0)return;i.fireWith(Se,[a]),a.fn.trigger&&a(Se).trigger("ready").off("ready")}},bindReady:function(){if(!i){if(i=a.Callbacks("once memory"),"complete"===Se.readyState)return setTimeout(a.ready,1);if(Se.addEventListener)Se.addEventListener("DOMContentLoaded",r,!1),o.addEventListener("load",a.ready,!1);else if(Se.attachEvent){Se.attachEvent("onreadystatechange",r),o.attachEvent("onload",a.ready);var e=!1;try{e=null==o.frameElement}catch(t){}Se.documentElement.doScroll&&e&&t()}}},isFunction:function(t){return"function"===a.type(t)},isArray:Array.isArray||function(t){return"array"===a.type(t)},isWindow:function(t){
@@ -29,7 +29,7 @@ ue=/(\=)\?(&|$)|\?\?/i,Te.ajaxSetup({jsonp:"callback",jsonpCallback:function(){r
be=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],Te.fn.extend({show:function(t,e,n){var i,r,o,s;if(t||0===t)return this.animate(A("show",3),t,e,n);for(o=0,s=this.length;o<s;o++)i=this[o],i.style&&(r=i.style.display,Te._data(i,"olddisplay")||"none"!==r||(r=i.style.display=""),(""===r&&"none"===Te.css(i,"display")||!Te.contains(i.ownerDocument.documentElement,i))&&Te._data(i,"olddisplay",I(i.nodeName)));for(o=0;o<s;o++)i=this[o],i.style&&(""!==(r=i.style.display)&&"none"!==r||(i.style.display=Te._data(i,"olddisplay")||""));return this},hide:function(t,e,n){if(t||0===t)return this.animate(A("hide",3),t,e,n);for(var i,r,o=0,s=this.length;o<s;o++)i=this[o],i.style&&("none"===(r=Te.css(i,"display"))||Te._data(i,"olddisplay")||Te._data(i,"olddisplay",r));for(o=0;o<s;o++)this[o].style&&(this[o].style.display="none");return this},_toggle:Te.fn.toggle,toggle:function(t,e,n){var i="boolean"==typeof t;return Te.isFunction(t)&&Te.isFunction(e)?this._toggle.apply(this,arguments):null==t||i?this.each(function(){var e=i?t:Te(this).is(":hidden");Te(this)[e?"show":"hide"]()}):this.animate(A("toggle",3),t,e,n),this},fadeTo:function(t,e,n,i){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){function r(){!1===o.queue&&Te._mark(this);var e,n,i,r,s,a,l,u,c,h,f,d=Te.extend({},o),p=1===this.nodeType,g=p&&Te(this).is(":hidden");d.animatedProperties={};for(i in t)if(e=Te.camelCase(i),i!==e&&(t[e]=t[i],delete t[i]),(s=Te.cssHooks[e])&&"expand"in s){a=s.expand(t[e]),delete t[e];for(i in a)i in t||(t[i]=a[i])}for(e in t){if(n=t[e],Te.isArray(n)?(d.animatedProperties[e]=n[1],n=t[e]=n[0]):d.animatedProperties[e]=d.specialEasing&&d.specialEasing[e]||d.easing||"swing","hide"===n&&g||"show"===n&&!g)return d.complete.call(this);!p||"height"!==e&&"width"!==e||(d.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===Te.css(this,"display")&&"none"===Te.css(this,"float")&&(Te.support.inlineBlockNeedsLayout&&"inline"!==I(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=d.overflow&&(this.style.overflow="hidden");for(i in t)r=new Te.fx(this,d,i),n=t[i],me.test(n)?(f=Te._data(this,"toggle"+i)||("toggle"===n?g?"show":"hide":0),f?(Te._data(this,"toggle"+i,"show"===f?"hide":"show"),r[f]()):r[n]()):(l=ye.exec(n),u=r.cur(),l?(c=parseFloat(l[2]),h=l[3]||(Te.cssNumber[i]?"":"px"),"px"!==h&&(Te.style(this,i,(c||1)+h),u=(c||1)/r.cur()*u,Te.style(this,i,u+h)),l[1]&&(c=("-="===l[1]?-1:1)*c+u),r.custom(u,c,h)):r.custom(u,n,""));return!0}var o=Te.speed(e,n,i);return Te.isEmptyObject(t)?this.each(o.complete,[!1]):(t=Te.extend({},t),!1===o.queue?this.each(r):this.queue(o.queue,r))},stop:function(t,e,n){return"string"!=typeof t&&(n=e,e=t,t=s),e&&!1!==t&&this.queue(t||"fx",[]),this.each(function(){function e(t,e,i){var r=e[i];Te.removeData(t,i,!0),r.stop(n)}var i,r=!1,o=Te.timers,s=Te._data(this);if(n||Te._unmark(!0,this),
null==t)for(i in s)s[i]&&s[i].stop&&i.indexOf(".run")===i.length-4&&e(this,s,i);else s[i=t+".run"]&&s[i].stop&&e(this,s,i);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(n?o[i](!0):o[i].saveState(),r=!0,o.splice(i,1));n&&r||Te.dequeue(this,t)})}}),Te.each({slideDown:A("show",1),slideUp:A("hide",1),slideToggle:A("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){Te.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}}),Te.extend({speed:function(t,e,n){var i=t&&"object"==typeof t?Te.extend({},t):{complete:n||!n&&e||Te.isFunction(t)&&t,duration:t,easing:n&&e||e&&!Te.isFunction(e)&&e};return i.duration=Te.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in Te.fx.speeds?Te.fx.speeds[i.duration]:Te.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(t){Te.isFunction(i.old)&&i.old.call(this),i.queue?Te.dequeue(this,i.queue):!1!==t&&Te._unmark(this)},i},easing:{linear:function(t){return t},swing:function(t){return-Math.cos(t*Math.PI)/2+.5}},timers:[],fx:function(t,e,n){this.options=e,this.elem=t,this.prop=n,e.orig=e.orig||{}}}),Te.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(Te.fx.step[this.prop]||Te.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var t,e=Te.css(this.elem,this.prop);return isNaN(t=parseFloat(e))?e&&"auto"!==e?e:0:t},custom:function(t,e,n){function i(t){return r.step(t)}var r=this,o=Te.fx;this.startTime=_e||N(),this.end=e,this.now=this.start=t,this.pos=this.state=0,this.unit=n||this.unit||(Te.cssNumber[this.prop]?"":"px"),i.queue=this.options.queue,i.elem=this.elem,i.saveState=function(){Te._data(r.elem,"fxshow"+r.prop)===s&&(r.options.hide?Te._data(r.elem,"fxshow"+r.prop,r.start):r.options.show&&Te._data(r.elem,"fxshow"+r.prop,r.end))},i()&&Te.timers.push(i)&&!ve&&(ve=setInterval(o.tick,o.interval))},show:function(){var t=Te._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=t||Te.style(this.elem,this.prop),this.options.show=!0,t!==s?this.custom(this.cur(),t):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur()),Te(this.elem).show()},hide:function(){this.options.orig[this.prop]=Te._data(this.elem,"fxshow"+this.prop)||Te.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(t){var e,n,i,r=_e||N(),o=!0,s=this.elem,a=this.options;if(t||r>=a.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),a.animatedProperties[this.prop]=!0;for(e in a.animatedProperties)!0!==a.animatedProperties[e]&&(o=!1);if(o){if(null==a.overflow||Te.support.shrinkWrapBlocks||Te.each(["","X","Y"],function(t,e){s.style["overflow"+e]=a.overflow[t]}),a.hide&&Te(s).hide(),a.hide||a.show)for(e in a.animatedProperties)Te.style(s,e,a.orig[e]),Te.removeData(s,"fxshow"+e,!0),Te.removeData(s,"toggle"+e,!0);i=a.complete,i&&(a.complete=!1,i.call(s))}return!1}
return a.duration==1/0?this.now=r:(n=r-this.startTime,this.state=n/a.duration,this.pos=Te.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},Te.extend(Te.fx,{tick:function(){for(var t,e=Te.timers,n=0;n<e.length;n++)(t=e[n])()||e[n]!==t||e.splice(n--,1);e.length||Te.fx.stop()},interval:13,stop:function(){clearInterval(ve),ve=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(t){Te.style(t.elem,"opacity",t.now)},_default:function(t){t.elem.style&&null!=t.elem.style[t.prop]?t.elem.style[t.prop]=t.now+t.unit:t.elem[t.prop]=t.now}}}),Te.each(be.concat.apply([],be),function(t,e){e.indexOf("margin")&&(Te.fx.step[e]=function(t){Te.style(t.elem,e,Math.max(0,t.now)+t.unit)})}),Te.expr&&Te.expr.filters&&(Te.expr.filters.animated=function(t){return Te.grep(Te.timers,function(e){return t===e.elem}).length}),xe=/^t(?:able|d|h)$/i,ke=/^(?:body|html)$/i,we="getBoundingClientRect"in Se.documentElement?function(t,e,n,i){try{i=t.getBoundingClientRect()}catch(t){}if(!i||!Te.contains(n,t))return i?{top:i.top,left:i.left}:{top:0,left:0};var r=e.body,o=j(e),s=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,l=o.pageYOffset||Te.support.boxModel&&n.scrollTop||r.scrollTop,u=o.pageXOffset||Te.support.boxModel&&n.scrollLeft||r.scrollLeft;return{top:i.top+l-s,left:i.left+u-a}}:function(t,e,n){for(var i,r=t.offsetParent,o=e.body,s=e.defaultView,a=s?s.getComputedStyle(t,null):t.currentStyle,l=t.offsetTop,u=t.offsetLeft;(t=t.parentNode)&&t!==o&&t!==n&&(!Te.support.fixedPosition||"fixed"!==a.position);)i=s?s.getComputedStyle(t,null):t.currentStyle,l-=t.scrollTop,u-=t.scrollLeft,t===r&&(l+=t.offsetTop,u+=t.offsetLeft,!Te.support.doesNotAddBorder||Te.support.doesAddBorderForTableAndCells&&xe.test(t.nodeName)||(l+=parseFloat(i.borderTopWidth)||0,u+=parseFloat(i.borderLeftWidth)||0),r,r=t.offsetParent),Te.support.subtractsBorderForOverflowNotVisible&&"visible"!==i.overflow&&(l+=parseFloat(i.borderTopWidth)||0,u+=parseFloat(i.borderLeftWidth)||0),a=i;return"relative"!==a.position&&"static"!==a.position||(l+=o.offsetTop,u+=o.offsetLeft),Te.support.fixedPosition&&"fixed"===a.position&&(l+=Math.max(n.scrollTop,o.scrollTop),u+=Math.max(n.scrollLeft,o.scrollLeft)),{top:l,left:u}},Te.fn.offset=function(t){if(arguments.length)return t===s?this:this.each(function(e){Te.offset.setOffset(this,t,e)});var e=this[0],n=e&&e.ownerDocument;return n?e===n.body?Te.offset.bodyOffset(e):we(e,n,n.documentElement):null},Te.offset={bodyOffset:function(t){var e=t.offsetTop,n=t.offsetLeft;return Te.support.doesNotIncludeMarginInBodyOffset&&(e+=parseFloat(Te.css(t,"marginTop"))||0,n+=parseFloat(Te.css(t,"marginLeft"))||0),{top:e,left:n}},setOffset:function(t,e,n){var i,r,o,s,a,l,u,c,h,f=Te.css(t,"position");"static"===f&&(t.style.position="relative"),i=Te(t),r=i.offset(),o=Te.css(t,"top"),s=Te.css(t,"left"),a=("absolute"===f||"fixed"===f)&&Te.inArray("auto",[o,s])>-1,l={},u={},a?(u=i.position(),c=u.top,h=u.left):(c=parseFloat(o)||0,h=parseFloat(s)||0),
Te.isFunction(e)&&(e=e.call(t,n,r)),null!=e.top&&(l.top=e.top-r.top+c),null!=e.left&&(l.left=e.left-r.left+h),"using"in e?e.using.call(t,l):i.css(l)}},Te.fn.extend({position:function(){if(!this[0])return null;var t=this[0],e=this.offsetParent(),n=this.offset(),i=ke.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(Te.css(t,"marginTop"))||0,n.left-=parseFloat(Te.css(t,"marginLeft"))||0,i.top+=parseFloat(Te.css(e[0],"borderTopWidth"))||0,i.left+=parseFloat(Te.css(e[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Se.body;t&&!ke.test(t.nodeName)&&"static"===Te.css(t,"position");)t=t.offsetParent;return t})}}),Te.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);Te.fn[t]=function(i){return Te.access(this,function(t,i,r){var o=j(t);if(r===s)return o?e in o?o[e]:Te.support.boxModel&&o.document.documentElement[i]||o.document.body[i]:t[i];o?o.scrollTo(n?Te(o).scrollLeft():r,n?r:Te(o).scrollTop()):t[i]=r},t,i,arguments.length,null)}}),Te.each({Height:"height",Width:"width"},function(t,e){var n="client"+t,i="scroll"+t,r="offset"+t;Te.fn["inner"+t]=function(){var t=this[0];return t?t.style?parseFloat(Te.css(t,e,"padding")):this[e]():null},Te.fn["outer"+t]=function(t){var n=this[0];return n?n.style?parseFloat(Te.css(n,e,t?"margin":"border")):this[e]():null},Te.fn[e]=function(t){return Te.access(this,function(t,e,o){var a,l,u,c;return Te.isWindow(t)?(a=t.document,l=a.documentElement[n],Te.support.boxModel&&l||a.body&&a.body[n]||l):9===t.nodeType?(a=t.documentElement,a[n]>=a[i]?a[n]:Math.max(t.body[i],a[i],t.body[r],a[r])):o===s?(u=Te.css(t,e),c=parseFloat(u),Te.isNumeric(c)?c:u):void Te(t).css(e,o)},e,t,arguments.length,null)}}),o.jQuery=o.$=Te,n(385)&&n(385).jQuery&&(i=[],(r=function(){return Te}.apply(e,i))!==s&&(t.exports=r))}(window),t.exports=$},function(t,e,n){var i=n(29);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},,function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},,function(t,e,n){var i=n(183)("wks"),r=n(112),o=n(20).Symbol,s="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=s&&o[t]||(s?o:r)("Symbol."+t))}).store=i},,,,,,,function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){(function(e){t.exports=e.Mustache=n(570)}).call(e,function(){return this}())},,,,,,function(t,e,n){"use strict";function i(t,e,n){return B.isNaN(e)?t:e<t?t:e>n?n:Math.round(e)}function r(t,e,n){return B.isNaN(e)?t:e<t?t:e>n?n:Math.round(1e4*e)/1e4}function o(t){return i(0,t,255)}function s(t){return i(0,t,255)}function a(t){return i(0,t,255)}function l(t){return r(0,t,1)}function u(t,e,n){return[o(t),s(e),a(n)]}function c(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function h(t,e,n,i){var r,u,c;return Array.isArray(t)?(r=t,i=e,[r[0],r[1],r[2],l(i)]):(u=t,
Te.isFunction(e)&&(e=e.call(t,n,r)),null!=e.top&&(l.top=e.top-r.top+c),null!=e.left&&(l.left=e.left-r.left+h),"using"in e?e.using.call(t,l):i.css(l)}},Te.fn.extend({position:function(){if(!this[0])return null;var t=this[0],e=this.offsetParent(),n=this.offset(),i=ke.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(Te.css(t,"marginTop"))||0,n.left-=parseFloat(Te.css(t,"marginLeft"))||0,i.top+=parseFloat(Te.css(e[0],"borderTopWidth"))||0,i.left+=parseFloat(Te.css(e[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Se.body;t&&!ke.test(t.nodeName)&&"static"===Te.css(t,"position");)t=t.offsetParent;return t})}}),Te.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);Te.fn[t]=function(i){return Te.access(this,function(t,i,r){var o=j(t);if(r===s)return o?e in o?o[e]:Te.support.boxModel&&o.document.documentElement[i]||o.document.body[i]:t[i];o?o.scrollTo(n?Te(o).scrollLeft():r,n?r:Te(o).scrollTop()):t[i]=r},t,i,arguments.length,null)}}),Te.each({Height:"height",Width:"width"},function(t,e){var n="client"+t,i="scroll"+t,r="offset"+t;Te.fn["inner"+t]=function(){var t=this[0];return t?t.style?parseFloat(Te.css(t,e,"padding")):this[e]():null},Te.fn["outer"+t]=function(t){var n=this[0];return n?n.style?parseFloat(Te.css(n,e,t?"margin":"border")):this[e]():null},Te.fn[e]=function(t){return Te.access(this,function(t,e,o){var a,l,u,c;return Te.isWindow(t)?(a=t.document,l=a.documentElement[n],Te.support.boxModel&&l||a.body&&a.body[n]||l):9===t.nodeType?(a=t.documentElement,a[n]>=a[i]?a[n]:Math.max(t.body[i],a[i],t.body[r],a[r])):o===s?(u=Te.css(t,e),c=parseFloat(u),Te.isNumeric(c)?c:u):void Te(t).css(e,o)},e,t,arguments.length,null)}}),o.jQuery=o.$=Te,n(385)&&n(385).jQuery&&(i=[],(r=function(){return Te}.apply(e,i))!==s&&(t.exports=r))}(window),t.exports=$},function(t,e,n){var i=n(29);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},,function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},,function(t,e,n){var i=n(183)("wks"),r=n(112),o=n(20).Symbol,s="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=s&&o[t]||(s?o:r)("Symbol."+t))}).store=i},,,,,,,function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){(function(e){t.exports=e.Mustache=n(570)}).call(e,function(){return this}())},,,,,,,function(t,e,n){"use strict";function i(t,e,n){return B.isNaN(e)?t:e<t?t:e>n?n:Math.round(e)}function r(t,e,n){return B.isNaN(e)?t:e<t?t:e>n?n:Math.round(1e4*e)/1e4}function o(t){return i(0,t,255)}function s(t){return i(0,t,255)}function a(t){return i(0,t,255)}function l(t){return r(0,t,1)}function u(t,e,n){return[o(t),s(e),a(n)]}function c(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function h(t,e,n,i){var r,u,c;return Array.isArray(t)?(r=t,i=e,[r[0],r[1],r[2],l(i)]):(u=t,
c=e,n=n||0,i=i||0,[o(u),s(c),a(n),l(i)])}function f(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function d(t){return r(0,t,1)}function p(t){return r(0,t,1)}function g(t){return r(0,t,1)}function m(t){return r(0,t,1)}function y(t){return r(0,t,1)}function v(t,e,n){return[d(t),p(e),m(n)]}function b(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function _(t,e,n){return[d(t),g(e),y(n)]}function w(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function x(t){var e,n=t[0],i=t[1],r=t[2],o=n/255,s=i/255,a=r/255,l=Math.min(o,s,a),u=Math.max(o,s,a),c=0,h=0,f=(l+u)/2;if(l===u)c=0,h=0;else switch(e=u-l,h=f>.5?e/(2-u-l):e/(u+l),u){case o:c=((s-a)/e+(s<a?6:0))/6;break;case s:c=((a-o)/e+2)/6;break;case a:c=((o-s)/e+4)/6}return[c,h,f]}function k(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function S(t){var e,n,i,r,l,u=t[0],c=t[1],h=t[2];return 0===c?e=n=i=h:(r=h<.5?h*(1+c):h+c-h*c,l=2*h-r,e=k(l,r,u+1/3),n=k(l,r,u),i=k(l,r,u-1/3)),[o(255*e),s(255*n),a(255*i)]}function M(t){var e=t[0],n=t[1],i=t[2],r=e/255,o=n/255,s=i/255,a=Math.min(r,o,s),l=Math.max(r,o,s),u=l-a,c=0,h=0===l?0:u/l,f=l;if(l===a)c=0;else switch(l){case e:c=((o-s)/u+(o<s?6:0))/6;break;case n:c=((s-r)/u+2)/6;break;case i:c=((r-o)/u+4)/6}return[c,h,f]}function D(t){var e=t[0],n=t[1],i=t[2],r=Math.floor(6*e),l=6*e-r,u=i*(1-n),c=i*(1-l*n),h=i*(1-(1-l)*n),f=0,d=0,p=0;switch(r%6){case 0:f=i,d=h,p=u;break;case 1:f=c,d=i,p=u;break;case 2:f=u,d=i,p=h;break;case 3:f=u,d=c,p=i;break;case 4:f=h,d=u,p=i;break;case 5:f=i,d=u,p=c}return[o(255*f),s(255*d),a(255*p)]}function T(t){return U[0]*t[0]+U[1]*t[1]+U[2]*t[2]}function C(t,e){var n=t[0],i=t[1],r=t[2],o=e[0],s=e[1],a=e[2],l=o-n,u=s-i,c=a-r;return Math.sqrt(l*l+u*u+c*c)}function P(t){return[255-t[0],255-t[1],255-t[2]]}function O(t,e){var n=x(t);return S([n[0],n[1],m(n[2]-e/100)])}function E(t,e){return e in t}function N(t){var e=$.re.exec(t);return null!==e?$.parse(e):null}function L(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function A(t){var e=G.re.exec(t);return null!==e?G.parse(e):null}function I(t){var e=t[0],n=t[1],i=t[2],r=e.toString(16),o=n.toString(16),s=i.toString(16);return"#"+(1===r.length?"0":"")+r+(1===o.length?"0":"")+o+(1===s.length?"0":"")+s}function j(t){var e=X.re.exec(t);return null!==e?X.parse(e):null}function F(t){var e=K.re.exec(t);return null!==e?K.parse(e):null}function H(t){return"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Y(t){return T(t)<150?"white":"black"}function z(t){var e,n,i,r,o;if(t=t.toLowerCase(),E(q,t)){if(null!==(e=A(q[t])))return e;throw Error("Invalid named color definition")}return null!==(n=N(t))?n:null!==(i=A(t))?i:null!==(r=j(t))?r:(o=F(t),null!==o?o:null)}function R(t){var e=z(t);if(null!==e)return e;throw Error("Passed color string does not match any of the known color representations")}function W(t){var e,n,i,r,o,s,a,l;if(t=t.toLowerCase(),E(q,t)){if(null!==(e=A(q[t])))return n=e[0],i=e[1],r=e[2],[n,i,r,1];throw Error("Invalid named color definition")}return null!==(o=N(t))?(n=o[0],i=o[1],r=o[2],
[n,i,r,1]):null!==(s=A(t))?(n=s[0],i=s[1],r=s[2],[n,i,r,1]):null!==(a=j(t))?(n=a[0],i=a[1],r=a[2],[n,i,r,1]):(l=F(t),null!==l?l:null)}function V(t){var e=W(t);if(null!==e)return e;throw Error("Passed color string does not match any of the known color representations")}var B,U,q,$,G,X,K;Object.defineProperty(e,"__esModule",{value:!0}),B=n(386),e.normalizeRedComponent=o,e.normalizeGreenComponent=s,e.normalizeBlueComponent=a,e.normalizeAlphaComponent=l,e.rgb=u,e.areEqualRgb=c,e.rgba=h,e.areEqualRgba=f,e.normalizeHue=d,e.normalizeHslSaturation=p,e.normalizeHsvSaturation=g,e.normalizeLightness=m,e.normalizeValue=y,e.hsl=v,e.areEqualHsl=b,e.hsv=_,e.areEqualHsv=w,e.rgbToHsl=x,e.hslToRgb=S,e.rgbToHsv=M,e.hsvToRgb=D,U=[.199,.687,.114],e.rgbToGrayscale=T,e.distanceRgb=C,e.invertRgb=P,e.darkenRgb=O,q={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",
pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},function(t){function e(t){return[o(parseInt(t[1],10)),s(parseInt(t[2],10)),a(parseInt(t[3],10))]}t.re=/^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,t.parse=e}($||($={})),e.rgbToString=L,function(t){function e(t){return[o(parseInt(t[1],16)),s(parseInt(t[2],16)),a(parseInt(t[3],16))]}t.re=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,t.parse=e}(G||(G={})),e.rgbToHexString=I,function(t){function e(t){return[o(parseInt(t[1]+t[1],16)),s(parseInt(t[2]+t[2],16)),a(parseInt(t[3]+t[3],16))]}t.re=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,t.parse=e}(X||(X={})),function(t){function e(t){return[o(parseInt(t[1],10)),s(parseInt(t[2],10)),a(parseInt(t[3],10)),l(parseFloat(t[4]))]}t.re=/^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?[\d]{0,10}(?:\.\d+)?)\s*\)$/,t.parse=e}(K||(K={})),e.rgbaToString=H,e.rgbToBlackWhiteString=Y,e.tryParseRgb=z,e.parseRgb=R,e.tryParseRgba=W,e.parseRgba=V},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(18),r=n(233),o=n(111),s=Object.defineProperty;e.f=n(55)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){(function(t){!function(e,n){t.exports=n()}(0,function(){"use strict";function e(){return jn.apply(null,arguments)}function i(t){jn=t}function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t,e){for(var n in e)a(e,n)&&(t[n]=e[n]);return a(e,"toString")&&(t.toString=e.toString),a(e,"valueOf")&&(t.valueOf=e.valueOf),t}function u(t,e,n,i){return Ot(t,e,n,i,!0).utc()}function c(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function h(t){return null==t._pf&&(t._pf=c()),t._pf}function f(t){if(null==t._isValid){var e=h(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function d(t){var e=u(NaN)
@@ -44,9 +44,9 @@ this.add(t-e,"d")):e}function Be(t){var e=(this.day()+7-this.localeData()._week.
Rn=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Vn=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Bn=/^\/?Date\((\-?\d+)/i,e.createFromInputFallback=nt("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),T("year","y"),R("Y",rr),R("YY",Zi,Xi),R("YYYY",er,Qi),R("YYYYY",nr,Ji),R("YYYYYY",nr,Ji),B(["YYYYY","YYYYYY"],cr),B("YYYY",function(t,n){n[cr]=2===t.length?e.parseTwoDigitYear(t):v(t)}),B("YY",function(t,n){n[cr]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(t){return v(t)+(v(t)>68?1900:2e3)},Un=O("FullYear",!1),I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),T("week","w"),T("isoWeek","W"),R("w",Zi),R("ww",Zi,Xi),R("W",Zi),R("WW",Zi,Xi),U(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=v(t)}),qn={dow:0,doy:6},I("DDD",["DDDD",3],"DDDo","dayOfYear"),T("dayOfYear","DDD"),R("DDD",tr),R("DDDD",Ki),B(["DDD","DDDD"],function(t,e,n){n._dayOfYear=v(t)}),e.ISO_8601=function(){},$n=nt("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Et.apply(null,arguments);return t<this?this:t}),Gn=nt("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Et.apply(null,arguments);return t>this?this:t}),Ft("Z",":"),Ft("ZZ",""),R("Z",or),R("ZZ",or),B(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ht(t)}),Xn=/([\+\-]|\d\d)/gi,e.updateOffset=function(){},Kn=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Qn=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Jt.fn=It.prototype,Jn=ne(1,"add"),Zn=ne(-1,"subtract"),e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",ti=nt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)}),I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ee("gggg","weekYear"),Ee("ggggg","weekYear"),Ee("GGGG","isoWeekYear"),Ee("GGGGG","isoWeekYear"),T("weekYear","gg"),T("isoWeekYear","GG"),R("G",rr),R("g",rr),R("GG",Zi,Xi),R("gg",Zi,Xi),R("GGGG",er,Qi),R("gggg",er,Qi),R("GGGGG",nr,Ji),R("ggggg",nr,Ji),U(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=v(t)}),U(["gg","GG"],function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)
}),I("Q",0,0,"quarter"),T("quarter","Q"),R("Q",Gi),B("Q",function(t,e){e[hr]=3*(v(t)-1)}),I("D",["DD",2],"Do","date"),T("date","D"),R("D",Zi),R("DD",Zi,Xi),R("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),B(["D","DD"],fr),B("Do",function(t,e){e[fr]=v(t.match(Zi)[0],10)}),ei=O("Date",!0),I("d",0,"do","day"),I("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),I("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),I("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),T("day","d"),T("weekday","e"),T("isoWeekday","E"),R("d",Zi),R("e",Zi),R("E",Zi),R("dd",ar),R("ddd",ar),R("dddd",ar),U(["dd","ddd","dddd"],function(t,e,n){var i=n._locale.weekdaysParse(t);null!=i?e.d=i:h(n).invalidWeekday=t}),U(["d","e","E"],function(t,e,n,i){e[i]=v(t)}),ni="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ii="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ri="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),I("H",["HH",2],0,"hour"),I("h",["hh",2],0,function(){return this.hours()%12||12}),qe("a",!0),qe("A",!1),T("hour","h"),R("a",$e),R("A",$e),R("H",Zi),R("h",Zi),R("HH",Zi,Xi),R("hh",Zi,Xi),B(["H","HH"],dr),B(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),B(["h","hh"],function(t,e,n){e[dr]=v(t),h(n).bigHour=!0}),oi=/[ap]\.?m?\.?/i,si=O("Hours",!0),I("m",["mm",2],0,"minute"),T("minute","m"),R("m",Zi),R("mm",Zi,Xi),B(["m","mm"],pr),ai=O("Minutes",!1),I("s",["ss",2],0,"second"),T("second","s"),R("s",Zi),R("ss",Zi,Xi),B(["s","ss"],gr),li=O("Seconds",!1),I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),T("millisecond","ms"),R("S",tr,Gi),R("SS",tr,Xi),R("SSS",tr,Ki),ui="SSSS";ui.length<=9;ui+="S")R(ui,ir);for(ui="S";ui.length<=9;ui+="S")B(ui,Ke);return ci=O("Milliseconds",!1),I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName"),hi=g.prototype,hi.add=Jn,hi.calendar=re,hi.clone=oe,hi.diff=ce,hi.endOf=xe,hi.format=pe,hi.from=ge,hi.fromNow=me,hi.to=ye,hi.toNow=ve,hi.get=L,hi.invalidAt=Oe,hi.isAfter=se,hi.isBefore=ae,hi.isBetween=le,hi.isSame=ue,hi.isValid=Ce,hi.lang=ti,hi.locale=be,hi.localeData=_e,hi.max=Gn,hi.min=$n,hi.parsingFlags=Pe,hi.set=L,hi.startOf=we,hi.subtract=Zn,hi.toArray=De,hi.toObject=Te,hi.toDate=Me,hi.toISOString=de,hi.toJSON=de,hi.toString=fe,hi.unix=Se,hi.valueOf=ke,hi.year=Un,hi.isLeapYear=ct,hi.weekYear=Le,hi.isoWeekYear=Ae,hi.quarter=hi.quarters=Fe,hi.month=J,hi.daysInMonth=Z,hi.week=hi.weeks=gt,hi.isoWeek=hi.isoWeeks=mt,hi.weeksInYear=je,hi.isoWeeksInYear=Ie,hi.date=ei,hi.day=hi.days=Ve,hi.weekday=Be,hi.isoWeekday=Ue,hi.dayOfYear=vt,
hi.hour=hi.hours=si,hi.minute=hi.minutes=ai,hi.second=hi.seconds=li,hi.millisecond=hi.milliseconds=ci,hi.utcOffset=Rt,hi.utc=Vt,hi.local=Bt,hi.parseZone=Ut,hi.hasAlignedHourOffset=qt,hi.isDST=$t,hi.isDSTShifted=Gt,hi.isLocal=Xt,hi.isUtcOffset=Kt,hi.isUtc=Qt,hi.isUTC=Qt,hi.zoneAbbr=Qe,hi.zoneName=Je,hi.dates=nt("dates accessor is deprecated. Use date instead.",ei),hi.months=nt("months accessor is deprecated. Use month instead",J),hi.years=nt("years accessor is deprecated. Use year instead",Un),hi.zone=nt("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Wt),fi=hi,di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},pi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},gi="Invalid date",mi="%d",yi=/\d{1,2}/,vi={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},bi=_.prototype,bi._calendar=di,bi.calendar=en,bi._longDateFormat=pi,bi.longDateFormat=nn,bi._invalidDate=gi,bi.invalidDate=rn,bi._ordinal=mi,bi.ordinal=on,bi._ordinalParse=yi,bi.preparse=sn,bi.postformat=sn,bi._relativeTime=vi,bi.relativeTime=an,bi.pastFuture=ln,bi.set=un,bi.months=G,bi._months=Hn,bi.monthsShort=X,bi._monthsShort=Yn,bi.monthsParse=K,bi.week=ft,bi._week=qn,bi.firstDayOfYear=pt,bi.firstDayOfWeek=dt,bi.weekdays=Ye,bi._weekdays=ni,bi.weekdaysMin=Re,bi._weekdaysMin=ri,bi.weekdaysShort=ze,bi._weekdaysShort=ii,bi.weekdaysParse=We,bi.isPM=Ge,bi._meridiemParse=oi,bi.meridiem=Xe,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),e.lang=nt("moment.lang is deprecated. Use moment.locale instead.",S),e.langData=nt("moment.langData is deprecated. Use moment.localeData instead.",D),_i=Math.abs,wi=Tn("ms"),xi=Tn("s"),ki=Tn("m"),Si=Tn("h"),Mi=Tn("d"),Di=Tn("w"),Ti=Tn("M"),Ci=Tn("y"),Pi=Pn("milliseconds"),Oi=Pn("seconds"),Ei=Pn("minutes"),Ni=Pn("hours"),Li=Pn("days"),Ai=Pn("months"),Ii=Pn("years"),ji=Math.round,Fi={s:45,m:45,h:22,d:26,M:11},Hi=Math.abs,Yi=It.prototype,Yi.abs=yn,Yi.add=bn,Yi.subtract=_n,Yi.as=Mn,Yi.asMilliseconds=wi,Yi.asSeconds=xi,Yi.asMinutes=ki,Yi.asHours=Si,Yi.asDays=Mi,Yi.asWeeks=Di,Yi.asMonths=Ti,Yi.asYears=Ci,Yi.valueOf=Dn,Yi._bubble=xn,Yi.get=Cn,Yi.milliseconds=Pi,Yi.seconds=Oi,Yi.minutes=Ei,Yi.hours=Ni,Yi.days=Li,Yi.weeks=On,Yi.months=Ai,Yi.years=Ii,Yi.humanize=An,Yi.toISOString=In,Yi.toString=In,Yi.toJSON=In,Yi.locale=be,Yi.localeData=_e,Yi.toIsoString=nt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",In),Yi.lang=ti,I("X",0,0,"unix"),I("x",0,0,"valueOf"),R("x",rr),R("X",sr),B("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),B("x",function(t,e,n){n._d=new Date(v(t))}),e.version="2.10.6",i(Et),e.fn=fi,e.min=Lt,e.max=At,e.utc=u,e.unix=Ze,e.months=fn,
e.isDate=o,e.locale=S,e.invalid=d,e.duration=Jt,e.isMoment=m,e.weekdays=pn,e.parseZone=tn,e.localeData=D,e.isDuration=jt,e.monthsShort=dn,e.weekdaysMin=mn,e.defineLocale=M,e.weekdaysShort=gn,e.normalizeUnits=C,e.relativeTimeThreshold=Ln,e})}).call(e,n(50)(t))},,,,,,,,,,,function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},,,,function(t,e,n){t.exports=!n(37)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},,,,,,function(t,e,n){var i=n(172),r=n(83);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(136),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},,,,,,,,,,,,function(t,e,n){var i=n(94);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i,r,o;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,i;for(e=1;e<arguments.length;e++){n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r={type:"logger",log:function(t){this._output("log",t)},warn:function(t){this._output("warn",t)},error:function(t){this._output("error",t)},_output:function(t,e){console&&console[t]&&console[t].apply(console,Array.prototype.slice.call(e))}},o=function(){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];n(this,t),this.subs=[],this.init(e,i)}return t.prototype.init=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.prefix=e.prefix||"i18next:",this.logger=t||r,this.options=e,this.debug=!1!==e.debug},t.prototype.setDebug=function(t){this.debug=t,this.subs.forEach(function(e){e.setDebug(t)})},t.prototype.log=function(){this.forward(arguments,"log","",!0)},t.prototype.warn=function(){this.forward(arguments,"warn","",!0)},t.prototype.error=function(){this.forward(arguments,"error","")},t.prototype.deprecate=function(){this.forward(arguments,"warn","WARNING DEPRECATED: ",!0)},t.prototype.forward=function(t,e,n,i){i&&!this.debug||("string"==typeof t[0]&&(t[0]=n+this.prefix+" "+t[0]),this.logger[e](t))},t.prototype.create=function(e){var n=new t(this.logger,i({prefix:this.prefix+":"+e+":"},this.options));return this.subs.push(n),n},t}(),e.default=new o},,,,,,,function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(38),r=n(85);t.exports=n(55)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),
e.isDate=o,e.locale=S,e.invalid=d,e.duration=Jt,e.isMoment=m,e.weekdays=pn,e.parseZone=tn,e.localeData=D,e.isDuration=jt,e.monthsShort=dn,e.weekdaysMin=mn,e.defineLocale=M,e.weekdaysShort=gn,e.normalizeUnits=C,e.relativeTimeThreshold=Ln,e})}).call(e,n(50)(t))},,,,,,,,,,function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},,,,function(t,e,n){t.exports=!n(38)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},,,,,,function(t,e,n){var i=n(172),r=n(83);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(136),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},,,,,,,,,,,,function(t,e,n){var i=n(94);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i,r,o;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,i;for(e=1;e<arguments.length;e++){n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r={type:"logger",log:function(t){this._output("log",t)},warn:function(t){this._output("warn",t)},error:function(t){this._output("error",t)},_output:function(t,e){console&&console[t]&&console[t].apply(console,Array.prototype.slice.call(e))}},o=function(){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];n(this,t),this.subs=[],this.init(e,i)}return t.prototype.init=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.prefix=e.prefix||"i18next:",this.logger=t||r,this.options=e,this.debug=!1!==e.debug},t.prototype.setDebug=function(t){this.debug=t,this.subs.forEach(function(e){e.setDebug(t)})},t.prototype.log=function(){this.forward(arguments,"log","",!0)},t.prototype.warn=function(){this.forward(arguments,"warn","",!0)},t.prototype.error=function(){this.forward(arguments,"error","")},t.prototype.deprecate=function(){this.forward(arguments,"warn","WARNING DEPRECATED: ",!0)},t.prototype.forward=function(t,e,n,i){i&&!this.debug||("string"==typeof t[0]&&(t[0]=n+this.prefix+" "+t[0]),this.logger[e](t))},t.prototype.create=function(e){var n=new t(this.logger,i({prefix:this.prefix+":"+e+":"},this.options));return this.subs.push(n),n},t}(),e.default=new o},,,,,,,function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(39),r=n(85);t.exports=n(55)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),
writable:!(4&t),value:e}}},,,,,,,,,function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(22)("unscopables"),r=Array.prototype;void 0==r[i]&&n(84)(r,i,{}),t.exports=function(t){r[i][t]=!0}},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(109),r=n(85),o=n(61),s=n(111),a=n(51),l=n(233),u=Object.getOwnPropertyDescriptor;e.f=n(55)?u:function(t,e){if(t=o(t),e=s(e,!0),l)try{return u(t,e)}catch(t){}if(a(t,e))return r(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(242),r=n(169);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(20),r=n(84),o=n(51),s=n(112)("src"),a="toString",l=Function[a],u=(""+l).split(a);n(96).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,n,a){var l="function"==typeof n;l&&(o(n,"name")||r(n,"name",e)),t[e]!==n&&(l&&(o(n,s)||r(n,s,t[e]?""+t[e]:u.join(e+""))),t===i?t[e]=n:a?t[e]?t[e]=n:r(t,e,n):(delete t[e],r(t,e,n)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||l.call(this)})},function(t,e,n){var i=n(83);t.exports=function(t){return Object(i(t))}},,,,,function(t,e){"use strict";var n=window.Modernizr=function(t,e,n){function i(t){v.cssText=t}function r(t,e){return typeof t===e}function o(t,e){return!!~(""+t).indexOf(e)}function s(t,e){var i,r;for(i in t)if(r=t[i],!o(r,"-")&&v[r]!==n)return"pfx"!=e||r;return!1}function a(t,e,i){var o,s;for(o in t)if((s=e[t[o]])!==n)return!1===i?t[o]:r(s,"function")?s.bind(i||e):s;return!1}function l(t,e,n){var i=t.charAt(0).toUpperCase()+t.slice(1),o=(t+" "+w.join(i+" ")+i).split(" ");return r(e,"string")||r(e,"undefined")?s(o,e):(o=(t+" "+x.join(i+" ")+i).split(" "),a(o,e,n))}var u,c,h,f="2.8.3",d={},p=!0,g=e.documentElement,m="modernizr",y=e.createElement(m),v=y.style,b=" -webkit- -moz- -o- -ms- ".split(" "),_="Webkit Moz O ms",w=_.split(" "),x=_.toLowerCase().split(" "),k={},S=[],M=S.slice,D=function(t,n,i,r){var o,s,a,l,u=e.createElement("div"),c=e.body,h=c||e.createElement("body");if(parseInt(i,10))for(;i--;)a=e.createElement("div"),a.id=r?r[i]:m+(i+1),u.appendChild(a);return o='&#173;<style id="s'+m+'">'+t+"</style>",u.id=m,(c?u:h).innerHTML+=o,h.appendChild(u),c||(h.style.background="",h.style.overflow="hidden",l=g.style.overflow,g.style.overflow="hidden",g.appendChild(h)),s=n(u,t),c?u.parentNode.removeChild(u):(h.parentNode.removeChild(h),g.style.overflow=l),!!s},T=function(){function t(t,o){o=o||e.createElement(i[t]||"div"),t="on"+t;var s=t in o;return s||(o.setAttribute||(o=e.createElement("div")),o.setAttribute&&o.removeAttribute&&(o.setAttribute(t,""),s=r(o[t],"function"),r(o[t],"undefined")||(o[t]=n),o.removeAttribute(t))),o=null,s}var i={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t}(),C={}.hasOwnProperty;c=r(C,"undefined")||r(C.call,"undefined")?function(t,e){return e in t&&r(t.constructor.prototype[e],"undefined")}:function(t,e){return C.call(t,e)},
Function.prototype.bind||(Function.prototype.bind=function(t){var e,n,i=this;if("function"!=typeof i)throw new TypeError;return e=M.call(arguments,1),n=function(){var r,o,s;return this instanceof n?(r=function(){},r.prototype=i.prototype,o=new r,s=i.apply(o,e.concat(M.call(arguments))),Object(s)===s?s:o):i.apply(t,e.concat(M.call(arguments)))}}),k.flexbox=function(){return l("flexWrap")},k.canvas=function(){var t=e.createElement("canvas");return!!t.getContext&&!!t.getContext("2d")},k.canvastext=function(){return!!d.canvas&&!!r(e.createElement("canvas").getContext("2d").fillText,"function")},k.touch=function(){var n;return"ontouchstart"in t||t.DocumentTouch&&e instanceof DocumentTouch?n=!0:D("@media ("+b.join("touch-enabled),(")+m+"){#modernizr{top:9px;position:absolute}}",function(t){n=9===t.offsetTop}),n},k.history=function(){return!!t.history&&!!history.pushState},k.draganddrop=function(){var t=e.createElement("div");return"draggable"in t||"ondragstart"in t&&"ondrop"in t},k.websockets=function(){return"WebSocket"in t||"MozWebSocket"in t},k.multiplebgs=function(){return i("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(v.background)},k.csscolumns=function(){return l("columnCount")},k.csstransitions=function(){return l("transition")},k.localstorage=function(){try{return localStorage.setItem(m,m),localStorage.removeItem(m),!0}catch(t){return!1}};for(h in k)c(k,h)&&(u=h.toLowerCase(),d[u]=k[h](),S.push((d[u]?"":"no-")+u));return d.addTest=function(t,e){if("object"==typeof t)for(var i in t)c(t,i)&&d.addTest(i,t[i]);else{if(t=t.toLowerCase(),d[t]!==n)return d;e="function"==typeof e?e():e,void 0!==p&&p&&(g.className+=" feature-"+(e?"":"no-")+t),d[t]=e}return d},i(""),y=null,d._version=f,d._prefixes=b,d._domPrefixes=x,d._cssomPrefixes=w,d.hasEvent=T,d.testProp=function(t){return s([t])},d.testAllProps=l,d.testStyles=D,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" feature-js feature-"+S.join(" feature-"):""),d}(window,document);!n.touch||"onorientationchange"in window||(n.touch=!1,document.documentElement.className=document.documentElement.className.replace("feature-touch","feature-no-touch")),n.addTest("pointerevents",function(){var t,e=document.createElement("x"),n=document.documentElement,i=window.getComputedStyle,r=!1;return"pointerEvents"in e.style&&(e.style.pointerEvents="auto",e.style.pointerEvents="x",n.appendChild(e),i&&(t=i(e,""),r=!!t&&"auto"===t.pointerEvents),n.removeChild(e),!!r)}),n.addTest("flexbox",n.testAllProps("flexBasis","1px",!0))},,,function(t,e,n){var i=n(51),r=n(100),o=n(182)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(38).f,r=n(51),o=n(22)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(29);t.exports=function(t,e){if(!i(t))return t
Function.prototype.bind||(Function.prototype.bind=function(t){var e,n,i=this;if("function"!=typeof i)throw new TypeError;return e=M.call(arguments,1),n=function(){var r,o,s;return this instanceof n?(r=function(){},r.prototype=i.prototype,o=new r,s=i.apply(o,e.concat(M.call(arguments))),Object(s)===s?s:o):i.apply(t,e.concat(M.call(arguments)))}}),k.flexbox=function(){return l("flexWrap")},k.canvas=function(){var t=e.createElement("canvas");return!!t.getContext&&!!t.getContext("2d")},k.canvastext=function(){return!!d.canvas&&!!r(e.createElement("canvas").getContext("2d").fillText,"function")},k.touch=function(){var n;return"ontouchstart"in t||t.DocumentTouch&&e instanceof DocumentTouch?n=!0:D("@media ("+b.join("touch-enabled),(")+m+"){#modernizr{top:9px;position:absolute}}",function(t){n=9===t.offsetTop}),n},k.history=function(){return!!t.history&&!!history.pushState},k.draganddrop=function(){var t=e.createElement("div");return"draggable"in t||"ondragstart"in t&&"ondrop"in t},k.websockets=function(){return"WebSocket"in t||"MozWebSocket"in t},k.multiplebgs=function(){return i("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(v.background)},k.csscolumns=function(){return l("columnCount")},k.csstransitions=function(){return l("transition")},k.localstorage=function(){try{return localStorage.setItem(m,m),localStorage.removeItem(m),!0}catch(t){return!1}};for(h in k)c(k,h)&&(u=h.toLowerCase(),d[u]=k[h](),S.push((d[u]?"":"no-")+u));return d.addTest=function(t,e){if("object"==typeof t)for(var i in t)c(t,i)&&d.addTest(i,t[i]);else{if(t=t.toLowerCase(),d[t]!==n)return d;e="function"==typeof e?e():e,void 0!==p&&p&&(g.className+=" feature-"+(e?"":"no-")+t),d[t]=e}return d},i(""),y=null,d._version=f,d._prefixes=b,d._domPrefixes=x,d._cssomPrefixes=w,d.hasEvent=T,d.testProp=function(t){return s([t])},d.testAllProps=l,d.testStyles=D,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" feature-js feature-"+S.join(" feature-"):""),d}(window,document);!n.touch||"onorientationchange"in window||(n.touch=!1,document.documentElement.className=document.documentElement.className.replace("feature-touch","feature-no-touch")),n.addTest("pointerevents",function(){var t,e=document.createElement("x"),n=document.documentElement,i=window.getComputedStyle,r=!1;return"pointerEvents"in e.style&&(e.style.pointerEvents="auto",e.style.pointerEvents="x",n.appendChild(e),i&&(t=i(e,""),r=!!t&&"auto"===t.pointerEvents),n.removeChild(e),!!r)}),n.addTest("flexbox",n.testAllProps("flexBasis","1px",!0))},,,function(t,e,n){var i=n(51),r=n(100),o=n(182)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var i=n(39).f,r=n(51),o=n(22)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(29);t.exports=function(t,e){if(!i(t))return t
;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){n(this,t),this.observers={}}return t.prototype.on=function(t,e){var n=this;t.split(" ").forEach(function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)})},t.prototype.off=function(t,e){var n=this;this.observers[t]&&this.observers[t].forEach(function(){if(e){var i=n.observers[t].indexOf(e);i>-1&&n.observers[t].splice(i,1)}else delete n.observers[t]})},t.prototype.emit=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this.observers[t]&&this.observers[t].forEach(function(t){t.apply(void 0,n)}),this.observers["*"]&&this.observers["*"].forEach(function(e){var i;e.apply(e,(i=[t]).concat.apply(i,n))})},t}();e.default=i},function(t,e){"use strict";function n(t){return null==t?"":""+t}function i(t,e,n){t.forEach(function(t){e[t]&&(n[t]=e[t])})}function r(t,e,n){function i(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}for(var r,o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(!t)return{};r=i(o.shift()),!t[r]&&n&&(t[r]=new n),t=t[r]}return t?{obj:t,k:i(o.shift())}:{}}function o(t,e,n){var i=r(t,e,Object);i.obj[i.k]=n}function s(t,e,n,i){var o=r(t,e,Object),s=o.obj,a=o.k;s[a]=s[a]||[],i&&(s[a]=s[a].concat(n)),i||s[a].push(n)}function a(t,e){var n=r(t,e),i=n.obj,o=n.k;if(i)return i[o]}function l(t,e,n){for(var i in e)i in t?"string"==typeof t[i]||t[i]instanceof String||"string"==typeof e[i]||e[i]instanceof String?n&&(t[i]=e[i]):l(t[i],e[i],n):t[i]=e[i];return t}function u(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function c(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return h[t]}):t}Object.defineProperty(e,"__esModule",{value:!0}),e.makeString=n,e.copy=i,e.setPath=o,e.pushPath=s,e.getPath=a,e.deepExtend=l,e.regexEscape=u,e.escape=c;var h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"}},,,,,,,,,,,,,,,function(t,e,n){var i,r;(function(){function n(t){function e(e,n,i,r,o,s){for(;o>=0&&o<s;o+=t){var a=r?r[o]:o;i=n(i,e[a],a,e)}return i}return function(n,i,r,o){i=l(i,o,4);var s=!g(n)&&U.keys(n),a=(s||n).length,u=t>0?0:a-1;return arguments.length<3&&(r=n[s?s[u]:u],u+=t),e(n,i,r,s,u,a)}}function o(t){return function(e,n,i){var r,o;for(n=u(n,i),r=p(e),o=t>0?0:r-1;o>=0&&o<r;o+=t)if(n(e[o],o,e))return o;return-1}}function s(t,e,n){return function(i,r,o){var s=0,a=p(i);if("number"==typeof o)t>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return o=n(i,r),i[o]===r?o:-1
;if(r!==r)return o=e(F.call(i,s,a),U.isNaN),o>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&o<a;o+=t)if(i[o]===r)return o;return-1}}function a(t,e){var n=_.length,i=t.constructor,r=U.isFunction(i)&&i.prototype||A,o="constructor";for(U.has(t,o)&&!U.contains(e,o)&&e.push(o);n--;)(o=_[n])in t&&t[o]!==r[o]&&!U.contains(e,o)&&e.push(o)}var l,u,c,h,f,d,p,g,m,y,v,b,_,w,x,k,S,M,D,T,C,P,O,E=this,N=E._,L=Array.prototype,A=Object.prototype,I=Function.prototype,j=L.push,F=L.slice,H=A.toString,Y=A.hasOwnProperty,z=Array.isArray,R=Object.keys,W=I.bind,V=Object.create,B=function(){},U=function(t){return t instanceof U?t:this instanceof U?void(this._wrapped=t):new U(t)};void 0!==t&&t.exports&&(e=t.exports=U),e._=U,U.VERSION="1.8.3",l=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,o){return t.call(e,n,i,r,o)}}return function(){return t.apply(e,arguments)}},u=function(t,e,n){return null==t?U.identity:U.isFunction(t)?l(t,e,n):U.isObject(t)?U.matcher(t):U.property(t)},U.iteratee=function(t,e){return u(t,e,1/0)},c=function(t,e){return function(n){var i,r,o,s,a,l,u=arguments.length;if(u<2||null==n)return n;for(i=1;i<u;i++)for(r=arguments[i],o=t(r),s=o.length,a=0;a<s;a++)l=o[a],e&&void 0!==n[l]||(n[l]=r[l]);return n}},h=function(t){if(!U.isObject(t))return{};if(V)return V(t);B.prototype=t;var e=new B;return B.prototype=null,e},f=function(t){return function(e){return null==e?void 0:e[t]}},d=Math.pow(2,53)-1,p=f("length"),g=function(t){var e=p(t);return"number"==typeof e&&e>=0&&e<=d},U.each=U.forEach=function(t,e,n){var i,r,o;if(e=l(e,n),g(t))for(i=0,r=t.length;i<r;i++)e(t[i],i,t);else for(o=U.keys(t),i=0,r=o.length;i<r;i++)e(t[o[i]],o[i],t);return t},U.map=U.collect=function(t,e,n){var i,r,o,s,a;for(e=u(e,n),i=!g(t)&&U.keys(t),r=(i||t).length,o=Array(r),s=0;s<r;s++)a=i?i[s]:s,o[s]=e(t[a],a,t);return o},U.reduce=U.foldl=U.inject=n(1),U.reduceRight=U.foldr=n(-1),U.find=U.detect=function(t,e,n){var i;if(void 0!==(i=g(t)?U.findIndex(t,e,n):U.findKey(t,e,n))&&-1!==i)return t[i]},U.filter=U.select=function(t,e,n){var i=[];return e=u(e,n),U.each(t,function(t,n,r){e(t,n,r)&&i.push(t)}),i},U.reject=function(t,e,n){return U.filter(t,U.negate(u(e)),n)},U.every=U.all=function(t,e,n){var i,r,o,s;for(e=u(e,n),i=!g(t)&&U.keys(t),r=(i||t).length,o=0;o<r;o++)if(s=i?i[o]:o,!e(t[s],s,t))return!1;return!0},U.some=U.any=function(t,e,n){var i,r,o,s;for(e=u(e,n),i=!g(t)&&U.keys(t),r=(i||t).length,o=0;o<r;o++)if(s=i?i[o]:o,e(t[s],s,t))return!0;return!1},U.contains=U.includes=U.include=function(t,e,n,i){return g(t)||(t=U.values(t)),("number"!=typeof n||i)&&(n=0),U.indexOf(t,e,n)>=0},U.invoke=function(t,e){var n=F.call(arguments,2),i=U.isFunction(e);return U.map(t,function(t){var r=i?e:t[e];return null==r?r:r.apply(t,n)})},U.pluck=function(t,e){return U.map(t,U.property(e))},U.where=function(t,e){return U.filter(t,U.matcher(e))},U.findWhere=function(t,e){return U.find(t,U.matcher(e))},
U.max=function(t,e,n){var i,r,o,s,a=-1/0,l=-1/0;if(null==e&&null!=t)for(t=g(t)?t:U.values(t),o=0,s=t.length;o<s;o++)(i=t[o])>a&&(a=i);else e=u(e,n),U.each(t,function(t,n,i){((r=e(t,n,i))>l||r===-1/0&&a===-1/0)&&(a=t,l=r)});return a},U.min=function(t,e,n){var i,r,o,s,a=1/0,l=1/0;if(null==e&&null!=t)for(t=g(t)?t:U.values(t),o=0,s=t.length;o<s;o++)(i=t[o])<a&&(a=i);else e=u(e,n),U.each(t,function(t,n,i){((r=e(t,n,i))<l||r===1/0&&a===1/0)&&(a=t,l=r)});return a},U.shuffle=function(t){var e,n,i=g(t)?t:U.values(t),r=i.length,o=Array(r);for(e=0;e<r;e++)n=U.random(0,e),n!==e&&(o[e]=o[n]),o[n]=i[e];return o},U.sample=function(t,e,n){return null==e||n?(g(t)||(t=U.values(t)),t[U.random(t.length-1)]):U.shuffle(t).slice(0,Math.max(0,e))},U.sortBy=function(t,e,n){return e=u(e,n),U.pluck(U.map(t,function(t,n,i){return{value:t,index:n,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,i=e.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return t.index-e.index}),"value")},m=function(t){return function(e,n,i){var r={};return n=u(n,i),U.each(e,function(i,o){var s=n(i,o,e);t(r,i,s)}),r}},U.groupBy=m(function(t,e,n){U.has(t,n)?t[n].push(e):t[n]=[e]}),U.indexBy=m(function(t,e,n){t[n]=e}),U.countBy=m(function(t,e,n){U.has(t,n)?t[n]++:t[n]=1}),U.toArray=function(t){return t?U.isArray(t)?F.call(t):g(t)?U.map(t,U.identity):U.values(t):[]},U.size=function(t){return null==t?0:g(t)?t.length:U.keys(t).length},U.partition=function(t,e,n){e=u(e,n);var i=[],r=[];return U.each(t,function(t,n,o){(e(t,n,o)?i:r).push(t)}),[i,r]},U.first=U.head=U.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:U.initial(t,t.length-e)},U.initial=function(t,e,n){return F.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},U.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:U.rest(t,Math.max(0,t.length-e))},U.rest=U.tail=U.drop=function(t,e,n){return F.call(t,null==e||n?1:e)},U.compact=function(t){return U.filter(t,U.identity)},y=function(t,e,n,i){var r,o,s,a,l,u=[],c=0;for(r=i||0,o=p(t);r<o;r++)if(s=t[r],g(s)&&(U.isArray(s)||U.isArguments(s)))for(e||(s=y(s,e,n)),a=0,l=s.length,u.length+=l;a<l;)u[c++]=s[a++];else n||(u[c++]=s);return u},U.flatten=function(t,e){return y(t,e,!1)},U.without=function(t){return U.difference(t,F.call(arguments,1))},U.uniq=U.unique=function(t,e,n,i){var r,o,s,a,l,c;for(U.isBoolean(e)||(i=n,n=e,e=!1),null!=n&&(n=u(n,i)),r=[],o=[],s=0,a=p(t);s<a;s++)l=t[s],c=n?n(l,s,t):l,e?(s&&o===c||r.push(l),o=c):n?U.contains(o,c)||(o.push(c),r.push(l)):U.contains(r,l)||r.push(l);return r},U.union=function(){return U.uniq(y(arguments,!0,!0))},U.intersection=function(t){var e,n,i,r,o=[],s=arguments.length;for(e=0,n=p(t);e<n;e++)if(i=t[e],!U.contains(o,i)){for(r=1;r<s&&U.contains(arguments[r],i);r++);r===s&&o.push(i)}return o},U.difference=function(t){var e=y(arguments,!0,!0,1);return U.filter(t,function(t){return!U.contains(e,t)})},U.zip=function(){return U.unzip(arguments)},U.unzip=function(t){var e,n=t&&U.max(t,p).length||0,i=Array(n);for(e=0;e<n;e++)i[e]=U.pluck(t,e);return i},U.object=function(t,e){var n,i,r={}
@@ -54,15 +54,15 @@ U.max=function(t,e,n){var i,r,o,s,a=-1/0,l=-1/0;if(null==e&&null!=t)for(t=g(t)?t
var e,n=U.keys(t),i=n.length,r=Array(i);for(e=0;e<i;e++)r[e]=t[n[e]];return r},U.mapObject=function(t,e,n){var i,r,o,s,a;for(e=u(e,n),i=U.keys(t),r=i.length,o={},a=0;a<r;a++)s=i[a],o[s]=e(t[s],s,t);return o},U.pairs=function(t){var e,n=U.keys(t),i=n.length,r=Array(i);for(e=0;e<i;e++)r[e]=[n[e],t[n[e]]];return r},U.invert=function(t){var e,n,i={},r=U.keys(t);for(e=0,n=r.length;e<n;e++)i[t[r[e]]]=r[e];return i},U.functions=U.methods=function(t){var e,n=[];for(e in t)U.isFunction(t[e])&&n.push(e);return n.sort()},U.extend=c(U.allKeys),U.extendOwn=U.assign=c(U.keys),U.findKey=function(t,e,n){var i,r,o,s;for(e=u(e,n),i=U.keys(t),o=0,s=i.length;o<s;o++)if(r=i[o],e(t[r],r,t))return r},U.pick=function(t,e,n){var i,r,o,s,a,u,c={},h=t;if(null==h)return c;U.isFunction(e)?(r=U.allKeys(h),i=l(e,n)):(r=y(arguments,!1,!1,1),i=function(t,e,n){return e in n},h=Object(h));for(o=0,s=r.length;o<s;o++)a=r[o],u=h[a],i(u,a,h)&&(c[a]=u);return c},U.omit=function(t,e,n){if(U.isFunction(e))e=U.negate(e);else{var i=U.map(y(arguments,!1,!1,1),String);e=function(t,e){return!U.contains(i,e)}}return U.pick(t,e,n)},U.defaults=c(U.allKeys,!0),U.create=function(t,e){var n=h(t);return e&&U.extendOwn(n,e),n},U.clone=function(t){return U.isObject(t)?U.isArray(t)?t.slice():U.extend({},t):t},U.tap=function(t,e){return e(t),t},U.isMatch=function(t,e){var n,i,r,o=U.keys(e),s=o.length;if(null==t)return!s;for(n=Object(t),i=0;i<s;i++)if(r=o[i],e[r]!==n[r]||!(r in n))return!1;return!0},w=function(t,e,n,i){var r,o,s,a,l,u,c;if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;if(t instanceof U&&(t=t._wrapped),e instanceof U&&(e=e._wrapped),(r=H.call(t))!==H.call(e))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}if(!(o="[object Array]"===r)){if("object"!=typeof t||"object"!=typeof e)return!1;if(s=t.constructor,a=e.constructor,s!==a&&!(U.isFunction(s)&&s instanceof s&&U.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}for(n=n||[],i=i||[],l=n.length;l--;)if(n[l]===t)return i[l]===e;if(n.push(t),i.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!w(t[l],e[l],n,i))return!1}else{if(u=U.keys(t),l=u.length,U.keys(e).length!==l)return!1;for(;l--;)if(c=u[l],!U.has(e,c)||!w(t[c],e[c],n,i))return!1}return n.pop(),i.pop(),!0},U.isEqual=function(t,e){return w(t,e)},U.isEmpty=function(t){return null==t||(g(t)&&(U.isArray(t)||U.isString(t)||U.isArguments(t))?0===t.length:0===U.keys(t).length)},U.isElement=function(t){return!(!t||1!==t.nodeType)},U.isArray=z||function(t){return"[object Array]"===H.call(t)},U.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},U.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){U["is"+t]=function(e){return H.call(e)==="[object "+t+"]"}}),U.isArguments(arguments)||(U.isArguments=function(t){return U.has(t,"callee")}),
"function"!=typeof/./&&"object"!=typeof Int8Array&&(U.isFunction=function(t){return"function"==typeof t||!1}),U.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},U.isNaN=function(t){return U.isNumber(t)&&t!==+t},U.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===H.call(t)},U.isNull=function(t){return null===t},U.isUndefined=function(t){return void 0===t},U.has=function(t,e){return null!=t&&Y.call(t,e)},U.noConflict=function(){return E._=N,this},U.identity=function(t){return t},U.constant=function(t){return function(){return t}},U.noop=function(){},U.property=f,U.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},U.matcher=U.matches=function(t){return t=U.extendOwn({},t),function(e){return U.isMatch(e,t)}},U.times=function(t,e,n){var i,r=Array(Math.max(0,t));for(e=l(e,n,1),i=0;i<t;i++)r[i]=e(i);return r},U.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},U.now=Date.now||function(){return(new Date).getTime()},x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},k=U.invert(x),S=function(t){var e=function(e){return t[e]},n="(?:"+U.keys(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}},U.escape=S(x),U.unescape=S(k),U.result=function(t,e,n){var i=null==t?void 0:t[e];return void 0===i&&(i=n),U.isFunction(i)?i.call(t):i},M=0,U.uniqueId=function(t){var e=++M+"";return t?t+e:e},U.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},D=/(.)^/,T={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},C=/\\|'|\r|\n|\u2028|\u2029/g,P=function(t){return"\\"+T[t]},U.template=function(t,e,n){var i,r,o,s,a,l;!e&&n&&(e=n),e=U.defaults({},e,U.templateSettings),i=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),r=0,o="__p+='",t.replace(i,function(e,n,i,s,a){return o+=t.slice(r,a).replace(C,P),r=a+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{s=Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}return a=function(t){return s.call(this,t,U)},l=e.variable||"obj",a.source="function("+l+"){\n"+o+"}",a},U.chain=function(t){var e=U(t);return e._chain=!0,e},O=function(t,e){return t._chain?U(e).chain():e},U.mixin=function(t){U.each(U.functions(t),function(e){var n=U[e]=t[e];U.prototype[e]=function(){var t=[this._wrapped];return j.apply(t,arguments),O(this,n.apply(U,t))}})},U.mixin(U),U.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=L[t];U.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],O(this,n)}}),U.each(["concat","join","slice"],function(t){var e=L[t]
;U.prototype[t]=function(){return O(this,e.apply(this._wrapped,arguments))}}),U.prototype.value=function(){return this._wrapped},U.prototype.valueOf=U.prototype.toJSON=U.prototype.value,U.prototype.toString=function(){return""+this._wrapped},i=[],void 0!==(r=function(){return U}.apply(e,i))&&(t.exports=r)}).call(this)},function(t,e){t.exports={}},function(t,e){t.exports=!1},function(t,e,n){var i=n(18),r=n(404),o=n(169),s=n(182)("IE_PROTO"),a=function(){},l="prototype",u=function(){var t,e=n(168)("iframe"),i=o.length,r="<",s=">";for(e.style.display="none",n(232).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+s+"document.F=Object"+r+"/script"+s),t.close(),u=t.F;i--;)delete u[l][o[i]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[l]=i(t),n=new a,a[l]=null,n[s]=t):n=u(),void 0===e?n:r(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(136),r=Math.max,o=Math.min;t.exports=function(t,e){return t=i(t),t<0?r(t+e,0):o(t,e)}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){t.exports=n(387)},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var i=n(29),r=n(20).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(22)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var i=n(74),r=n(238),o=n(235),s=n(18),a=n(62),l=n(248),u={},c={};e=t.exports=function(t,e,n,h,f){var d,p,g,m,y=f?function(){return t}:l(t),v=i(n,h,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=a(t.length);d>b;b++)if((m=e?v(s(p=t[b])[0],p[1]):v(t[b]))===u||m===c)return m}else for(g=y.call(t);!(p=g.next()).done;)if((m=r(g,v,p.value,e))===u||m===c)return m},e.BREAK=u,e.RETURN=c},function(t,e,n){var i=n(82);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var i=n(132),r=n(4),o=n(99),s=n(84),a=n(51),l=n(131),u=n(239),c=n(110),h=n(108),f=n(22)("iterator"),d=!([].keys&&"next"in[].keys()),p="keys",g="values",m=function(){return this};t.exports=function(t,e,n,y,v,b,_){var w,x,k,S,M,D,T,C,P,O,E,N;if(u(n,e,y),w=function(t){if(!d&&t in M)return M[t];switch(t){case p:case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",k=v==g,S=!1,M=t.prototype,D=M[f]||M["@@iterator"]||v&&M[v],T=D||w(v),C=v?k?w("entries"):T:void 0,P="Array"==e?M.entries||D:D,P&&(N=h(P.call(new t)))!==Object.prototype&&(c(N,x,!0),i||a(N,f)||s(N,f,m)),k&&D&&D.name!==g&&(S=!0,T=function(){return D.call(this)}),i&&!_||!d&&!S&&M[f]||s(M,f,T),l[e]=T,l[x]=m,v)if(O={
values:k?T:w(g),keys:b?T:w(p),entries:C},_)for(E in O)E in M||o(M,E,O[E]);else r(r.P+r.F*(d||S),e,O);return O}},function(t,e,n){var i,r=n(22)("iterator"),o=!1;try{i=[7][r](),i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){var n,i,s;if(!e&&!o)return!1;n=!1;try{i=[7],s=i[r](),s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(t){}return n}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,n){var i=n(112)("meta"),r=n(29),o=n(51),s=n(38).f,a=0,l=Object.isExtensible||function(){return!0},u=!n(37)(function(){return l(Object.preventExtensions({}))}),c=function(t){s(t,i,{value:{i:"O"+ ++a,w:{}}})},h=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[i].i},f=function(t,e){if(!o(t,i)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[i].w},d=function(t){return u&&p.NEED&&l(t)&&!o(t,i)&&c(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:h,getWeak:f,onFreeze:d}},function(t,e,n){var i=n(242),r=n(169).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){var i=n(99);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},function(t,e,n){var i=n(29),r=n(18),o=function(t,e){if(r(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n(74)(Function.call,n(97).f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){"use strict";var i=n(20),r=n(38),o=n(55),s=n(22)("species");t.exports=function(t){var e=i[t];o&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var i=n(183)("keys"),r=n(112);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e,n){var i=n(20),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var i=n(400),r=n(83);t.exports=function(t,e,n){if(i(e))throw TypeError("String#"+n+" doesn't accept regex!");return r(t)+""}},function(t,e){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var i=n(61),r=n(62),o=n(135);t.exports=function(t){return function(e,n,s){var a,l=i(e),u=r(l.length),c=o(s,u);if(t&&n!=n){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e,n){var i=n(74),r=n(172),o=n(100),s=n(62),a=n(394);t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,h=6==t,f=5==t||h,d=e||a;return function(e,a,p){for(var g,m,y=o(e),v=r(y),b=i(a,p,3),_=s(v.length),w=0,x=n?d(e,_):l?d(e,0):void 0;_>w;w++)if((f||w in v)&&(g=v[w],m=b(g,w,y),
t))if(n)x[w]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return w;case 2:x.push(g)}else if(c)return!1;return h?-1:u||c?c:x}}},function(t,e,n){var i=n(82),r=n(22)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),r))?n:o?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){"use strict";var i=n(38).f,r=n(133),o=n(179),s=n(74),a=n(167),l=n(83),u=n(171),c=n(173),h=n(240),f=n(181),d=n(55),p=n(177).fastKey,g=d?"_s":"size",m=function(t,e){var n,i=p(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var h=t(function(t,i){a(t,h,e,"_i"),t._i=r(null),t._f=void 0,t._l=void 0,t[g]=0,void 0!=i&&u(i,n,t[c],t)});return o(h.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var e,n,i=this,r=m(i,t);return r&&(e=r.n,n=r.p,delete i._i[r.i],r.r=!0,n&&(n.n=e),e&&(e.p=n),i._f==r&&(i._f=e),i._l==r&&(i._l=n),i[g]--),!!r},forEach:function(t){a(this,h,"forEach");for(var e,n=s(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!m(this,t)}}),d&&i(h.prototype,"size",{get:function(){return l(this[g])}}),h},def:function(t,e,n){var i,r,o=m(t,e);return o?o.v=n:(t._l=o={i:r=p(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=o),i&&(i.n=o),t[g]++,"F"!==r&&(t._i[r]=o)),t},getEntry:m,setStrong:function(t,e,n){c(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?h(0,n.k):"values"==e?h(0,n.v):h(0,[n.k,n.v]):(t._t=void 0,h(1))},n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var i=n(20),r=n(4),o=n(99),s=n(179),a=n(177),l=n(171),u=n(167),c=n(29),h=n(37),f=n(174),d=n(110),p=n(399);t.exports=function(t,e,n,g,m,y){var v,b,_,w,x,k=i[t],S=k,M=m?"set":"add",D=S&&S.prototype,T={},C=function(t){var e=D[t];o(D,t,"delete"==t?function(t){return!(y&&!c(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};return"function"==typeof S&&(y||D.forEach&&!h(function(){(new S).entries().next()}))?(v=new S,b=v[M](y?{}:-0,1)!=v,_=h(function(){v.has(1)}),w=f(function(t){new S(t)}),x=!y&&h(function(){for(var t=new S,e=5;e--;)t[M](e,e);return!t.has(-0)}),w||(S=e(function(e,n){u(e,S,t);var i=p(new k,e,S);return void 0!=n&&l(n,m,i[M],i),i}),S.prototype=D,D.constructor=S),(_||x)&&(C("delete"),C("has"),m&&C("get")),(x||b)&&C(M),y&&D.clear&&delete D.clear):(S=g.getConstructor(e,t,m,M),s(S.prototype,n),a.NEED=!0),d(S,t),T[t]=S,r(r.G+r.W+r.F*(S!=k),T),y||g.setStrong(S,t,m),S}},function(t,e,n){"use strict"
;var i=n(38),r=n(85);t.exports=function(t,e,n){e in t?i.f(t,e,r(0,n)):t[e]=n}},function(t,e,n){t.exports=n(20).document&&document.documentElement},function(t,e,n){t.exports=!n(55)&&!n(37)(function(){return 7!=Object.defineProperty(n(168)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i=n(131),r=n(22)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},function(t,e,n){var i=n(82);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(29),r=Math.floor;t.exports=function(t){return!i(t)&&isFinite(t)&&r(t)===t}},function(t,e,n){var i=n(18);t.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(t,e,n){"use strict";var i=n(133),r=n(85),o=n(110),s={};n(84)(s,n(22)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){var i=n(51),r=n(61),o=n(226)(!1),s=n(182)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),l=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>l;)i(a,n=e[l++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(98),r=n(61),o=n(109).f;t.exports=function(t){return function(e){for(var n,s=r(e),a=i(s),l=a.length,u=0,c=[];l>u;)o.call(s,n=a[u++])&&c.push(t?[n,s[n]]:s[n]);return c}}},function(t,e,n){var i=n(136),r=n(83);t.exports=function(t){return function(e,n){var o,s,a=r(e)+"",l=i(n),u=a.length;return l<0||l>=u?t?"":void 0:(o=a.charCodeAt(l),o<55296||o>56319||l+1===u||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var i=n(4),r=n(83),o=n(37),s=n(185),a="["+s+"]",l="…",u=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),h=function(t,e,n){var r={},a=o(function(){return!!s[t]()||l[t]()!=l}),u=r[t]=a?e(f):s[t];n&&(r[n]=u),i(i.P+i.F*a,"String",r)},f=h.trim=function(t,e){return t=r(t)+"",1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=h},function(t,e,n){var i,r,o,s=n(74),a=n(234),l=n(232),u=n(168),c=n(20),h=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,g=0,m={},y="onreadystatechange",v=function(){var t,e=+this;m.hasOwnProperty(e)&&(t=m[e],delete m[e],t())},b=function(t){v.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){a("function"==typeof t?t:Function(t),e)},i(g),g},d=function(t){delete m[t]},"process"==n(82)(h)?i=function(t){h.nextTick(s(v,t,1))}:p?(r=new p,o=r.port2,r.port1.onmessage=b,
values:k?T:w(g),keys:b?T:w(p),entries:C},_)for(E in O)E in M||o(M,E,O[E]);else r(r.P+r.F*(d||S),e,O);return O}},function(t,e,n){var i,r=n(22)("iterator"),o=!1;try{i=[7][r](),i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){var n,i,s;if(!e&&!o)return!1;n=!1;try{i=[7],s=i[r](),s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(t){}return n}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,n){var i=n(112)("meta"),r=n(29),o=n(51),s=n(39).f,a=0,l=Object.isExtensible||function(){return!0},u=!n(38)(function(){return l(Object.preventExtensions({}))}),c=function(t){s(t,i,{value:{i:"O"+ ++a,w:{}}})},h=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,i)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[i].i},f=function(t,e){if(!o(t,i)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[i].w},d=function(t){return u&&p.NEED&&l(t)&&!o(t,i)&&c(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:h,getWeak:f,onFreeze:d}},function(t,e,n){var i=n(242),r=n(169).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){var i=n(99);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},function(t,e,n){var i=n(29),r=n(18),o=function(t,e){if(r(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n(74)(Function.call,n(97).f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){"use strict";var i=n(20),r=n(39),o=n(55),s=n(22)("species");t.exports=function(t){var e=i[t];o&&e&&!e[s]&&r.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var i=n(183)("keys"),r=n(112);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e,n){var i=n(20),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var i=n(400),r=n(83);t.exports=function(t,e,n){if(i(e))throw TypeError("String#"+n+" doesn't accept regex!");return r(t)+""}},function(t,e){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var i=n(61),r=n(62),o=n(135);t.exports=function(t){return function(e,n,s){var a,l=i(e),u=r(l.length),c=o(s,u);if(t&&n!=n){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e,n){var i=n(74),r=n(172),o=n(100),s=n(62),a=n(394);t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,h=6==t,f=5==t||h,d=e||a;return function(e,a,p){for(var g,m,y=o(e),v=r(y),b=i(a,p,3),_=s(v.length),w=0,x=n?d(e,_):l?d(e,0):void 0;_>w;w++)if((f||w in v)&&(g=v[w],m=b(g,w,y),
t))if(n)x[w]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return w;case 2:x.push(g)}else if(c)return!1;return h?-1:u||c?c:x}}},function(t,e,n){var i=n(82),r=n(22)("toStringTag"),o="Arguments"==i(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),r))?n:o?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){"use strict";var i=n(39).f,r=n(133),o=n(179),s=n(74),a=n(167),l=n(83),u=n(171),c=n(173),h=n(240),f=n(181),d=n(55),p=n(177).fastKey,g=d?"_s":"size",m=function(t,e){var n,i=p(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var h=t(function(t,i){a(t,h,e,"_i"),t._i=r(null),t._f=void 0,t._l=void 0,t[g]=0,void 0!=i&&u(i,n,t[c],t)});return o(h.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[g]=0},delete:function(t){var e,n,i=this,r=m(i,t);return r&&(e=r.n,n=r.p,delete i._i[r.i],r.r=!0,n&&(n.n=e),e&&(e.p=n),i._f==r&&(i._f=e),i._l==r&&(i._l=n),i[g]--),!!r},forEach:function(t){a(this,h,"forEach");for(var e,n=s(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!m(this,t)}}),d&&i(h.prototype,"size",{get:function(){return l(this[g])}}),h},def:function(t,e,n){var i,r,o=m(t,e);return o?o.v=n:(t._l=o={i:r=p(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=o),i&&(i.n=o),t[g]++,"F"!==r&&(t._i[r]=o)),t},getEntry:m,setStrong:function(t,e,n){c(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?h(0,n.k):"values"==e?h(0,n.v):h(0,[n.k,n.v]):(t._t=void 0,h(1))},n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var i=n(20),r=n(4),o=n(99),s=n(179),a=n(177),l=n(171),u=n(167),c=n(29),h=n(38),f=n(174),d=n(110),p=n(399);t.exports=function(t,e,n,g,m,y){var v,b,_,w,x,k=i[t],S=k,M=m?"set":"add",D=S&&S.prototype,T={},C=function(t){var e=D[t];o(D,t,"delete"==t?function(t){return!(y&&!c(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};return"function"==typeof S&&(y||D.forEach&&!h(function(){(new S).entries().next()}))?(v=new S,b=v[M](y?{}:-0,1)!=v,_=h(function(){v.has(1)}),w=f(function(t){new S(t)}),x=!y&&h(function(){for(var t=new S,e=5;e--;)t[M](e,e);return!t.has(-0)}),w||(S=e(function(e,n){u(e,S,t);var i=p(new k,e,S);return void 0!=n&&l(n,m,i[M],i),i}),S.prototype=D,D.constructor=S),(_||x)&&(C("delete"),C("has"),m&&C("get")),(x||b)&&C(M),y&&D.clear&&delete D.clear):(S=g.getConstructor(e,t,m,M),s(S.prototype,n),a.NEED=!0),d(S,t),T[t]=S,r(r.G+r.W+r.F*(S!=k),T),y||g.setStrong(S,t,m),S}},function(t,e,n){"use strict"
;var i=n(39),r=n(85);t.exports=function(t,e,n){e in t?i.f(t,e,r(0,n)):t[e]=n}},function(t,e,n){t.exports=n(20).document&&document.documentElement},function(t,e,n){t.exports=!n(55)&&!n(38)(function(){return 7!=Object.defineProperty(n(168)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i=n(131),r=n(22)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},function(t,e,n){var i=n(82);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(29),r=Math.floor;t.exports=function(t){return!i(t)&&isFinite(t)&&r(t)===t}},function(t,e,n){var i=n(18);t.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(t,e,n){"use strict";var i=n(133),r=n(85),o=n(110),s={};n(84)(s,n(22)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){var i=n(51),r=n(61),o=n(226)(!1),s=n(182)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),l=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>l;)i(a,n=e[l++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(98),r=n(61),o=n(109).f;t.exports=function(t){return function(e){for(var n,s=r(e),a=i(s),l=a.length,u=0,c=[];l>u;)o.call(s,n=a[u++])&&c.push(t?[n,s[n]]:s[n]);return c}}},function(t,e,n){var i=n(136),r=n(83);t.exports=function(t){return function(e,n){var o,s,a=r(e)+"",l=i(n),u=a.length;return l<0||l>=u?t?"":void 0:(o=a.charCodeAt(l),o<55296||o>56319||l+1===u||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536)}}},function(t,e,n){var i=n(4),r=n(83),o=n(38),s=n(185),a="["+s+"]",l="…",u=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),h=function(t,e,n){var r={},a=o(function(){return!!s[t]()||l[t]()!=l}),u=r[t]=a?e(f):s[t];n&&(r[n]=u),i(i.P+i.F*a,"String",r)},f=h.trim=function(t,e){return t=r(t)+"",1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=h},function(t,e,n){var i,r,o,s=n(74),a=n(234),l=n(232),u=n(168),c=n(20),h=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,g=0,m={},y="onreadystatechange",v=function(){var t,e=+this;m.hasOwnProperty(e)&&(t=m[e],delete m[e],t())},b=function(t){v.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){a("function"==typeof t?t:Function(t),e)},i(g),g},d=function(t){delete m[t]},"process"==n(82)(h)?i=function(t){h.nextTick(s(v,t,1))}:p?(r=new p,o=r.port2,r.port1.onmessage=b,
i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",b,!1)):i=y in u("script")?function(t){l.appendChild(u("script"))[y]=function(){l.removeChild(this),v.call(t)}}:function(t){setTimeout(s(v,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,n){e.f=n(22)},function(t,e,n){var i=n(228),r=n(22)("iterator"),o=n(131);t.exports=n(96).getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||o[i(t)]}},,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){return t.interpolation={unescapeSuffix:"HTML"},t.interpolation.prefix=t.interpolationPrefix||"__",t.interpolation.suffix=t.interpolationSuffix||"__",t.interpolation.escapeValue=t.escapeInterpolation||!1,t.interpolation.nestingPrefix=t.reusePrefix||"$t(",t.interpolation.nestingSuffix=t.reuseSuffix||")",t}function o(t){return t.resStore&&(t.resources=t.resStore),t.ns&&t.ns.defaultNs?(t.defaultNS=t.ns.defaultNs,t.ns=t.ns.namespaces):t.defaultNS=t.ns||"translation",t.fallbackToDefaultNS&&t.defaultNS&&(t.fallbackNS=t.defaultNS),t.saveMissing=t.sendMissing,t.saveMissingTo=t.sendMissingTo||"current",t.returnNull=!t.fallbackOnNull,t.returnEmptyString=!t.fallbackOnEmpty,t.returnObjects=t.returnObjectTrees,t.joinArrays="\n",t.returnedObjectHandler=t.objectTreeKeyHandler,t.parseMissingKeyHandler=t.parseMissingKey,t.appendNamespaceToMissingKey=!0,t.nsSeparator=t.nsseparator,t.keySeparator=t.keyseparator,"sprintf"===t.shortcutFunction&&(t.overloadTranslationOptionHandler=function(t){var e,n=[];for(e=1;e<t.length;e++)n.push(t[e]);return{postProcess:"sprintf",sprintf:n}}),t.whitelist=t.lngWhitelist,t.preload=t.preload,"current"===t.load&&(t.load="currentOnly"),"unspecific"===t.load&&(t.load="languageOnly"),t.backend=t.backend||{},t.backend.loadPath=t.resGetPath||"locales/__lng__/__ns__.json",t.backend.addPath=t.resPostPath||"locales/add/__lng__/__ns__",t.backend.allowMultiLoading=t.dynamicLoad,t.cache=t.cache||{},t.cache.prefix="res_",t.cache.expirationTime=6048e5,t.cache.enabled=!!t.useLocalStorage,t=r(t),t.defaultVariables&&(t.interpolation.defaultVariables=t.defaultVariables),t}function s(t){return t=r(t),t.joinArrays="\n",t}function a(t){return(t.interpolationPrefix||t.interpolationSuffix||t.escapeInterpolation)&&(t=r(t)),t.nsSeparator=t.nsseparator,t.keySeparator=t.keyseparator,t.returnObjects=t.returnObjectTrees,t}function l(t){t.lng=function(){return c.default.deprecate("i18next.lng() can be replaced by i18next.language for detected language or i18next.languages for languages ordered by translation lookup."),t.services.languageUtils.toResolveHierarchy(t.language)[0]},t.preload=function(e,n){c.default.deprecate("i18next.preload() can be replaced with i18next.loadLanguages()"),t.loadLanguages(e,n)},t.setLng=function(e,n,i){if(c.default.deprecate("i18next.setLng() can be replaced with i18next.changeLanguage() or i18next.getFixedT() to get a translation function with fixed language or namespace."),
"function"==typeof n&&(i=n,n={}),n||(n={}),!0===n.fixLng&&i)return i(null,t.getFixedT(e));t.changeLanguage(e,i)},t.addPostProcessor=function(e,n){c.default.deprecate("i18next.addPostProcessor() can be replaced by i18next.use({ type: 'postProcessor', name: 'name', process: fc })"),t.use({type:"postProcessor",name:e,process:n})}}var u,c;Object.defineProperty(e,"__esModule",{value:!0}),e.convertAPIOptions=o,e.convertJSONOptions=s,e.convertTOptions=a,e.appendBackwardsAPI=l,u=n(75),c=i(u)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,i,r){var o=this;return t.forEach(function(t){o.processors[t]&&(e=o.processors[t].process(e,n,i,r))}),e}}},function(t,e,n){t.exports=n(564).default},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";var e="Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),n="Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_");return t.defineLocale("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:function(t,i){return/-MMM-/.test(i)?n[t.month()]:e[t.month()]},weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},
sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(t){
return"오후"===t},meridiem:function(t,e,n){return t<12?"오전":"오후"}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";function e(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function n(t,n,i){var r=t+" ";switch(i){case"m":return n?"minuta":"minutę";case"mm":return r+(e(t)?"minuty":"minut");case"h":return n?"godzina":"godzinę";case"hh":return r+(e(t)?"godziny":"godzin");case"MM":return r+(e(t)?"miesiące":"miesięcy");case"yy":return r+(e(t)?"lata":"lat")}}var i="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),r="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return t.defineLocale("pl",{months:function(t,e){return""===e?"("+r[t.month()]+"|"+i[t.month()]+")":/D MMMM/.test(e)?r[t.month()]:i[t.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:n,mm:n,h:n,hh:n,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:n,y:"rok",yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";return t.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";function e(t,e){var n=t.split("_");return e%10==1&&e%100!=11?n[0]:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?n[1]:n[2]}function n(t,n,i){var r={mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:асасаасов",dd:ень_дня_дней",MM:есяц_месяцаесяцев",yy:"год_годает"};return"m"===i?n?"минута":"минуту":t+" "+e(r[i],+t)}function i(t,e){return{nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")}[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(e)?"accusative":"nominative"][t.month()]}function r(t,e){return{nominative:"янв_фев_март_апрай_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апрая_июня_июля_авг_сен_окт_ноя_дек".split("_")}[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(e)?"accusative":"nominative"][t.month()]}function o(t,e){return{nominative:оскресенье_понедельник_вторник_средаетверг_пятница_суббота".split("_"),accusative:оскресенье_понедельник_вторник_средуетверг_пятницу_субботу".split("_")}[/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(e)?"accusative":"nominative"][t.day()]}return t.defineLocale("ru",{months:i,monthsShort:r,weekdays:o,weekdaysShort:с_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:с_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",
s:"несколько секунд",m:n,mm:n,h:"час",hh:n,d:"день",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(t){return/^(дня|вечера)$/.test(t)},meridiem:function(t,e,n){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":return t+"-й";case"D":return t+"-го";case"w":case"W":return t+"-я";default:return t}},week:{dow:1,doy:7}})})},function(t,e,n){!function(t,e){e(n(39))}(0,function(t){"use strict";var e={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return t.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(t){if(0===t)return t+"'ıncı";var n=t%10,i=t%100-n,r=t>=100?100:null;return t+(e[n]||e[i]||e[r])},week:{dow:1,doy:7}})})},,,,,,,,,function(module,exports){"use strict";!function(t,e){function n(e){return!t(e).parents().andSelf().filter(function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)}).length}t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),t.fn.extend({_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each(function(){var i=this;setTimeout(function(){t(i).focus(),n&&n.call(i)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){
"function"==typeof n&&(i=n,n={}),n||(n={}),!0===n.fixLng&&i)return i(null,t.getFixedT(e));t.changeLanguage(e,i)},t.addPostProcessor=function(e,n){c.default.deprecate("i18next.addPostProcessor() can be replaced by i18next.use({ type: 'postProcessor', name: 'name', process: fc })"),t.use({type:"postProcessor",name:e,process:n})}}var u,c;Object.defineProperty(e,"__esModule",{value:!0}),e.convertAPIOptions=o,e.convertJSONOptions=s,e.convertTOptions=a,e.appendBackwardsAPI=l,u=n(75),c=i(u)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,i,r){var o=this;return t.forEach(function(t){o.processors[t]&&(e=o.processors[t].process(e,n,i,r))}),e}}},function(t,e,n){t.exports=n(564).default},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10;return t+(1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")},week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";var e="Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),n="Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic".split("_");return t.defineLocale("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:function(t,i){return/-MMM-/.test(i)?n[t.month()]:e[t.month()]},weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},
sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"D_L_Ma_Me_G_V_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(t){
return"오후"===t},meridiem:function(t,e,n){return t<12?"오전":"오후"}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";function e(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function n(t,n,i){var r=t+" ";switch(i){case"m":return n?"minuta":"minutę";case"mm":return r+(e(t)?"minuty":"minut");case"h":return n?"godzina":"godzinę";case"hh":return r+(e(t)?"godziny":"godzin");case"MM":return r+(e(t)?"miesiące":"miesięcy");case"yy":return r+(e(t)?"lata":"lat")}}var i="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),r="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");return t.defineLocale("pl",{months:function(t,e){return""===e?"("+r[t.month()]+"|"+i[t.month()]+")":/D MMMM/.test(e)?r[t.month()]:i[t.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"N_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:n,mm:n,h:n,hh:n,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:n,y:"rok",yy:n},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";return t.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";function e(t,e){var n=t.split("_");return e%10==1&&e%100!=11?n[0]:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?n[1]:n[2]}function n(t,n,i){var r={mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:асасаасов",dd:ень_дня_дней",MM:есяц_месяцаесяцев",yy:"год_годает"};return"m"===i?n?"минута":"минуту":t+" "+e(r[i],+t)}function i(t,e){return{nominative:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),accusative:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_")}[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(e)?"accusative":"nominative"][t.month()]}function r(t,e){return{nominative:"янв_фев_март_апрай_июнь_июль_авг_сен_окт_ноя_дек".split("_"),accusative:"янв_фев_мар_апрая_июня_июля_авг_сен_окт_ноя_дек".split("_")}[/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/.test(e)?"accusative":"nominative"][t.month()]}function o(t,e){return{nominative:оскресенье_понедельник_вторник_средаетверг_пятница_суббота".split("_"),accusative:оскресенье_понедельник_вторник_средуетверг_пятницу_субботу".split("_")}[/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/.test(e)?"accusative":"nominative"][t.day()]}return t.defineLocale("ru",{months:i,monthsShort:r,weekdays:o,weekdaysShort:с_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:с_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",
s:"несколько секунд",m:n,mm:n,h:"час",hh:n,d:"день",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(t){return/^(дня|вечера)$/.test(t)},meridiem:function(t,e,n){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":return t+"-й";case"D":return t+"-го";case"w":case"W":return t+"-я";default:return t}},week:{dow:1,doy:7}})})},function(t,e,n){!function(t,e){e(n(40))}(0,function(t){"use strict";var e={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};return t.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(t){if(0===t)return t+"'ıncı";var n=t%10,i=t%100-n,r=t>=100?100:null;return t+(e[n]||e[i]||e[r])},week:{dow:1,doy:7}})})},,,,,,,,,function(module,exports){"use strict";!function(t,e){function n(e){return!t(e).parents().andSelf().filter(function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)}).length}t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),t.fn.extend({_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each(function(){var i=this;setTimeout(function(){t(i).focus(),n&&n.call(i)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){
return/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length){n=t(this[0]);for(var i;n.length&&n[0]!==document;){if(("absolute"===(i=n.css("position"))||"relative"===i||"fixed"===i)&&(i=parseInt(n.css("zIndex"),10),!isNaN(i)&&0!==i))return i;n=n.parent()}}return 0},disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(o,function(){n-=parseFloat(t.curCSS(e,"padding"+this,!0))||0,i&&(n-=parseFloat(t.curCSS(e,"border"+this+"Width",!0))||0),r&&(n-=parseFloat(t.curCSS(e,"margin"+this,!0))||0)}),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?a["inner"+i].call(this):this.each(function(){t(this).css(s,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(s,r(this,e,!0,n)+"px")})}}),t.extend(t.expr[":"],{data:function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){var i=e.nodeName.toLowerCase(),r=t.attr(e,"tabindex");return"area"===i?(i=e.parentNode,r=i.name,!(!e.href||!r||"map"!==i.nodeName.toLowerCase())&&(!!(e=t("img[usemap=#"+r+"]")[0])&&n(e))):(/input|select|textarea|button|object/.test(i)?!e.disabled:"a"==i?e.href||!isNaN(r):!isNaN(r))&&n(e)},tabbable:function(e){var n=t.attr(e,"tabindex");return(isNaN(n)||n>=0)&&t(e).is(":focusable")}}),t(function(){var e=document.body,n=e.appendChild(n=document.createElement("div"));t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,e.removeChild(n).style.display="none"}),t.extend(t.ui,{plugin:{add:function(e,n,i){e=t.ui[e].prototype;for(var r in i)e.plugins[r]=e.plugins[r]||[],e.plugins[r].push([n,i[r]])},call:function(t,e,n){if((e=t.plugins[e])&&t.element[0].parentNode)for(var i=0;i<e.length;i++)t.options[e[i][0]]&&e[i][1].apply(t.element,n)}},contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;n=n&&"left"===n?"scrollLeft":"scrollTop";var i=!1;return e[n]>0||(e[n]=1,i=e[n]>0,e[n]=0,i)},isOverAxis:function(t,e,n){return t>e&&t<e+n},isOver:function(e,n,i,r,o,s){return t.ui.isOverAxis(e,i,o)&&t.ui.isOverAxis(n,r,s)}}))}(jQuery),function(t,e){var n,i;t.cleanData?(n=t.cleanData,t.cleanData=function(e){for(var i,r=0;null!=(i=e[r]);r++)t(i).triggerHandler("remove");n(e)}):(i=t.fn.remove,t.fn.remove=function(e,n){return this.each(function(){
return n||e&&!t.filter(e,[this]).length||t("*",this).add([this]).each(function(){t(this).triggerHandler("remove")}),i.call(t(this),e,n)})}),t.widget=function(e,n,i){var r,o=e.split(".")[0];e=e.split(".")[1],r=o+"-"+e,i||(i=n,n=t.Widget),t.expr[":"][r]=function(n){return!!t.data(n,e)},t[o]=t[o]||{},t[o][e]=function(t,e){arguments.length&&this._createWidget(t,e)},n=new n,n.options=t.extend(!0,{},n.options),t[o][e].prototype=t.extend(!0,n,{namespace:o,widgetName:e,widgetEventPrefix:t[o][e].prototype.widgetEventPrefix||e,widgetBaseClass:r},i),t.widget.bridge(e,t[o][e])},t.widget.bridge=function(n,i){t.fn[n]=function(r){var o="string"==typeof r,s=Array.prototype.slice.call(arguments,1),a=this;return r=!o&&s.length?t.extend.apply(null,[!0,r].concat(s)):r,o&&"_"===r.charAt(0)?a:(o?this.each(function(){var i=t.data(this,n),o=i&&t.isFunction(i[r])?i[r].apply(i,s):i;if(o!==i&&o!==e)return a=o,!1}):this.each(function(){var e=t.data(this,n);e?e.option(r||{})._init():t.data(this,n,new i(r,this))}),a)}},t.Widget=function(t,e){arguments.length&&this._createWidget(t,e)},t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(e,n){t.data(n,this.widgetName,this),this.element=t(n),this.options=t.extend(!0,{},this.options,this._getCreateOptions(),e);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(n,i){var r=n;if(0===arguments.length)return t.extend({},this.options);if("string"==typeof n){if(i===e)return this.options[n];r={},r[n]=i}return this._setOptions(r),this},_setOptions:function(e){var n=this;return t.each(e,function(t,e){n._setOption(t,e)}),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(e,n,i){var r,o=this.options[e];if(n=t.Event(n),n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i=i||{},n.originalEvent)for(e=t.event.props.length;e;)r=t.event.props[--e],n[r]=n.originalEvent[r];return this.element.trigger(n,i),!(t.isFunction(o)&&!1===o.call(this.element[0],n,i)||n.isDefaultPrevented())}}}(jQuery),function(t){t.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(n){
if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(e){if(e.originalEvent=e.originalEvent||{},!e.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var n=this,i=1==e.which,r="string"==typeof this.options.cancel&&t(e.target).parents().add(e.target).filter(this.options.cancel).length;return!(i&&!r&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),e.originalEvent.mouseHandled=!0))}},_mouseMove:function(e){return!t.browser.msie||document.documentMode>=9||e.button?this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&((this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e))?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted):this._mouseUp(e)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target==this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t){t.ui=t.ui||{};var e=/left|center|right/,n=/top|center|bottom/,i=t.fn.position,r=t.fn.offset;t.fn.position=function(r){if(!r||!r.of)return i.apply(this,arguments);r=t.extend({},r);var o,s,a,l=t(r.of),u=l[0],c=(r.collision||"flip").split(" "),h=r.offset?r.offset.split(" "):[0,0];return 9===u.nodeType?(o=l.width(),s=l.height(),a={top:0,left:0}):u.setTimeout?(o=l.width(),s=l.height(),a={top:l.scrollTop(),left:l.scrollLeft()}):u.preventDefault?(r.at="left top",o=s=0,a={top:r.of.pageY,left:r.of.pageX}):(o=l.outerWidth(),s=l.outerHeight(),a=l.offset()),t.each(["my","at"],function(){var t=(r[this]||"").split(" ");1===t.length&&(t=e.test(t[0])?t.concat(["center"]):n.test(t[0])?["center"].concat(t):["center","center"]),t[0]=e.test(t[0])?t[0]:"center",t[1]=n.test(t[1])?t[1]:"center",r[this]=t}),
@@ -104,7 +104,7 @@ i=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(i,r,e))),t.selected
;return e&&e.constructor==Array&&3==e.length?e:(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))?[parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)]:(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e))?[2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3])]:(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))?[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(e)?u.transparent:u[t.trim(e).toLowerCase()]}function i(e,i){var r;do{if(""!=(r=t.curCSS(e,i))&&"transparent"!=r||t.nodeName(e,"body"))break;i="backgroundColor"}while(e=e.parentNode);return n(r)}function r(){var t,e,n,i=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,r={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)t=i[n],"string"==typeof i[t]&&(e=t.replace(/\-(\w)/g,function(t,e){return e.toUpperCase()}),r[e]=i[t]);else for(t in i)"string"==typeof i[t]&&(r[t]=i[t]);return r}function o(e){var n,i;for(n in e)(null==(i=e[n])||t.isFunction(i)||n in h||/scrollbar/.test(n)||!/color/i.test(n)&&isNaN(parseFloat(i)))&&delete e[n];return e}function s(t,e){var n,i={_:0};for(n in e)t[n]!=e[n]&&(i[n]=e[n]);return i}function a(e,n,i,r){return"object"==typeof e&&(r=n,i=null,n=e,e=n.effect),t.isFunction(n)&&(r=n,i=null,n={}),("number"==typeof n||t.fx.speeds[n])&&(r=i,i=n,n={}),t.isFunction(i)&&(r=i,i=null),n=n||{},i=i||n.duration,i=t.fx.off?0:"number"==typeof i?i:i in t.fx.speeds?t.fx.speeds[i]:t.fx.speeds._default,r=r||n.complete,[e,n,i,r]}function l(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||"string"==typeof e&&!t.effects[e]}t.effects={},t.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(e,r){t.fx.step[r]=function(t){t.colorInit||(t.start=i(t.elem,r),t.end=n(t.end),t.colorInit=!0),t.elem.style[r]="rgb("+Math.max(Math.min(parseInt(t.pos*(t.end[0]-t.start[0])+t.start[0],10),255),0)+","+Math.max(Math.min(parseInt(t.pos*(t.end[1]-t.start[1])+t.start[1],10),255),0)+","+Math.max(Math.min(parseInt(t.pos*(t.end[2]-t.start[2])+t.start[2],10),255),0)+")"}});var u={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],
orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},c=["add","remove","toggle"],h={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.effects.animateClass=function(e,n,i,a){return t.isFunction(i)&&(a=i,i=null),this.queue("fx",function(){var l,u=t(this),h=u.attr("style")||" ",f=o(r.call(this)),d=u.attr("className");t.each(c,function(t,n){e[n]&&u[n+"Class"](e[n])}),l=o(r.call(this)),u.attr("className",d),u.animate(s(f,l),n,i,function(){t.each(c,function(t,n){e[n]&&u[n+"Class"](e[n])}),"object"==typeof u.attr("style")?(u.attr("style").cssText="",u.attr("style").cssText=h):u.attr("style",h),a&&a.apply(this,arguments)}),f=t.queue(this),l=f.splice(f.length-1,1)[0],f.splice(1,0,l),t.dequeue(this)})},t.fn.extend({_addClass:t.fn.addClass,addClass:function(e,n,i,r){return n?t.effects.animateClass.apply(this,[{add:e},n,i,r]):this._addClass(e)},_removeClass:t.fn.removeClass,removeClass:function(e,n,i,r){return n?t.effects.animateClass.apply(this,[{remove:e},n,i,r]):this._removeClass(e)},_toggleClass:t.fn.toggleClass,toggleClass:function(n,i,r,o,s){return"boolean"==typeof i||i===e?r?t.effects.animateClass.apply(this,[i?{add:n}:{remove:n},r,o,s]):this._toggleClass(n,i):t.effects.animateClass.apply(this,[{toggle:n},i,r,o])},switchClass:function(e,n,i,r,o){return t.effects.animateClass.apply(this,[{add:n,remove:e},i,r,o])}}),t.extend(t.effects,{version:"1.8.11",save:function(t,e){for(var n=0;n<e.length;n++)null!==e[n]&&t.data("ec.storage."+e[n],t[0].style[e[n]])},restore:function(t,e){for(var n=0;n<e.length;n++)null!==e[n]&&t.css(e[n],t.data("ec.storage."+e[n]))},setMode:function(t,e){return"toggle"==e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var n;switch(t[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=t[0]/e.height}switch(t[1]){case"left":t=0;break;case"center":t=.5;break;case"right":t=1;break;default:t=t[1]/e.width}return{x:t,y:n}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var n={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},i=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});return e.wrap(i),i=e.parent(),"static"==e.css("position")?(i.css({position:"relative"}),e.css({position:"relative"})):(t.extend(n,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,i){n[i]=e.css(i),isNaN(parseInt(n[i],10))&&(n[i]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(n).show()},removeWrapper:function(t){return t.parent().is(".ui-effects-wrapper")?t.parent().replaceWith(t):t},setTransition:function(e,n,i,r){return r=r||{},t.each(n,function(t,n){unit=e.cssUnit(n),unit[0]>0&&(r[n]=unit[0]*i+unit[1])}),r}}),t.fn.extend({effect:function(e){var n,i=a.apply(this,arguments),r={
options:i[1],duration:i[2],callback:i[3]};return i=r.options.mode,n=t.effects[e],t.fx.off||!n?i?this[i](r.duration,r.callback):this.each(function(){r.callback&&r.callback.call(this)}):n.call(this,r)},_show:t.fn.show,show:function(t){if(l(t))return this._show.apply(this,arguments);var e=a.apply(this,arguments);return e[1].mode="show",this.effect.apply(this,e)},_hide:t.fn.hide,hide:function(t){if(l(t))return this._hide.apply(this,arguments);var e=a.apply(this,arguments);return e[1].mode="hide",this.effect.apply(this,e)},__toggle:t.fn.toggle,toggle:function(e){if(l(e)||"boolean"==typeof e||t.isFunction(e))return this.__toggle.apply(this,arguments);var n=a.apply(this,arguments);return n[1].mode="toggle",this.effect.apply(this,n)},cssUnit:function(e){var n=this.css(e),i=[];return t.each(["em","px","%","pt"],function(t,e){n.indexOf(e)>0&&(i=[parseFloat(n),e])}),i}}),t.easing.jswing=t.easing.swing,t.extend(t.easing,{def:"easeOutQuad",swing:function(e,n,i,r,o){return t.easing[t.easing.def](e,n,i,r,o)},easeInQuad:function(t,e,n,i,r){return i*(e/=r)*e+n},easeOutQuad:function(t,e,n,i,r){return-i*(e/=r)*(e-2)+n},easeInOutQuad:function(t,e,n,i,r){return(e/=r/2)<1?i/2*e*e+n:-i/2*(--e*(e-2)-1)+n},easeInCubic:function(t,e,n,i,r){return i*(e/=r)*e*e+n},easeOutCubic:function(t,e,n,i,r){return i*((e=e/r-1)*e*e+1)+n},easeInOutCubic:function(t,e,n,i,r){return(e/=r/2)<1?i/2*e*e*e+n:i/2*((e-=2)*e*e+2)+n},easeInQuart:function(t,e,n,i,r){return i*(e/=r)*e*e*e+n},easeOutQuart:function(t,e,n,i,r){return-i*((e=e/r-1)*e*e*e-1)+n},easeInOutQuart:function(t,e,n,i,r){return(e/=r/2)<1?i/2*e*e*e*e+n:-i/2*((e-=2)*e*e*e-2)+n},easeInQuint:function(t,e,n,i,r){return i*(e/=r)*e*e*e*e+n},easeOutQuint:function(t,e,n,i,r){return i*((e=e/r-1)*e*e*e*e+1)+n},easeInOutQuint:function(t,e,n,i,r){return(e/=r/2)<1?i/2*e*e*e*e*e+n:i/2*((e-=2)*e*e*e*e+2)+n},easeInSine:function(t,e,n,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+n},easeOutSine:function(t,e,n,i,r){return i*Math.sin(e/r*(Math.PI/2))+n},easeInOutSine:function(t,e,n,i,r){return-i/2*(Math.cos(Math.PI*e/r)-1)+n},easeInExpo:function(t,e,n,i,r){return 0==e?n:i*Math.pow(2,10*(e/r-1))+n},easeOutExpo:function(t,e,n,i,r){return e==r?n+i:i*(1-Math.pow(2,-10*e/r))+n},easeInOutExpo:function(t,e,n,i,r){return 0==e?n:e==r?n+i:(e/=r/2)<1?i/2*Math.pow(2,10*(e-1))+n:i/2*(2-Math.pow(2,-10*--e))+n},easeInCirc:function(t,e,n,i,r){return-i*(Math.sqrt(1-(e/=r)*e)-1)+n},easeOutCirc:function(t,e,n,i,r){return i*Math.sqrt(1-(e=e/r-1)*e)+n},easeInOutCirc:function(t,e,n,i,r){return(e/=r/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+n:i/2*(Math.sqrt(1-(e-=2)*e)+1)+n},easeInElastic:function(t,e,n,i,r){t=1.70158;var o=0,s=i;return 0==e?n:1==(e/=r)?n+i:(o||(o=.3*r),s<Math.abs(i)?(s=i,t=o/4):t=o/(2*Math.PI)*Math.asin(i/s),-s*Math.pow(2,10*(e-=1))*Math.sin(2*(e*r-t)*Math.PI/o)+n)},easeOutElastic:function(t,e,n,i,r){t=1.70158;var o=0,s=i;return 0==e?n:1==(e/=r)?n+i:(o||(o=.3*r),s<Math.abs(i)?(s=i,t=o/4):t=o/(2*Math.PI)*Math.asin(i/s),s*Math.pow(2,-10*e)*Math.sin(2*(e*r-t)*Math.PI/o)+i+n)},easeInOutElastic:function(t,e,n,i,r){t=1.70158;var o=0,s=i
;return 0==e?n:2==(e/=r/2)?n+i:(o||(o=.3*r*1.5),s<Math.abs(i)?(s=i,t=o/4):t=o/(2*Math.PI)*Math.asin(i/s),e<1?-.5*s*Math.pow(2,10*(e-=1))*Math.sin(2*(e*r-t)*Math.PI/o)+n:s*Math.pow(2,-10*(e-=1))*Math.sin(2*(e*r-t)*Math.PI/o)*.5+i+n)},easeInBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),r*(n/=o)*n*((s+1)*n-s)+i},easeOutBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),r*((n=n/o-1)*n*((s+1)*n+s)+1)+i},easeInOutBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),(n/=o/2)<1?r/2*n*n*((1+(s*=1.525))*n-s)+i:r/2*((n-=2)*n*((1+(s*=1.525))*n+s)+2)+i},easeInBounce:function(e,n,i,r,o){return r-t.easing.easeOutBounce(e,o-n,0,r,o)+i},easeOutBounce:function(t,e,n,i,r){return(e/=r)<1/2.75?7.5625*i*e*e+n:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+n:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+n:i*(7.5625*(e-=2.625/2.75)*e+.984375)+n},easeInOutBounce:function(e,n,i,r,o){return n<o/2?.5*t.easing.easeInBounce(e,2*n,0,r,o)+i:.5*t.easing.easeOutBounce(e,2*n-o,0,r,o)+.5*r+i}})}(jQuery)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";!function(t){function e(e){var n=e||window.event,i=[].slice.call(arguments,1),r=0,o=0,s=0;return e=t.event.fix(n),e.type="mousewheel",n.wheelDelta&&(r=n.wheelDelta/120),n.detail&&(r=-n.detail/3),s=r,void 0!==n.axis&&n.axis===n.HORIZONTAL_AXIS&&(s=0,o=-1*r),void 0!==n.wheelDeltaY&&(s=n.wheelDeltaY/120),void 0!==n.wheelDeltaX&&(o=-1*n.wheelDeltaX/120),i.unshift(e,r,o,s),(t.event.dispatch||t.event.handle).apply(this,i)}var n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r=["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(t.event.fixHooks)for(n=i.length;n;)t.event.fixHooks[i[--n]]=t.event.mouseHooks;t.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],e,!1);else this.onmousewheel=null}},t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}(jQuery)},function(t,e,n){"use strict";var i=n(36),r=i.rgba,o=i.areEqualRgb,s=i.areEqualRgba,a=i.normalizeHue,l=i.normalizeHsvSaturation,u=i.normalizeValue,c=i.hsv,h=i.rgbToHsv,f=i.hsvToRgb,d=i.rgbToString,p=i.rgbaToString,g=i.parseRgb,m=i.parseRgba,y=n(551);!function(t){function e(t){return""===t?t:p(m(t))}function n(t){t&&(t.join||(t=t?(""+t).split(","):[]),b=t)}function i(w){function x(e){var n=!1,i=g(e);return t.each(b,function(t,e){if(o(g(e),i))return n=!0,!1}),!n&&(b=[d(i)].concat(b.slice(0,v-1)),!0)}function k(e,n,i){var o=t(this);e=p(r(g(e),n)),S.call(this,e),o.removeData("tvcolorpicker").removeData("tvcolorpicker-custom-color"),i&&(P(),o.blur())}function S(e){var n=t(this);n.val(e),n.change(),e?n.trigger("pick-color",e):n.trigger("pick-transparent"),M.call(this,e)}function M(e){if(""===e)return void t(this).addClass("tvcolorpicker-gradient-widget")
;return 0==e?n:2==(e/=r/2)?n+i:(o||(o=.3*r*1.5),s<Math.abs(i)?(s=i,t=o/4):t=o/(2*Math.PI)*Math.asin(i/s),e<1?-.5*s*Math.pow(2,10*(e-=1))*Math.sin(2*(e*r-t)*Math.PI/o)+n:s*Math.pow(2,-10*(e-=1))*Math.sin(2*(e*r-t)*Math.PI/o)*.5+i+n)},easeInBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),r*(n/=o)*n*((s+1)*n-s)+i},easeOutBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),r*((n=n/o-1)*n*((s+1)*n+s)+1)+i},easeInOutBack:function(t,n,i,r,o,s){return s==e&&(s=1.70158),(n/=o/2)<1?r/2*n*n*((1+(s*=1.525))*n-s)+i:r/2*((n-=2)*n*((1+(s*=1.525))*n+s)+2)+i},easeInBounce:function(e,n,i,r,o){return r-t.easing.easeOutBounce(e,o-n,0,r,o)+i},easeOutBounce:function(t,e,n,i,r){return(e/=r)<1/2.75?7.5625*i*e*e+n:e<2/2.75?i*(7.5625*(e-=1.5/2.75)*e+.75)+n:e<2.5/2.75?i*(7.5625*(e-=2.25/2.75)*e+.9375)+n:i*(7.5625*(e-=2.625/2.75)*e+.984375)+n},easeInOutBounce:function(e,n,i,r,o){return n<o/2?.5*t.easing.easeInBounce(e,2*n,0,r,o)+i:.5*t.easing.easeOutBounce(e,2*n-o,0,r,o)+.5*r+i}})}(jQuery)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";!function(t){function e(e){var n=e||window.event,i=[].slice.call(arguments,1),r=0,o=0,s=0;return e=t.event.fix(n),e.type="mousewheel",n.wheelDelta&&(r=n.wheelDelta/120),n.detail&&(r=-n.detail/3),s=r,void 0!==n.axis&&n.axis===n.HORIZONTAL_AXIS&&(s=0,o=-1*r),void 0!==n.wheelDeltaY&&(s=n.wheelDeltaY/120),void 0!==n.wheelDeltaX&&(o=-1*n.wheelDeltaX/120),i.unshift(e,r,o,s),(t.event.dispatch||t.event.handle).apply(this,i)}var n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r=["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(t.event.fixHooks)for(n=i.length;n;)t.event.fixHooks[i[--n]]=t.event.mouseHooks;t.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],e,!1);else this.onmousewheel=null}},t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}(jQuery)},function(t,e,n){"use strict";var i=n(37),r=i.rgba,o=i.areEqualRgb,s=i.areEqualRgba,a=i.normalizeHue,l=i.normalizeHsvSaturation,u=i.normalizeValue,c=i.hsv,h=i.rgbToHsv,f=i.hsvToRgb,d=i.rgbToString,p=i.rgbaToString,g=i.parseRgb,m=i.parseRgba,y=n(551);!function(t){function e(t){return""===t?t:p(m(t))}function n(t){t&&(t.join||(t=t?(""+t).split(","):[]),b=t)}function i(w){function x(e){var n=!1,i=g(e);return t.each(b,function(t,e){if(o(g(e),i))return n=!0,!1}),!n&&(b=[d(i)].concat(b.slice(0,v-1)),!0)}function k(e,n,i){var o=t(this);e=p(r(g(e),n)),S.call(this,e),o.removeData("tvcolorpicker").removeData("tvcolorpicker-custom-color"),i&&(P(),o.blur())}function S(e){var n=t(this);n.val(e),n.change(),e?n.trigger("pick-color",e):n.trigger("pick-transparent"),M.call(this,e)}function M(e){if(""===e)return void t(this).addClass("tvcolorpicker-gradient-widget")
;t(this).removeClass("tvcolorpicker-gradient-widget"),t(this).css({backgroundColor:e,color:e})}function D(e,n){var i,r,s,a,l,u;return n=n||{},i=this,r=t(i).val().toLowerCase(),s=document.createElement("table"),a=document.createElement("tbody"),s.appendChild(a),u=0,t.each(e,function(e,s){var c,h;u++,e%v==0&&(l=t("<tr></tr>").appendTo(a)),c=t('<td class="tvcolorpicker-cell"></td>').appendTo(l),h=t('<div class="tvcolorpicker-transparency"><div class="tvcolorpicker-swatch"></div></div>').appendTo(c).find(".tvcolorpicker-swatch").data("color",s),n.addClass&&h.addClass(n.addClass),s&&(s=s.toLowerCase(),r&&o(g(r),g(s))&&h.addClass("active"),h.css({backgroundColor:s}).data("color",s),h.bind("click",function(){k.call(i,s,O.val(),!0)}))}),t(s).addClass("tvcolorpicker-table"),u?s:t()}function T(e,n,i){var r,o=t(e).offset(),s={left:t(document).scrollLeft(),top:t(document).scrollTop()},a={width:t(e).outerWidth(),height:t(e).outerHeight()},l={width:t(window).width(),height:t(window).height()},u={width:t(n).outerWidth(),height:t(n).outerHeight()};switch("function"==typeof i.direction?i.direction():i.direction){default:case"down":r={top:o.top+a.height+i.offset,left:o.left+i.drift};break;case"right":r={top:o.top+i.drift,left:o.left+a.width+i.offset}}r.top+u.height>l.height+s.top&&(r.top=l.height-u.height+s.top),o.left+u.width>l.width&&(r.left=l.width-u.width),r.left+="px",r.top+="px",n.css(r)}function C(e){function n(t){var e=t.originalEvent,n=t.offsetX||t.layerX||e&&(e.offsetX||e.layerX)||0,i=t.offsetY||t.layerY||e&&(e.offsetY||e.layerY)||0;E.css({left:n+"px",top:i+"px"}),W[0]=a(n/H),W[1]=l(1-i/F),A.css({backgroundColor:d(f(c(W[0],W[1],1)))}),x()}function i(e){1==e.which&&(Y=!1,U.is(".opened")&&t(B).get(0).focus())}function o(e){var n=e.pageY,i=t(j),r=i.offset().top,o=n-r;return o>i.height()?i.height():o<0?0:o}function v(t){var e=o(t);I.css({top:e+"px"}),W[2]=u(1-Math.max(0,Math.min(e,F))/F),x()}function w(e){1==e.which&&(z=!1,t(document).unbind("mouseup",w),U.is(".opened")&&t(B).get(0).focus())}function x(){var t,e;R&&(R=!1,U.find(".tvcolorpicker-swatch.active").removeClass("active")),t=r(f(W),O.val()),s(m(B.val().toUpperCase()),t)||(e=p(t),B.data("tvcolorpicker-custom-color",e),S.call(B,e))}var M,C,P,E,N,L,A,I,j,F,H,Y,z,R,W,V=!1,B=t(this),U=t('<div class="tvcolorpicker-popup opened">'),q=t('<div class="tvcolorpicker-swatches-area"></div>').appendTo(U);return q.append(D.call(this,["rgb(0, 0, 0)","rgb(66, 66, 66)","rgb(101, 101, 101)","rgb(152, 152, 152)","rgb(182, 182, 182)","rgb(203, 203, 203)","rgb(216, 216, 216)","rgb(238, 238, 238)","rgb(242, 242, 242)","rgb(255, 255, 255)"])),q.append(D.call(this,["rgb(151, 0, 0)","rgb(255, 0, 0)","rgb(255, 152, 0)","rgb(255, 255, 0)","rgb(0, 255, 0)","rgb(0, 255, 255)","rgb(73, 133, 231)","rgb(0, 0, 255)","rgb(152, 0, 255)","rgb(255, 0, 255)"])),
q.append(D.call(this,["rgb(230, 184, 175)","rgb(244, 204, 204)","rgb(252, 229, 205)","rgb(255, 242, 204)","rgb(217, 234, 211)","rgb(208, 224, 227)","rgb(201, 218, 248)","rgb(207, 226, 243)","rgb(217, 210, 233)","rgb(234, 209, 220)","rgb(221, 126, 107)","rgb(234, 153, 153)","rgb(249, 203, 156)","rgb(255, 229, 153)","rgb(182, 215, 168)","rgb(162, 196, 201)","rgb(164, 194, 244)","rgb(159, 197, 232)","rgb(180, 167, 214)","rgb(213, 166, 189)","rgb(204, 65, 37)","rgb(224, 102, 102)","rgb(246, 178, 107)","rgb(255, 217, 102)","rgb(147, 196, 125)","rgb(118, 165, 175)","rgb(109, 158, 235)","rgb(111, 168, 220)","rgb(142, 124, 195)","rgb(194, 123, 160)","rgb(166, 28, 0)","rgb(204, 0, 0)","rgb(230, 145, 56)","rgb(241, 194, 50)","rgb(106, 168, 79)","rgb(69, 129, 142)","rgb(60, 120, 216)","rgb(61, 133, 198)","rgb(103, 78, 167)","rgb(166, 77, 121)","rgb(133, 32, 12)","rgb(153, 0, 0)","rgb(180, 95, 6)","rgb(191, 144, 0)","rgb(56, 118, 29)","rgb(19, 79, 92)","rgb(17, 85, 204)","rgb(11, 83, 148)","rgb(53, 28, 117)","rgb(116, 27, 71)","rgb(91, 15, 0)","rgb(102, 0, 0)","rgb(120, 63, 4)","rgb(127, 96, 0)","rgb(39, 78, 19)","rgb(12, 52, 61)","rgb(28, 69, 135)","rgb(7, 55, 99)","rgb(32, 18, 77)","rgb(76, 17, 48)"])),M=t('<div class="tvcolorpicker-custom-area"></div>').css({display:"none"}).appendTo(U),C=t('<div class="tvcolorpicker-hsv"></div>').appendTo(M),P=t('<div class="tvcolorpicker-hs"></div>').appendTo(C),E=t('<div class="tvcolorpicker-hs-handle"></div>').appendTo(P),N=t('<div class="tvcolorpicker-hs-area"></div>').appendTo(P),L=t('<div class="tvcolorpicker-vv">').appendTo(C),A=t('<div class="tvcolorpicker-v"></div>').appendTo(L),I=t('<div class="tvcolorpicker-v-handle"></div>').appendTo(A),j=t('<div class="tvcolorpicker-v-area"></div>').appendTo(A),O=y(t(this),e.hideTransparency),O.initEvents(),O.updateColor(),O.$el.appendTo(U),O.val(m(B.val()||_)[3]),F=P.height(),H=P.width(),Y=!1,z=!1,R=!0,W=[0,0,.5],N.bind("mousedown",function(e){1==e.which&&(Y=!0,t(document).bind("mouseup",i),n(e),e.preventDefault())}),N.bind("mousemove",function(t){Y&&(n(t),t.preventDefault())}),t(O).on("change",function(){if(V)return void x();k.call(this,t(this).val()||_,O.val())}.bind(this)),t(O).on("afterChange",function(){t(this).focus()}.bind(this)),L.bind("mousedown",function(e){1==e.which&&(z=!0,t(document).bind("mouseup",w),v(e),e.preventDefault())}),t(document).bind("mousemove",function(t){z&&(v(t),t.preventDefault())}),t('<a class="tvcolorpicker-custom-button _tv-button">'+t.t("Custom color...")+"</a>").appendTo(U).bind("click",function(){var e,n=t(this).is(".active");n||M.css({minWidth:q.width()+"px",minHeight:q.height()+"px"}),t(this)[n?"removeClass":"addClass"]("active"),V=t(this).is(".active"),M.css({display:n?"none":"block"}),q.css({display:n?"block":"none"}),n?B.removeData("tvcolorpicker-custom-color"):(F=P.height(),H=P.width(),e=g(B.val()||_),W=h(e),E.css({left:~~(W[0]*H)+"px",top:~~((1-W[1])*F)+"px"}),I.css({top:~~((1-W[2])*F)+"px"}),A.css({backgroundColor:d(f(c(W[0],W[1],1)))}))}),U.append(t(D.call(this,b,{addClass:"tvcolorpicker-user"
})).addClass("tvcolorpicker-user-swatches")),t(document.body).append(U),T(B,U,e),U}function P(){t(".tvcolorpicker-popup").removeClass("opened").remove(),t(O).off("change"),t(O).off("afterChange"),t(E).data("tvcolorpicker",null),t(E).each(function(){var e,n=t(this).data("tvcolorpicker-custom-color");n&&(x(n)&&t(this).trigger("customcolorchange",[b]),t(this).data("tvcolorpicker-custom-color",null)),e=t(this).data("tvcolorpicker-previous-color"),e&&e!=t(this).val()&&t(this).trigger("change"),t(this).removeData("tvcolorpicker-previous-color")})}var O,E;return w=t.extend({},i.options,w||{}),E=this,w&&"customColors"in w&&n(w.customColors),this.each(function(){function n(){var t=e(s.val());M.call(s,t)}var i,r,o,s=t(this);s.val(e(s.val())),i=null,r=!1,s.addClass("tvcolorpicker-widget").attr("autocomplete","off").attr("readonly",!0),o=function(){s.data("tvcolorpicker")||(P.call(s),i=C.call(s,w),s.data("tvcolorpicker-custom-color",null),s.data("tvcolorpicker",i),s.data("tvcolorpicker-previous-color",s.val()),i.bind("mousedown click",function(e){t(e.target).parents().andSelf().is(i)&&(s.focus(),r=!0,setTimeout(function(){r=!1},0))}))},s.on("touchstart",o),s.focus(o),P.call(s),s.bind("blur",function(t){r?t.stopPropagation():P.call(s)}),s.change(function(t){n()}),n()})}var v,b,_;if(!t)throw Error("This program cannot be run in DOS mode");i.setCustomColors=n,t.fn.tvcolorpicker=i,v=10,b=[],_="rgb(14, 15, 16)",i.options={direction:"down",offset:0,drift:0}}(window.jQuery)},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var i,r;!function(t){"use strict";function e(t){var e=t.length,i=n.type(t);return"function"!==i&&!n.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t))}var n,i,r,o,s,a,l;if(!t.jQuery){n=function(t,e){return new n.fn.init(t,e)},n.isWindow=function(t){return t&&t===t.window},n.type=function(t){return t?"object"==typeof t||"function"==typeof t?r[s.call(t)]||"object":typeof t:t+""},n.isArray=Array.isArray||function(t){return"array"===n.type(t)},n.isPlainObject=function(t){var e;if(!t||"object"!==n.type(t)||t.nodeType||n.isWindow(t))return!1;try{if(t.constructor&&!o.call(t,"constructor")&&!o.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}for(e in t);return void 0===e||o.call(t,e)},n.each=function(t,n,i){var r=0,o=t.length,s=e(t);if(i){if(s)for(;r<o&&!1!==n.apply(t[r],i);r++);else for(r in t)if(t.hasOwnProperty(r)&&!1===n.apply(t[r],i))break}else if(s)for(;r<o&&!1!==n.call(t[r],r,t[r]);r++);else for(r in t)if(t.hasOwnProperty(r)&&!1===n.call(t[r],r,t[r]))break;return t},n.data=function(t,e,r){var o,s,a;if(void 0===r){if(o=t[n.expando],s=o&&i[o],void 0===e)return s;if(s&&e in s)return s[e]}else if(void 0!==e)return a=t[n.expando]||(t[n.expando]=++n.uuid),i[a]=i[a]||{},i[a][e]=r,r},n.removeData=function(t,e){var r=t[n.expando],o=r&&i[r];o&&(e?n.each(e,function(t,e){delete o[e]}):delete i[r])},n.extend=function(){var t,e,i,r,o,s,a=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[l]||{},l++),
@@ -124,12 +124,12 @@ c.complete&&!C.isFunction(c.complete)&&(c.complete=null),c.display!==i&&null!==c
if(i===r)if((!0===k||C.isString(k))&&(p.each(p.queue(i,C.isString(k)?k:""),function(t,e){C.isFunction(e)&&e(null,!0)}),p.queue(i,C.isString(k)?k:"",[])),"stop"===x){var a=s(i);a&&a.tweensContainer&&!1!==o&&p.each(a.tweensContainer,function(t,e){e.endValue=e.currentValue}),L.push(t)}else"finish"!==x&&"finishAll"!==x||(e[2].duration=1)})})}),"stop"===x&&(p.each(L,function(t,e){d(e,!0)}),S.promise&&S.resolver(w)),t();default:if(!p.isPlainObject(x)||C.isEmptyObject(x))return C.isString(x)&&y.Redirects[x]?(u=p.extend({},k),A=u.duration,I=u.delay||0,!0===u.backwards&&(w=p.extend(!0,[],w).reverse()),p.each(w,function(t,e){parseFloat(u.stagger)?u.delay=I+parseFloat(u.stagger)*t:C.isFunction(u.stagger)&&(u.delay=I+u.stagger.call(e,t,M)),u.drag&&(u.duration=parseFloat(A)||(/^(callout|transition)/.test(x)?1e3:g),u.duration=Math.max(u.duration*(u.backwards?1-t/M:(t+1)/M),.75*u.duration,200)),y.Redirects[x].call(e,e,u||{},t,M,w,S.promise?S:i)}),t()):(j="Velocity: First argument ("+x+") was not a property map, a known action, or a registered redirect. Aborting.",S.promise?S.rejecter(Error(j)):e.console&&console.log(j),t());E="start"}if(F={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},H=[],p.each(w,function(t,e){C.isNode(e)&&r(e,t)}),u=p.extend({},y.defaults,k),u.loop=parseInt(u.loop,10),Y=2*u.loop-1,u.loop)for(z=0;z<Y;z++)R={delay:u.delay,progress:u.progress},z===Y-1&&(R.display=u.display,R.visibility=u.visibility,R.complete=u.complete),_(w,"reverse",R);return t()},y=p.extend(_,y),y.animate=_,w=e.requestAnimationFrame||S,y.State.isMobile||n.hidden===i||(x=function(){n.hidden?(w=function(t){return setTimeout(function(){t(!0)},16)},f()):w=e.requestAnimationFrame||S},x(),n.addEventListener("visibilitychange",x)),t.Velocity=y,t!==e&&(t.fn.velocity=_,t.fn.velocity.defaults=y.defaults),p.each(["Down","Up"],function(t,e){y.Redirects["slide"+e]=function(t,n,r,o,s,a){var l=p.extend({},n),u=l.begin,c=l.complete,h={},f={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};l.display===i&&(l.display="Down"===e?"inline"===y.CSS.Values.getDisplayType(t)?"inline-block":"block":"none"),l.begin=function(){var n,i;0===r&&u&&u.call(s,s);for(n in f)f.hasOwnProperty(n)&&(h[n]=t.style[n],i=b.getPropertyValue(t,n),f[n]="Down"===e?[i,0]:[0,i]);h.overflow=t.style.overflow,t.style.overflow="hidden"},l.complete=function(){for(var e in h)h.hasOwnProperty(e)&&(t.style[e]=h[e]);r===o-1&&(c&&c.call(s,s),a&&a.resolver(s))},y(t,f,l)}}),p.each(["In","Out"],function(t,e){y.Redirects["fade"+e]=function(t,n,r,o,s,a){var l=p.extend({},n),u=l.complete,c={opacity:"In"===e?1:0};0!==r&&(l.begin=null),l.complete=r!==o-1?null:function(){u&&u.call(s,s),a&&a.resolver(s)},l.display===i&&(l.display="In"===e?"auto":"none"),y(this,c,l)}}),y)}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)})},function(t,e){(function(e){t.exports=e}).call(e,{})},function(t,e){"use strict";function n(t){return"number"==typeof t&&isFinite(t)}
function i(t){return"number"==typeof t&&t%1==0}function r(t){return!(t<=0||t>0)}Object.defineProperty(e,"__esModule",{value:!0}),e.isNumber=n,e.isInteger=i,e.isNaN=r},function(t,e,n){!function(){function n(){return{keys:Object.keys||function(t){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError("keys() called on a non-object");var e,n=[];for(e in t)t.hasOwnProperty(e)&&(n[n.length]=e);return n},uniqueId:function(t){var e=++s+"";return t?t+e:e},has:function(t,e){return r.call(t,e)},each:function(t,e,n){var r,o,s;if(null!=t)if(i&&t.forEach===i)t.forEach(e,n);else if(t.length===+t.length)for(r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t);else for(s in t)this.has(t,s)&&e.call(n,t[s],s,t)},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var i=Array.prototype.forEach,r=Object.prototype.hasOwnProperty,o=Array.prototype.slice,s=0,a=n(),l={on:function(t,e,n){return c(this,"on",t,[e,n])&&e?(this._events||(this._events={}),(this._events[t]||(this._events[t]=[])).push({callback:e,context:n,ctx:n||this}),this):this},once:function(t,e,n){var i,r;return c(this,"once",t,[e,n])&&e?(i=this,r=a.once(function(){i.off(t,r),e.apply(this,arguments)}),r._callback=e,this.on(t,r,n)):this},off:function(t,e,n){var i,r,o,s,l,u,h,f;if(!this._events||!c(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(s=t?[t]:a.keys(this._events),l=0,u=s.length;l<u;l++)if(t=s[l],o=this._events[t]){if(this._events[t]=i=[],e||n)for(h=0,f=o.length;h<f;h++)r=o[h],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&i.push(r);i.length||delete this._events[t]}return this},trigger:function(t){var e,n,i;return this._events?(e=o.call(arguments,1),c(this,"trigger",t,e)?(n=this._events[t],i=this._events.all,n&&h(n,e),i&&h(i,arguments),this):this):this},stopListening:function(t,e,n){var i,r,o=this._listeners;if(!o)return this;i=!e&&!n,"object"==typeof e&&(n=this),t&&((o={})[t._listenerId]=t);for(r in o)o[r].off(e,n,this),i&&delete this._listeners[r];return this}},u=/\s+/,c=function(t,e,n,i){var r,o,s,a;if(!n)return!0;if("object"==typeof n){for(r in n)t[e].apply(t,[r,n[r]].concat(i));return!1}if(u.test(n)){for(o=n.split(u),s=0,a=o.length;s<a;s++)t[e].apply(t,[o[s]].concat(i));return!1}return!0},h=function(t,e){var n,i=-1,r=t.length,o=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++i<r;)(n=t[i]).callback.call(n.ctx);return;case 1:for(;++i<r;)(n=t[i]).callback.call(n.ctx,o);return;case 2:for(;++i<r;)(n=t[i]).callback.call(n.ctx,o,s);return;case 3:for(;++i<r;)(n=t[i]).callback.call(n.ctx,o,s,a);return;default:for(;++i<r;)(n=t[i]).callback.apply(n.ctx,e)}},f={listenTo:"on",listenToOnce:"once"};a.each(f,function(t,e){l[e]=function(e,n,i){return(this._listeners||(this._listeners={}))[e._listenerId||(e._listenerId=a.uniqueId("l"))]=e,"object"==typeof n&&(i=this),e[t](n,i,this),this}}),l.bind=l.on,l.unbind=l.off,l.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return a.each(e,function(e){t[e]=this[e]},this),
t},void 0!==t&&t.exports&&(e=t.exports=l),e.BackboneEvents=l}()},,,function(t,e,n){var i=n(82);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=i(t))throw TypeError(e);return+t}},function(t,e,n){"use strict";var i=n(100),r=n(135),o=n(62);t.exports=[].copyWithin||function(t,e){var n=i(this),s=o(n.length),a=r(t,s),l=r(e,s),u=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===u?s:r(u,s))-l,s-a),h=1;for(l<a&&a<l+c&&(h=-1,l+=c-1,a+=c-1);c-- >0;)l in n?n[a]=n[l]:delete n[a],a+=h,l+=h;return n}},function(t,e,n){"use strict";var i=n(100),r=n(135),o=n(62);t.exports=function(t){for(var e=i(this),n=o(e.length),s=arguments.length,a=r(s>1?arguments[1]:void 0,n),l=s>2?arguments[2]:void 0,u=void 0===l?n:r(l,n);u>a;)e[a++]=t;return e}},function(t,e,n){var i=n(29),r=n(236),o=n(22)("species");t.exports=function(t){var e;return r(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!r(e.prototype)||(e=void 0),i(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var i=n(393);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,n){"use strict";var i=n(94),r=n(29),o=n(234),s=[].slice,a={},l=function(t,e,n){if(!(e in a)){for(var i=[],r=0;r<e;r++)i[r]="a["+r+"]";a[e]=Function("F,a","return new F("+i.join(",")+")")}return a[e](t,n)};t.exports=Function.bind||function(t){var e=i(this),n=s.call(arguments,1),a=function(){var i=n.concat(s.call(arguments));return this instanceof a?l(e,i.length,i):o(e,i,t)};return r(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e,n){"use strict";var i=n(18),r=n(111),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return r(i(this),t!=o)}},function(t,e,n){var i=n(98),r=n(134),o=n(109);t.exports=function(t){var e,n,s,a,l=i(t),u=r.f;if(u)for(e=u(t),n=o.f,s=0;e.length>s;)n.call(t,a=e[s++])&&l.push(a);return l}},function(t,e,n){"use strict";var i=n(18);t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var i=n(29),r=n(180).set;t.exports=function(t,e,n){var o,s=e.constructor;return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&i(o)&&r&&r(t,o),t}},function(t,e,n){var i=n(29),r=n(82),o=n(22)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},function(t,e,n){var i=n(98),r=n(61);t.exports=function(t,e){for(var n,o=r(t),s=i(o),a=s.length,l=0;a>l;)if(o[n=s[l++]]===e)return n}},function(t,e,n){var i=n(20),r=n(246).set,o=i.MutationObserver||i.WebKitMutationObserver,s=i.process,a=i.Promise,l="process"==n(82)(s);t.exports=function(){var t,e,n,u,c,h,f=function(){var i,r;for(l&&(i=s.domain)&&i.exit();t;){r=t.fn,t=t.next;try{r()}catch(i){throw t?n():e=void 0,i}}e=void 0,i&&i.enter()};return l?n=function(){s.nextTick(f)}:o?(u=!0,c=document.createTextNode(""),new o(f).observe(c,{characterData:!0}),n=function(){c.data=u=!u}):a&&a.resolve?(h=a.resolve(),n=function(){h.then(f)}):n=function(){r.call(i,f)},function(i){var r={fn:i,next:void 0};e&&(e.next=r),t||(t=r,
n()),e=r}}},function(t,e,n){"use strict";var i=n(98),r=n(134),o=n(109),s=n(100),a=n(172),l=Object.assign;t.exports=!l||n(37)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var n,l,u,c,h,f=s(t),d=arguments.length,p=1,g=r.f,m=o.f;d>p;)for(n=a(arguments[p++]),l=g?i(n).concat(g(n)):i(n),u=l.length,c=0;u>c;)m.call(n,h=l[c++])&&(f[h]=n[h]);return f}:l},function(t,e,n){var i=n(38),r=n(18),o=n(98);t.exports=n(55)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,l=0;a>l;)i.f(t,n=s[l++],e[n]);return t}},function(t,e,n){var i=n(61),r=n(178).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return r(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):r(i(t))}},function(t,e,n){var i=n(178),r=n(134),o=n(18),s=n(20).Reflect;t.exports=s&&s.ownKeys||function(t){var e=i.f(o(t)),n=r.f;return n?e.concat(n(t)):e}},function(t,e,n){var i=n(20).parseFloat,r=n(245).trim;t.exports=1/i(n(185)+"-0")!=-1/0?function(t){var e=r(t+"",3),n=i(e);return 0===n&&"-"==e.charAt(0)?-0:n}:i},function(t,e,n){var i=n(20).parseInt,r=n(245).trim,o=n(185),s=/^[\-+]?0[xX]/;t.exports=8!==i(o+"08")||22!==i(o+"0x16")?function(t,e){var n=r(t+"",3);return i(n,e>>>0||(s.test(n)?16:10))}:i},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){var i=n(18),r=n(94),o=n(22)("species");t.exports=function(t,e){var n,s=i(t).constructor;return void 0===s||void 0==(n=i(s)[o])?e:r(n)}},function(t,e,n){"use strict";var i=n(136),r=n(83);t.exports=function(t){var e=r(this)+"",n="",o=i(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var i=n(20),r=n(96),o=n(132),s=n(247),a=n(38).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){var i=n(4);i(i.P,"Array",{copyWithin:n(391)}),n(95)("copyWithin")},function(t,e,n){var i=n(4);i(i.P,"Array",{fill:n(392)}),n(95)("fill")},function(t,e,n){"use strict";var i=n(4),r=n(227)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),i(i.P+i.F*s,"Array",{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(95)(o)},function(t,e,n){"use strict";var i=n(4),r=n(227)(5),o="find",s=!0;o in[]&&Array(1)[o](function(){s=!1}),i(i.P+i.F*s,"Array",{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(95)(o)},function(t,e,n){"use strict";var i=n(74),r=n(4),o=n(100),s=n(238),a=n(235),l=n(62),u=n(231),c=n(248);r(r.S+r.F*!n(174)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,r,h,f=o(t),d="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g,y=0,v=c(f);if(m&&(g=i(g,p>2?arguments[2]:void 0,2)),void 0==v||d==Array&&a(v))for(e=l(f.length),
n=new d(e);e>y;y++)u(n,y,m?g(f[y],y):f[y]);else for(h=v.call(f),n=new d;!(r=h.next()).done;y++)u(n,y,m?s(h,g,[r.value,y],!0):r.value);return n.length=y,n}})},function(t,e,n){"use strict";var i=n(95),r=n(240),o=n(131),s=n(61);t.exports=n(173)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){"use strict";var i=n(4),r=n(231);i(i.S+i.F*n(37)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)r(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){n(181)("Array")},function(t,e,n){var i=n(22)("toPrimitive"),r=Date.prototype;i in r||n(84)(r,i,n(396))},function(t,e,n){var i=Date.prototype,r="Invalid Date",o="toString",s=i[o],a=i.getTime;new Date(NaN)+""!=r&&n(99)(i,o,function(){var t=a.call(this);return t===t?s.call(this):r})},function(t,e,n){"use strict";var i=n(29),r=n(108),o=n(22)("hasInstance"),s=Function.prototype;o in s||n(38).f(s,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var i=n(38).f,r=n(85),o=n(51),s=Function.prototype,a=/^\s*function ([^ (]*)/,l="name",u=Object.isExtensible||function(){return!0};l in s||n(55)&&i(s,l,{configurable:!0,get:function(){try{var t=this,e=(""+t).match(a)[1];return o(t,l)||!u(t)||i(t,l,r(5,e)),e}catch(t){return""}}})},function(t,e,n){"use strict";var i=n(229);t.exports=n(230)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=i.getEntry(this,t);return e&&e.v},set:function(t,e){return i.def(this,0===t?0:t,e)}},i,!0)},function(t,e,n){var i=n(4),r=n(241),o=Math.sqrt,s=Math.acosh;i(i.S+i.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:r(t-1+o(t-1)*o(t+1))}})},function(t,e,n){function i(t){return isFinite(t=+t)&&0!=t?t<0?-i(-t):Math.log(t+Math.sqrt(t*t+1)):t}var r=n(4),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:i})},function(t,e,n){var i=n(4),r=Math.atanh;i(i.S+i.F*!(r&&1/r(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var i=n(4),r=n(176);i(i.S,"Math",{cbrt:function(t){return r(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var i=n(4);i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var i=n(4),r=Math.exp;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},function(t,e,n){var i=n(4),r=n(175);i(i.S+i.F*(r!=Math.expm1),"Math",{expm1:r})},function(t,e,n){var i=n(4),r=n(176),o=Math.pow,s=o(2,-52),a=o(2,-23),l=o(2,127)*(2-a),u=o(2,-126),c=function(t){return t+1/s-1/s};i(i.S,"Math",{fround:function(t){
var e,n,i=Math.abs(t),o=r(t);return i<u?o*c(i/u/a)*u*a:(e=(1+a/s)*i,n=e-(e-i),n>l||n!=n?o*(1/0):o*n)}})},function(t,e,n){var i=n(4),r=Math.abs;i(i.S,"Math",{hypot:function(t,e){for(var n,i,o=0,s=0,a=arguments.length,l=0;s<a;)n=r(arguments[s++]),l<n?(i=l/n,o=o*i*i+1,l=n):n>0?(i=n/l,o+=i*i):o+=n;return l===1/0?1/0:l*Math.sqrt(o)}})},function(t,e,n){var i=n(4),r=Math.imul;i(i.S+i.F*n(37)(function(){return-5!=r(4294967295,5)||2!=r.length}),"Math",{imul:function(t,e){var n=65535,i=+t,r=+e,o=n&i,s=n&r;return 0|o*s+((n&i>>>16)*s+o*(n&r>>>16)<<16>>>0)}})},function(t,e,n){var i=n(4);i(i.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},function(t,e,n){var i=n(4);i(i.S,"Math",{log1p:n(241)})},function(t,e,n){var i=n(4);i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var i=n(4);i(i.S,"Math",{sign:n(176)})},function(t,e,n){var i=n(4),r=n(175),o=Math.exp;i(i.S+i.F*n(37)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(r(t)-r(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var i=n(4),r=n(175),o=Math.exp;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var i=n(4);i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var i=n(4);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var i=n(4),r=n(20).isFinite;i(i.S,"Number",{isFinite:function(t){return"number"==typeof t&&r(t)}})},function(t,e,n){var i=n(4);i(i.S,"Number",{isInteger:n(237)})},function(t,e,n){var i=n(4);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var i=n(4),r=n(237),o=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},function(t,e,n){var i=n(4);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var i=n(4);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var i=n(4),r=n(407);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(4),r=n(408);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,e,n){"use strict";var i=n(4),r=n(37),o=n(390),s=1..toPrecision;i(i.P+i.F*(r(function(){return"1"!==s.call(1,void 0)})||!r(function(){s.call({})})),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,n){var i=n(4);i(i.S+i.F,"Object",{assign:n(403)})},function(t,e,n){var i=n(4);i(i.S,"Object",{is:n(409)})},function(t,e,n){var i=n(4);i(i.S,"Object",{setPrototypeOf:n(180).set})},function(t,e,n){"use strict";var i,r,o,s,a,l,u,c,h,f,d,p,g,m,y,v,b,_=n(132),w=n(20),x=n(74),k=n(228),S=n(4),M=n(29),D=n(94),T=n(167),C=n(171),P=n(410),O=n(246).set,E=n(402)(),N="Promise",L=w.TypeError,A=w.process,I=w[N];A=w.process,i="process"==k(A),r=function(){},l=!!function(){try{var t=I.resolve(1),e=(t.constructor={})[n(22)("species")]=function(t){t(r,r)};return(i||"function"==typeof PromiseRejectionEvent)&&t.then(r)instanceof e}catch(t){}}(),u=function(t,e){
n()),e=r}}},function(t,e,n){"use strict";var i=n(98),r=n(134),o=n(109),s=n(100),a=n(172),l=Object.assign;t.exports=!l||n(38)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var n,l,u,c,h,f=s(t),d=arguments.length,p=1,g=r.f,m=o.f;d>p;)for(n=a(arguments[p++]),l=g?i(n).concat(g(n)):i(n),u=l.length,c=0;u>c;)m.call(n,h=l[c++])&&(f[h]=n[h]);return f}:l},function(t,e,n){var i=n(39),r=n(18),o=n(98);t.exports=n(55)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,l=0;a>l;)i.f(t,n=s[l++],e[n]);return t}},function(t,e,n){var i=n(61),r=n(178).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return r(t)}catch(t){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):r(i(t))}},function(t,e,n){var i=n(178),r=n(134),o=n(18),s=n(20).Reflect;t.exports=s&&s.ownKeys||function(t){var e=i.f(o(t)),n=r.f;return n?e.concat(n(t)):e}},function(t,e,n){var i=n(20).parseFloat,r=n(245).trim;t.exports=1/i(n(185)+"-0")!=-1/0?function(t){var e=r(t+"",3),n=i(e);return 0===n&&"-"==e.charAt(0)?-0:n}:i},function(t,e,n){var i=n(20).parseInt,r=n(245).trim,o=n(185),s=/^[\-+]?0[xX]/;t.exports=8!==i(o+"08")||22!==i(o+"0x16")?function(t,e){var n=r(t+"",3);return i(n,e>>>0||(s.test(n)?16:10))}:i},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){var i=n(18),r=n(94),o=n(22)("species");t.exports=function(t,e){var n,s=i(t).constructor;return void 0===s||void 0==(n=i(s)[o])?e:r(n)}},function(t,e,n){"use strict";var i=n(136),r=n(83);t.exports=function(t){var e=r(this)+"",n="",o=i(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var i=n(20),r=n(96),o=n(132),s=n(247),a=n(39).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){var i=n(4);i(i.P,"Array",{copyWithin:n(391)}),n(95)("copyWithin")},function(t,e,n){var i=n(4);i(i.P,"Array",{fill:n(392)}),n(95)("fill")},function(t,e,n){"use strict";var i=n(4),r=n(227)(6),o="findIndex",s=!0;o in[]&&Array(1)[o](function(){s=!1}),i(i.P+i.F*s,"Array",{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(95)(o)},function(t,e,n){"use strict";var i=n(4),r=n(227)(5),o="find",s=!0;o in[]&&Array(1)[o](function(){s=!1}),i(i.P+i.F*s,"Array",{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(95)(o)},function(t,e,n){"use strict";var i=n(74),r=n(4),o=n(100),s=n(238),a=n(235),l=n(62),u=n(231),c=n(248);r(r.S+r.F*!n(174)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,r,h,f=o(t),d="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g,y=0,v=c(f);if(m&&(g=i(g,p>2?arguments[2]:void 0,2)),void 0==v||d==Array&&a(v))for(e=l(f.length),
n=new d(e);e>y;y++)u(n,y,m?g(f[y],y):f[y]);else for(h=v.call(f),n=new d;!(r=h.next()).done;y++)u(n,y,m?s(h,g,[r.value,y],!0):r.value);return n.length=y,n}})},function(t,e,n){"use strict";var i=n(95),r=n(240),o=n(131),s=n(61);t.exports=n(173)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):"keys"==e?r(0,n):"values"==e?r(0,t[n]):r(0,[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){"use strict";var i=n(4),r=n(231);i(i.S+i.F*n(38)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)r(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){n(181)("Array")},function(t,e,n){var i=n(22)("toPrimitive"),r=Date.prototype;i in r||n(84)(r,i,n(396))},function(t,e,n){var i=Date.prototype,r="Invalid Date",o="toString",s=i[o],a=i.getTime;new Date(NaN)+""!=r&&n(99)(i,o,function(){var t=a.call(this);return t===t?s.call(this):r})},function(t,e,n){"use strict";var i=n(29),r=n(108),o=n(22)("hasInstance"),s=Function.prototype;o in s||n(39).f(s,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var i=n(39).f,r=n(85),o=n(51),s=Function.prototype,a=/^\s*function ([^ (]*)/,l="name",u=Object.isExtensible||function(){return!0};l in s||n(55)&&i(s,l,{configurable:!0,get:function(){try{var t=this,e=(""+t).match(a)[1];return o(t,l)||!u(t)||i(t,l,r(5,e)),e}catch(t){return""}}})},function(t,e,n){"use strict";var i=n(229);t.exports=n(230)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=i.getEntry(this,t);return e&&e.v},set:function(t,e){return i.def(this,0===t?0:t,e)}},i,!0)},function(t,e,n){var i=n(4),r=n(241),o=Math.sqrt,s=Math.acosh;i(i.S+i.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:r(t-1+o(t-1)*o(t+1))}})},function(t,e,n){function i(t){return isFinite(t=+t)&&0!=t?t<0?-i(-t):Math.log(t+Math.sqrt(t*t+1)):t}var r=n(4),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:i})},function(t,e,n){var i=n(4),r=Math.atanh;i(i.S+i.F*!(r&&1/r(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var i=n(4),r=n(176);i(i.S,"Math",{cbrt:function(t){return r(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var i=n(4);i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var i=n(4),r=Math.exp;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},function(t,e,n){var i=n(4),r=n(175);i(i.S+i.F*(r!=Math.expm1),"Math",{expm1:r})},function(t,e,n){var i=n(4),r=n(176),o=Math.pow,s=o(2,-52),a=o(2,-23),l=o(2,127)*(2-a),u=o(2,-126),c=function(t){return t+1/s-1/s};i(i.S,"Math",{fround:function(t){
var e,n,i=Math.abs(t),o=r(t);return i<u?o*c(i/u/a)*u*a:(e=(1+a/s)*i,n=e-(e-i),n>l||n!=n?o*(1/0):o*n)}})},function(t,e,n){var i=n(4),r=Math.abs;i(i.S,"Math",{hypot:function(t,e){for(var n,i,o=0,s=0,a=arguments.length,l=0;s<a;)n=r(arguments[s++]),l<n?(i=l/n,o=o*i*i+1,l=n):n>0?(i=n/l,o+=i*i):o+=n;return l===1/0?1/0:l*Math.sqrt(o)}})},function(t,e,n){var i=n(4),r=Math.imul;i(i.S+i.F*n(38)(function(){return-5!=r(4294967295,5)||2!=r.length}),"Math",{imul:function(t,e){var n=65535,i=+t,r=+e,o=n&i,s=n&r;return 0|o*s+((n&i>>>16)*s+o*(n&r>>>16)<<16>>>0)}})},function(t,e,n){var i=n(4);i(i.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},function(t,e,n){var i=n(4);i(i.S,"Math",{log1p:n(241)})},function(t,e,n){var i=n(4);i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var i=n(4);i(i.S,"Math",{sign:n(176)})},function(t,e,n){var i=n(4),r=n(175),o=Math.exp;i(i.S+i.F*n(38)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(r(t)-r(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var i=n(4),r=n(175),o=Math.exp;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var i=n(4);i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var i=n(4);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var i=n(4),r=n(20).isFinite;i(i.S,"Number",{isFinite:function(t){return"number"==typeof t&&r(t)}})},function(t,e,n){var i=n(4);i(i.S,"Number",{isInteger:n(237)})},function(t,e,n){var i=n(4);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var i=n(4),r=n(237),o=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},function(t,e,n){var i=n(4);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var i=n(4);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var i=n(4),r=n(407);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(4),r=n(408);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,e,n){"use strict";var i=n(4),r=n(38),o=n(390),s=1..toPrecision;i(i.P+i.F*(r(function(){return"1"!==s.call(1,void 0)})||!r(function(){s.call({})})),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,n){var i=n(4);i(i.S+i.F,"Object",{assign:n(403)})},function(t,e,n){var i=n(4);i(i.S,"Object",{is:n(409)})},function(t,e,n){var i=n(4);i(i.S,"Object",{setPrototypeOf:n(180).set})},function(t,e,n){"use strict";var i,r,o,s,a,l,u,c,h,f,d,p,g,m,y,v,b,_=n(132),w=n(20),x=n(74),k=n(228),S=n(4),M=n(29),D=n(94),T=n(167),C=n(171),P=n(410),O=n(246).set,E=n(402)(),N="Promise",L=w.TypeError,A=w.process,I=w[N];A=w.process,i="process"==k(A),r=function(){},l=!!function(){try{var t=I.resolve(1),e=(t.constructor={})[n(22)("species")]=function(t){t(r,r)};return(i||"function"==typeof PromiseRejectionEvent)&&t.then(r)instanceof e}catch(t){}}(),u=function(t,e){
return t===e||t===I&&e===a},c=function(t){var e;return!(!M(t)||"function"!=typeof(e=t.then))&&e},h=function(t){return u(I,t)?new f(t):new s(t)},f=s=function(t){var e,n;this.promise=new t(function(t,i){if(void 0!==e||void 0!==n)throw L("Bad Promise constructor");e=t,n=i}),this.resolve=D(e),this.reject=D(n)},d=function(t){try{t()}catch(t){return{error:t}}},p=function(t,e){if(!t._n){t._n=!0;var n=t._c;E(function(){for(var i=t._v,r=1==t._s,o=0,s=function(e){var n,o,s=r?e.ok:e.fail,a=e.resolve,l=e.reject,u=e.domain;try{s?(r||(2==t._h&&y(t),t._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&u.exit()),n===e.promise?l(L("Promise-chain cycle")):(o=c(n))?o.call(n,a,l):a(n)):l(i)}catch(t){l(t)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&g(t)})}},g=function(t){O.call(w,function(){var e,n,r,o=t._v;if(m(t)&&(e=d(function(){i?A.emit("unhandledRejection",o,t):(n=w.onunhandledrejection)?n({promise:t,reason:o}):(r=w.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=i||m(t)?2:1),t._a=void 0,e)throw e.error})},m=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,i=0;n.length>i;)if(e=n[i++],e.fail||!m(e.promise))return!1;return!0},y=function(t){O.call(w,function(){var e;i?A.emit("rejectionHandled",t):(e=w.onrejectionhandled)&&e({promise:t,reason:t._v})})},v=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),p(e,!0))},b=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw L("Promise can't be resolved itself");(e=c(t))?E(function(){var i={_w:n,_d:!1};try{e.call(t,x(b,i,1),x(v,i,1))}catch(t){v.call(i,t)}}):(n._v=t,n._s=1,p(n,!1))}catch(t){v.call({_w:n,_d:!1},t)}}},l||(I=function(t){T(this,I,N,"_h"),D(t),o.call(this);try{t(x(b,this,1),x(v,this,1))}catch(t){v.call(this,t)}},o=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},o.prototype=n(179)(I.prototype,{then:function(t,e){var n=h(P(this,I));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=i?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&p(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),f=function(){var t=new o;this.promise=t,this.resolve=x(b,t,1),this.reject=x(v,t,1)}),S(S.G+S.W+S.F*!l,{Promise:I}),n(110)(I,N),n(181)(N),a=n(96)[N],S(S.S+S.F*!l,N,{reject:function(t){var e=h(this);return(0,e.reject)(t),e.promise}}),S(S.S+S.F*(_||!l),N,{resolve:function(t){if(t instanceof I&&u(t.constructor,this))return t;var e=h(this);return(0,e.resolve)(t),e.promise}}),S(S.S+S.F*!(l&&n(174)(function(t){I.all(t).catch(r)})),N,{all:function(t){var e=this,n=h(e),i=n.resolve,r=n.reject,o=d(function(){var n=[],o=0,s=1;C(t,!1,function(t){var a=o++,l=!1;n.push(void 0),s++,e.resolve(t).then(function(t){l||(l=!0,n[a]=t,--s||i(n))},r)}),--s||i(n)});return o&&r(o.error),n.promise},race:function(t){var e=this,n=h(e),i=n.reject,r=d(function(){C(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r&&i(r.error),n.promise}})},function(t,e,n){var i=n(4),r=n(94),o=n(18),s=(n(20).Reflect||{}).apply,a=Function.apply
;i(i.S+i.F*!n(37)(function(){s(function(){})}),"Reflect",{apply:function(t,e,n){var i=r(t),l=o(n);return s?s(i,e,l):a.call(i,e,l)}})},function(t,e,n){var i=n(4),r=n(133),o=n(94),s=n(18),a=n(29),l=n(37),u=n(395),c=(n(20).Reflect||{}).construct,h=l(function(){function t(){}return!(c(function(){},[],t)instanceof t)}),f=!l(function(){c(function(){})});i(i.S+i.F*(h||f),"Reflect",{construct:function(t,e){var n,i,l,d,p;if(o(t),s(e),n=arguments.length<3?t:o(arguments[2]),f&&!h)return c(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}return i=[null],i.push.apply(i,e),new(u.apply(t,i))}return l=n.prototype,d=r(a(l)?l:Object.prototype),p=Function.apply.call(t,d,e),a(p)?p:d}})},function(t,e,n){var i=n(38),r=n(4),o=n(18),s=n(111);r(r.S+r.F*n(37)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return i.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var i=n(4),r=n(97).f,o=n(18);i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var i=n(4),r=n(18),o=function(t){this._t=r(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(239)(o,"Object",function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}}),i(i.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){var i=n(97),r=n(4),o=n(18);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.f(o(t),e)}})},function(t,e,n){var i=n(4),r=n(108),o=n(18);i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){function i(t,e){var n,a,c=arguments.length<3?t:arguments[2];return u(t)===c?t[e]:(n=r.f(t,e))?s(n,"value")?n.value:void 0!==n.get?n.get.call(c):void 0:l(a=o(t))?i(a,e,c):void 0}var r=n(97),o=n(108),s=n(51),a=n(4),l=n(29),u=n(18);a(a.S,"Reflect",{get:i})},function(t,e,n){var i=n(4);i(i.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var i=n(4),r=n(18),o=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){var i=n(4);i(i.S,"Reflect",{ownKeys:n(406)})},function(t,e,n){var i=n(4),r=n(18),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){var i=n(4),r=n(180);r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){function i(t,e,n){var l,f,d=arguments.length<4?t:arguments[3],p=o.f(c(t),e);if(!p){if(h(f=s(t)))return i(f,e,n,d);p=u(0)}return a(p,"value")?!(!1===p.writable||!h(d))&&(l=o.f(d,e)||u(0),l.value=n,r.f(d,e,l),!0):void 0!==p.set&&(p.set.call(d,n),!0)}var r=n(38),o=n(97),s=n(108),a=n(51),l=n(4),u=n(85),c=n(18),h=n(29);l(l.S,"Reflect",{set:i})},function(t,e,n){n(55)&&"g"!=/./g.flags&&n(38).f(RegExp.prototype,"flags",{
configurable:!0,get:n(398)})},function(t,e,n){"use strict";var i=n(229);t.exports=n(230)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return i.def(this,t=0===t?0:t,t)}},i)},function(t,e,n){"use strict";var i=n(4),r=n(244)(!1);i(i.P,"String",{codePointAt:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(4),r=n(62),o=n(184),s="endsWith",a=""[s];i(i.P+i.F*n(170)(s),"String",{endsWith:function(t){var e=o(this,t,s),n=arguments.length>1?arguments[1]:void 0,i=r(e.length),l=void 0===n?i:Math.min(r(n),i),u=t+"";return a?a.call(e,u,l):e.slice(l-u.length,l)===u}})},function(t,e,n){var i=n(4),r=n(135),o=String.fromCharCode,s=String.fromCodePoint;i(i.S+i.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,s=0;i>s;){if(e=+arguments[s++],r(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";var i=n(4),r=n(184),o="includes";i(i.P+i.F*n(170)(o),"String",{includes:function(t){return!!~r(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var i=n(244)(!0);n(173)(String,"String",function(t){this._t=t+"",this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var i=n(4),r=n(61),o=n(62);i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,s=[],a=0;n>a;)s.push(e[a++]+""),a<i&&s.push(arguments[a]+"");return s.join("")}})},function(t,e,n){var i=n(4);i(i.P,"String",{repeat:n(411)})},function(t,e,n){"use strict";var i=n(4),r=n(62),o=n(184),s="startsWith",a=""[s];i(i.P+i.F*n(170)(s),"String",{startsWith:function(t){var e=o(this,t,s),n=r(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),i=t+"";return a?a.call(e,i,n):e.slice(n,n+i.length)===i}})},function(t,e,n){"use strict";var i,r,o=n(20),s=n(51),a=n(55),l=n(4),u=n(99),c=n(177).KEY,h=n(37),f=n(183),d=n(110),p=n(112),g=n(22),m=n(247),y=n(412),v=n(401),b=n(397),_=n(236),w=n(18),x=n(61),k=n(111),S=n(85),M=n(133),D=n(405),T=n(97),C=n(38),P=n(98),O=T.f,E=C.f,N=D.f,L=o.Symbol,A=o.JSON,I=A&&A.stringify,j="prototype",F=g("_hidden"),H=g("toPrimitive"),Y={}.propertyIsEnumerable,z=f("symbol-registry"),R=f("symbols"),W=f("op-symbols"),V=Object[j],B="function"==typeof L,U=o.QObject,q=!U||!U[j]||!U[j].findChild,$=a&&h(function(){return 7!=M(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=O(V,e);i&&delete V[e],E(t,e,n),i&&t!==V&&E(V,e,i)}:E,G=function(t){var e=R[t]=M(L[j]);return e._k=t,e},X=B&&"symbol"==typeof L.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof L},K=function(t,e,n){return t===V&&K(W,e,n),w(t),e=k(e,!0),w(n),s(R,e)?(n.enumerable?(s(t,F)&&t[F][e]&&(t[F][e]=!1),n=M(n,{enumerable:S(0,!1)})):(s(t,F)||E(t,F,S(1,{})),t[F][e]=!0),$(t,e,n)):E(t,e,n)},Q=function(t,e){w(t)
;i(i.S+i.F*!n(38)(function(){s(function(){})}),"Reflect",{apply:function(t,e,n){var i=r(t),l=o(n);return s?s(i,e,l):a.call(i,e,l)}})},function(t,e,n){var i=n(4),r=n(133),o=n(94),s=n(18),a=n(29),l=n(38),u=n(395),c=(n(20).Reflect||{}).construct,h=l(function(){function t(){}return!(c(function(){},[],t)instanceof t)}),f=!l(function(){c(function(){})});i(i.S+i.F*(h||f),"Reflect",{construct:function(t,e){var n,i,l,d,p;if(o(t),s(e),n=arguments.length<3?t:o(arguments[2]),f&&!h)return c(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}return i=[null],i.push.apply(i,e),new(u.apply(t,i))}return l=n.prototype,d=r(a(l)?l:Object.prototype),p=Function.apply.call(t,d,e),a(p)?p:d}})},function(t,e,n){var i=n(39),r=n(4),o=n(18),s=n(111);r(r.S+r.F*n(38)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return i.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var i=n(4),r=n(97).f,o=n(18);i(i.S,"Reflect",{deleteProperty:function(t,e){var n=r(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var i=n(4),r=n(18),o=function(t){this._t=r(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(239)(o,"Object",function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}}),i(i.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){var i=n(97),r=n(4),o=n(18);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.f(o(t),e)}})},function(t,e,n){var i=n(4),r=n(108),o=n(18);i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){function i(t,e){var n,a,c=arguments.length<3?t:arguments[2];return u(t)===c?t[e]:(n=r.f(t,e))?s(n,"value")?n.value:void 0!==n.get?n.get.call(c):void 0:l(a=o(t))?i(a,e,c):void 0}var r=n(97),o=n(108),s=n(51),a=n(4),l=n(29),u=n(18);a(a.S,"Reflect",{get:i})},function(t,e,n){var i=n(4);i(i.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var i=n(4),r=n(18),o=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){var i=n(4);i(i.S,"Reflect",{ownKeys:n(406)})},function(t,e,n){var i=n(4),r=n(18),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){var i=n(4),r=n(180);r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){function i(t,e,n){var l,f,d=arguments.length<4?t:arguments[3],p=o.f(c(t),e);if(!p){if(h(f=s(t)))return i(f,e,n,d);p=u(0)}return a(p,"value")?!(!1===p.writable||!h(d))&&(l=o.f(d,e)||u(0),l.value=n,r.f(d,e,l),!0):void 0!==p.set&&(p.set.call(d,n),!0)}var r=n(39),o=n(97),s=n(108),a=n(51),l=n(4),u=n(85),c=n(18),h=n(29);l(l.S,"Reflect",{set:i})},function(t,e,n){n(55)&&"g"!=/./g.flags&&n(39).f(RegExp.prototype,"flags",{
configurable:!0,get:n(398)})},function(t,e,n){"use strict";var i=n(229);t.exports=n(230)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return i.def(this,t=0===t?0:t,t)}},i)},function(t,e,n){"use strict";var i=n(4),r=n(244)(!1);i(i.P,"String",{codePointAt:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(4),r=n(62),o=n(184),s="endsWith",a=""[s];i(i.P+i.F*n(170)(s),"String",{endsWith:function(t){var e=o(this,t,s),n=arguments.length>1?arguments[1]:void 0,i=r(e.length),l=void 0===n?i:Math.min(r(n),i),u=t+"";return a?a.call(e,u,l):e.slice(l-u.length,l)===u}})},function(t,e,n){var i=n(4),r=n(135),o=String.fromCharCode,s=String.fromCodePoint;i(i.S+i.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,s=0;i>s;){if(e=+arguments[s++],r(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";var i=n(4),r=n(184),o="includes";i(i.P+i.F*n(170)(o),"String",{includes:function(t){return!!~r(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var i=n(244)(!0);n(173)(String,"String",function(t){this._t=t+"",this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var i=n(4),r=n(61),o=n(62);i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,s=[],a=0;n>a;)s.push(e[a++]+""),a<i&&s.push(arguments[a]+"");return s.join("")}})},function(t,e,n){var i=n(4);i(i.P,"String",{repeat:n(411)})},function(t,e,n){"use strict";var i=n(4),r=n(62),o=n(184),s="startsWith",a=""[s];i(i.P+i.F*n(170)(s),"String",{startsWith:function(t){var e=o(this,t,s),n=r(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),i=t+"";return a?a.call(e,i,n):e.slice(n,n+i.length)===i}})},function(t,e,n){"use strict";var i,r,o=n(20),s=n(51),a=n(55),l=n(4),u=n(99),c=n(177).KEY,h=n(38),f=n(183),d=n(110),p=n(112),g=n(22),m=n(247),y=n(412),v=n(401),b=n(397),_=n(236),w=n(18),x=n(61),k=n(111),S=n(85),M=n(133),D=n(405),T=n(97),C=n(39),P=n(98),O=T.f,E=C.f,N=D.f,L=o.Symbol,A=o.JSON,I=A&&A.stringify,j="prototype",F=g("_hidden"),H=g("toPrimitive"),Y={}.propertyIsEnumerable,z=f("symbol-registry"),R=f("symbols"),W=f("op-symbols"),V=Object[j],B="function"==typeof L,U=o.QObject,q=!U||!U[j]||!U[j].findChild,$=a&&h(function(){return 7!=M(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=O(V,e);i&&delete V[e],E(t,e,n),i&&t!==V&&E(V,e,i)}:E,G=function(t){var e=R[t]=M(L[j]);return e._k=t,e},X=B&&"symbol"==typeof L.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof L},K=function(t,e,n){return t===V&&K(W,e,n),w(t),e=k(e,!0),w(n),s(R,e)?(n.enumerable?(s(t,F)&&t[F][e]&&(t[F][e]=!1),n=M(n,{enumerable:S(0,!1)})):(s(t,F)||E(t,F,S(1,{})),t[F][e]=!0),$(t,e,n)):E(t,e,n)},Q=function(t,e){w(t)
;for(var n,i=b(e=x(e)),r=0,o=i.length;o>r;)K(t,n=i[r++],e[n]);return t},J=function(t,e){return void 0===e?M(t):Q(M(t),e)},Z=function(t){var e=Y.call(this,t=k(t,!0));return!(this===V&&s(R,t)&&!s(W,t))&&(!(e||!s(this,t)||!s(R,t)||s(this,F)&&this[F][t])||e)},tt=function(t,e){if(t=x(t),e=k(e,!0),t!==V||!s(R,e)||s(W,e)){var n=O(t,e);return!n||!s(R,e)||s(t,F)&&t[F][e]||(n.enumerable=!0),n}},et=function(t){for(var e,n=N(x(t)),i=[],r=0;n.length>r;)s(R,e=n[r++])||e==F||e==c||i.push(e);return i},nt=function(t){for(var e,n=t===V,i=N(n?W:x(t)),r=[],o=0;i.length>o;)!s(R,e=i[o++])||n&&!s(V,e)||r.push(R[e]);return r};for(B||(L=function(){var t,e;if(this instanceof L)throw TypeError("Symbol is not a constructor!");return t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(W,n),s(this,F)&&s(this[F],t)&&(this[F][t]=!1),$(this,t,S(1,n))},a&&q&&$(V,t,{configurable:!0,set:e}),G(t)},u(L[j],"toString",function(){return this._k}),T.f=tt,C.f=K,n(178).f=D.f=et,n(109).f=Z,n(134).f=nt,a&&!n(132)&&u(V,"propertyIsEnumerable",Z,!0),m.f=function(t){return G(g(t))}),l(l.G+l.W+l.F*!B,{Symbol:L}),i="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),r=0;i.length>r;)g(i[r++]);for(i=P(g.store),r=0;i.length>r;)y(i[r++]);l(l.S+l.F*!B,"Symbol",{for:function(t){return s(z,t+="")?z[t]:z[t]=L(t)},keyFor:function(t){if(X(t))return v(z,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){q=!0},useSimple:function(){q=!1}}),l(l.S+l.F*!B,"Object",{create:J,defineProperty:K,defineProperties:Q,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt}),A&&l(l.S+l.F*(!B||h(function(){var t=L();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!X(t)){for(var e,n,i=[t],r=1;arguments.length>r;)i.push(arguments[r++]);return e=i[1],"function"==typeof e&&(n=e),!n&&_(e)||(e=function(t,e){if(n&&(e=n.call(this,t,e)),!X(e))return e}),i[1]=e,I.apply(A,i)}}}),L[j][H]||n(84)(L[j],H,L[j].valueOf),d(L,"Symbol"),d(Math,"Math",!0),d(o.JSON,"JSON",!0)},function(t,e,n){"use strict";var i=n(4),r=n(226)(!0);i(i.P,"Array",{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(95)("includes")},function(t,e,n){var i=n(4),r=n(243)(!0);i(i.S,"Object",{entries:function(t){return r(t)}})},function(t,e,n){var i=n(4),r=n(243)(!1);i(i.S,"Object",{values:function(t){return r(t)}})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";var n=function(){function t(t,e){this.mouseFlag=!1,this.accuracy=2,this.value=1,this.colorInput=t,this.$el=$('<div class="transparency-slider wide-slider ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">'),e&&this.$el.hide(),this.$gradient=$('<div class="gradient">').appendTo(this.$el),this.$roller=$('<a href="#" class="ui-slider-handle ui-state-default ui-corner-all without-shift-handle-left">').appendTo(this.$gradient)}return t.prototype.calculateRollerPosition=function(t){
var e=t.pageX,n=this.$gradient.offset().left,i=e-n,r=this.$gradient.width();return i>r?100:i<0?0:~~(i/r*100)},t.prototype.toRgb=function(t){var e;return~t.indexOf("#")?t:(e=t.match(/[0-9.]+/g),e?"rgb("+e.slice(0,3).join(", ")+")":"rgb(127, 127, 127)")},t.prototype.setValue=function(t){if(1===t)return void(this.value=t);this.value=t.toFixed(this.accuracy)},t.prototype.updateRoller=function(){this.$roller.css("left",100-100*this.value+"%")},t.prototype.rollerMoveHandler=function(t){if(this.mouseFlag){var e=this.calculateRollerPosition(t);this.setValue((100-e)/100),$(this).trigger("change",[this.val()]),this.$roller.css("left",e+"%")}t.preventDefault()},t.prototype.mouseupHandler=function(t){this.mouseFlag&&(this.mouseFlag=!1,$(this).trigger("afterChange",[this.val()]))},t.prototype.initEvents=function(){var t=function(t){return this.rollerMoveHandler(t)}.bind(this),e=function(n){return $(document).off("mousemove mouseup",t),$(document).off("mouseup",e),this.mouseupHandler(n)}.bind(this);this.$el.on("mousedown",function(n){this.mouseFlag=!0,$(document).on("mousemove mouseup",t),$(document).on("mouseup",e),n.preventDefault()}.bind(this)),this.colorInput.on("change",function(t){this.updateColor()}.bind(this))},t.prototype.removeEvents=function(){},t.prototype.updateColor=function(){var t=this.colorInput.val()||"black",e=this.toRgb(t),n=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];$.browser.msie?this.$gradient.css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr='"+e+"', EndColor=0, GradientType=1)"):n.forEach(function(t){this.$gradient.css("background-image",t.replace(/%COLOR/,e))}.bind(this))},t.prototype.val=function(t){return t&&(this.setValue(+t),this.updateRoller()),this.value},function(e,n){return new t(e,n)}}();t.exports=n},,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,n;if(t&&t.__esModule)return t;if(e={},null!=t)for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e){var n,i,r,o=Object.getOwnPropertyNames(e);for(n=0;n<o.length;n++)i=o[n],(r=Object.getOwnPropertyDescriptor(e,i))&&r.configurable&&void 0===t[i]&&Object.defineProperty(t,i,r);return t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):o(t,e))}
function u(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}var c,h,f,d,p,g,m,y,v;Object.defineProperty(e,"__esModule",{value:!0}),c=Object.assign||function(t){var e,n,i;for(e=1;e<arguments.length;e++){n=arguments[e];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},h=function(){function t(t,e){var n,i,r=[],o=!0,s=!1,a=void 0;try{for(n=t[Symbol.iterator]();!(o=(i=n.next()).done)&&(r.push(i.value),!e||r.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{!o&&n.return&&n.return()}finally{if(s)throw a}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=n(115),d=r(f),p=n(75),g=i(p),m=n(114),y=i(m),v=function(t){function e(n,i,r){var o,l=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];return s(this,e),o=a(this,t.call(this)),o.backend=n,o.store=i,o.services=r,o.options=l,o.logger=g.default.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,l.backend,l),o}return l(e,t),e.prototype.queueLoad=function(t,e,n){var i=this,r=[],o=[],s=[],a=[];return t.forEach(function(t){var n=!0;e.forEach(function(e){var s=t+"|"+e;i.store.hasResourceBundle(t,e)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?o.indexOf(s)<0&&o.push(s):(i.state[s]=1,n=!1,o.indexOf(s)<0&&o.push(s),r.indexOf(s)<0&&r.push(s),a.indexOf(e)<0&&a.push(e)))}),n||s.push(t)}),(r.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:n}),{toLoad:r,pending:o,toLoadLanguages:s,toLoadNamespaces:a}},e.prototype.loaded=function(t,e,n){var i=this,r=t.split("|"),o=h(r,2),s=o[0],a=o[1];e&&this.emit("failedLoading",s,a,e),n&&this.store.addResourceBundle(s,a,n),this.state[t]=e?-1:2,this.queue.forEach(function(n){d.pushPath(n.loaded,[s],a),u(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(n.errors.length?n.callback(n.errors):n.callback(),i.emit("loaded",n.loaded),n.done=!0)}),this.queue=this.queue.filter(function(t){return!t.done})},e.prototype.read=function(t,e,n,i,r,o){var s=this;if(i||(i=0),r||(r=250),!t.length)return o(null,{});this.backend[n](t,e,function(a,l){if(a&&l&&i<5)return void setTimeout(function(){s.read.call(s,t,e,n,++i,2*r,o)},r);o(a,l)})},e.prototype.load=function(t,e,n){var i,r,o=this;return this.backend?(i=c({},this.backend.options,this.options.backend),"string"==typeof t&&(t=this.services.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]),r=this.queueLoad(t,e,n),r.toLoad.length?void(i.allowMultiLoading&&this.backend.readMulti?this.read(r.toLoadLanguages,r.toLoadNamespaces,"readMulti",null,null,function(t,e){t&&o.logger.warn("loading namespaces "+r.toLoadNamespaces.join(", ")+" for languages "+r.toLoadLanguages.join(", ")+" via multiloading failed",t),!t&&e&&o.logger.log("loaded namespaces "+r.toLoadNamespaces.join(", ")+" for languages "+r.toLoadLanguages.join(", ")+" via multiloading",e),r.toLoad.forEach(function(n){var i,r=n.split("|"),s=h(r,2),a=s[0],l=s[1],u=d.getPath(e,[a,l])

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"><link type="text/css" href="bundles/library.2e4e86e4539a260f4a7b69dd55f2595b.css" rel="stylesheet"/></head><body class="chart-page on-widget"><div class="loading-indicator" id="loading-indicator"></div><script src="js/external/spin.min.js"></script><script>var loadingSpinner=new Spinner({lines:17,length:0,width:3,radius:30,scale:1,corners:1,color:"#00A2E2",opacity:0,rotate:0,direction:1,speed:1.5,trail:60,fps:20,zIndex:2000000000,className:"spinner",top:"50%",left:"50%",shadow:false,hwaccel:false}).spin(document.getElementById("loading-indicator"));</script><script>var JSServer={};var __initialEnabledFeaturesets=["charting_library"];</script><script>urlParams=(function(){var e,c=/\+/g,h=/([^&=]+)=?([^&]*)/g,a=function(j){return decodeURIComponent(j.replace(c," ")).replace(/<\/?[^>]+(>|$)/g,"")},f=function(){var k=location.href;var j=k.indexOf("#");if(j>=0){return k.substring(j+1)}else{throw"Unexpected use of this page"}}(),i={};while(e=h.exec(f)){i[a(e[1])]=a(e[2])}var g=window.parent[i.uid];var d=["datafeed","customFormatters","brokerFactory"];for(var b in g){if(b==="tradingController"){window.tradingController=g[b]}else{if(d.indexOf(b)===-1){i[b]=JSON.stringify(g[b])}}}return i})();window.locale=urlParams.locale;window.language=urlParams.locale;</script><script src="bundles/vendors.037de1a224aecfed7020.js"></script><script src="bundles/library.5b9e0d4f842989964d56.js"></script></body></html>
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"><link type="text/css" href="bundles/library.2e4e86e4539a260f4a7b69dd55f2595b.css" rel="stylesheet"/></head><body class="chart-page on-widget"><div class="loading-indicator" id="loading-indicator"></div><script src="js/external/spin.min.js"></script><script>var loadingSpinner=new Spinner({lines:17,length:0,width:3,radius:30,scale:1,corners:1,color:"#00A2E2",opacity:0,rotate:0,direction:1,speed:1.5,trail:60,fps:20,zIndex:2000000000,className:"spinner",top:"50%",left:"50%",shadow:false,hwaccel:false}).spin(document.getElementById("loading-indicator"));</script><script>var JSServer={};var __initialEnabledFeaturesets=["charting_library"];</script><script>urlParams=(function(){var e,c=/\+/g,h=/([^&=]+)=?([^&]*)/g,a=function(j){return decodeURIComponent(j.replace(c," ")).replace(/<\/?[^>]+(>|$)/g,"")},f=function(){var k=location.href;var j=k.indexOf("#");if(j>=0){return k.substring(j+1)}else{throw"Unexpected use of this page"}}(),i={};while(e=h.exec(f)){i[a(e[1])]=a(e[2])}var g=window.parent[i.uid];var d=["datafeed","customFormatters","brokerFactory"];for(var b in g){if(b==="tradingController"){window.tradingController=g[b]}else{if(d.indexOf(b)===-1){i[b]=JSON.stringify(g[b])}}}return i})();window.locale=urlParams.locale;window.language=urlParams.locale;</script><script src="bundles/vendors.8c445fe91dc494c5dec6.js"></script><script src="bundles/library.52f448f933885e5e0fed.js"></script></body></html>