commit 2017-07-18 11:16:18.911637

How to hide screenshot icon in the footer #1802
This commit is contained in:
Jenkins
2017-07-18 06:17:01 -05:00
parent e83c759d19
commit da7ea2d32b
4 changed files with 93 additions and 93 deletions

View File

@@ -1,6 +1,6 @@
(function(){function l(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 g(){var a,b,c,e,d,f=arguments[0]||{},h=1,g=arguments.length,k=!1;"boolean"===typeof f&&(k=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&&(k&&e&& (function(){function l(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 g(){var a,b,c,e,d,f=arguments[0]||{},h=1,g=arguments.length,k=!1;"boolean"===typeof f&&(k=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&&(k&&e&&
(l(e)||(d=Array.isArray(e)))?(d?(d=!1,c=c&&Array.isArray(c)?c:[]):c=c&&l(c)?c:{},f[b]=jQuery.extend(k,c,e)):void 0!==e&&(f[b]=e));return f}function m(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, (l(e)||(d=Array.isArray(e)))?(d?(d=!1,c=c&&Array.isArray(c)?c:[]):c=c&&l(c)?c:{},f[b]=jQuery.extend(k,c,e)):void 0!==e&&(f[b]=e));return f}function m(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.10 (internal id d69dc83c @ 2017-06-29 11:42:41.941632)"},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"); CANDLES:1,LINE:2,AREA:3,HEIKEN_ASHI:8,HOLLOW_CANDLES:9,version:function(){return"1.10 (internal id 22011445 @ 2017-07-18 06:15:57.098661)"},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, 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:{},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"}, 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:{},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};this.options=g(!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,drawingsAccess:a.drawings_access, {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};this.options=g(!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,drawingsAccess:a.drawings_access,
@@ -9,7 +9,7 @@ debug:a.debug,client_id:a.client_id,user_id:a.user_id,charts_storage_url:a.chart
0<this.options.disabledFeatures.length?this.options.disabledFeatures.concat(a.disabledFeatures):a.disabledFeatures,this.options.enabledFeatures=0<this.options.enabledFeatures.length?this.options.enabledFeatures.concat(a.enabledFeatures):a.enabledFeatures):console.warn("Unknown preset: `"+a+"`"));this._ready_handlers=[];this.create()}};d.widget.prototype={_innerWindow:function(){return d.gEl(this.id).contentWindow},_autoResizeChart:function(){this.options.fullscreen&&(d.gEl(this.id).style.height=window.innerHeight+ 0<this.options.disabledFeatures.length?this.options.disabledFeatures.concat(a.disabledFeatures):a.disabledFeatures,this.options.enabledFeatures=0<this.options.enabledFeatures.length?this.options.enabledFeatures.concat(a.enabledFeatures):a.enabledFeatures):console.warn("Unknown preset: `"+a+"`"));this._ready_handlers=[];this.create()}};d.widget.prototype={_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; "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,overrides:this.options.overrides,studiesOverrides:this.options.studiesOverrides,disabledFeatures:this.options.disabledFeatures,enabledFeatures:this.options.enabledFeatures,favorites:this.options.favorites, 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,overrides:this.options.overrides,studiesOverrides:this.options.studiesOverrides,disabledFeatures:this.options.disabledFeatures,enabledFeatures:this.options.enabledFeatures,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};this.options.savedData&&(window[this.options.uid].chartContent={json:this.options.savedData});var a=(this.options.path||"")+"static/tv-chart.d69dc83c61da25991e9b.html#localserver=1&symbol="+encodeURIComponent(this.options.symbol)+"&interval="+encodeURIComponent(this.options.interval)+(this.options.timeframe? 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};this.options.savedData&&(window[this.options.uid].chartContent={json:this.options.savedData});var a=(this.options.path||"")+"static/tv-chart.2201144508e5c17a3a1e.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))+ "&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): "&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.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):

View File

@@ -3,22 +3,22 @@ urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.deci
c=$("<tr>").appendTo(h),$('<td class="custom-logo">').append(s).appendTo(c),d=$("<tr>").appendTo(h),t.enabled("link_to_tradingview")&&$('<td class="tv-link">').append(r).appendTo(d),o&&a.addClass("on-pane")}:function(e,i,o){if(t.enabled("link_to_tradingview")){i=i||chartWidget._jqMainDiv,$(i).find(".onchart-tv-logo").remove();var n=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/charting_library/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/charting_library/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text"><span id="logo-symbol"></span>&nbsp;charts&nbsp;by&nbsp;<span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(i);t.enabled("minimalistic_logo")?n.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")}):n.addClass("expanded"),o&&n.addClass("on-pane")}},P=t.enabled("widget_logo"),P&&(chartWidget.createLogo=v,t.enabled("show_logo_on_all_charts")&&(a.createLogo=v.bind(this)),t.enabled("move_logo_to_main_pane")||chartWidget.withModel(null,v)),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:a,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(a),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) c=$("<tr>").appendTo(h),$('<td class="custom-logo">').append(s).appendTo(c),d=$("<tr>").appendTo(h),t.enabled("link_to_tradingview")&&$('<td class="tv-link">').append(r).appendTo(d),o&&a.addClass("on-pane")}:function(e,i,o){if(t.enabled("link_to_tradingview")){i=i||chartWidget._jqMainDiv,$(i).find(".onchart-tv-logo").remove();var n=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/charting_library/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/charting_library/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text"><span id="logo-symbol"></span>&nbsp;charts&nbsp;by&nbsp;<span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(i);t.enabled("minimalistic_logo")?n.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")}):n.addClass("expanded"),o&&n.addClass("on-pane")}},P=t.enabled("widget_logo"),P&&(chartWidget.createLogo=v,t.enabled("show_logo_on_all_charts")&&(a.createLogo=v.bind(this)),t.enabled("move_logo_to_main_pane")||chartWidget.withModel(null,v)),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:a,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(a),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(),V=$.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(),O=$.Deferred(),$.when(s,O,V).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",{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,O.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(1))},function(t,e,i){var o=i(2),n={},s={},r={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets, ;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(),V=$.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(),O=$.Deferred(),$.when(s,O,V).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",{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,O.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(1))},function(t,e,i){var o=i(2),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){t.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol"]},compare_symbol:{subsets:["header_compare"]},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},show_hide_button_in_legend:{},format_button_in_legend:{},study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{ 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){t.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol"]},compare_symbol:{subsets:["header_compare"]},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},show_hide_button_in_legend:{},format_button_in_legend:{},study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{
subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},charting_library_debug_mode:{},cl_feed_return_all_data:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},create_volume_indicator_by_default_once:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},link_to_tradingview:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_deafults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},symbol_search_quandl:{},footer_share_buttons:{},footer_bugreport_button:{},footer_publish_idea_button:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},japanese_chart_styles:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},chart_scroll:{},chart_zoom:{},high_density_bars:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{ subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},charting_library_debug_mode:{},cl_feed_return_all_data:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},create_volume_indicator_by_default_once:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},link_to_tradingview:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_deafults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},symbol_search_quandl:{},footer_share_buttons:{},footer_bugreport_button:{},footer_publish_idea_button:{},footer_screenshot:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},japanese_chart_styles:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},chart_scroll:{},chart_zoom:{},high_density_bars:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","create_volume_indicator_by_default_once","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_property_page_trading","chart_content_overrides_by_deafults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_saveload_to_the_right","header_layouttoggle","datasource_copypaste","alerts","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","chart_property_page","show_chart_property_page","support_multicharts","display_market_status","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_share_buttons","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","symbol_search_quandl","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","timezone_menu","main_series_scale_menu","chart_crosshair_menu","study_on_study","japanese_chart_styles","show_login_dialog","dome_widget","chart_scroll","chart_zoom"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{ subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","create_volume_indicator_by_default_once","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_property_page_trading","chart_content_overrides_by_deafults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_saveload_to_the_right","header_layouttoggle","datasource_copypaste","alerts","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","chart_property_page","show_chart_property_page","support_multicharts","display_market_status","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_share_buttons","footer_screenshot","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","symbol_search_quandl","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","timezone_menu","main_series_scale_menu","chart_crosshair_menu","study_on_study","japanese_chart_styles","show_login_dialog","dome_widget","chart_scroll","chart_zoom"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","create_volume_indicator_by_default_once","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","header_widget_dom_node","header_symbol_search","symbol_search_hot_key","header_resolutions","header_chart_type","header_compare","header_indicators","header_resolutions","header_widget_dom_node","left_toolbar","saveload_requires_authentication","show_dialog_on_snapshot_ready","star_some_intervals_by_default","symbol_search_parser_mixin","symbollist_context_menu","use_localstorage_for_settings","volume_force_overlay","websocket_connection","display_market_status","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","force_quandl_search","compare_symbol","timezone_menu","main_series_scale_menu","show_login_dialog","plain_studymarket","japanese_chart_styles","chart_scroll","chart_zoom"]},bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","adapt_onchart_logo_background","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","header_widget","header_saveload","header_saveload_to_the_right","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","create_volume_indicator_by_default_once","chart_scroll","chart_zoom","show_chart_property_page","chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts"]},charting_library:{subsets:["charting_library_base","header_screenshot"]},static_charts_service:{ subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","create_volume_indicator_by_default_once","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","header_widget_dom_node","header_symbol_search","symbol_search_hot_key","header_resolutions","header_chart_type","header_compare","header_indicators","header_resolutions","header_widget_dom_node","left_toolbar","saveload_requires_authentication","show_dialog_on_snapshot_ready","star_some_intervals_by_default","symbol_search_parser_mixin","symbollist_context_menu","use_localstorage_for_settings","volume_force_overlay","websocket_connection","display_market_status","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","force_quandl_search","compare_symbol","timezone_menu","main_series_scale_menu","show_login_dialog","plain_studymarket","japanese_chart_styles","chart_scroll","chart_zoom"]},bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","adapt_onchart_logo_background","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","header_widget","header_saveload","header_saveload_to_the_right","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","create_volume_indicator_by_default_once","chart_scroll","chart_zoom","show_chart_property_page","chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_evetns_alerts"]},charting_library:{subsets:["charting_library_base","header_screenshot"]},static_charts_service:{
subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library_base","support_multicharts","header_layouttoggle","japanese_chart_styles","chart_property_page_trading","add_to_watchlist"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","caption_buttons_text_if_possible","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","dome_widget","dome_widget_always_enabled","japanese_chart_styles","remove_img_from_rss","add_to_watchlist"]},amp_terminal:{subsets:["cqg_terminal"]}}},function(t,e){},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(window.actualLanguage){if(!window._tv_languages){var o="localization/translations/"+window.actualLanguage+".json";window._tv_languages={},window._tv_languages[window.actualLanguage]=i(o)||{}}}else window.actualLanguage="en"},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(6),s=i(7),r=i(8),a=i(24),l={translate:s.translationFunction},window.__tradingviewI18nextInited||(h=window.actualLanguage||null,c=o(h),h&&c||(console.error("No translation data"),h="en",c=o("en")),h&&c?(d={compatibilityJSON:"v1",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){"use strict";var o=i(7);o.addTranslationFunctionToWindow(o.translationFunction),o.addTranslationFunctionToJQuery(o.translationFunction)},function(t,e){"use strict";function i(t){window.t=t}function o(t){s.$||(s.$={}),s.$.t=t}var n,s=window;e.addTranslationFunctionToWindow=i,e.addTranslationFunctionToJQuery=o,n=function(t,e){return t},e.translationFunction=n},,,,,,,,,,,,,,,,,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){"use strict";var o,n;i(26),o=$.Deferred(),n=function(){o.resolve(),document.body.removeEventListener("tradingview-i18next-initialized",n)},window.__tradingviewI18nextInited?n():document.body.addEventListener("tradingview-i18next-initialized",n),t.exports=o},,,function(t,e,i){"use strict";function o(t){return t.keys().map(t)}window.TradingView=window.TradingView||{},window.requireAll=o,i(29),i(43), subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library_base","support_multicharts","header_layouttoggle","japanese_chart_styles","chart_property_page_trading","footer_screenshot","add_to_watchlist"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","caption_buttons_text_if_possible","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","dome_widget","dome_widget_always_enabled","japanese_chart_styles","remove_img_from_rss","footer_screenshot","add_to_watchlist"]},amp_terminal:{subsets:["cqg_terminal"]}}},function(t,e){},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(window.actualLanguage){if(!window._tv_languages){var o="localization/translations/"+window.actualLanguage+".json";window._tv_languages={},window._tv_languages[window.actualLanguage]=i(o)||{}}}else window.actualLanguage="en"},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(6),s=i(7),r=i(8),a=i(24),l={translate:s.translationFunction},window.__tradingviewI18nextInited||(h=window.actualLanguage||null,c=o(h),h&&c||(console.error("No translation data"),h="en",c=o("en")),h&&c?(d={compatibilityJSON:"v1",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){"use strict";var o=i(7);o.addTranslationFunctionToWindow(o.translationFunction),o.addTranslationFunctionToJQuery(o.translationFunction)},function(t,e){"use strict";function i(t){window.t=t}function o(t){s.$||(s.$={}),s.$.t=t}var n,s=window;e.addTranslationFunctionToWindow=i,e.addTranslationFunctionToJQuery=o,n=function(t,e){return t},e.translationFunction=n},,,,,,,,,,,,,,,,,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){"use strict";var o,n;i(26),o=$.Deferred(),n=function(){o.resolve(),document.body.removeEventListener("tradingview-i18next-initialized",n)},window.__tradingviewI18nextInited?n():document.body.addEventListener("tradingview-i18next-initialized",n),t.exports=o},,,function(t,e,i){"use strict";function o(t){return t.keys().map(t)}
i(44),i(45),i(46),i(47),i(48),i(49),i(50),i(51),i(59),i(60),i(62),i(63),i(55),i(71),i(192),i(52),i(179)},function(t,e,i){"use strict";var o=i(30);window.actualLanguage&&(o.locale(window.actualLanguage,{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:"MM/DD/YYYY",l:"M/D/YYYY",LL:"D MMMM YYYY",ll:"D MMM LT",LLL:"D MMMM YYYY LT",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",{count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.actualLanguage))},,,,,,,,,,,,,,function(t,e){"use strict";!function(t){t.fn.contextMenu=function(e){t(this).bind("contextmenu",function(t){return e(t),!1})}}(jQuery)},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"), window.TradingView=window.TradingView||{},window.requireAll=o,i(29),i(43),i(44),i(45),i(46),i(47),i(48),i(49),i(50),i(51),i(59),i(60),i(62),i(63),i(55),i(71),i(192),i(52),i(179)},function(t,e,i){"use strict";var o=i(30);window.actualLanguage&&(o.locale(window.actualLanguage,{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:"MM/DD/YYYY",l:"M/D/YYYY",LL:"D MMMM YYYY",ll:"D MMM LT",LLL:"D MMMM YYYY LT",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",{count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.actualLanguage))},,,,,,,,,,,,,,function(t,e){"use strict";!function(t){t.fn.contextMenu=function(e){t(this).bind("contextmenu",function(t){return e(t),!1})}}(jQuery)},function(t,e){"use strict";!function(t){t.fn.selectable=function(e){return this.each(function(){
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(module,exports){(function(){"use strict";this.JSON||(this.JSON={}),function(){function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var i,o,n,s,r,a=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,r=[],"[object Array]"===Object.prototype.toString.apply(l)){for(s=l.length,i=0;i<s;i+=1)r[i]=str(i,l)||"null";return n=0===r.length?"[]":gap?"[\n"+gap+r.join(",\n"+gap)+"\n"+a+"]":"["+r.join(",")+"]",gap=a,n}if(rep&&"object"==typeof rep)for(s=rep.length,i=0;i<s;i+=1)"string"==typeof(o=rep[i])&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);else for(o in l)Object.hasOwnProperty.call(l,o)&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);return n=0===r.length?"{}":gap?"{\n"+gap+r.join(",\n"+gap)+"\n"+a+"}":"{"+r.join(",")+"}",gap=a,n}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,i){var o;if(gap="",indent="","number"==typeof i)for(o=0;o<i;o+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var i,o,n=t[e];if(n&&"object"==typeof n)for(i in n)Object.hasOwnProperty.call(n,i)&&(o=walk(n,i),void 0!==o?n[i]=o:delete n[i]);return reviver.call(t,e,n)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j 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(module,exports){(function(){"use strict";this.JSON||(this.JSON={}),function(){function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var i,o,n,s,r,a=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,r=[],"[object Array]"===Object.prototype.toString.apply(l)){for(s=l.length,i=0;i<s;i+=1)r[i]=str(i,l)||"null";return n=0===r.length?"[]":gap?"[\n"+gap+r.join(",\n"+gap)+"\n"+a+"]":"["+r.join(",")+"]",gap=a,n}if(rep&&"object"==typeof rep)for(s=rep.length,i=0;i<s;i+=1)"string"==typeof(o=rep[i])&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);else for(o in l)Object.hasOwnProperty.call(l,o)&&(n=str(o,l))&&r.push(quote(o)+(gap?": ":":")+n);return n=0===r.length?"{}":gap?"{\n"+gap+r.join(",\n"+gap)+"\n"+a+"}":"{"+r.join(",")+"}",gap=a,n}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,i){var o;if(gap="",indent="","number"==typeof i)for(o=0;o<i;o+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var i,o,n=t[e];if(n&&"object"==typeof n)for(i in n)Object.hasOwnProperty.call(n,i)&&(o=walk(n,i),void 0!==o?n[i]=o:delete n[i]);return reviver.call(t,e,n)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),
;throw new SyntaxError("JSON.parse")})}()}).call(window)},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(){return/widgetembed|widgetpopup|idea-popup/.test(window.location.pathname)},e.onOrder=function(){return"/order/"===window.location.pathname}}).call(e,i(1))},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.mousecapture=function(e){var i=t(document);return this.each(function(){var o=t(this),n={};o.mousedown(function(t){var s,r,a;return e.move&&(s=function(t){e.move.call(o,t,n)},i.mousemove(s)),a=function(){e.move&&i.unbind("mousemove",s),i.unbind("mouseup",r)},r=e.up?function(t){return a(),e.up.call(o,t,n)}:a,i.mouseup(r),e.down.call(o,t,n)})}),this}}(jQuery)},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)}, /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()}).call(window)},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(){return/widgetembed|widgetpopup|idea-popup/.test(window.location.pathname)},e.onOrder=function(){return"/order/"===window.location.pathname}}).call(e,i(1))},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.mousecapture=function(e){var i=t(document);return this.each(function(){var o=t(this),n={};o.mousedown(function(t){var s,r,a;return e.move&&(s=function(t){e.move.call(o,t,n)},i.mousemove(s)),a=function(){e.move&&i.unbind("mousemove",s),i.unbind("mouseup",r)},r=e.up?function(t){return a(),e.up.call(o,t,n)}:a,i.mouseup(r),e.down.call(o,t,n)})}),this}}(jQuery)},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
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,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] ;!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,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
;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(31)(t))},function(t,e,i){"use strict";var o,n;i(52),o=i(53),n=window.CanvasEx=i(61),TradingView.resizeCanvas=function(t,e,i){var o,n,s,r,a,l=t.prop("height"),h=t.prop("width");l&&h&&(l/=window.hidpiCanvasRatio||1,h/=window.hidpiCanvasRatio||1,l<1&&(l=1),h<1&&(h=1),o=$("<canvas>").prop("width",h).prop("height",l),n=o.get(0).getContext("2d"),s=Math.min(h,e),r=Math.min(l,i),s&&r&&n.drawImage(t.get(0),0,0,s,r,0,0,s,r),t.prop("height",i).prop("width",e),a=t.get(0).getContext("2d"),s&&r&&a.drawImage(o.get(0),0,0,s,r,0,0,s,r),o.remove())},n.computeDashPattern=function(t){return[[t.lineWidth,2*t.lineWidth],[5*t.lineWidth,6*t.lineWidth],[6*t.lineWidth,6*t.lineWidth]][t.lineStyle-1]},n.drawLine=function(t,e,i,o,s){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(s)&&(t.lineStyle===n.LINESTYLE_DASHED||t.lineStyle===n.LINESTYLE_DOTTED?t.drawDashedLine(t,e,i,o,s):n.drawSolidLine(t,e,i,o,s))},n.drawArrow=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.beginPath(),t.moveTo(o,n),t.lineTo(e,i),t.moveTo(e+2,i+2),t.lineTo(e-2,i+2),t.moveTo(e-1,i+1),t.lineTo(e+1,i+1),t.stroke())},n.drawSolidLine=function(t,e,i,o,n){t.beginPath(),t.moveTo(e,i),t.lineTo(o,n),t.stroke()},n.setLineStyle=function(t,e){t.lineStyle=e;var i=[];e!==n.LINESTYLE_SOLID&&(i=n.computeDashPattern(t)),"function"==typeof t.setLineDash?t.setLineDash(i):void 0!==t.mozDash?t.mozDash=i:void 0!==t.webkitLineDash&&(t.webkitLineDash=i)},n.drawPoly=function(t,e,i){var o,n;for(t.beginPath(),t.moveTo(e[0].x,e[0].y), ;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(31)(t))},function(t,e,i){"use strict";var o,n;i(52),o=i(53),n=window.CanvasEx=i(61),TradingView.resizeCanvas=function(t,e,i){var o,n,s,r,a,l=t.prop("height"),h=t.prop("width");l&&h&&(l/=window.hidpiCanvasRatio||1,h/=window.hidpiCanvasRatio||1,l<1&&(l=1),h<1&&(h=1),o=$("<canvas>").prop("width",h).prop("height",l),n=o.get(0).getContext("2d"),s=Math.min(h,e),r=Math.min(l,i),s&&r&&n.drawImage(t.get(0),0,0,s,r,0,0,s,r),t.prop("height",i).prop("width",e),a=t.get(0).getContext("2d"),s&&r&&a.drawImage(o.get(0),0,0,s,r,0,0,s,r),o.remove())},n.computeDashPattern=function(t){return[[t.lineWidth,2*t.lineWidth],[5*t.lineWidth,6*t.lineWidth],[6*t.lineWidth,6*t.lineWidth]][t.lineStyle-1]},n.drawLine=function(t,e,i,o,s){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(s)&&(t.lineStyle===n.LINESTYLE_DASHED||t.lineStyle===n.LINESTYLE_DOTTED?t.drawDashedLine(t,e,i,o,s):n.drawSolidLine(t,e,i,o,s))},n.drawArrow=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.beginPath(),t.moveTo(o,n),t.lineTo(e,i),t.moveTo(e+2,i+2),t.lineTo(e-2,i+2),t.moveTo(e-1,i+1),t.lineTo(e+1,i+1),t.stroke())},n.drawSolidLine=function(t,e,i,o,n){t.beginPath(),t.moveTo(e,i),t.lineTo(o,n),t.stroke()},n.setLineStyle=function(t,e){t.lineStyle=e
o=0;o<e.length;o++)n=e[o],t.lineTo(n.x,n.y);t.closePath(),t.stroke(),i&&t.fill()},n.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(t){if(this.font!==t)try{this.font=t}catch(t){}},CanvasRenderingContext2D.prototype.lineStyle=n.LINESTYLE_SOLID,n.originalSave=CanvasRenderingContext2D.prototype.save,n.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){n.lineStyles.push(this.lineStyle),n.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){n.lineStyles.length>0&&(this.lineStyle=n.lineStyles.pop(),n.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(t,e,i,o,s){t.save();var r=n.computeDashPattern(t);if(t.beginPath(),"function"==typeof t.setLineDash)t.setLineDash(r);else if(void 0!==t.mozDash)t.mozDash=r;else{if(void 0===t.webkitLineDash)return t.dashedLineTo(e,i,o,s,r),t.stroke(),void t.restore();t.webkitLineDash=r}t.moveTo(e,i),t.lineTo(o,s),t.stroke(),t.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(t,e,i,n,s){var r,a,l,h,c,d,p={thereYet:o.greaterThan,cap:Math.min},u={thereYet:o.greaterThan,cap:Math.min};for(e-n>0&&(u.thereYet=o.lessThan,u.cap=Math.max),t-i>0&&(p.thereYet=o.lessThan,p.cap=Math.max),this.moveTo(t,e),r=t,a=e,l=0,h=!0;!p.thereYet(r,i)||!u.thereYet(a,n);)c=Math.atan2(n-e,i-t),d=s[l],r=p.cap(i,r+Math.cos(c)*d),a=u.cap(n,a+Math.sin(c)*d),h?this.lineTo(r,a):this.moveTo(r,a),l=(l+1)%s.length,h=!h},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arcTo(t+i,e,t+i,e+n,n),this.lineTo(t+i,e+o-n),this.arcTo(t+i,e+o,t+i-n,e+o,n),this.lineTo(t+n,e+o),this.arcTo(t,e+o,t,e+o-n,n),this.lineTo(t,e+n),this.arcTo(t,e,t+n,e,n)}),t.exports=n},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=[], ;var i=[];e!==n.LINESTYLE_SOLID&&(i=n.computeDashPattern(t)),"function"==typeof t.setLineDash?t.setLineDash(i):void 0!==t.mozDash?t.mozDash=i:void 0!==t.webkitLineDash&&(t.webkitLineDash=i)},n.drawPoly=function(t,e,i){var o,n;for(t.beginPath(),t.moveTo(e[0].x,e[0].y),o=0;o<e.length;o++)n=e[o],t.lineTo(n.x,n.y);t.closePath(),t.stroke(),i&&t.fill()},n.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(t){if(this.font!==t)try{this.font=t}catch(t){}},CanvasRenderingContext2D.prototype.lineStyle=n.LINESTYLE_SOLID,n.originalSave=CanvasRenderingContext2D.prototype.save,n.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){n.lineStyles.push(this.lineStyle),n.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){n.lineStyles.length>0&&(this.lineStyle=n.lineStyles.pop(),n.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(t,e,i,o,s){t.save();var r=n.computeDashPattern(t);if(t.beginPath(),"function"==typeof t.setLineDash)t.setLineDash(r);else if(void 0!==t.mozDash)t.mozDash=r;else{if(void 0===t.webkitLineDash)return t.dashedLineTo(e,i,o,s,r),t.stroke(),void t.restore();t.webkitLineDash=r}t.moveTo(e,i),t.lineTo(o,s),t.stroke(),t.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(t,e,i,n,s){var r,a,l,h,c,d,p={thereYet:o.greaterThan,cap:Math.min},u={thereYet:o.greaterThan,cap:Math.min};for(e-n>0&&(u.thereYet=o.lessThan,u.cap=Math.max),t-i>0&&(p.thereYet=o.lessThan,p.cap=Math.max),this.moveTo(t,e),r=t,a=e,l=0,h=!0;!p.thereYet(r,i)||!u.thereYet(a,n);)c=Math.atan2(n-e,i-t),d=s[l],r=p.cap(i,r+Math.cos(c)*d),a=u.cap(n,a+Math.sin(c)*d),h?this.lineTo(r,a):this.moveTo(r,a),l=(l+1)%s.length,h=!h},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arcTo(t+i,e,t+i,e+n,n),this.lineTo(t+i,e+o-n),this.arcTo(t+i,e+o,t+i-n,e+o,n),this.lineTo(t+n,e+o),this.arcTo(t,e+o,t,e+o-n,n),this.lineTo(t,e+n),this.arcTo(t,e,t+n,e,n)}),t.exports=n},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)
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){"use strict";function o(t,e){return t<=e}function n(t,e){return t>=e}function s(t,e,i){return Math.min(Math.max(t,e),i)}function r(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return L.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function h(t,e,i){return Math.abs(t-e)<i}function c(t){return t<=0?(L.logDebug("MathEx.log10: argument less or equal zero"),NaN):Math.log(t)/Math.log(10)}function d(t,e){return t<e?-1:t>e?1:0}function p(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)<0&&(i=t[o]);return i}function u(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)>0&&(i=t[o]);return i}function _(t,e,i){var o=e.substract(t),n=i.substract(t),s=n.dotProduct(o)/o.dotProduct(o);return{coeff:s,distance:t.addScaled(o,s).substract(i).length()}}function f(t,e,i){var o,n,s=_(t,e,i);return 0<=s.coeff&&s.coeff<=1?s:(o=t.substract(i).length(),n=e.substract(i).length(),o<n?{coeff:0,distance:o}:{coeff:1,distance:n})}function m(t,e,i,o){var n,s=e.substract(t),r=o.substract(i),a=s.x*r.y-s.y*r.x;return Math.abs(a)<1e-6?null:(n=t.substract(i),(n.y*r.x-n.x*r.y)/a)}function g(t,e,i,o){var n,s,r,a=m(t,e,i,o);return null===a?null:(n=e.substract(t),s=n.scaled(a).add(t),r=f(i,o,s),Math.abs(r.distance)<1e-6?a:null)}function v(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function y(t,e,i,o){var n=t.add(e).scaled(.5),s=n.add(i).scaled(.5),r=g(t,e,s,o);return null===r&&(null===(r=g(e,i,s,o))&&null===(r=g(i,t,s,o)))}function b(t,e,i,o){ ;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){"use strict";function o(t,e){return t<=e}function n(t,e){return t>=e}function s(t,e,i){return Math.min(Math.max(t,e),i)}function r(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return L.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function h(t,e,i){return Math.abs(t-e)<i}function c(t){return t<=0?(L.logDebug("MathEx.log10: argument less or equal zero"),NaN):Math.log(t)/Math.log(10)}function d(t,e){return t<e?-1:t>e?1:0}function p(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)<0&&(i=t[o]);return i}function u(t,e){var i,o;if(void 0===e&&(e=d),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)>0&&(i=t[o]);return i}function _(t,e,i){var o=e.substract(t),n=i.substract(t),s=n.dotProduct(o)/o.dotProduct(o);return{coeff:s,distance:t.addScaled(o,s).substract(i).length()}}function f(t,e,i){var o,n,s=_(t,e,i);return 0<=s.coeff&&s.coeff<=1?s:(o=t.substract(i).length(),n=e.substract(i).length(),o<n?{coeff:0,distance:o}:{coeff:1,distance:n})}function m(t,e,i,o){var n,s=e.substract(t),r=o.substract(i),a=s.x*r.y-s.y*r.x;return Math.abs(a)<1e-6?null:(n=t.substract(i),(n.y*r.x-n.x*r.y)/a)}function g(t,e,i,o){var n,s,r,a=m(t,e,i,o);return null===a?null:(n=e.substract(t),s=n.scaled(a).add(t),r=f(i,o,s),Math.abs(r.distance)<1e-6?a:null)}function v(t,e,i){
var n,s=g(t,e,i,new C(o.x,i.y)),r=g(t,e,new C(o.x,i.y),o),a=g(t,e,o,new C(i.x,o.y)),l=g(t,e,new C(i.x,o.y),i),h=[];return s&&s>=0&&h.push(s),r&&r>=0&&h.push(r),a&&a>=0&&h.push(a),l&&l>=0&&h.push(l),0===h.length?null:(h.sort(function(t,e){return t-e}),n=v(t,i,o)?h[0]:h[h.length-1],t.addScaled(e.substract(t),n))}function w(t,e){var i,o,n,s=t.length-1,r=!1,a=e.x,l=e.y;for(i=0;i<t.length;i++)o=t[i],n=t[s],(o.y<l&&n.y>=l||n.y<l&&o.y>=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)<a&&(r=!r),s=i;return r}function S(t,e,i){return(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)<=e*e}function T(t,e,i,o){return Math.abs(t.x-e.x)>1e-6&&Math.abs(t.y-e.y)>1e-6?0===Math.round(t.x)||0===Math.round(e.x)?0===Math.round(t.y)||0===Math.round(e.y)?new C(0,0):new C(0,o):0===Math.round(t.y)||0===Math.round(e.y)?new C(i,0):new C(i,o):null}var C,x,P=i(54),L=P.getLogger("Common.MathEx");e.lessThan=o,e.greaterThan=n,e.clamp=s,e.sign=r,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=h,e.log10=c,e.defComparator=d,e.min=p,e.max=u,C=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){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=C,x=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 C(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=x,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){"use strict";function o(){return T.getInt(f)}function n(){return T.getBool(m)}function s(t){t="number"==typeof t?Math.max(p.ERROR,Math.min(p.DEBUG,t)):u,T.setValue(f,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){var n,s;g[i]||(g[i]=[]),n=g[i],s={message:e,timestamp:+t},n.unshift(s),o&&n.length>o&&(n.length=o)}function l(t,e){ return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function y(t,e,i,o){var n=t.add(e).scaled(.5),s=n.add(i).scaled(.5),r=g(t,e,s,o);return null===r&&(null===(r=g(e,i,s,o))&&null===(r=g(i,t,s,o)))}function b(t,e,i,o){var n,s=g(t,e,i,new C(o.x,i.y)),r=g(t,e,new C(o.x,i.y),o),a=g(t,e,o,new C(i.x,o.y)),l=g(t,e,new C(i.x,o.y),i),h=[];return s&&s>=0&&h.push(s),r&&r>=0&&h.push(r),a&&a>=0&&h.push(a),l&&l>=0&&h.push(l),0===h.length?null:(h.sort(function(t,e){return t-e}),n=v(t,i,o)?h[0]:h[h.length-1],t.addScaled(e.substract(t),n))}function w(t,e){var i,o,n,s=t.length-1,r=!1,a=e.x,l=e.y;for(i=0;i<t.length;i++)o=t[i],n=t[s],(o.y<l&&n.y>=l||n.y<l&&o.y>=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)<a&&(r=!r),s=i;return r}function S(t,e,i){return(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)<=e*e}function T(t,e,i,o){return Math.abs(t.x-e.x)>1e-6&&Math.abs(t.y-e.y)>1e-6?0===Math.round(t.x)||0===Math.round(e.x)?0===Math.round(t.y)||0===Math.round(e.y)?new C(0,0):new C(0,o):0===Math.round(t.y)||0===Math.round(e.y)?new C(i,0):new C(i,o):null}var C,x,P=i(54),L=P.getLogger("Common.MathEx");e.lessThan=o,e.greaterThan=n,e.clamp=s,e.sign=r,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=h,e.log10=c,e.defComparator=d,e.min=p,e.max=u,C=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){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=C,x=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 C(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=x,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){"use strict";function o(){return T.getInt(f)}function n(){return T.getBool(m)}function s(t){t="number"==typeof t?Math.max(p.ERROR,Math.min(p.DEBUG,t)):u,T.setValue(f,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),
for(var i=0;i<t.length;i++)t[i].subsystem=e;return t}function h(t){var e,i=Object.keys(g).reduce(function(t,e){return t.concat(l(g[e],e))},[]);return i.sort(function(t,e){return t.timestamp-e.timestamp}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subsystem+":"+t.message.replace(/"/g,"'")}),r(e,_)}function c(t,e,i){var s,r;if((e!==y||i.id!==b)&&(s=new Date,"\n"!==e&&t<=p.NORMAL&&a(s,e,i.id,i.maxCount),t<=o()&&(!i.highRate||n())&&(!v||i.id.match(v)))){if("\n"!==e)switch(r=s.toISOString()+":"+i.id+":"+e,t){case p.DEBUG:console.debug(r);break;case p.INFO:case p.NORMAL:i.color?console.log("%c"+r,"color: "+i.color):console.log(r);break;case p.WARNING:console.warn(r);break;case p.ERROR:console.error(r)}y=e,b=i.id,w&&clearTimeout(w),w=setTimeout(function(){y=null,b=null,w=NaN},1e3)}}function d(t,e){function i(t){return function(e){return c(t,e,o)}}void 0===e&&(e={});var o=Object.assign(e,{id:t});return{logDebug:i(p.DEBUG),logError:i(p.ERROR),logInfo:i(p.INFO),logNormal:i(p.NORMAL),logWarn:i(p.WARNING)}}var p,u,_,f,m,g,v,y,b,w,S,T=i(55),C="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"}(p=e.LOGLEVEL||(e.LOGLEVEL={})),u=p.INFO,_=75497472,f="loglevel",m="logHighRate",g={},v=null,y=null,b=null,w=NaN,e.getLogLevel=o,e.setLogLevel=s,e.getLogHistory=h,e.getLogger=d,S=d("logger"),e.loggingOn=window.lon=C.loggingOn=function(t,e){s(p.DEBUG),S.logNormal("Debug logging enabled"),T.setValue(m,t),v=e||null},e.loggingNormal=C.loggingNormal=function(){s(p.NORMAL),S.logNormal("Logging set to normal level")},e.loggingOff=window.loff=function(){s(u),S.logInfo("Debug logging disabled")}},function(t,e,i){(function(t,e,o){"use strict";var n=i(57).regExpEscape,s=i(58).TVXWindowEvents,r=i(60).TVLocalStorage,a=window.TVSettings=function(){function i(t){return A+"."+t}function o(t,e){var i;return i=E[t],window.is_authenticated&&!N||null!=i||(i=E[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 E[t]!==o&&(E[t]=o,m(t)),i.forceFlush&&!V&&(V=setTimeout(function(){V=void 0,g()},I)),a}function u(t,e,i){return p(t,JSON.stringify(e),i),a}function _(t,e){return e=e||{},null!=E[t]&&(delete E[t],m(t)),e.forceFlush&&g(),a}function f(){D=void 0,M.length&&g()}function m(t){if(!window.is_authenticated||N)try{null==E[t]?r.removeItem(i(t)):r.setItem(i(t),E[t])}catch(t){}else M.push(t),D||(D=setTimeout(f,k));s.emit("settings",JSON.stringify({key:t,value:E[t]}))}function g(e){var i,o,n,s,r !(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){var n,s;g[i]||(g[i]=[]),n=g[i],s={message:e,timestamp:+t},n.unshift(s),o&&n.length>o&&(n.length=o)}function l(t,e){for(var i=0;i<t.length;i++)t[i].subsystem=e;return t}function h(t){var e,i=Object.keys(g).reduce(function(t,e){return t.concat(l(g[e],e))},[]);return i.sort(function(t,e){return t.timestamp-e.timestamp}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subsystem+":"+t.message.replace(/"/g,"'")}),r(e,_)}function c(t,e,i){var s,r;if((e!==y||i.id!==b)&&(s=new Date,"\n"!==e&&t<=p.NORMAL&&a(s,e,i.id,i.maxCount),t<=o()&&(!i.highRate||n())&&(!v||i.id.match(v)))){if("\n"!==e)switch(r=s.toISOString()+":"+i.id+":"+e,t){case p.DEBUG:console.debug(r);break;case p.INFO:case p.NORMAL:i.color?console.log("%c"+r,"color: "+i.color):console.log(r);break;case p.WARNING:console.warn(r);break;case p.ERROR:console.error(r)}y=e,b=i.id,w&&clearTimeout(w),w=setTimeout(function(){y=null,b=null,w=NaN},1e3)}}function d(t,e){function i(t){return function(e){return c(t,e,o)}}void 0===e&&(e={});var o=Object.assign(e,{id:t});return{logDebug:i(p.DEBUG),logError:i(p.ERROR),logInfo:i(p.INFO),logNormal:i(p.NORMAL),logWarn:i(p.WARNING)}}var p,u,_,f,m,g,v,y,b,w,S,T=i(55),C="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"}(p=e.LOGLEVEL||(e.LOGLEVEL={})),u=p.INFO,_=75497472,f="loglevel",m="logHighRate",g={},v=null,y=null,b=null,w=NaN,e.getLogLevel=o,e.setLogLevel=s,e.getLogHistory=h,e.getLogger=d,S=d("logger"),e.loggingOn=window.lon=C.loggingOn=function(t,e){s(p.DEBUG),S.logNormal("Debug logging enabled"),T.setValue(m,t),v=e||null},e.loggingNormal=C.loggingNormal=function(){s(p.NORMAL),S.logNormal("Logging set to normal level")},e.loggingOff=window.loff=function(){s(u),S.logInfo("Debug logging disabled")}},function(t,e,i){(function(t,e,o){"use strict";var n=i(57).regExpEscape,s=i(58).TVXWindowEvents,r=i(60).TVLocalStorage,a=window.TVSettings=function(){function i(t){return A+"."+t}function o(t,e){var i;return i=E[t],window.is_authenticated&&!N||null!=i||(i=E[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 E[t]!==o&&(E[t]=o,m(t)),i.forceFlush&&!V&&(V=setTimeout(function(){V=void 0,g()},I)),a}function u(t,e,i){return p(t,JSON.stringify(e),i),a}function _(t,e){return e=e||{},null!=E[t]&&(delete E[t],m(t)),e.forceFlush&&g(),a}function f(){D=void 0,M.length&&g()}function m(t){
;if(!t.enabled("widget")&&window.is_authenticated&&!N&&0!==M.length){for(i=M,M=[],o={},n=i.length;n--;)s=i[n],r=E[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=A.length,e.substring(0,i+1)===A+"."&&(M=[],r.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function y(){return Object.keys(E)}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<O.length;++e)if(O[e].exec(t))return!0;return!1}function S(){var e,i,o,n,s;for(E=[],e=A+".",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)||(E[s]=r.getItem(n)))}function T(t){var e,i,o,n,s;for(E=[],e=0===Object.keys(t).length,i=A+".",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));for(o in t)E[o]=t[o]+""}function C(t){window.is_authenticated&&!N?T(t||{}):S(),B.fire()}var x,P,L,k,I,A,E,M,D,V,O,B,R=!1,N=t.enabled("cqg_terminal");try{R=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return R?(x={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},P=function(t,e,i){var o=x[t];return null==o?e:o},L=function(){},{loaded:!1,loadedModel:!1,getValue:P,getJSON:P,getBool:P,getFloat:P,getInt:P,setValue:L,setJSON:L,remove:L,restoreDefaults:L,keys:function(){return Object.keys(x)},keysMask:function(){return[]},sync:L,onSync:{subscribe:function(){}}}):(k=12e4,I=10,"local"===window.environment&&(k=5e3),A="tradingview",E={},M=[],O=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^ChartFavoriteDrawingToolbarWidget\.visible/],s.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete E[e.key]:E[e.key]=e.value}),B=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:B})}();void 0!==o&&o&&o.exports&&(o.exports=a)}).call(e,i(1),i(56),i(31)(t))},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}}, if(!window.is_authenticated||N)try{null==E[t]?r.removeItem(i(t)):r.setItem(i(t),E[t])}catch(t){}else M.push(t),D||(D=setTimeout(f,k));s.emit("settings",JSON.stringify({key:t,value:E[t]}))}function g(e){var i,o,n,s,r;if(!t.enabled("widget")&&window.is_authenticated&&!N&&0!==M.length){for(i=M,M=[],o={},n=i.length;n--;)s=i[n],r=E[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=A.length,e.substring(0,i+1)===A+"."&&(M=[],r.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function y(){return Object.keys(E)}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<O.length;++e)if(O[e].exec(t))return!0;return!1}function S(){var e,i,o,n,s;for(E=[],e=A+".",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)||(E[s]=r.getItem(n)))}function T(t){var e,i,o,n,s;for(E=[],e=0===Object.keys(t).length,i=A+".",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));for(o in t)E[o]=t[o]+""}function C(t){window.is_authenticated&&!N?T(t||{}):S(),B.fire()}var x,P,L,k,I,A,E,M,D,V,O,B,R=!1,N=t.enabled("cqg_terminal");try{R=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return R?(x={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},P=function(t,e,i){var o=x[t];return null==o?e:o},L=function(){},{loaded:!1,loadedModel:!1,getValue:P,getJSON:P,getBool:P,getFloat:P,getInt:P,setValue:L,setJSON:L,remove:L,restoreDefaults:L,keys:function(){return Object.keys(x)},keysMask:function(){return[]},sync:L,onSync:{subscribe:function(){}}}):(k=12e4,I=10,"local"===window.environment&&(k=5e3),A="tradingview",E={},M=[],O=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^ChartFavoriteDrawingToolbarWidget\.visible/],s.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete E[e.key]:E[e.key]=e.value}),B=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:B})}();void 0!==o&&o&&o.exports&&(o.exports=a)}).call(e,i(1),i(56),i(31)(t))},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}
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(31)(t))},function(t,e){"use strict";function i(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}e.regExpEscape=i},function(t,e,i){"use strict";i(59);!function(t){function e(t,e){r[t]||(r[t]=[]),r[t].push(e)}function i(t,e){if(r[t]){var i=r[t].indexOf(e);-1!==i&&(1===r[t].length?delete r[t]:r[t].splice(i,1))}}function o(t){return TVLocalStorage.getItem(s+t)}function n(t,e){void 0===e&&(e=(new Date).valueOf()),e!==TVLocalStorage.getItem(s+t)&&TVLocalStorage.setItem(s+t,e)}var s="tvxwevents.",r={};window.addEventListener("storage",function(t){if(null!==t.newValue){var e=t.key;e&&e.startsWith(s)&&(e=e.substr(s.length),r[e]&&r[e].forEach(function(e){e.call(t.newValue,t.newValue)}))}}),t.on=e,t.off=i,t.current=o,t.emit=n}(e.TVXWindowEvents||(e.TVXWindowEvents={}))},function(t,e,i){var o=i(50).isInteger;String.prototype.left=function(t){if(!o(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(0,t)},String.prototype.right=function(t){if(!o(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(this.length-t,this.length)},String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")},String.prototype.startsWith=function(t){return!(t.length>this.length)&&this.left(t.length)===t},String.prototype.format||(String.prototype.format=function(){var t=arguments;return this.replace(/{(\d+)}/g,function(e,i){return void 0!==t[i]?t[i]:e})})},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._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(31)(t))},function(t,e){"use strict";function i(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}e.regExpEscape=i},function(t,e,i){"use strict";i(59);!function(t){function e(t,e){r[t]||(r[t]=[]),r[t].push(e)}function i(t,e){if(r[t]){var i=r[t].indexOf(e);-1!==i&&(1===r[t].length?delete r[t]:r[t].splice(i,1))}}function o(t){return TVLocalStorage.getItem(s+t)}function n(t,e){void 0===e&&(e=(new Date).valueOf()),e!==TVLocalStorage.getItem(s+t)&&TVLocalStorage.setItem(s+t,e)}var s="tvxwevents.",r={};window.addEventListener("storage",function(t){if(null!==t.newValue){var e=t.key;e&&e.startsWith(s)&&(e=e.substr(s.length),r[e]&&r[e].forEach(function(e){e.call(t.newValue,t.newValue)}))}}),t.on=e,t.off=i,t.current=o,t.emit=n}(e.TVXWindowEvents||(e.TVXWindowEvents={}))},function(t,e,i){var o=i(50).isInteger;String.prototype.left=function(t){if(!o(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(0,t)},String.prototype.right=function(t){if(!o(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(this.length-t,this.length)},String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")},String.prototype.startsWith=function(t){return!(t.length>this.length)&&this.left(t.length)===t},String.prototype.format||(String.prototype.format=function(){var t=arguments;return this.replace(/{(\d+)}/g,function(e,i){return void 0!==t[i]?t[i]:e})})},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()},
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){(function(t){var e={};e.LINESTYLE_SOLID=0,e.LINESTYLE_DOTTED=1,e.LINESTYLE_DASHED=2,e.LINESTYLE_LARGE_DASHED=3,e.TEXTPOS_TOPLEFT=0,e.TEXTPOS_TOPCENTER=1,e.TEXTPOS_TOPRIGHT=2,e.TEXTPOS_MIDDLELEFT=3,e.TEXTPOS_MIDDLECENTER=4,e.TEXTPOS_MIDDLERIGHT=5,e.TEXTPOS_BOTTOMLEFT=6,e.TEXTPOS_BOTTOMCENTER=7,e.TEXTPOS_BOTTOMRIGHT=8,e.SIZE_AUTO="auto",e.SIZE_TINY="tiny",e.SIZE_SMALL="small",e.SIZE_NORMAL="normal",e.SIZE_LARGE="large",e.SIZE_HUGE="huge",e.MARKLOC_ABOVEBAR="AboveBar",e.MARKLOC_BELOWBAR="BelowBar",e.MARKLOC_TOP="Top",e.MARKLOC_BOTTOM="Bottom",e.MARKLOC_RIGHT="Right",e.MARKLOC_LEFT="Left",e.MARKLOC_ABSOLUTE="Absolute",e.MARKLOC_ABSOLUTEUP="AbsoluteUp",e.MARKLOC_ABSOLUTEDOWN="AbsoluteDown",e.HHISTLOC_RELATIVE="relative",e.HHISTLOC_ABSOLUTE="absolute",e.HHISTDIR_LEFTTORIGHT="left_to_right",e.HHISTDIR_RIGHTTOLEFT="right_to_left",void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(31)(t))},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(31)(t))},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), 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){(function(t){var e={};e.LINESTYLE_SOLID=0,e.LINESTYLE_DOTTED=1,e.LINESTYLE_DASHED=2,e.LINESTYLE_LARGE_DASHED=3,e.TEXTPOS_TOPLEFT=0,e.TEXTPOS_TOPCENTER=1,e.TEXTPOS_TOPRIGHT=2,e.TEXTPOS_MIDDLELEFT=3,e.TEXTPOS_MIDDLECENTER=4,e.TEXTPOS_MIDDLERIGHT=5,e.TEXTPOS_BOTTOMLEFT=6,e.TEXTPOS_BOTTOMCENTER=7,e.TEXTPOS_BOTTOMRIGHT=8,e.SIZE_AUTO="auto",e.SIZE_TINY="tiny",e.SIZE_SMALL="small",e.SIZE_NORMAL="normal",e.SIZE_LARGE="large",e.SIZE_HUGE="huge",e.MARKLOC_ABOVEBAR="AboveBar",e.MARKLOC_BELOWBAR="BelowBar",e.MARKLOC_TOP="Top",e.MARKLOC_BOTTOM="Bottom",e.MARKLOC_RIGHT="Right",e.MARKLOC_LEFT="Left",e.MARKLOC_ABSOLUTE="Absolute",e.MARKLOC_ABSOLUTEUP="AbsoluteUp",e.MARKLOC_ABSOLUTEDOWN="AbsoluteDown",e.HHISTLOC_RELATIVE="relative",e.HHISTLOC_ABSOLUTE="absolute",e.HHISTDIR_LEFTTORIGHT="left_to_right",e.HHISTDIR_RIGHTTOLEFT="right_to_left",void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(31)(t))},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(31)(t))},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&&"pro_realtime_trial"===user.pro_plan).toggleClass("is-not-trial",!(is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan)).toggleClass("is-not-trial-available",!user.trial_availiable).toggleClass("is-trial-available",!!user.trial_availiable),TVSettings.sync(user.settings),is_initial||TradingView.dropPrerenderCache(),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?(is_initial||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(userBadge(user,!0,"strong")),$('input[name="csrfmiddlewaretoken"]').val($.cookie("csrftoken")||"")),$(".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(){var t=showSignModal({mode:"step-two",noCloseButton:!!user.social_registration,dontCloseOnEsc:!!user.social_registration,nameFields:!user.social_registration,noUsernameField:!user.social_registration,newUserHandler:user.social_registration});user.social_registration?delete user.social_registration:TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),window.iframeAuthWidget&&(window.iframeAuthWidget.preventClose=!1,t.on("destroy",function(){window.iframeAuthWidget.postClose()}))}),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__(58).TVXWindowEvents,trackEvent=__webpack_require__(65).trackEvent;__webpack_require__(67),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.language?e.setRequestHeader("X-Language",window.language):console.warn("window.language 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 $("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&&"pro_realtime_trial"===user.pro_plan).toggleClass("is-not-trial",!(is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan)).toggleClass("is-not-trial-available",!user.trial_availiable).toggleClass("is-trial-available",!!user.trial_availiable),TVSettings.sync(user.settings),is_initial||TradingView.dropPrerenderCache(),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?(is_initial||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(userBadge(user,!0,"strong")),$('input[name="csrfmiddlewaretoken"]').val($.cookie("csrftoken")||"")),$(".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(){var t=showSignModal({mode:"step-two",noCloseButton:!!user.social_registration,dontCloseOnEsc:!!user.social_registration,nameFields:!user.social_registration,noUsernameField:!user.social_registration,newUserHandler:user.social_registration});user.social_registration?delete user.social_registration:TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),window.iframeAuthWidget&&(window.iframeAuthWidget.preventClose=!1,t.on("destroy",function(){window.iframeAuthWidget.postClose()}))}),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__(58).TVXWindowEvents,trackEvent=__webpack_require__(65).trackEvent;__webpack_require__(67),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.language?e.setRequestHeader("X-Language",window.language):console.warn("window.language 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){if(e||(e={}),!0===e.verifiedPhoneRequired){var i=t;t=function(){whenPhoneVerified({showDialog:!0,source:e.source,doNotCheckSuspicious:e.doNotCheckSuspicious}).done(i)}}is_authenticated||Featuresets.enabled("charting_library_base")?t():showSignModal({source:e.source,sourceMeta:e.sourceMeta,feature:e.feature,signinSuccess:t})},TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},TradingView.dropPrerenderCache=function(){$('link[rel="prerender"]').remove()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.isProRealtime=function(){return this.isPro()&&("pro_realtime"===user.pro_plan||"pro_realtime_trial"===user.pro_plan)},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&&window.user.show_billing;t.toggleClass("i-hidden",!e),"A"!==this.tagName&&(t=t.find("a")),t.attr("href",e?"/u/"+user.username+"/#billing":"")})})}).call(exports,__webpack_require__(56),__webpack_require__(64),__webpack_require__(1))},,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=i(66),s=i(1),r=i(54),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)} ;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){if(e||(e={}),!0===e.verifiedPhoneRequired){var i=t;t=function(){whenPhoneVerified({showDialog:!0,source:e.source,doNotCheckSuspicious:e.doNotCheckSuspicious}).done(i)}}is_authenticated||Featuresets.enabled("charting_library_base")?t():showSignModal({source:e.source,sourceMeta:e.sourceMeta,feature:e.feature,signinSuccess:t})},TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},TradingView.dropPrerenderCache=function(){$('link[rel="prerender"]').remove()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.isProRealtime=function(){return this.isPro()&&("pro_realtime"===user.pro_plan||"pro_realtime_trial"===user.pro_plan)},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&&window.user.show_billing;t.toggleClass("i-hidden",!e),"A"!==this.tagName&&(t=t.find("a")),t.attr("href",e?"/u/"+user.username+"/#billing":"")})})}).call(exports,__webpack_require__(56),__webpack_require__(64),__webpack_require__(1))},,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=i(66),s=i(1),r=i(54),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=i(56),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){"use strict";function o(t){$(t).attr("title")||t.offsetWidth+s>=t.scrollWidth||$(t).attr("title",$(t).text())}var n,s;i(26),n=i(68),s=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){o(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function t(){n.hide(),e.off("mouseleave mousedown",t)}var e=$(this);e[0].offsetWidth+s>=e[0].scrollWidth||(n.showOnElement(e[0],{text:e.text()}),e.on("mouseleave mousedown",t))})})},function(t,e,i){"use strict";function o(t,e){var i,o,n;return void 0===e&&(e=!1),i=t.data("commonTooltipText")||"",o=t.attr("title"),i||o||e?(i=r(t),n={h:t.outerHeight(),w:t.outerWidth(),x:t.offset().left-$(window).scrollLeft(),y:t.offset().top-$(window).scrollTop()},{above:t.hasClass("common-tooltip-above"),below:t.hasClass("common-tooltip-below"),html:t.hasClass("common-tooltip-html"),otl:t.hasClass("common-tooltip-otl"),otr:t.hasClass("common-tooltip-otr"),rect:n,text:i,vertical:t.hasClass("common-tooltip-vertical")}):null}function n(t){var e=-1!==g.indexOf(t)?m[t]:"";p.removeClass(g.filter(function(t){return!!t}).map(function(t){return m[t]}).join(" ")),e&&!p.hasClass(e)&&p.addClass(e)}function s(t){var e,i,o,n,s=t.rect;s&&(p.attr("class","common-tooltip-wrapper").css({bottom:"auto",left:"auto",right:"auto",top:"auto"}),Modernizr.pointerevents||p.addClass("no-pointer-events"),u.css({left:"0",width:"auto"}),u.width(u.width()+2),e=$(window).width(),i=$(window).height(),o=t.vertical,(o&&s.w<20||!o&&s.h<20)&&p.addClass("farther"),n="",o?(p.addClass("vertical").css({left:s.x+s.w,top:s.y-(p.outerHeight()-s.h)/2}),n=t.otr?"otr":t.otl||u.offset().left+u.outerWidth()+d>e?"otl":"otr","otl"===n?p.addClass("otl").css({left:"auto",right:e-s.x}):p.addClass("otr")):(p.css({bottom:i-s.y,left:s.x-(p.outerWidth()-s.w)/2}),n=t.above?"above":t.below||u.offset().top-$(window).scrollTop()<d?"below":"above","below"===n?p.addClass("below").css({bottom:"auto",top:s.y+s.h}):p.addClass("above"),u.offset().left-d<0?u.css("left",Math.abs(u.offset().left)+d):u.offset().left+u.outerWidth()+d>e&&u.css("left",e-(u.offset().left+u.outerWidth()+d))))}function r(t){var e=t.data("commonTooltipText")||"",i=t.attr("title");return i&&(e=i,t.data("commonTooltipText",e),t.removeAttr("title")),e}function a(){clearTimeout(_),clearTimeout(f),document.body.contains(p[0])&&(p.css("opacity","0"),f=setTimeout(p.detach.bind(p),c/2))}function l(t,e){var i,n;void 0===e&&(e={}),i=$(t),0!==i.length&&(n=!(!e.text&&!e.$inner),e=$.extend({},o(i,n),e),$.isEmptyObject(e)||h(e))}function h(t){var e=document.body.contains(p[0]);if(clearTimeout(_),clearTimeout(f),!e)return void(_=setTimeout(function(){p.appendTo(document.body),h(t)},c)) 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=i(56),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){"use strict";function o(t){$(t).attr("title")||t.offsetWidth+s>=t.scrollWidth||$(t).attr("title",$(t).text())}var n,s;i(26),n=i(68),s=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){o(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function t(){n.hide(),e.off("mouseleave mousedown",t)}var e=$(this);e[0].offsetWidth+s>=e[0].scrollWidth||(n.showOnElement(e[0],{text:e.text()}),e.on("mouseleave mousedown",t))})})},function(t,e,i){"use strict";function o(t,e){var i,o,n;return void 0===e&&(e=!1),i=t.data("commonTooltipText")||"",o=t.attr("title"),i||o||e?(i=r(t),n={h:t.outerHeight(),w:t.outerWidth(),x:t.offset().left-$(window).scrollLeft(),y:t.offset().top-$(window).scrollTop()},{above:t.hasClass("common-tooltip-above"),below:t.hasClass("common-tooltip-below"),html:t.hasClass("common-tooltip-html"),otl:t.hasClass("common-tooltip-otl"),otr:t.hasClass("common-tooltip-otr"),rect:n,text:i,vertical:t.hasClass("common-tooltip-vertical")}):null}function n(t){var e=-1!==g.indexOf(t)?m[t]:"";p.removeClass(g.filter(function(t){return!!t}).map(function(t){return m[t]}).join(" ")),e&&!p.hasClass(e)&&p.addClass(e)}function s(t){var e,i,o,n,s=t.rect;s&&(p.attr("class","common-tooltip-wrapper").css({bottom:"auto",left:"auto",right:"auto",top:"auto"}),Modernizr.pointerevents||p.addClass("no-pointer-events"),u.css({left:"0",width:"auto"}),u.width(u.width()+2),e=$(window).width(),i=$(window).height(),o=t.vertical,(o&&s.w<20||!o&&s.h<20)&&p.addClass("farther"),n="",o?(p.addClass("vertical").css({left:s.x+s.w,top:s.y-(p.outerHeight()-s.h)/2}),n=t.otr?"otr":t.otl||u.offset().left+u.outerWidth()+d>e?"otl":"otr","otl"===n?p.addClass("otl").css({left:"auto",right:e-s.x}):p.addClass("otr")):(p.css({bottom:i-s.y,left:s.x-(p.outerWidth()-s.w)/2}),n=t.above?"above":t.below||u.offset().top-$(window).scrollTop()<d?"below":"above","below"===n?p.addClass("below").css({bottom:"auto",top:s.y+s.h}):p.addClass("above"),u.offset().left-d<0?u.css("left",Math.abs(u.offset().left)+d):u.offset().left+u.outerWidth()+d>e&&u.css("left",e-(u.offset().left+u.outerWidth()+d))))}function r(t){var e=t.data("commonTooltipText")||"",i=t.attr("title");return i&&(e=i,t.data("commonTooltipText",e),t.removeAttr("title")),e}function a(){clearTimeout(_),clearTimeout(f),document.body.contains(p[0])&&(p.css("opacity","0"),f=setTimeout(p.detach.bind(p),c/2))}function l(t,e){var i,n;void 0===e&&(e={}),i=$(t),0!==i.length&&(n=!(!e.text&&!e.$inner),e=$.extend({},o(i,n),e),$.isEmptyObject(e)||h(e))}function h(t){var e=document.body.contains(p[0]);if(clearTimeout(_),clearTimeout(f),!e)return void(_=setTimeout(function(){p.appendTo(document.body),h(t)},c))
@@ -247,56 +247,56 @@ this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),e&&thi
this._priceAxisViewsBase.push(s),this._paneViews.push(new E(this,this._series,this._model,o)),this.properties().styles[o].trackPrice.value()&&this._paneViews.push(new r(this,this._series,this._model,o)),e.push(o);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new P(this._properties.bands[i],this));this._properties.bandsBackground&&this._paneViews.push(new L(this)),a=[],this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(t,e){return S.graphicsZOrderPriority(t)-S.graphicsZOrderPriority(e)}));for(l in a)h=a[l],c="_paneView"+h,d="StudyPaneView_"+h,TradingView.Study[d]&&(this[c]=new TradingView.Study[d](this,this._model),this._paneViews.push(this[c])),this._dataWindowView||"hhists"!==h||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this._model));if(this._properties.areaBackground&&this._paneViews.push(new z(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)p=this._metaInfo.filledAreas[i],u=this._properties.filledAreasStyle[p.id],p.type===at.FilledArea.TYPE_PLOTS||p.palette?this._paneViews.push(new F(this,p,u)):p.type===at.FilledArea.TYPE_HLINES?this._paneViews.push(new k(this,p,u)):ct.logWarn("Unsupported filledArea type: "+p.type);this.createPlotLabels(e),this._dataWindowView||(this._dataWindowView=new U(this,this._model)),this._statusView||(this._statusView=new j(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},S.prototype.recalculate=function(t){var e=this._model.paneForSource(this);this._model.recalculatePane(e,t),this._model.updateSource(this)},S.prototype.data=function(){return this.m_data},S.prototype.metaInfo=function(){return this._metaInfo},S.prototype.status=function(){return this._status},S.prototype.title=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g=JSON.stringify([t,e,i]);if(this._titleCache[g])return this._titleCache[g];if(o=t?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",o=$.t(o),!0!==i&&(n=this._showStudyArgumentsProperty.value(),s=this.inputsForGUI()||[],r=this,e&&"object"==typeof e||(e={}),n&&s.length>0)){if(a={},this._isChildStudy)for(l=0;l<this._metaInfo.inputs.length;++l)if(h=this._metaInfo.inputs[l],at.isSourceInput(h)){c=h.id,d=this._properties.inputs[c].value(),d.indexOf("$")>=0&&this._source&&(p=this._source.metaInfo(),u=this._source.title(t,null,!0),1===p.plots.length?a[d]=u:(_=d.split("$")[1],f=p.plots[_].id,m=p.styles&&p.styles[f]&&p.styles[f].title||f,a[d]=u+":"+m));break}s=s.map(function(t){var i=isNumber(t)?r._numericFormatter.format(t):a&&a[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+s.join(", ")+")"}return this._titleCache[g]=o,o},S.prototype.invalidateTitleCache=function(t){if(this._titleCache={}, this._priceAxisViewsBase.push(s),this._paneViews.push(new E(this,this._series,this._model,o)),this.properties().styles[o].trackPrice.value()&&this._paneViews.push(new r(this,this._series,this._model,o)),e.push(o);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new P(this._properties.bands[i],this));this._properties.bandsBackground&&this._paneViews.push(new L(this)),a=[],this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(t,e){return S.graphicsZOrderPriority(t)-S.graphicsZOrderPriority(e)}));for(l in a)h=a[l],c="_paneView"+h,d="StudyPaneView_"+h,TradingView.Study[d]&&(this[c]=new TradingView.Study[d](this,this._model),this._paneViews.push(this[c])),this._dataWindowView||"hhists"!==h||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this._model));if(this._properties.areaBackground&&this._paneViews.push(new z(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)p=this._metaInfo.filledAreas[i],u=this._properties.filledAreasStyle[p.id],p.type===at.FilledArea.TYPE_PLOTS||p.palette?this._paneViews.push(new F(this,p,u)):p.type===at.FilledArea.TYPE_HLINES?this._paneViews.push(new k(this,p,u)):ct.logWarn("Unsupported filledArea type: "+p.type);this.createPlotLabels(e),this._dataWindowView||(this._dataWindowView=new U(this,this._model)),this._statusView||(this._statusView=new j(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},S.prototype.recalculate=function(t){var e=this._model.paneForSource(this);this._model.recalculatePane(e,t),this._model.updateSource(this)},S.prototype.data=function(){return this.m_data},S.prototype.metaInfo=function(){return this._metaInfo},S.prototype.status=function(){return this._status},S.prototype.title=function(t,e,i){var o,n,s,r,a,l,h,c,d,p,u,_,f,m,g=JSON.stringify([t,e,i]);if(this._titleCache[g])return this._titleCache[g];if(o=t?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",o=$.t(o),!0!==i&&(n=this._showStudyArgumentsProperty.value(),s=this.inputsForGUI()||[],r=this,e&&"object"==typeof e||(e={}),n&&s.length>0)){if(a={},this._isChildStudy)for(l=0;l<this._metaInfo.inputs.length;++l)if(h=this._metaInfo.inputs[l],at.isSourceInput(h)){c=h.id,d=this._properties.inputs[c].value(),d.indexOf("$")>=0&&this._source&&(p=this._source.metaInfo(),u=this._source.title(t,null,!0),1===p.plots.length?a[d]=u:(_=d.split("$")[1],f=p.plots[_].id,m=p.styles&&p.styles[f]&&p.styles[f].title||f,a[d]=u+":"+m));break}s=s.map(function(t){var i=isNumber(t)?r._numericFormatter.format(t):a&&a[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+s.join(", ")+")"}return this._titleCache[g]=o,o},S.prototype.invalidateTitleCache=function(t){if(this._titleCache={},
!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].invalidateTitleCache(t)},S.prototype.graphics=function(){return this._graphics.graphics()},S.prototype.turnaround=function(t){return!0===t?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},S.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries().turnaround()||t===this.turnaround(!0)},S.prototype._makeJSONForNSData=function(t,e){var i=""!==t.params.nonseries.d?K(t.params.nonseries.d):e||"";return Promise.resolve(i)},S.prototype.onData=function(t){var e,i,o,n=this;switch(t.method){case"study_loading":this._status=$.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),-1===["Plot splits","Plot earnings","Plot dividends"].indexOf(n._metaInfo.description)&&(n._loadingStartTime=(new Date).getTime());break;case"study_error":delete this._loadingStartTime,this._failed=!0,this.clearData(),t.params[2]?this._status=$.t(t.params[2].split(":",2)[0]):this._status="",-1===["Sessions"].indexOf(n._metaInfo.description)&&Telemetry.sendReport("study_error"),this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(t.params[1]))return Promise.resolve();e="chartSession:"+n._chartApi._sessionid,ct.logDebug(e+", Study "+this._metaInfo.description+" loading took "+((new Date).getTime()-this._loadingStartTime)+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),i=this._model.paneForSource(this),this._model.recalculatePane(i),this._updateSources(),this._model.invalidate(new G(G.FULL_UPDATE));break;case"study_deleted":break;case"data_update":return this._checkTurnaround(t.params.turnaround)?(this._studyModified&&(this.clearData(),this._studyModified=!1),o=0===this.m_data.size()&&this._metaInfo.plots.length>0,ht(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){n._makeJSONForNSData(t).then(function(i){var s,r;t.params.nonseries.d=i,n._processPlotOffsets(t.params),n.transformData(t.params.plots),s=n._mergeData(t.params.plots).earliestRow,n.hasBarColorer()&&(null!==s?n._model.mainSeries().invalidateBarStylesCache(s.index):ct.logNormal("ERROR: No earliestRow in studies plots, "+n._debugId())),n._graphics.process(t.params.nonseries),n._postProcessGraphics(),r=n._model.paneForSource(n),n._model.recalculatePane(r,o),n._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},S.prototype.transformData=function(t){},S.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},S.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},S.prototype._processPlotOffsets=function(t){S.processPlotOffsets(this,t)},S.prototype._mergeData=function(t){return this.m_data.merge(t)},S.prototype._postProcessGraphics=function(){ !0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].invalidateTitleCache(t)},S.prototype.graphics=function(){return this._graphics.graphics()},S.prototype.turnaround=function(t){return!0===t?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},S.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries().turnaround()||t===this.turnaround(!0)},S.prototype._makeJSONForNSData=function(t,e){var i=""!==t.params.nonseries.d?K(t.params.nonseries.d):e||"";return Promise.resolve(i)},S.prototype.onData=function(t){var e,i,o,n=this;switch(t.method){case"study_loading":this._status=$.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),-1===["Plot splits","Plot earnings","Plot dividends"].indexOf(n._metaInfo.description)&&(n._loadingStartTime=(new Date).getTime());break;case"study_error":delete this._loadingStartTime,this._failed=!0,this.clearData(),t.params[2]?this._status=$.t(t.params[2].split(":",2)[0]):this._status="",-1===["Sessions"].indexOf(n._metaInfo.description)&&Telemetry.sendReport("study_error"),this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(t.params[1]))return Promise.resolve();e="chartSession:"+n._chartApi._sessionid,ct.logDebug(e+", Study "+this._metaInfo.description+" loading took "+((new Date).getTime()-this._loadingStartTime)+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),i=this._model.paneForSource(this),this._model.recalculatePane(i),this._updateSources(),this._model.invalidate(new G(G.FULL_UPDATE));break;case"study_deleted":break;case"data_update":return this._checkTurnaround(t.params.turnaround)?(this._studyModified&&(this.clearData(),this._studyModified=!1),o=0===this.m_data.size()&&this._metaInfo.plots.length>0,ht(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){n._makeJSONForNSData(t).then(function(i){var s,r;t.params.nonseries.d=i,n._processPlotOffsets(t.params),n.transformData(t.params.plots),s=n._mergeData(t.params.plots).earliestRow,n.hasBarColorer()&&(null!==s?n._model.mainSeries().invalidateBarStylesCache(s.index):ct.logNormal("ERROR: No earliestRow in studies plots, "+n._debugId())),n._graphics.process(t.params.nonseries),n._postProcessGraphics(),r=n._model.paneForSource(n),n._model.recalculatePane(r,o),n._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},S.prototype.transformData=function(t){},S.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},S.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},S.prototype._processPlotOffsets=function(t){S.processPlotOffsets(this,t)},S.prototype._mergeData=function(t){return this.m_data.merge(t)},S.prototype._postProcessGraphics=function(){
var t=this,e=function(e){var i,o,n,s=t._graphics.graphics(),r=[];if(s&&s[e])for(n=s[e],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.StudyPriceAxisView_hlines(t,t._model,n[i].data[o],n[i].styleId,e));return r};this._hlinesPriceAsisViews=e("hlines"),this._horizlinesPriceAsisViews=e("horizlines"),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},S.prototype._getNonPriceParent=function(){var t,e;if(this._nonPriceParent)return this._nonPriceParent;for(t=this.source();t instanceof S;){if(e=t.metaInfo(),!e.is_price_study||"Compare@tv-basicstudies"===e.id)return this._nonPriceParent=t,t;t=t.source()}},S.prototype.firstValue=function(t){var e,i,o,n,s,r;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?(e=this._model.timeScale().visibleBars(),i=e.firstBar(),o=e.lastBar(),0===this.m_data.size()?null:(s=this,this.m_data.range(i,o).each(function(e,i){var o,r,a;for(o=1;o<i.length;++o)if(void 0!==i[o-1]&&null!==i[o-1]&&!s.isSelfColorerPlot(o-1)&&(r=s._metaInfo.plots[o-1].id,a=s.properties().styles[r],a.visible&&a.visible.value()&&!(t&&Math.abs(i[o])<1e-10||void 0===i[o]||null===i[o]||n)))return n=i[o],!0}),this._nonPriceFirstValue=n,n)):this._isChildStudy&&(r=this._getNonPriceParent())&&this.priceScale()===r.priceScale()?void 0!==r._nonPriceFirstValue?r._nonPriceFirstValue:r.firstValue():this._series.data().firstValue()},S.offset=function(t,e){var i=0;return t._plotOffsets&&void 0!==t._plotOffsets[e]&&(i+=t._plotOffsets[e]),void 0!==t._plotOffsetsMetaInfoOverride[e]?i+=t._plotOffsetsMetaInfoOverride[e]:t.properties().offsets&&void 0!==t.properties().offsets[e]&&(i+=t.properties().offsets[e].val.value()),t.properties().offset&&(i+=t.properties().offset.val.value()),i},S.prototype.offset=function(t){return S.offset(this,t)},S.prototype.priceRange=function(t,e){var i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;if(!TradingView.isInteger(t))return void ct.logDebug("Study.priceRange: incorrect startBar");if(!TradingView.isInteger(e))return void ct.logDebug("Study.priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,o=this,n=o._metaInfo,0===n.plots.length)return null;for(a=[],h=0;h<n.plots.length;++h)if(!(o.isSelfColorerPlot(h)||o.isTextColorerPlot(h)||o.isBarColorerPlot(h)||o.isBgColorerPlot(h)||o.isOHLCColorerPlot(h))&&(c=n.plots[h].id,o.isOHLCSeriesPlot(h)?(p=n.plots[h].target,d=o.properties().ohlcPlots[p]):d=o.properties().styles[c],d.visible.value()&&(l=null,d.location&&(l=d.location.value()),r||(u=[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(l)<0,_=o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h),r=_&&u||o.isPlotArrowsPlot(h)),o.isLinePlot(h)||(o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h))&&d.location.value()===CanvasEx.MARKLOC_ABSOLUTE||o.isOHLCSeriesPlot(h)))){if(f={index:h+1,offset:o.offset(c)},m=o.properties().styles[c].plottype.value(), var t=this,e=function(e){var i,o,n,s=t._graphics.graphics(),r=[];if(s&&s[e])for(n=s[e],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.StudyPriceAxisView_hlines(t,t._model,n[i].data[o],n[i].styleId,e));return r};this._hlinesPriceAsisViews=e("hlines"),this._horizlinesPriceAsisViews=e("horizlines"),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},S.prototype._getNonPriceParent=function(){var t,e;if(this._nonPriceParent)return this._nonPriceParent;for(t=this.source();t instanceof S;){if(e=t.metaInfo(),!e.is_price_study||"Compare@tv-basicstudies"===e.id)return this._nonPriceParent=t,t;t=t.source()}},S.prototype.firstValue=function(t){var e,i,o,n,s,r;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?(e=this._model.timeScale().visibleBars(),i=e.firstBar(),o=e.lastBar(),0===this.m_data.size()?null:(s=this,this.m_data.range(i,o).each(function(e,i){var o,r,a;for(o=1;o<i.length;++o)if(void 0!==i[o-1]&&null!==i[o-1]&&!s.isSelfColorerPlot(o-1)&&(r=s._metaInfo.plots[o-1].id,a=s.properties().styles[r],a.visible&&a.visible.value()&&!(t&&Math.abs(i[o])<1e-10||void 0===i[o]||null===i[o]||n)))return n=i[o],!0}),this._nonPriceFirstValue=n,n)):this._isChildStudy&&(r=this._getNonPriceParent())&&this.priceScale()===r.priceScale()?void 0!==r._nonPriceFirstValue?r._nonPriceFirstValue:r.firstValue():this._series.data().firstValue()},S.offset=function(t,e){var i=0;return t._plotOffsets&&void 0!==t._plotOffsets[e]&&(i+=t._plotOffsets[e]),void 0!==t._plotOffsetsMetaInfoOverride[e]?i+=t._plotOffsetsMetaInfoOverride[e]:t.properties().offsets&&void 0!==t.properties().offsets[e]&&(i+=t.properties().offsets[e].val.value()),t.properties().offset&&(i+=t.properties().offset.val.value()),i},S.prototype.offset=function(t){return S.offset(this,t)},S.prototype.priceRange=function(t,e){var i,o,n,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b,w,S;if(!TradingView.isInteger(t))return void ct.logDebug("Study.priceRange: incorrect startBar");if(!TradingView.isInteger(e))return void ct.logDebug("Study.priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,o=this,n=o._metaInfo,0===n.plots.length)return null;for(a=[],h=0;h<n.plots.length;++h)if(!(o.isSelfColorerPlot(h)||o.isTextColorerPlot(h)||o.isBarColorerPlot(h)||o.isBgColorerPlot(h)||o.isOHLCColorerPlot(h))&&(c=n.plots[h].id,o.isOHLCSeriesPlot(h)?(p=n.plots[h].target,d=o.properties().ohlcPlots[p]):d=o.properties().styles[c],d.visible.value()&&(l=null,d.location&&(l=d.location.value()),r||(u=[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(l)<0,_=o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h),r=_&&u||o.isPlotArrowsPlot(h)),o.isLinePlot(h)||(o.isPlotShapesPlot(h)||o.isPlotCharsPlot(h))&&d.location.value()===CanvasEx.MARKLOC_ABSOLUTE||o.isOHLCSeriesPlot(h)))){if(f={index:h+1,offset:o.offset(c)},m=o.properties().styles[c].plottype.value(),
!o.properties().skipHistogramBaseOnAutoScale&&[lt.PlotType.Histogram,lt.PlotType.Columns,lt.PlotType.Area].indexOf(m)>=0){if(g=o.properties().styles[c].histogramBase.value(),!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._model.properties().scalesProperties.showStudyLastValue.value()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},S.prototype.isLinePlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.LINE},S.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===lt.PlotTypes.COLORER},S.prototype.isSelfColorerPlot=function(t){return S.isSelfColorerPlot(this,t)},S.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.TEXT_COLORER},S.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.BAR_COLORER},S.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.BG_COLORER},S.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.SHAPES},S.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.CHARS},S.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===lt.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===lt.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===lt.OHLCType.CANDLES},S.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type;return e===lt.PlotTypes.OHLC_OPEN||e===lt.PlotTypes.OHLC_HIGH||e===lt.PlotTypes.OHLC_LOW||e===lt.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCOpenPlot=function(t){ !o.properties().skipHistogramBaseOnAutoScale&&[lt.PlotType.Histogram,lt.PlotType.Columns,lt.PlotType.Area].indexOf(m)>=0){if(g=o.properties().styles[c].histogramBase.value(),!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===lt.PlotTypes.LINE},S.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===lt.PlotTypes.COLORER},S.prototype.isSelfColorerPlot=function(t){return S.isSelfColorerPlot(this,t)},S.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.TEXT_COLORER},S.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.BAR_COLORER},S.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.BG_COLORER},S.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.SHAPES},S.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.CHARS},S.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===lt.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===lt.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===lt.OHLCType.CANDLES},S.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type
return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_OPEN},S.prototype.isOHLCHighPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_HIGH},S.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_LOW},S.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_COLORER},S.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===lt.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 nt(i)):this._formatter=new ot(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 ct.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": ;return e===lt.PlotTypes.OHLC_OPEN||e===lt.PlotTypes.OHLC_HIGH||e===lt.PlotTypes.OHLC_LOW||e===lt.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCOpenPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_OPEN},S.prototype.isOHLCHighPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_HIGH},S.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_LOW},S.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_CLOSE},S.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===lt.PlotTypes.OHLC_COLORER},S.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===lt.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 nt(i)):this._formatter=new ot(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 ct.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_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(287).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=!!at.canHaveChildren(this._metaInfo)),this._canHaveChildren},S.getInputRebindType=function(t,e,i){var o=at.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(195),i(56),i(1),i(223)) 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(287).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=!!at.canHaveChildren(this._metaInfo)),this._canHaveChildren},S.getInputRebindType=function(t,e,i){var o=at.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,
},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(53),l=i(241).HorzLineRenderer,h=i(233),c=i(258),d=i(259).assert,p=i(199);a=i(53),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){"use strict";function o(t,e,i){this._study=t, prepareStudyProperties:h,prepareStudyPropertiesForLoadChart:d,prepareStudyPropsStateForLoadChart:_,shiftColor:w}}).call(e,i(195),i(56),i(1),i(223))},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(53),l=i(241).HorzLineRenderer,h=i(233),c=i(258),d=i(259).assert,p=i(199);a=i(53),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),
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(246),s=i(196),r=i(198);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";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,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,n=this._study.metaInfo().plots,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s,N(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.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 t.transparency=this._fillStyleProps.transparency.value(),new n(t)},e.BandPaneView=o,e.BandBackgroundPaneView=s,e.HlineFillPaneView=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(246),s=i(196),r=i(198);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";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,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,n=this._study.metaInfo().plots,s=0;s<n.length;s++)n[s].id===this._plotName&&(this._plotIndex=s,N(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.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],
;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,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(233),u=i(232),_=u.SelectionRenderer,f=u.SelectionRendererArrowsUpDown,m=i(234),g=m.PaneRendererBars,v=m.PaneRendererHistogram,y=m.PaneRendererColumns,b=m.PaneRendererLine,w=m.PaneRendererArea,S=m.PaneRendererCandles,T=m.PaneRendererCross,C=m.PaneRendererCircles,x=m.PaneRendererArrowsUpDownItem,P=m.PaneRendererArrowsUpDown,L=m.PaneRendererUnicodeChar,k=m.PaneRendererBackground,I=i(236),A=i(237),E=i(238),M=i(53),$=i(197),D=$.RGBColor,V=$.rgbToHsl,O=$.hslToRgb,B=i(298),R=i(299),N=i(259).assert,F=i(199);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,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,$,D,V,O,R;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=[B.PlotType.Line,B.PlotType.Area,B.PlotType.Circles,B.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),u=this.m_study.priceScale(),_=u.properties().percentage.value(),f=M.clamp(this._getTranspValue(),0,100),m={},g=function(t,e){var i=t+"@"+e;return m[i]||(this._plotName&&"vol"===this._plotName?m[i]=F.generateColor(t,e):m[i]=F.generateColor(t,e,!0)),m[i]}.bind(this),v=d._start;v<d._end;++v)y=d._indexAt(v),y+=n,y=Math.floor(y),b=d._valueAt(v),w=b[this._plotIndex+1],S=void 0===w||null===w,w=S?NaN:w,_&&!S&&(w=100*(w-l)/l),r&&S||(T=new M.Point(y,w),C=void 0!==b[this._colorer+1]||this._palette&&this._palette.addDefaultColor, 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,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(233),u=i(232),_=u.SelectionRenderer,f=u.SelectionRendererArrowsUpDown,m=i(234),g=m.PaneRendererBars,v=m.PaneRendererHistogram,y=m.PaneRendererColumns,b=m.PaneRendererLine,w=m.PaneRendererArea,S=m.PaneRendererCandles,T=m.PaneRendererCross,C=m.PaneRendererCircles,x=m.PaneRendererArrowsUpDownItem,P=m.PaneRendererArrowsUpDown,L=m.PaneRendererUnicodeChar,k=m.PaneRendererBackground,I=i(236),A=i(237),E=i(238),M=i(53),$=i(197),D=$.RGBColor,V=$.rgbToHsl,O=$.hslToRgb,B=i(298),R=i(299),N=i(259).assert,F=i(199);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,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,$,D,V,O,R;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=[B.PlotType.Line,B.PlotType.Area,B.PlotType.Circles,B.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),u=this.m_study.priceScale(),_=u.properties().percentage.value(),f=M.clamp(this._getTranspValue(),0,100),m={},g=function(t,e){var i=t+"@"+e;return m[i]||(this._plotName&&"vol"===this._plotName?m[i]=F.generateColor(t,e):m[i]=F.generateColor(t,e,!0)),m[i]}.bind(this),
this._colorer&&C&&(w=b[this._colorer+1],T.style={},x=this.m_study.properties().styles[this._plotName],void 0!==w&&null!==w?(P=this._palette.valToIndex?this._palette.valToIndex[w]:w,L=this._paletterProps.colors[P],k=L.color.value(),T.style.color=F.isHexColor(k)?g(k,f):k):(k=x.color.value(),T.style.color=g(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(u.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(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=p.REGULAR,v=0;v<$.length;v++)y=$[v],b=this.m_study.data().valueAt(y),y+=n,void 0!==b&&(w=b[this._plotIndex+1],u.properties().percentage.value()&&(w=100*(w-l)/l),D=this.m_model.timeScale().indexToCoordinate(Math.floor(y)),V=this.m_study.priceScale().priceToCoordinate(w),this._selectionData.points.push(new M.Point(D,V)));O=this.m_study.properties().styles[this._plotName],this._lineColor=F.generateColor(O.color.value(),f),this._lineWidth=O.linewidth.value(),R=O.color.value(),this._colorer&&(R=this._paletterProps.colors[0].color.value(),this._lineWidth=this._paletterProps.colors[0].width.value(),this._lineColor=F.generateColor(this._paletterProps.colors[0].color.value(),f)),this._color2=F.generateColor(R,f),this._color1=F.generateColor(o.addHueForColor(R),f)}},o.addHueForColor=R(function(t){var e,i=new D(t),o=V(i.r,i.g,i.b),n=o[0]+.05;return o[0]=n-Math.floor(n),e=O(o[0],o[1],o[2]),i.r=e[0],i.g=e[1],i.b=e[2],i.toHex()}),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 A,i=!!n.joinPoints&&n.joinPoints.value(),n.plottype.value()){case B.PlotType.Line:case B.PlotType.Line_with_breaks:e.append(new b(t));break;case B.PlotType.Area:case B.PlotType.Area_with_breaks:e.append(new w(t));break;case B.PlotType.Histogram:e.append(new v(t));break;case B.PlotType.Columns: v=d._start;v<d._end;++v)y=d._indexAt(v),y+=n,y=Math.floor(y),b=d._valueAt(v),w=b[this._plotIndex+1],S=void 0===w||null===w,w=S?NaN:w,_&&!S&&(w=100*(w-l)/l),r&&S||(T=new M.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],void 0!==w&&null!==w?(P=this._palette.valToIndex?this._palette.valToIndex[w]:w,L=this._paletterProps.colors[P],k=L.color.value(),T.style.color=F.isHexColor(k)?g(k,f):k):(k=x.color.value(),T.style.color=g(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(u.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(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=p.REGULAR,v=0;v<$.length;v++)y=$[v],b=this.m_study.data().valueAt(y),y+=n,void 0!==b&&(w=b[this._plotIndex+1],u.properties().percentage.value()&&(w=100*(w-l)/l),D=this.m_model.timeScale().indexToCoordinate(Math.floor(y)),V=this.m_study.priceScale().priceToCoordinate(w),this._selectionData.points.push(new M.Point(D,V)));O=this.m_study.properties().styles[this._plotName],this._lineColor=F.generateColor(O.color.value(),f),this._lineWidth=O.linewidth.value(),R=O.color.value(),this._colorer&&(R=this._paletterProps.colors[0].color.value(),this._lineWidth=this._paletterProps.colors[0].width.value(),this._lineColor=F.generateColor(this._paletterProps.colors[0].color.value(),f)),this._color2=F.generateColor(R,f),this._color1=F.generateColor(o.addHueForColor(R),f)}},o.addHueForColor=R(function(t){var e,i=new D(t),o=V(i.r,i.g,i.b),n=o[0]+.05;return o[0]=n-Math.floor(n),e=O(o[0],o[1],o[2]),i.r=e[0],i.g=e[1],i.b=e[2],i.toHex()}),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 A,
e.append(new y(t));break;case B.PlotType.Cross:e.append(new T(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new b(o)));break;case B.PlotType.Circles:e.append(new C(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new b(o)));break;default:e.append(new b(t))}return this.m_study===this.m_model.selectedSource()&&e.append(new _(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=[],N(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 M.Point(Math.floor(u)-.5),g=isNumber(r)?r:50,g=Math.min(g,100),g=Math.max(g,0),void 0!==f&&null!==f?(v=s.valToIndex?s.valToIndex[f]:f,m.color=F.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 A,e.append(new k(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,u,_,f,m,g,v,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=E(o,n), i=!!n.joinPoints&&n.joinPoints.value(),n.plottype.value()){case B.PlotType.Line:case B.PlotType.Line_with_breaks:e.append(new b(t));break;case B.PlotType.Area:case B.PlotType.Area_with_breaks:e.append(new w(t));break;case B.PlotType.Histogram:e.append(new v(t));break;case B.PlotType.Columns:e.append(new y(t));break;case B.PlotType.Cross:e.append(new T(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new b(o)));break;case B.PlotType.Circles:e.append(new C(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new b(o)));break;default:e.append(new b(t))}return this.m_study===this.m_model.selectedSource()&&e.append(new _(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=[],N(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 M.Point(Math.floor(u)-.5),g=isNumber(r)?r:50,g=Math.min(g,100),g=Math.max(g,0),void 0!==f&&null!==f?(v=s.valToIndex?s.valToIndex[f]:f,m.color=F.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 A,e.append(new k(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,u,_,f,m,g,v,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),
u=this.m_study===this.m_model.selectedSource(),u&&(this.m_selectionData={points:[],hittestResult:p.REGULAR,vertOffset:0}),_=this.m_series.properties().style.value(),f=_===TradingView.Series.STYLE_LINE?"lineStyle":_===TradingView.Series.STYLE_AREA?"areaStyle":null,f?(m=this.m_series.properties()[f].priceSource.value(),g=m):(m="high",g="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),v=l._start;v<l._end;++v)y=l._indexAt(v),b=Math.floor(y+s),w=l._valueAt(v),null!==(S=w[this.m_plotIndex+1])&&void 0!==S&&void 0!==(T=this._createItem(b,S,m,g,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={},void 0!==S&&null!==S?(P=this._palette.valToIndex?this._palette.valToIndex[S]:S,x=this._paletterProps.colors[P].color.value(),T.style.color=F.generateColor(x,c)):(x=this.m_study.properties().styles[this.m_plotName].color.value(),T.style.color=F.generateColor(x,100)),L=c>9?c-10:0,T.style.borderColor=F.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={}),void 0!==S&&null!==S?(P=this._textPalette.valToIndex?this._textPalette.valToIndex[S]:S,I=this._textPaletterProps.colors[P].color.value(),T.style.textColor=F.generateColor(I,c)):(I=this.m_study.properties().styles[this.m_plotName].textColor.value(),T.style.textColor=F.generateColor(I,100))),u&&-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),M.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){case CanvasEx.MARKLOC_ABOVEBAR:if(void 0===(r=this._getSeriesVal(i,t))||null==r)return null;a=r;break;case CanvasEx.MARKLOC_BELOWBAR:if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l;break;case CanvasEx.MARKLOC_TOP:a=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:a=this._bottomCoord;break;case CanvasEx.MARKLOC_ABSOLUTE:a=e;break;default:throw Error("Bad value: "+h)}return n&&h!==CanvasEx.MARKLOC_TOP&&h!==CanvasEx.MARKLOC_BOTTOM&&(a=100*(a-s)/s),new M.Point(t,a)},s.prototype._convertItemsToCoordinates=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();t.indexesToCoordinates(this.m_items),e.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e})},s.prototype._calculateVerticalOffset=function(t,e){var i=0;switch(t){case CanvasEx.MARKLOC_ABOVEBAR: 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=E(o,n),u=this.m_study===this.m_model.selectedSource(),u&&(this.m_selectionData={points:[],hittestResult:p.REGULAR,vertOffset:0}),_=this.m_series.properties().style.value(),f=_===TradingView.Series.STYLE_LINE?"lineStyle":_===TradingView.Series.STYLE_AREA?"areaStyle":null,f?(m=this.m_series.properties()[f].priceSource.value(),g=m):(m="high",g="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),v=l._start;v<l._end;++v)y=l._indexAt(v),b=Math.floor(y+s),w=l._valueAt(v),null!==(S=w[this.m_plotIndex+1])&&void 0!==S&&void 0!==(T=this._createItem(b,S,m,g,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={},void 0!==S&&null!==S?(P=this._palette.valToIndex?this._palette.valToIndex[S]:S,x=this._paletterProps.colors[P].color.value(),T.style.color=F.generateColor(x,c)):(x=this.m_study.properties().styles[this.m_plotName].color.value(),T.style.color=F.generateColor(x,100)),L=c>9?c-10:0,T.style.borderColor=F.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={}),void 0!==S&&null!==S?(P=this._textPalette.valToIndex?this._textPalette.valToIndex[S]:S,I=this._textPaletterProps.colors[P].color.value(),T.style.textColor=F.generateColor(I,c)):(I=this.m_study.properties().styles[this.m_plotName].textColor.value(),T.style.textColor=F.generateColor(I,100))),u&&-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),M.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){case CanvasEx.MARKLOC_ABOVEBAR:if(void 0===(r=this._getSeriesVal(i,t))||null==r)return null;a=r;break;case CanvasEx.MARKLOC_BELOWBAR:if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l;break;case CanvasEx.MARKLOC_TOP:a=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:a=this._bottomCoord;break;case CanvasEx.MARKLOC_ABSOLUTE:a=e;break;default:throw Error("Bad value: "+h)}return n&&h!==CanvasEx.MARKLOC_TOP&&h!==CanvasEx.MARKLOC_BOTTOM&&(a=100*(a-s)/s),new M.Point(t,a)},s.prototype._convertItemsToCoordinates=function(){
case CanvasEx.MARKLOC_BOTTOM:i=-e;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:i=e}return i},s.prototype._calculateShapeHeight=function(t,e){var i=t;switch(e){case CanvasEx.SIZE_TINY:i=.3*t;break;case CanvasEx.SIZE_SMALL:i=.6*t;break;case CanvasEx.SIZE_NORMAL:i=t;break;case CanvasEx.SIZE_LARGE:i=1.5*t;break;case CanvasEx.SIZE_HUGE:i=2*t}return i},s.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),n=this._calculateShapeHeight(o),s=this.m_study.properties().styles[this.m_plotName].location.value(),r=this._calculateVerticalOffset(s,n+n/2),e.barSpacing=o,e.items=this.m_items,e.color=F.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),e.height=n,e.vertOffset=r,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=B.plotShapesData[a],h=new A,l&&h.append(new TradingView[l.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=r,h.append(new _(this.m_selectionData))),h},inherit(r,s),r.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v,y,b,w=this.m_study.properties().styles[this.m_plotName];if(w.visible&&w.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),w.size?(s=w.size.value(),n=this._calculateShapeHeight(25,s)):n=Math.round(o/2),r=w.location.value(),a=F.generateColor(w.color.value(),i),l=i>19?i-10:0,h=this._calculateVerticalOffset(r,Math.round(1.5*n)),e.barSpacing=o,e.items=this.items(),e.color=a,e.borderColor=F.generateColor(w.color.value(),l),e.height=n,e.vertOffset=h,c=w.plottype.value(),d=B.plotShapesData[c],p=new A,u=w.text?w.text.value():void 0,void 0!==u&&""!==u.trim()&&(f=u.trim().replace(/\\n/gm,"\n"),f=TradingView.cleanButAmpersand(f,!0),m=!1,g=!1,v="Arial",y=12,e.textCache=new I(f,m,g,v,y),b=w.textColor?w.textColor.value():void 0,e.textColor=b?F.generateColor(b,i):a),null!=d&&p.append(new TradingView[d.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=h,p.append(new _(this.m_selectionData))),p},inherit(a,r),a.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v=this.m_study.properties().styles[this.m_plotName];if(v.visible&&v.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),v.size?(s=v.size.value(),n=this._calculateShapeHeight(50,s)):n=Math.round(o),r=v.location.value(),a=F.generateColor(v.color.value(),i),l=this._calculateVerticalOffset(r,n),e.items=this.items(),e.char=v.char.value(),e.height=n,e.vertOffset=l,e.color=a,h=new A,c=v.text?v.text.value():void 0, var t=this.m_model.timeScale(),e=this.m_study.priceScale();t.indexesToCoordinates(this.m_items),e.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e})},s.prototype._calculateVerticalOffset=function(t,e){var i=0;switch(t){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:i=-e;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:i=e}return i},s.prototype._calculateShapeHeight=function(t,e){var i=t;switch(e){case CanvasEx.SIZE_TINY:i=.3*t;break;case CanvasEx.SIZE_SMALL:i=.6*t;break;case CanvasEx.SIZE_NORMAL:i=t;break;case CanvasEx.SIZE_LARGE:i=1.5*t;break;case CanvasEx.SIZE_HUGE:i=2*t}return i},s.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),n=this._calculateShapeHeight(o),s=this.m_study.properties().styles[this.m_plotName].location.value(),r=this._calculateVerticalOffset(s,n+n/2),e.barSpacing=o,e.items=this.m_items,e.color=F.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),e.height=n,e.vertOffset=r,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=B.plotShapesData[a],h=new A,l&&h.append(new TradingView[l.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=r,h.append(new _(this.m_selectionData))),h},inherit(r,s),r.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v,y,b,w=this.m_study.properties().styles[this.m_plotName];if(w.visible&&w.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),w.size?(s=w.size.value(),n=this._calculateShapeHeight(25,s)):n=Math.round(o/2),r=w.location.value(),a=F.generateColor(w.color.value(),i),l=i>19?i-10:0,h=this._calculateVerticalOffset(r,Math.round(1.5*n)),e.barSpacing=o,e.items=this.items(),e.color=a,e.borderColor=F.generateColor(w.color.value(),l),e.height=n,e.vertOffset=h,c=w.plottype.value(),d=B.plotShapesData[c],p=new A,u=w.text?w.text.value():void 0,void 0!==u&&""!==u.trim()&&(f=u.trim().replace(/\\n/gm,"\n"),f=TradingView.cleanButAmpersand(f,!0),m=!1,g=!1,v="Arial",y=12,e.textCache=new I(f,m,g,v,y),b=w.textColor?w.textColor.value():void 0,e.textColor=b?F.generateColor(b,i):a),null!=d&&p.append(new TradingView[d.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=h,p.append(new _(this.m_selectionData))),p},inherit(a,r),a.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,f,m,g,v=this.m_study.properties().styles[this.m_plotName];if(v.visible&&v.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),
void 0!==c&&""!==c.trim()&&(d=c.trim().replace(/\\n/gm,"\n"),d=TradingView.cleanButAmpersand(d,!0),p=!1,u=!1,f="Arial",m=12,e.textCache=new I(d,p,u,f,m),g=v.textColor?v.textColor.value():void 0,e.textColor=g?F.generateColor(g,i):a),h.append(new L(e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=l,h.append(new _(this.m_selectionData))),h},inherit(l,s),l.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},e=M.clamp(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.barSpacing=i,t.colorup=F.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),e),t.colordown=F.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),e),o=F.rgbaDecomp(t.colorup),n=o?100*(1-o[3]):0,s=F.rgbaDecomp(t.colordown),r=s?100*(1-s[3]):0,t.colorBorderUp=F.generateColor("#000000",n),t.colorBorderDown=F.generateColor("#000000",r),t.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),t.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),a=new A,a.append(new P(t)),this.m_study===this.m_model.selectedSource()&&(l=this.m_selectionData,l.barSpacing=i,a.append(new f(l))),a},l.prototype._createItem=function(t,e,i,o,n,s){var r,a,l,h;if(0!==e){if(Math.abs(e)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(e)),r=e>0){if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l}else{if(void 0===(h=this._getSeriesVal(i,t))||null==h)return null;a=h}return n&&(a=100*(a-s)/s),new x(t,a,e,r)}},l.prototype._convertItemsToCoordinates=function(){var t,e,i,o,n,s,r,a,l,h=this.m_model.timeScale(),c=this.m_study.priceScale();for(h.indexesToCoordinates(this.m_items),c.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e}),t=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),e=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),t>e&&(i=t,t=e,e=i),o=e-t,n=o/this._maxAbsValue,s=this.m_items,r=0;r<s.length;r++)a=s[r],l=Math.abs(a.height),a.height=l*n+t},h.prototype.update=function(){this._invalidated=!0},h.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,$,B,R,N,z;if(this.m_bars.length=0,!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),o=this.m_study.data(),n=this.m_study.firstValue(),s=o.range(e,i),r=this.m_study.priceScale(),a=r.properties().percentage.value(),l=0,h=this.m_study.properties().ohlcPlots[this.m_plotName],c={},d=function(t,e){var i=t+"@"+e;return c[i]||(c[i]=F.generateColor(t,e)),c[i]}, v.size?(s=v.size.value(),n=this._calculateShapeHeight(50,s)):n=Math.round(o),r=v.location.value(),a=F.generateColor(v.color.value(),i),l=this._calculateVerticalOffset(r,n),e.items=this.items(),e.char=v.char.value(),e.height=n,e.vertOffset=l,e.color=a,h=new A,c=v.text?v.text.value():void 0,void 0!==c&&""!==c.trim()&&(d=c.trim().replace(/\\n/gm,"\n"),d=TradingView.cleanButAmpersand(d,!0),p=!1,u=!1,f="Arial",m=12,e.textCache=new I(d,p,u,f,m),g=v.textColor?v.textColor.value():void 0,e.textColor=g?F.generateColor(g,i):a),h.append(new L(e)),this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=l,h.append(new _(this.m_selectionData))),h},inherit(l,s),l.prototype.renderer=function(){var t,e,i,o,n,s,r,a,l;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},e=M.clamp(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.barSpacing=i,t.colorup=F.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),e),t.colordown=F.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),e),o=F.rgbaDecomp(t.colorup),n=o?100*(1-o[3]):0,s=F.rgbaDecomp(t.colordown),r=s?100*(1-s[3]):0,t.colorBorderUp=F.generateColor("#000000",n),t.colorBorderDown=F.generateColor("#000000",r),t.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),t.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),a=new A,a.append(new P(t)),this.m_study===this.m_model.selectedSource()&&(l=this.m_selectionData,l.barSpacing=i,a.append(new f(l))),a},l.prototype._createItem=function(t,e,i,o,n,s){var r,a,l,h;if(0!==e){if(Math.abs(e)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(e)),r=e>0){if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l}else{if(void 0===(h=this._getSeriesVal(i,t))||null==h)return null;a=h}return n&&(a=100*(a-s)/s),new x(t,a,e,r)}},l.prototype._convertItemsToCoordinates=function(){var t,e,i,o,n,s,r,a,l,h=this.m_model.timeScale(),c=this.m_study.priceScale();for(h.indexesToCoordinates(this.m_items),c.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e}),t=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),e=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),t>e&&(i=t,t=e,e=i),o=e-t,n=o/this._maxAbsValue,s=this.m_items,r=0;r<s.length;r++)a=s[r],l=Math.abs(a.height),a.height=l*n+t},h.prototype.update=function(){this._invalidated=!0},h.prototype._updateImpl=function(){var t,e,i,o,n,s,r,a,l,h,c,d,u,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,$,B,R,N,z;if(this.m_bars.length=0,!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()&&(t=this.m_model.timeScale().visibleBars().clone(),!t.isEmpty())){for(e=this.m_series.nearestIndex(t.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),
u=s._start;u<s._end;++u){for(_=s._indexAt(u),_=Math.floor(_),f=s._valueAt(u),m=!0,g={},v=TradingView.OPEN_PLOT;v<=TradingView.CLOSE_PLOT;++v){if(void 0===(y=f[this._ohlcPlotIndexes[v]+1])||null===y){m=!1;break}g[v]=y}m&&(b=g[TradingView.OPEN_PLOT],w=g[TradingView.CLOSE_PLOT],S=Math.max(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),T=Math.min(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),C={},C.time=Math.round(_),a?(C.open=100*(b-n)/n,C.high=100*(S-n)/n,C.low=100*(T-n)/n,C.close=100*(w-n)/n):(C.open=b,C.high=S,C.low=T,C.close=w),x=h.color.value(),P=void 0!==f[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&P&&void 0!==(y=f[this._colorer+1])&&null!==y&&(L=this._palette.valToIndex?this._palette.valToIndex[y]:y,k=this._paletterProps.colors[L],x=k.color.value()),C.color=d(x,l),I=new D(x),A=V(I.r,I.g,I.b),$=A[2]>.25?A[2]-.26:A[2]+.75,B=O(A[0],A[1],$),I.r=B[0],I.g=B[1],I.b=B[2],C.borderColor=d(I.toHex(),l),C.hollow=null,this.m_bars.push(C))}if(r.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study===this.m_model.selectedSource())for(R=E(e,i),this._selectionData={points:[],hittestResult:p.REGULAR},u=0;u<R.length;u++)_=R[u],void 0!==(f=this.m_study.data().valueAt(_))&&(y=f[this._plotIndex+1],r.properties().percentage.value()&&(y=100*(y-n)/n),N=this.m_model.timeScale().indexToCoordinate(Math.floor(_)),z=this.m_study.priceScale().priceToCoordinate(y),this._selectionData.points.push(new M.Point(N,z)))}},h.prototype.items=function(){return this.m_bars},inherit(c,h),c.prototype.renderer=function(){var t,e;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())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 A,e.append(new g(t)),this.m_series===this.m_model.selectedSource()&&e.append(new _(this._selectionData)),e},inherit(d,h),d.prototype.renderer=function(){var t,e,i,o=this.m_study.properties().ohlcPlots[this.m_plotName];if(o.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=o.drawWick.value(),t.drawBorder=o.drawBorder.value(),e=o.wickColor.value(),t.borderColor=e,t.wickColor=e,i=new A,i.append(new S(t)),this.m_series===this.m_model.selectedSource()&&i.append(new _(this._selectionData)),i},e.StudyPaneView=o,e.StudyBackgroundPaneView=n,e.StudyPlotShapesPaneView=r,e.StudyPlotCharsPaneView=a,e.StudyPlotArrowsPaneView=l,e.StudyPlotCandlesPaneView=d,e.StudyPlotBarsPaneView=c},function(t,e){"use strict";!function(t){t.LINE="line",t.COLORER="colorer",t.BAR_COLORER="bar_colorer",t.BG_COLORER="bg_colorer",t.TEXT_COLORER="text_colorer",t.OHLC_COLORER="ohlc_colorer",t.SHAPES="shapes",t.CHARS="chars",t.ARROWS="arrows",t.DATAOFFSET="dataoffset",t.OHLC_OPEN="ohlc_open",t.OHLC_HIGH="ohlc_high",t.OHLC_LOW="ohlc_low",t.OHLC_CLOSE="ohlc_close" i=this.m_series.nearestIndex(t.lastBar(),TradingView.SEARCH_NEAREST_LEFT),o=this.m_study.data(),n=this.m_study.firstValue(),s=o.range(e,i),r=this.m_study.priceScale(),a=r.properties().percentage.value(),l=0,h=this.m_study.properties().ohlcPlots[this.m_plotName],c={},d=function(t,e){var i=t+"@"+e;return c[i]||(c[i]=F.generateColor(t,e)),c[i]},u=s._start;u<s._end;++u){for(_=s._indexAt(u),_=Math.floor(_),f=s._valueAt(u),m=!0,g={},v=TradingView.OPEN_PLOT;v<=TradingView.CLOSE_PLOT;++v){if(void 0===(y=f[this._ohlcPlotIndexes[v]+1])||null===y){m=!1;break}g[v]=y}m&&(b=g[TradingView.OPEN_PLOT],w=g[TradingView.CLOSE_PLOT],S=Math.max(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),T=Math.min(b,g[TradingView.HIGH_PLOT],g[TradingView.LOW_PLOT],w),C={},C.time=Math.round(_),a?(C.open=100*(b-n)/n,C.high=100*(S-n)/n,C.low=100*(T-n)/n,C.close=100*(w-n)/n):(C.open=b,C.high=S,C.low=T,C.close=w),x=h.color.value(),P=void 0!==f[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&P&&void 0!==(y=f[this._colorer+1])&&null!==y&&(L=this._palette.valToIndex?this._palette.valToIndex[y]:y,k=this._paletterProps.colors[L],x=k.color.value()),C.color=d(x,l),I=new D(x),A=V(I.r,I.g,I.b),$=A[2]>.25?A[2]-.26:A[2]+.75,B=O(A[0],A[1],$),I.r=B[0],I.g=B[1],I.b=B[2],C.borderColor=d(I.toHex(),l),C.hollow=null,this.m_bars.push(C))}if(r.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study===this.m_model.selectedSource())for(R=E(e,i),this._selectionData={points:[],hittestResult:p.REGULAR},u=0;u<R.length;u++)_=R[u],void 0!==(f=this.m_study.data().valueAt(_))&&(y=f[this._plotIndex+1],r.properties().percentage.value()&&(y=100*(y-n)/n),N=this.m_model.timeScale().indexToCoordinate(Math.floor(_)),z=this.m_study.priceScale().priceToCoordinate(y),this._selectionData.points.push(new M.Point(N,z)))}},h.prototype.items=function(){return this.m_bars},inherit(c,h),c.prototype.renderer=function(){var t,e;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())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 A,e.append(new g(t)),this.m_series===this.m_model.selectedSource()&&e.append(new _(this._selectionData)),e},inherit(d,h),d.prototype.renderer=function(){var t,e,i,o=this.m_study.properties().ohlcPlots[this.m_plotName];if(o.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=o.drawWick.value(),t.drawBorder=o.drawBorder.value(),e=o.wickColor.value(),t.borderColor=e,t.wickColor=e,i=new A,i.append(new S(t)),this.m_series===this.m_model.selectedSource()&&i.append(new _(this._selectionData)),i},e.StudyPaneView=o,e.StudyBackgroundPaneView=n,e.StudyPlotShapesPaneView=r,e.StudyPlotCharsPaneView=a,e.StudyPlotArrowsPaneView=l,e.StudyPlotCandlesPaneView=d,e.StudyPlotBarsPaneView=c},function(t,e){
}(e.PlotTypes||(e.PlotTypes={})),function(t){t.BARS="ohlc_bars",t.CANDLES="ohlc_candles"}(e.OHLCType||(e.OHLCType={})),function(t){t[t.Line=0]="Line",t[t.Histogram=1]="Histogram",t[t.Cross=3]="Cross",t[t.Area=4]="Area",t[t.Columns=5]="Columns",t[t.Circles=6]="Circles",t[t.Line_with_breaks=7]="Line_with_breaks",t[t.Area_with_breaks=8]="Area_with_breaks"}(e.PlotType||(e.PlotType={})),function(t){t[t.Right=0]="Right",t[t.Left=1]="Left",t[t.None=2]="None"}(e.ScaleType||(e.ScaleType={})),e.plotShapesData={shape_arrow_down:{guiName:"Arrow Down",id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown"},shape_arrow_up:{guiName:"Arrow Up",id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup"},shape_circle:{guiName:"Circle",id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle"},shape_cross:{guiName:"Cross",id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross"},shape_diamond:{guiName:"Diamond",id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond"},shape_flag:{guiName:"Flag",id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag"},shape_label_down:{guiName:"Label Down",id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown"},shape_label_up:{guiName:"Label Up",id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup"},shape_square:{guiName:"Square",id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square"},shape_triangle_down:{guiName:"Triangle Down",id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown"},shape_triangle_up:{guiName:"Triangle Up",id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup"},shape_xcross:{guiName:"X Cross",id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross"}}},function(t,e){"use strict";function i(t,e){var i=function i(o){var n=i.cache,s=""+(e?e.apply(this,arguments):o);return n.hasOwnProperty(s)||(n[s]=t.apply(this,arguments)),n[s]};return i.cache={},i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},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}} "use strict";!function(t){t.LINE="line",t.COLORER="colorer",t.BAR_COLORER="bar_colorer",t.BG_COLORER="bg_colorer",t.TEXT_COLORER="text_colorer",t.OHLC_COLORER="ohlc_colorer",t.SHAPES="shapes",t.CHARS="chars",t.ARROWS="arrows",t.DATAOFFSET="dataoffset",t.OHLC_OPEN="ohlc_open",t.OHLC_HIGH="ohlc_high",t.OHLC_LOW="ohlc_low",t.OHLC_CLOSE="ohlc_close"}(e.PlotTypes||(e.PlotTypes={})),function(t){t.BARS="ohlc_bars",t.CANDLES="ohlc_candles"}(e.OHLCType||(e.OHLCType={})),function(t){t[t.Line=0]="Line",t[t.Histogram=1]="Histogram",t[t.Cross=3]="Cross",t[t.Area=4]="Area",t[t.Columns=5]="Columns",t[t.Circles=6]="Circles",t[t.Line_with_breaks=7]="Line_with_breaks",t[t.Area_with_breaks=8]="Area_with_breaks"}(e.PlotType||(e.PlotType={})),function(t){t[t.Right=0]="Right",t[t.Left=1]="Left",t[t.None=2]="None"}(e.ScaleType||(e.ScaleType={})),e.plotShapesData={shape_arrow_down:{guiName:"Arrow Down",id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown"},shape_arrow_up:{guiName:"Arrow Up",id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup"},shape_circle:{guiName:"Circle",id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle"},shape_cross:{guiName:"Cross",id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross"},shape_diamond:{guiName:"Diamond",id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond"},shape_flag:{guiName:"Flag",id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag"},shape_label_down:{guiName:"Label Down",id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown"},shape_label_up:{guiName:"Label Up",id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup"},shape_square:{guiName:"Square",id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square"},shape_triangle_down:{guiName:"Triangle Down",id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown"},shape_triangle_up:{guiName:"Triangle Up",id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup"},shape_xcross:{guiName:"X Cross",id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross"}}},function(t,e){"use strict";function i(t,e){var i=function i(o){var n=i.cache,s=""+(e?e.apply(this,arguments):o);return n.hasOwnProperty(s)||(n[s]=t.apply(this,arguments)),n[s]};return i.cache={},i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},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),
var a=i(233),l=i(235),h=i(258),c=i(259).assert,d=i(199),p=i(53);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), 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(233),l=i(235),h=i(258),c=i(259).assert,d=i(199),p=i(53);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++)),
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){(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(229),r=s.DataWindowView,a=s.DataWindowItem,l=i(250);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) 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){(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(229),r=s.DataWindowView,a=s.DataWindowItem,l=i(250)
;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(1))},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(225);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){"use strict";function o(t,e){this.handler=t,this.customId=e,this.requestHook=null}function n(){}var s=i(50).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){}, ;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(1))},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(225);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){"use strict";function o(t,e){this.handler=t,this.customId=e,this.requestHook=null}function n(){}var s=i(50).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.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){},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(272),n=i(50),s=function(){function t(t){this._numericFormatter=new o.NumericFormatter(t),this._fractionalValues=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){ 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){},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(272),n=i(50),s=function(){function t(t){this._numericFormatter=new o.NumericFormatter(t),this._fractionalValues=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),
return this._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/,function(t,e){return e})},t}();e.VolumeFormatter=s},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(53),a=i(243).TextRenderer,l=i(241).HorzLineRenderer,h=i(273).TrendLineRenderer,c=i(196),d=i(198),p=i(306),u=TradingView.Study,_=i(307),f=i(233),m=i(237),g=i(308).clearRect,v=i(199),y=i(54).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], 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},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(53),a=i(243).TextRenderer,l=i(241).HorzLineRenderer,h=i(273).TrendLineRenderer,c=i(196),d=i(198),p=i(306),u=TradingView.Study,_=i(307),f=i(233),m=i(237),g=i(308).clearRect,v=i(199),y=i(54).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(),
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(),v=e.priceRange().convertToPercent(v,b),y=e.priceRange().convertToPercent(y,b)),w=e.priceToCoordinate(v),S=e.priceToCoordinate(y),T=new r.Point(m,w),C=new r.Point(g,S),f.points=[T,C],f.color=c.color.value(),f.linewidth=c.width.value(),f.linestyle=c.style.value(),this._data.push(f))},u.StudyPaneView_hlines=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hlines.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 l(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData(),this._calcTextData()},u.StudyPaneView_hlines.prototype._calcTextData=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f;if(this._textData=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=0;o<t.length;o++)if(n=t[o], 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(),v=e.priceRange().convertToPercent(v,b),y=e.priceRange().convertToPercent(y,b)),w=e.priceToCoordinate(v),S=e.priceToCoordinate(y),T=new r.Point(m,w),C=new r.Point(g,S),f.points=[T,C],f.color=c.color.value(),f.linewidth=c.width.value(),f.linestyle=c.style.value(),this._data.push(f))},u.StudyPaneView_hlines=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hlines.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 l(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData(),this._calcTextData()},u.StudyPaneView_hlines.prototype._calcTextData=function(){
n.data&&(s=this._study.properties().graphics.hlines[n.styleId],s.enableText.value()&&s.showText.value()))for(a=0;a<n.data.length;a++)l=n.data[a],h={},h.text=void 0===l.text?"":l.text,h.color=s.color.value(),h.font="arial",h.fontsize=s.fontSize.value(),c=l.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),u=s.textPos.value(),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_BOTTOMLEFT?(_=4,h.horzAlign="left"):u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_BOTTOMCENTER?(_=i.width()/2,h.horzAlign="center"):u!==CanvasEx.TEXTPOS_TOPRIGHT&&u!==CanvasEx.TEXTPOS_MIDDLERIGHT&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(_=i.width(),h.horzAlign="right"),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_TOPRIGHT?(h.vertAlign="bottom",p-=4):u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_MIDDLERIGHT?(h.vertAlign="middle",p-=2):u!==CanvasEx.TEXTPOS_BOTTOMLEFT&&u!==CanvasEx.TEXTPOS_BOTTOMCENTER&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(h.vertAlign="top"),f=new r.Point(_,p),h.points=[f],h.offsetX=0,h.offsetY=0,this._textData.push(h)},u.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){var t,e,i,o,n,s,a,l,h,c,d,p;if(this._data=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale())&&!e.isEmpty())for(i=0;i<t.length;i++)if(o=t[i],o.data&&(n=this._study.properties().graphics.hlines[o.styleId],n.visible.value()))for(s=0;s<o.data.length;s++)a=o.data[s],l={},h=0,c=a.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),l.points=[new r.Point(h,p)],l.color=n.color.value(),l.linewidth=n.width.value(),l.linestyle=n.style.value(),l.hitTestResult=f.REGULAR,this._data.push(l)},u.StudyPriceAxisView_hlines=function(t,e,i,o,n){this._study=t,this._model=e,this._line=i,this._styleId=o,this._data={},this._lineType=n,this._invalidated=!0},inherit(u.StudyPriceAxisView_hlines,c),u.StudyPriceAxisView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPriceAxisView_hlines.prototype.updateImpl=function(){var t,e,i,o;if(this._data={},this._data.visible=!1,(t=this._study.priceScale())&&!t.isEmpty()&&this._study.properties().visible.value()&&(e=this._study.properties().graphics[this._lineType][this._styleId],e.visible&&e.visible.value()&&e.showPrice&&e.showPrice.value())){if(this._data.visible=!0,this._data.color="white",this._data.background=e.color.value(),i=this._line.level,t.isPercent()){if(o=this._study.firstValue(),!isNumber(o))return;i=t.priceRange().convertToPercent(i,o)}this._data.coordinate=t.priceToCoordinate(i),this._data.text=t.formatter().format(i)}},u.StudyPriceAxisView_hlines.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),new d(this._data)},TradingView.TriangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){ var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f;if(this._textData=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=0;o<t.length;o++)if(n=t[o],n.data&&(s=this._study.properties().graphics.hlines[n.styleId],s.enableText.value()&&s.showText.value()))for(a=0;a<n.data.length;a++)l=n.data[a],h={},h.text=void 0===l.text?"":l.text,h.color=s.color.value(),h.font="arial",h.fontsize=s.fontSize.value(),c=l.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),u=s.textPos.value(),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_BOTTOMLEFT?(_=4,h.horzAlign="left"):u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_BOTTOMCENTER?(_=i.width()/2,h.horzAlign="center"):u!==CanvasEx.TEXTPOS_TOPRIGHT&&u!==CanvasEx.TEXTPOS_MIDDLERIGHT&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(_=i.width(),h.horzAlign="right"),u===CanvasEx.TEXTPOS_TOPLEFT||u===CanvasEx.TEXTPOS_TOPCENTER||u===CanvasEx.TEXTPOS_TOPRIGHT?(h.vertAlign="bottom",p-=4):u===CanvasEx.TEXTPOS_MIDDLELEFT||u===CanvasEx.TEXTPOS_MIDDLECENTER||u===CanvasEx.TEXTPOS_MIDDLERIGHT?(h.vertAlign="middle",p-=2):u!==CanvasEx.TEXTPOS_BOTTOMLEFT&&u!==CanvasEx.TEXTPOS_BOTTOMCENTER&&u!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(h.vertAlign="top"),f=new r.Point(_,p),h.points=[f],h.offsetX=0,h.offsetY=0,this._textData.push(h)},u.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){var t,e,i,o,n,s,a,l,h,c,d,p;if(this._data=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale())&&!e.isEmpty())for(i=0;i<t.length;i++)if(o=t[i],o.data&&(n=this._study.properties().graphics.hlines[o.styleId],n.visible.value()))for(s=0;s<o.data.length;s++)a=o.data[s],l={},h=0,c=a.level,e.isPercent()&&(d=this._study.firstValue(),c=e.priceRange().convertToPercent(c,d)),p=e.priceToCoordinate(c),l.points=[new r.Point(h,p)],l.color=n.color.value(),l.linewidth=n.width.value(),l.linestyle=n.style.value(),l.hitTestResult=f.REGULAR,this._data.push(l)},u.StudyPriceAxisView_hlines=function(t,e,i,o,n){this._study=t,this._model=e,this._line=i,this._styleId=o,this._data={},this._lineType=n,this._invalidated=!0},inherit(u.StudyPriceAxisView_hlines,c),u.StudyPriceAxisView_hlines.prototype.update=function(){this._invalidated=!0},u.StudyPriceAxisView_hlines.prototype.updateImpl=function(){var t,e,i,o;if(this._data={},this._data.visible=!1,(t=this._study.priceScale())&&!t.isEmpty()&&this._study.properties().visible.value()&&(e=this._study.properties().graphics[this._lineType][this._styleId],e.visible&&e.visible.value()&&e.showPrice&&e.showPrice.value())){if(this._data.visible=!0,this._data.color="white",this._data.background=e.color.value(),i=this._line.level,t.isPercent()){if(o=this._study.firstValue(),!isNumber(o))return;i=t.priceRange().convertToPercent(i,o)}this._data.coordinate=t.priceToCoordinate(i),this._data.text=t.formatter().format(i)}},u.StudyPriceAxisView_hlines.prototype.renderer=function(){
return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.TriangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a;if(this._data){switch(e="up"===this._data.direction?1:-1,i=this._data.point.x,"left"===this._data.halign?i-=this._data.size:"right"===this._data.halign&&(i+=this._data.size),o=this._data.point.y,t.font=this.fontStyle(),n=t.measureText(this._data.text).width,this._textCache.textWidth=n,s=this._data.fontSize,r=.65*s,a=1*s,t.save(),t.translate(i+.5,o+.5),t.beginPath(),t.moveTo(0,0),this._data.direction){case"up":case"down":t.lineTo(r,a*e),t.lineTo(.5*n+r,a*e),t.lineTo(.5*n+r,(a+1.75*s)*e),t.lineTo(.5*-n-r,(a+1.75*s)*e),t.lineTo(.5*-n-r,a*e),t.lineTo(-r,a*e),t.lineTo(0,0),t.strokeStyle=this._data.borderColor,t.stroke(),t.fillStyle=this._data.color,t.fill(),t.fillStyle=this._data.fontColor,t.fillText(this._data.text,.5*-n,e<0?e*a-.5*s:a+1.25*s);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}t.restore()}},TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h,c,d,p,u=this._textCache.textWidth,_=this._data.fontSize;switch(this._data.direction){case"up":case"down":if(e="up"===this._data.direction?1:-1,i=.65*_,o=1*_,n=this._data.point.x,"left"===this._data.halign?n-=this._data.size:"right"===this._data.halign&&(n+=this._data.size),s=this._data.point.y,a=n-.5*u-i,l=n+.5*u+i,h=s+o*e,c=s+(o+1.75*_)*e,c<h&&(s=h,h=c,c=s),r.pointInRect(t,new r.Point(a,h),new r.Point(l,c)))return new f(f.REGULAR);if(d=[],d[0]={},d[0].x=this._data.point.x,d[0].y=this._data.point.y,d[1]={},d[1].x=this._data.point.x+.65*_,d[1].y=this._data.point.y+_*e,d[2]={},d[2].x=this._data.point.x-.65*_,d[2].y=this._data.point.y+_*e,p=(t.x-d[0].x)*(d[1].y-d[0].y)-(t.y-d[0].y)*(d[1].x-d[0].x),((t.x-d[1].x)*(d[2].y-d[1].y)-(t.y-d[1].y)*(d[2].x-d[1].x))*p>0&&((t.x-d[2].x)*(d[0].y-d[2].y)-(t.y-d[2].y)*(d[0].x-d[2].x))*p>0)return new f(f.REGULAR);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}return null},TradingView.RectangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.RectangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;if(this._data){switch(e=this._data.point.x,i=this._data.point.y,t.font=this.fontStyle(),o=t.measureText(this._data.text).width,this._textCache.textWidth=o,t.save(),t.translate(e+.5,i+.5),t.beginPath(),t.moveTo(0,0),n=this._data.halign,s=this._data.valign,t.textAlign=n,s){case"middle":t.textBaseline="middle";break;case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="hanging"}t.fillStyle=this._data.fontColor,t.fillText(this._data.text,0,0),t.restore()}},TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(t){ return this._invalidated&&(this.updateImpl(),this._invalidated=!1),new d(this._data)},TradingView.TriangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.TriangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a;if(this._data){switch(e="up"===this._data.direction?1:-1,i=this._data.point.x,"left"===this._data.halign?i-=this._data.size:"right"===this._data.halign&&(i+=this._data.size),o=this._data.point.y,t.font=this.fontStyle(),n=t.measureText(this._data.text).width,this._textCache.textWidth=n,s=this._data.fontSize,r=.65*s,a=1*s,t.save(),t.translate(i+.5,o+.5),t.beginPath(),t.moveTo(0,0),this._data.direction){case"up":case"down":t.lineTo(r,a*e),t.lineTo(.5*n+r,a*e),t.lineTo(.5*n+r,(a+1.75*s)*e),t.lineTo(.5*-n-r,(a+1.75*s)*e),t.lineTo(.5*-n-r,a*e),t.lineTo(-r,a*e),t.lineTo(0,0),t.strokeStyle=this._data.borderColor,t.stroke(),t.fillStyle=this._data.color,t.fill(),t.fillStyle=this._data.fontColor,t.fillText(this._data.text,.5*-n,e<0?e*a-.5*s:a+1.25*s);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}t.restore()}},TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h,c,d,p,u=this._textCache.textWidth,_=this._data.fontSize;switch(this._data.direction){case"up":case"down":if(e="up"===this._data.direction?1:-1,i=.65*_,o=1*_,n=this._data.point.x,"left"===this._data.halign?n-=this._data.size:"right"===this._data.halign&&(n+=this._data.size),s=this._data.point.y,a=n-.5*u-i,l=n+.5*u+i,h=s+o*e,c=s+(o+1.75*_)*e,c<h&&(s=h,h=c,c=s),r.pointInRect(t,new r.Point(a,h),new r.Point(l,c)))return new f(f.REGULAR);if(d=[],d[0]={},d[0].x=this._data.point.x,d[0].y=this._data.point.y,d[1]={},d[1].x=this._data.point.x+.65*_,d[1].y=this._data.point.y+_*e,d[2]={},d[2].x=this._data.point.x-.65*_,d[2].y=this._data.point.y+_*e,p=(t.x-d[0].x)*(d[1].y-d[0].y)-(t.y-d[0].y)*(d[1].x-d[0].x),((t.x-d[1].x)*(d[2].y-d[1].y)-(t.y-d[1].y)*(d[2].x-d[1].x))*p>0&&((t.x-d[2].x)*(d[0].y-d[2].y)-(t.y-d[2].y)*(d[0].x-d[2].x))*p>0)return new f(f.REGULAR);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}return null},TradingView.RectangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.RectangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;if(this._data){switch(e=this._data.point.x,i=this._data.point.y,t.font=this.fontStyle(),o=t.measureText(this._data.text).width,this._textCache.textWidth=o,t.save(),t.translate(e+.5,i+.5),t.beginPath(),t.moveTo(0,0),n=this._data.halign,s=this._data.valign,t.textAlign=n,s){case"middle":t.textBaseline="middle";break;case"top":t.textBaseline="bottom";break
var e,i,o=this._data.point.x+.5,n=this._data.point.y+.5,s=this._textCache.textWidth,a=this._data.fontSize,l=this._data.halign;switch(this._data.valign){case"middle":n-=a/2;break;case"bottom":n-=a}switch(l){case"right":o-=s;break;case"center":o-=s/2}return e=new r.Point(o,n),i=new r.Point(o+s,n+a),r.pointInRect(t,e,i)?new f(f.REGULAR):null},TradingView.CircleShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.CircleShapeMarkRenderer.prototype.draw=function(t){var e,i,o;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=this._data.point.x,o=this._data.point.y,t.save(),t.fillStyle=this._data.color,t.beginPath(),t.arc(i+1,o+2*this._data.size*e+.5,this._data.size,0,2*Math.PI),t.closePath(),t.fill(),t.stroke())},TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-t.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*e-t.y,2)<=Math.pow(this._data.size,2)?new f(f.REGULAR):null},TradingView.SquareShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.SquareShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=n.substract(o),t.beginPath(),t.fillStyle=this._data.color,t.rect(o.x,o.y,s.x,s.y),t.stroke(),t.fill())},TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=new r.Point(Math.min(o.x,n.x),Math.min(o.y,n.y)),a=new r.Point(Math.max(o.x,n.x),Math.max(o.y,n.y));return r.pointInRect(t,s,a)?new f(f.REGULAR):null},TradingView.ArrowShapeMarkRenderer=function(t,e,i){this._data=t,this._textCache=e,this._arrowDirection=i},TradingView.ArrowShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(this._data){switch(e=this._arrowDirection,i=1*this._data.size,o=this._data.color,n=this._data.point.x+1,s=this._data.point.y,r=1.1*i,e){case"up":s-=r;break;case"down":s+=r}switch(a=i/6,l=i/4,h=i/3,c=i/2,d=.6666666*i,t.save(),t.fillStyle=o,t.beginPath(),e){case"up":t.moveTo(n,s),t.lineTo(n-c,s+d),t.lineTo(n-l,s+d),t.lineTo(n,s+h),t.lineTo(n+l,s+d),t.lineTo(n+c,s+d),t.lineTo(n,s);break;case"down":t.moveTo(n,s+i),t.lineTo(n-c,s+h),t.lineTo(n-l,s+h),t.lineTo(n,s+d),t.lineTo(n+l,s+h),t.lineTo(n+c,s+h),t.lineTo(n,s+i);break;case"right":t.moveTo(n+a,s),t.lineTo(n-a,s-l),t.lineTo(n-a,s+l),t.lineTo(n+a,s);break;case"left":t.moveTo(n-a,s),t.lineTo(n+a,s-l),t.lineTo(n+a,s+l),t.lineTo(n-a,s)}t.closePath(),t.fill(),t.stroke()}},TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(t){ ;case"bottom":t.textBaseline="hanging"}t.fillStyle=this._data.fontColor,t.fillText(this._data.text,0,0),t.restore()}},TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o=this._data.point.x+.5,n=this._data.point.y+.5,s=this._textCache.textWidth,a=this._data.fontSize,l=this._data.halign;switch(this._data.valign){case"middle":n-=a/2;break;case"bottom":n-=a}switch(l){case"right":o-=s;break;case"center":o-=s/2}return e=new r.Point(o,n),i=new r.Point(o+s,n+a),r.pointInRect(t,e,i)?new f(f.REGULAR):null},TradingView.CircleShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.CircleShapeMarkRenderer.prototype.draw=function(t){var e,i,o;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=this._data.point.x,o=this._data.point.y,t.save(),t.fillStyle=this._data.color,t.beginPath(),t.arc(i+1,o+2*this._data.size*e+.5,this._data.size,0,2*Math.PI),t.closePath(),t.fill(),t.stroke())},TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-t.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*e-t.y,2)<=Math.pow(this._data.size,2)?new f(f.REGULAR):null},TradingView.SquareShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.SquareShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=n.substract(o),t.beginPath(),t.fillStyle=this._data.color,t.rect(o.x,o.y,s.x,s.y),t.stroke(),t.fill())},TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new r.Point(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new r.Point(this._data.point.x+i/2,this._data.point.y+i/2+e*i),s=new r.Point(Math.min(o.x,n.x),Math.min(o.y,n.y)),a=new r.Point(Math.max(o.x,n.x),Math.max(o.y,n.y));return r.pointInRect(t,s,a)?new f(f.REGULAR):null},TradingView.ArrowShapeMarkRenderer=function(t,e,i){this._data=t,this._textCache=e,this._arrowDirection=i},TradingView.ArrowShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,s,r,a,l,h,c,d;if(this._data){switch(e=this._arrowDirection,i=1*this._data.size,o=this._data.color,n=this._data.point.x+1,s=this._data.point.y,r=1.1*i,e){case"up":s-=r;break;case"down":s+=r}switch(a=i/6,l=i/4,h=i/3,c=i/2,d=.6666666*i,t.save(),t.fillStyle=o,t.beginPath(),e){case"up":t.moveTo(n,s),t.lineTo(n-c,s+d),t.lineTo(n-l,s+d),t.lineTo(n,s+h),t.lineTo(n+l,s+d),t.lineTo(n+c,s+d),t.lineTo(n,s);break;case"down":t.moveTo(n,s+i),t.lineTo(n-c,s+h),t.lineTo(n-l,s+h),t.lineTo(n,s+d),t.lineTo(n+l,s+h),t.lineTo(n+c,s+h),t.lineTo(n,s+i);break;case"right":t.moveTo(n+a,s),t.lineTo(n-a,s-l),t.lineTo(n-a,s+l),t.lineTo(n+a,s);break;case"left":t.moveTo(n-a,s),t.lineTo(n+a,s-l),t.lineTo(n+a,s+l),
var e,i,o,n,s,a,l,h=this._data.point.x,c=this._data.point.y,d=this._arrowDirection,p=1*this._data.size,u=p/2,_=1.1*p;switch(d){case"up":c-=_;break;case"down":c+=_}switch(e=p/6,i=p/4,o=p/3,u=p/2,n=.6666666*p,d){case"up":s=new r.Point(h,c),a=new r.Point(h+u,c+n),l=new r.Point(h-u,c+n);break;case"down":s=new r.Point(h,c+p),a=new r.Point(h+u,c+o),l=new r.Point(h-u,c+o);break;case"right":s=new r.Point(h+e,c),a=new r.Point(h-e,c-i),l=new r.Point(h-e,c+i);break;case"left":s=new r.Point(h-e,c),a=new r.Point(h+e,c-i),l=new r.Point(h+e,c+i)}return r.pointInTriangle(s,a,l,t)?new f(f.REGULAR):null},u.StudyPaneView_textmarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_textmarks,_),u.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_textmarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"triangle":t.append(new TradingView.TriangleTextMarkRenderer(this._data[e],this._textCache[e]));break;case"rectangle":t.append(new TradingView.RectangleTextMarkRenderer(this._data[e],this._textCache[e]))}return t},u.StudyPaneView_textmarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,y,b,w,S;if(this._data=[],(t=this._study.graphics().textmarks)&&(e=this._study.priceScale(),i=this._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.textmarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],_={},f=c.location.value(),m=c.shape.value(),!((g=o[u.time])<s||g>a)&&this._study.series().bars().valueAt(g)){switch(g=o[u.time]+(u.offset||0),_.font=c.fontFamily.value(),_.color=v.generateColor(c.color.value(),c.transparency.value()),_.bold=c.fontBold.value(),_.fontColor=v.generateColor(c.fontColor.value(),c.transparency.value()),_.italic=c.fontItalic.value(),_.fontSize=c.fontSize.value(),_.text=u.text?u.text:"",_.halign=c.halign.value(),_.valign=void 0!==c.valign?c.valign.value():"middle",_.shape=c.shape.value(),_.size=.5*i.barSpacing(),_.borderColor="rgb(0, 0, 0)",y=50,m){case"triangle":S=this._calcCoordsForTriangleShape(f,g,y,u.price,e),_.direction=S.direction,b=Math.round(i.indexToCoordinate(g)),w=S.y;break;case"rectangle":S=this._calcCoordsForRectangleShape(f,g,u.price,e,i),b=S.x,w=S.y}_.point=new r.Point(b,w),this._data.push(_),this._textCache.push({})}},u.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(t,e,i,o,n){var s,r,a;switch(t){case CanvasEx.MARKLOC_TOP:s=n.height()-i,r="down";break;case CanvasEx.MARKLOC_BOTTOM:s=i,r="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),s=n.priceToCoordinate(o),r="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.isPercent()&&(a=this._study.firstValue(), t.lineTo(n-a,s)}t.closePath(),t.fill(),t.stroke()}},TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,s,a,l,h=this._data.point.x,c=this._data.point.y,d=this._arrowDirection,p=1*this._data.size,u=p/2,_=1.1*p;switch(d){case"up":c-=_;break;case"down":c+=_}switch(e=p/6,i=p/4,o=p/3,u=p/2,n=.6666666*p,d){case"up":s=new r.Point(h,c),a=new r.Point(h+u,c+n),l=new r.Point(h-u,c+n);break;case"down":s=new r.Point(h,c+p),a=new r.Point(h+u,c+o),l=new r.Point(h-u,c+o);break;case"right":s=new r.Point(h+e,c),a=new r.Point(h-e,c-i),l=new r.Point(h-e,c+i);break;case"left":s=new r.Point(h-e,c),a=new r.Point(h+e,c-i),l=new r.Point(h+e,c+i)}return r.pointInTriangle(s,a,l,t)?new f(f.REGULAR):null},u.StudyPaneView_textmarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_textmarks,_),u.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_textmarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"triangle":t.append(new TradingView.TriangleTextMarkRenderer(this._data[e],this._textCache[e]));break;case"rectangle":t.append(new TradingView.RectangleTextMarkRenderer(this._data[e],this._textCache[e]))}return t},u.StudyPaneView_textmarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,y,b,w,S;if(this._data=[],(t=this._study.graphics().textmarks)&&(e=this._study.priceScale(),i=this._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.textmarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],_={},f=c.location.value(),m=c.shape.value(),!((g=o[u.time])<s||g>a)&&this._study.series().bars().valueAt(g)){switch(g=o[u.time]+(u.offset||0),_.font=c.fontFamily.value(),_.color=v.generateColor(c.color.value(),c.transparency.value()),_.bold=c.fontBold.value(),_.fontColor=v.generateColor(c.fontColor.value(),c.transparency.value()),_.italic=c.fontItalic.value(),_.fontSize=c.fontSize.value(),_.text=u.text?u.text:"",_.halign=c.halign.value(),_.valign=void 0!==c.valign?c.valign.value():"middle",_.shape=c.shape.value(),_.size=.5*i.barSpacing(),_.borderColor="rgb(0, 0, 0)",y=50,m){case"triangle":S=this._calcCoordsForTriangleShape(f,g,y,u.price,e),_.direction=S.direction,b=Math.round(i.indexToCoordinate(g)),w=S.y;break;case"rectangle":S=this._calcCoordsForRectangleShape(f,g,u.price,e,i),b=S.x,w=S.y}_.point=new r.Point(b,w),this._data.push(_),this._textCache.push({})}},u.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(t,e,i,o,n){var s,r,a;switch(t){case CanvasEx.MARKLOC_TOP:s=n.height()-i,r="down";break;case CanvasEx.MARKLOC_BOTTOM:s=i,r="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),
o=n.priceRange().convertToPercent(o,a)),s=n.priceToCoordinate(o),r="up";break;case CanvasEx.MARKLOC_ABOVEBAR:s=this._locationToY(t,e),r="down";break;case CanvasEx.MARKLOC_BELOWBAR:default:s=this._locationToY(t,e),r="up"}return{y:s,direction:r}},u.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(t,e,i,o,n){var s,r,a=Math.round(n.indexToCoordinate(e));switch(t){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BELOWBAR:s=this._locationToY(t,e);break;case CanvasEx.MARKLOC_RIGHT:case CanvasEx.MARKLOC_LEFT:a=n.width(),o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;default:s=this._locationToY(t,e)}return{x:a,y:s}},u.StudyPaneView_shapemarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_shapemarks,_),u.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_shapemarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"circle":t.append(new TradingView.CircleShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"square":t.append(new TradingView.SquareShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"arrowUp":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"up"));break;case"arrowDown":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"down"));break;case"arrowRight":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"right"));break;case"arrowLeft":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"left"))}return t},u.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,b,w,S,T;if(this._data=[],(t=this._study.graphics().shapemarks)&&(e=this._study.priceScale(),i=this._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.shapemarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],!((_=o[u.time])<s||_>a)&&(f={},null!=u.time&&this._study.series().bars().valueAt(_))){switch(f.color=v.generateColor(c.color.value(),c.transparency.value()),m=0,"left"===c.halign.value()?m-=i.barSpacing()/2+1:"right"===c.halign.value()&&(m+=i.barSpacing()/2+1),f.size=c.size.value(),f.shape=c.shape.value(),g=Math.round(i.indexToCoordinate(_))+m,b=u.price,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w)),S=e.priceToCoordinate(b),T=c.location.value()){case CanvasEx.MARKLOC_ABSOLUTE:f.direction="";break s=n.priceToCoordinate(o),r="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),s=n.priceToCoordinate(o),r="up";break;case CanvasEx.MARKLOC_ABOVEBAR:s=this._locationToY(t,e),r="down";break;case CanvasEx.MARKLOC_BELOWBAR:default:s=this._locationToY(t,e),r="up"}return{y:s,direction:r}},u.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(t,e,i,o,n){var s,r,a=Math.round(n.indexToCoordinate(e));switch(t){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BELOWBAR:s=this._locationToY(t,e);break;case CanvasEx.MARKLOC_RIGHT:case CanvasEx.MARKLOC_LEFT:a=n.width(),o.isPercent()&&(r=this._study.firstValue(),i=o.priceRange().convertToPercent(i,r)),s=o.priceToCoordinate(i);break;default:s=this._locationToY(t,e)}return{x:a,y:s}},u.StudyPaneView_shapemarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(u.StudyPaneView_shapemarks,_),u.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_shapemarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"circle":t.append(new TradingView.CircleShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"square":t.append(new TradingView.SquareShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"arrowUp":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"up"));break;case"arrowDown":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"down"));break;case"arrowRight":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"right"));break;case"arrowLeft":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"left"))}return t},u.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){var t,e,i,o,n,s,a,l,h,c,d,p,u,_,f,m,g,b,w,S,T;if(this._data=[],(t=this._study.graphics().shapemarks)&&(e=this._study.priceScale(),i=this._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.shapemarks[h.styleId],c.visible.value()))for(d=h.data,p=0;p<d.length;p++)if(u=d[p],!((_=o[u.time])<s||_>a)&&(f={},null!=u.time&&this._study.series().bars().valueAt(_))){switch(f.color=v.generateColor(c.color.value(),c.transparency.value()),m=0,"left"===c.halign.value()?m-=i.barSpacing()/2+1:"right"===c.halign.value()&&(m+=i.barSpacing()/2+1),f.size=c.size.value(),f.shape=c.shape.value(),g=Math.round(i.indexToCoordinate(_))+m,b=u.price,e.isPercent()&&(w=this._study.firstValue(),
;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:S=this._locationToY(T,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:S=this._locationToY(T,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="down";break;default:y.logWarn("Bad location value: "+T),S=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,_),f.direction="up"}f.point=new r.Point(g,S),this._data.push(f),this._textCache.push({})}},o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e=this._data;g(t,e.x1,e.y1,e.x2-e.x1,e.y2-e.y1,v.generateColor(this._data.color,this._data.transparency))},o.prototype.hitTest=function(t){return null},u.StudyPaneView_backgrounds=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_backgrounds.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 o(this._data[e]));return t},u.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(t){return("inSession"===t||"outOfSession"===t)&&!this._study._series.properties().extendedHours.value()},u.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b;if(this._data=[],(t=this._study.graphics().backgrounds)&&(e=this._model.timeScale(),(i=this._study.priceScale())&&!i.isEmpty()&&e&&!e.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<t.length;a++)if(l=t[a],h=l.styleId,c=l.data,d=this._study.properties().graphics.backgrounds[h],!this._hideExtendedHours(h)&&d.visible.value())for(_=0;_<c.length;_++)f=c[_],m={},g=o[f.start],(v=o[f.stop])<s||g>r||null!=f.start&&null!=f.stop&&(y=Math.ceil(e.indexToCoordinate(g,!0)-.5*e.barSpacing()),b=Math.ceil(e.indexToCoordinate(v,!0)+.5*e.barSpacing()),u===g-1&&(y=p),p=b,u=v,y<0&&b<0||y>e.width()&&b>e.width()||(m.x1=y,m.x2=b,m.y1=0,m.y2=i.height(),m.color=d.color.value(),m.transparency=d.transparency.value(),this._data.push(m)))},u.StudyPaneView_polygons=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_polygons.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 p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_polygons.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;if(this._data=[],(t=this._study.graphics().polygons)&&(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], b=e.priceRange().convertToPercent(b,w)),S=e.priceToCoordinate(b),T=c.location.value()){case CanvasEx.MARKLOC_ABSOLUTE:f.direction="";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:S=this._locationToY(T,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:S=this._locationToY(T,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="down";break;default:y.logWarn("Bad location value: "+T),S=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,_),f.direction="up"}f.point=new r.Point(g,S),this._data.push(f),this._textCache.push({})}},o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e=this._data;g(t,e.x1,e.y1,e.x2-e.x1,e.y2-e.y1,v.generateColor(this._data.color,this._data.transparency))},o.prototype.hitTest=function(t){return null},u.StudyPaneView_backgrounds=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_backgrounds.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 o(this._data[e]));return t},u.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(t){return("inSession"===t||"outOfSession"===t)&&!this._study._series.properties().extendedHours.value()},u.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f,m,g,v,y,b;if(this._data=[],(t=this._study.graphics().backgrounds)&&(e=this._model.timeScale(),(i=this._study.priceScale())&&!i.isEmpty()&&e&&!e.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<t.length;a++)if(l=t[a],h=l.styleId,c=l.data,d=this._study.properties().graphics.backgrounds[h],!this._hideExtendedHours(h)&&d.visible.value())for(_=0;_<c.length;_++)f=c[_],m={},g=o[f.start],(v=o[f.stop])<s||g>r||null!=f.start&&null!=f.stop&&(y=Math.ceil(e.indexToCoordinate(g,!0)-.5*e.barSpacing()),b=Math.ceil(e.indexToCoordinate(v,!0)+.5*e.barSpacing()),u===g-1&&(y=p),p=b,u=v,y<0&&b<0||y>e.width()&&b>e.width()||(m.x1=y,m.x2=b,m.y1=0,m.y2=i.height(),m.color=d.color.value(),m.transparency=d.transparency.value(),this._data.push(m)))},u.StudyPaneView_polygons=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_polygons.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 p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_polygons.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;if(this._data=[],(t=this._study.graphics().polygons)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,
h.data&&(c=this._study.properties().graphics.polygons[h.styleId],100!==c.transparency.value()))for(d=0;d<h.data.length;d++){for(p=h.data[d],u=1/0,_=-1/0,f=0;p.points&&f<p.points.length;f++)m=o[p.points[f].index]+(p.points[f].offset||0),u=Math.min(u,m),_=Math.max(_,m);if(!(_<s||u>a)){for(g={},g.points=[],f=0;p.points&&f<p.points.length;f++)v=p.points[f],y=i.indexToCoordinate(o[v.index]+(v.offset||0)),b=v.level,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w)),S=e.priceToCoordinate(b),T=new r.Point(y,S),T.data=f,g.points.push(T);g.color=c.color.value(),g.backcolor=c.color.value(),g.linewidth=void 0!==c.showBorder&&c.showBorder.value()?1:0,g.linestyle=CanvasEx.LINESTYLE_SOLID,g.filled=!0,g.fillBackground=!0,g.transparency=c.transparency.value(),g.mouseTouchable=c.mouseTouchable.value(),this._data.push(g)}}},u.StudyPaneView_trendchannels=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_trendchannels.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 p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_trendchannels.prototype._convertToYCoord=function(t){var e=this._study.priceScale(),i=this._study.firstValue();return e.isPercent()&&(t=e.priceRange().convertToPercent(t,i)),e.priceToCoordinate(t)},u.StudyPaneView_trendchannels.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,x,P,L,k,I,A;if(this._data=[],(t=this._study.graphics().trendchannels)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=function(t,e,i,o,n,s){var a,l,h=new r.Point(0,0),c=new r.Point(i,o);return n&&(a=t.substract(e),l=r.intersectRayWithRect(t,t.add(a),h,c),l?t=l:e.x=i),s&&(a=e.substract(t),l=r.intersectRayWithRect(e,e.add(a),h,c),l?e=l:e.x=i),[t,e]},n=this._study.graphics().indexes,s=this._model.timeScale().visibleBars(),a=s.firstBar(),l=s.lastBar(),h=0;h<t.length;h++)if(c=t[h],c.data)for(d=this._study.properties().graphics.trendchannels[c.styleId],p=0;p<c.data.length;p++)u=c.data[p],_=n[u.startIndex],f=n[u.endIndex],Math.max(_,f)<a&&!u.extendRight||Math.min(_,f)>l&&!u.extendLeft||(m=this._convertToYCoord(u.startHighPrice),g=this._convertToYCoord(u.startLowPrice),v=this._convertToYCoord(u.endHighPrice),y=m-g,b=v-y,w=i.indexToCoordinate(_),S=i.indexToCoordinate(f),T=new r.Point(w,m),C=new r.Point(w,g),x=new r.Point(S,v),P=new r.Point(S,b),L=o(T,x,i.width(),e.height(),u.extendLeft,u.extendRight),k=o(C,P,i.width(),e.height(),u.extendLeft,u.extendRight),T=L[0],x=L[1],C=k[0],P=k[1],I={},I.points=[T,C,P,x],I.color=d.color.value(),I.backcolor=d.color.value(),I.linewidth=void 0!==d.borderWidth?d.borderWidth.value():0,I.linestyle=CanvasEx.LINESTYLE_SOLID,I.filled=!0,I.fillBackground=!0,u.transparency?(A=u.transparency+d.transparency.value(),I.transparency=Math.min(A,100)):I.transparency=d.transparency.value(), 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.polygons[h.styleId],100!==c.transparency.value()))for(d=0;d<h.data.length;d++){for(p=h.data[d],u=1/0,_=-1/0,f=0;p.points&&f<p.points.length;f++)m=o[p.points[f].index]+(p.points[f].offset||0),u=Math.min(u,m),_=Math.max(_,m);if(!(_<s||u>a)){for(g={},g.points=[],f=0;p.points&&f<p.points.length;f++)v=p.points[f],y=i.indexToCoordinate(o[v.index]+(v.offset||0)),b=v.level,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w)),S=e.priceToCoordinate(b),T=new r.Point(y,S),T.data=f,g.points.push(T);g.color=c.color.value(),g.backcolor=c.color.value(),g.linewidth=void 0!==c.showBorder&&c.showBorder.value()?1:0,g.linestyle=CanvasEx.LINESTYLE_SOLID,g.filled=!0,g.fillBackground=!0,g.transparency=c.transparency.value(),g.mouseTouchable=c.mouseTouchable.value(),this._data.push(g)}}},u.StudyPaneView_trendchannels=function(t,e){this._study=t,this._model=e,this._data=[]},u.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_trendchannels.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 p(this._data[e],new f(f.REGULAR)));return t},u.StudyPaneView_trendchannels.prototype._convertToYCoord=function(t){var e=this._study.priceScale(),i=this._study.firstValue();return e.isPercent()&&(t=e.priceRange().convertToPercent(t,i)),e.priceToCoordinate(t)},u.StudyPaneView_trendchannels.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,x,P,L,k,I,A;if(this._data=[],(t=this._study.graphics().trendchannels)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=function(t,e,i,o,n,s){var a,l,h=new r.Point(0,0),c=new r.Point(i,o);return n&&(a=t.substract(e),l=r.intersectRayWithRect(t,t.add(a),h,c),l?t=l:e.x=i),s&&(a=e.substract(t),l=r.intersectRayWithRect(e,e.add(a),h,c),l?e=l:e.x=i),[t,e]},n=this._study.graphics().indexes,s=this._model.timeScale().visibleBars(),a=s.firstBar(),l=s.lastBar(),h=0;h<t.length;h++)if(c=t[h],c.data)for(d=this._study.properties().graphics.trendchannels[c.styleId],p=0;p<c.data.length;p++)u=c.data[p],_=n[u.startIndex],f=n[u.endIndex],Math.max(_,f)<a&&!u.extendRight||Math.min(_,f)>l&&!u.extendLeft||(m=this._convertToYCoord(u.startHighPrice),g=this._convertToYCoord(u.startLowPrice),v=this._convertToYCoord(u.endHighPrice),y=m-g,b=v-y,w=i.indexToCoordinate(_),S=i.indexToCoordinate(f),T=new r.Point(w,m),C=new r.Point(w,g),x=new r.Point(S,v),P=new r.Point(S,b),L=o(T,x,i.width(),e.height(),u.extendLeft,u.extendRight),k=o(C,P,i.width(),e.height(),u.extendLeft,u.extendRight),T=L[0],x=L[1],C=k[0],P=k[1],I={},I.points=[T,C,P,x],I.color=d.color.value(),I.backcolor=d.color.value(),I.linewidth=void 0!==d.borderWidth?d.borderWidth.value():0,I.linestyle=CanvasEx.LINESTYLE_SOLID,I.filled=!0,I.fillBackground=!0,
I.mouseTouchable=!0,this._data.push(I))},u.StudyPaneView_hhists=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hhists.prototype.renderer=function(){var t,e;this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m;for(e in this._data)t.append(new n(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hhists.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(this._data=[],this._textData=[],t=this._study.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&e&&!e.isEmpty()&&(i=this._study.graphics().hhists))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<i.length;a++)if(l=i[a],h=this._study.properties().graphics.hhists[l.styleId],h.visible.value()){c=l.dataObj;for(d in c){for(p=c[d],u=1/0,_=-1/0,f=p.length;f--;)u=Math.min(u,o[p[f].firstBarTime]),_=Math.max(_,o[p[f].lastBarTime]);_<s||u>r||this._updateDataForRenderers(p,h,t,e,o)}}},u.StudyPaneView_hhists.prototype._updateDataForRenderers=function(t,e,o,n,s){var a,l,h,c,d,p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I,A,E=[],M=this._findMaxRate(t),$=null,D=null,V=null,O={},B=i(294).shiftColor,R=function(t,e,i){if(i===CanvasEx.HHISTDIR_LEFTTORIGHT)return t+e;if(i===CanvasEx.HHISTDIR_RIGHTTOLEFT)return e+t;throw Error("Unknown direction value: "+i)};for(p=0;p<t.length;p++)for(u=t[p],null==D&&(D=this._findActualRateLength(u.rate)),null==$&&(_=Math.abs(n.indexToCoordinate(s[u.firstBarTime])-n.indexToCoordinate(s[u.lastBarTime])),$=e.percentWidth.value()*_/100,$-=D,$=Math.max($,0)),f=!1,y=0;y<D;y++)if(0!==u.rate[y]){if(void 0===O[y]?O[y]=u.rate[y]:O[y]+=u.rate[y],o.isPercent()?(b=this._study.firstValue(),a=o.priceRange().convertToPercent(u.priceHigh,b),l=o.priceRange().convertToPercent(u.priceLow,b)):(a=u.priceHigh,l=u.priceLow),w={},w.y1=o.priceToCoordinate(a)+1,w.y2=o.priceToCoordinate(l)-1,0===p&&(m=w.y2,g=w.y2-w.y1),S=e.location.value(),T=e.direction.value(),S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=n.indexToCoordinate(s[u.firstBarTime]),h=1,d="left";else if(S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_RIGHTTOLEFT)c=n.indexToCoordinate(s[u.lastBarTime]),h=-1,d="right";else if(S===CanvasEx.HHISTLOC_RELATIVE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=0,h=1,d="left";else{if(S!==CanvasEx.HHISTLOC_RELATIVE||T!==CanvasEx.HHISTDIR_RIGHTTOLEFT)throw Error("Unknown location/direction values: "+S+"/"+T);c=n.width(),h=-1,d="right"}if(w.x1=0===y?c:c+h*($*u.rate[y-1]/M+D),w.x2=w.x1+h*($*u.rate[y]/M),w.colorBg=e.colors[y].value(),w.transparency=e.transparencies[y].value(),w.blendedColor=v.generateColor(w.colorBg,w.transparency),w.x0=c,E.push(w),V||(V=.6*(w.y2-w.y1)),!f&&e.showValues.value()&&V>=7.5){for(f=!0,C={},x=this._study.formatter(),C.text="",P=0;P<D;P++)C.text=R(C.text,x.format(u.rate[P]),T), u.transparency?(A=u.transparency+d.transparency.value(),I.transparency=Math.min(A,100)):I.transparency=d.transparency.value(),I.mouseTouchable=!0,this._data.push(I))},u.StudyPaneView_hhists=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[],this._textRendererCache={}},u.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0},u.StudyPaneView_hhists.prototype.renderer=function(){var t,e;this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new m;for(e in this._data)t.append(new n(this._data[e]));for(e=0;e<this._textData.length;e++)t.append(new a(this._textData[e],this._textRendererCache,new f(f.REGULAR)));return t},u.StudyPaneView_hhists.prototype._updateViewInternal=function(){var t,e,i,o,n,s,r,a,l,h,c,d,p,u,_,f;if(this._data=[],this._textData=[],t=this._study.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&e&&!e.isEmpty()&&(i=this._study.graphics().hhists))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),s=n.firstBar(),r=n.lastBar(),a=0;a<i.length;a++)if(l=i[a],h=this._study.properties().graphics.hhists[l.styleId],h.visible.value()){c=l.dataObj;for(d in c){for(p=c[d],u=1/0,_=-1/0,f=p.length;f--;)u=Math.min(u,o[p[f].firstBarTime]),_=Math.max(_,o[p[f].lastBarTime]);_<s||u>r||this._updateDataForRenderers(p,h,t,e,o)}}},u.StudyPaneView_hhists.prototype._updateDataForRenderers=function(t,e,o,n,s){var a,l,h,c,d,p,u,_,f,m,g,y,b,w,S,T,C,x,P,L,k,I,A,E=[],M=this._findMaxRate(t),$=null,D=null,V=null,O={},B=i(294).shiftColor,R=function(t,e,i){if(i===CanvasEx.HHISTDIR_LEFTTORIGHT)return t+e;if(i===CanvasEx.HHISTDIR_RIGHTTOLEFT)return e+t;throw Error("Unknown direction value: "+i)};for(p=0;p<t.length;p++)for(u=t[p],null==D&&(D=this._findActualRateLength(u.rate)),null==$&&(_=Math.abs(n.indexToCoordinate(s[u.firstBarTime])-n.indexToCoordinate(s[u.lastBarTime])),$=e.percentWidth.value()*_/100,$-=D,$=Math.max($,0)),f=!1,y=0;y<D;y++)if(0!==u.rate[y]){if(void 0===O[y]?O[y]=u.rate[y]:O[y]+=u.rate[y],o.isPercent()?(b=this._study.firstValue(),a=o.priceRange().convertToPercent(u.priceHigh,b),l=o.priceRange().convertToPercent(u.priceLow,b)):(a=u.priceHigh,l=u.priceLow),w={},w.y1=o.priceToCoordinate(a)+1,w.y2=o.priceToCoordinate(l)-1,0===p&&(m=w.y2,g=w.y2-w.y1),S=e.location.value(),T=e.direction.value(),S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=n.indexToCoordinate(s[u.firstBarTime]),h=1,d="left";else if(S===CanvasEx.HHISTLOC_ABSOLUTE&&T===CanvasEx.HHISTDIR_RIGHTTOLEFT)c=n.indexToCoordinate(s[u.lastBarTime]),h=-1,d="right";else if(S===CanvasEx.HHISTLOC_RELATIVE&&T===CanvasEx.HHISTDIR_LEFTTORIGHT)c=0,h=1,d="left";else{if(S!==CanvasEx.HHISTLOC_RELATIVE||T!==CanvasEx.HHISTDIR_RIGHTTOLEFT)throw Error("Unknown location/direction values: "+S+"/"+T);c=n.width(),h=-1,d="right"}if(w.x1=0===y?c:c+h*($*u.rate[y-1]/M+D),w.x2=w.x1+h*($*u.rate[y]/M),w.colorBg=e.colors[y].value(),w.transparency=e.transparencies[y].value(),w.blendedColor=v.generateColor(w.colorBg,w.transparency),w.x0=c,E.push(w),V||(V=.6*(w.y2-w.y1)),
P!==D-1&&(C.text=R(C.text,"x",T));if(C.color=e.valuesColor.value(),C.font="arial",C.fontsize=V,C.horzAlign=d,C.vertAlign="middle",L=new r.Point(c+3*h,w.y2-.61*(w.y2-w.y1)),C.points=[L],C.offsetX=0,C.offsetY=0,this._textData.push(C),p===t.length-1){for(k=c+3*h,I=m+.39*g,A={text:"",color:B(e.valuesColor.value(),1.5),font:"arial",fontsize:V,horzAlign:d,vertAlign:"middle",points:[new r.Point(k,I)],offsetX:0,offsetY:0},P=0;P<D;P++)A.text=R(A.text,x.format(O[P]),T),P!==D-1&&(A.text=R(A.text,"x",T));this._textData.push(A)}}}E.length>0&&this._data.push(E)},u.StudyPaneView_hhists.prototype._findMaxRate=function(t){var e,i,o=0,n=0;for(e=0;e<t.length;e++){for(n=0,i=0;i<t[e].rate.length;i++)n+=t[e].rate[i];o=Math.max(o,n)}return o},u.StudyPaneView_hhists.prototype._findActualRateLength=function(t){var e,i,o=0;for(e=0;e<t.length&&(null!==(i=t[e])&&void 0!==i);++e)o++;return o},n.prototype.hitTest=function(t){var e,i,o=s(this._data,t.y);return o<0?null:(e=Math.min(this._data[o].x0,this._data[o].x2),i=Math.max(this._data[o].x0,this._data[o].x2),e<=t.x&&t.x<=i?new f(f.REGULAR):null)},n.prototype.draw=function(t){var e,i,o,n,s,r,a;for(t.save(),e={},i=[],n=0;n<this._data.length;n++)s=this._data[n],e[s.blendedColor]?e[s.blendedColor].push(s):(i.push(s.blendedColor),e[s.blendedColor]=[s]);for(r=0;r<i.length;r++){for(a=i[r],t.fillStyle=a,t.strokeStyle=a,t.beginPath(),o=e[a],n=0;n<o.length;n++)s=o[n],t.rect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1);t.stroke(),t.fill()}t.restore()},t.exports=u},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittest=e||new a(a.MOVEPOINT),this._backHittest=i||new a(a.MOVEPOINT_BACKGROUND),this._points=t.points}var n=i(53),s=i(194).LineDataSource,r=i(273).TrendLineRenderer,a=i(233),l=i(199);o.prototype.draw=function(t){var e,i,o;if(0!==this._points.length){for(t.beginPath(),t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._points[0],t.moveTo(e.x,e.y),i=0;i<this._points.length;i++)o=this._points[i],t.lineTo(o.x,o.y);this._data.filled&&this._data.fillBackground&&(t.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),this._data.linewidth>0&&t.stroke(),this._points.length>1&&(this._data.leftend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[1],this._points[0],t,t.lineWidth),this._data.rightend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],t,t.lineWidth))}},o.prototype.hitTest=function(t){var e,i,o,s,r;if(void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(e=TradingView.isMobile.any()?24:3,i=1;i<this._points.length;i++)if(o=this._points[i-1],s=this._points[i],r=n.distanceToSegment(o,s,t),r.distance<=e)return this._hittest;return this._data.filled&&this._data.fillBackground&&this._points.length>0&&(o=this._points[0],s=this._points[this._points.length-1],r=n.distanceToSegment(o,s,t), !f&&e.showValues.value()&&V>=7.5){for(f=!0,C={},x=this._study.formatter(),C.text="",P=0;P<D;P++)C.text=R(C.text,x.format(u.rate[P]),T),P!==D-1&&(C.text=R(C.text,"x",T));if(C.color=e.valuesColor.value(),C.font="arial",C.fontsize=V,C.horzAlign=d,C.vertAlign="middle",L=new r.Point(c+3*h,w.y2-.61*(w.y2-w.y1)),C.points=[L],C.offsetX=0,C.offsetY=0,this._textData.push(C),p===t.length-1){for(k=c+3*h,I=m+.39*g,A={text:"",color:B(e.valuesColor.value(),1.5),font:"arial",fontsize:V,horzAlign:d,vertAlign:"middle",points:[new r.Point(k,I)],offsetX:0,offsetY:0},P=0;P<D;P++)A.text=R(A.text,x.format(O[P]),T),P!==D-1&&(A.text=R(A.text,"x",T));this._textData.push(A)}}}E.length>0&&this._data.push(E)},u.StudyPaneView_hhists.prototype._findMaxRate=function(t){var e,i,o=0,n=0;for(e=0;e<t.length;e++){for(n=0,i=0;i<t[e].rate.length;i++)n+=t[e].rate[i];o=Math.max(o,n)}return o},u.StudyPaneView_hhists.prototype._findActualRateLength=function(t){var e,i,o=0;for(e=0;e<t.length&&(null!==(i=t[e])&&void 0!==i);++e)o++;return o},n.prototype.hitTest=function(t){var e,i,o=s(this._data,t.y);return o<0?null:(e=Math.min(this._data[o].x0,this._data[o].x2),i=Math.max(this._data[o].x0,this._data[o].x2),e<=t.x&&t.x<=i?new f(f.REGULAR):null)},n.prototype.draw=function(t){var e,i,o,n,s,r,a;for(t.save(),e={},i=[],n=0;n<this._data.length;n++)s=this._data[n],e[s.blendedColor]?e[s.blendedColor].push(s):(i.push(s.blendedColor),e[s.blendedColor]=[s]);for(r=0;r<i.length;r++){for(a=i[r],t.fillStyle=a,t.strokeStyle=a,t.beginPath(),o=e[a],n=0;n<o.length;n++)s=o[n],t.rect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1);t.stroke(),t.fill()}t.restore()},t.exports=u},function(t,e,i){"use strict";function o(t,e,i){this._data=t,this._hittest=e||new a(a.MOVEPOINT),this._backHittest=i||new a(a.MOVEPOINT_BACKGROUND),this._points=t.points}var n=i(53),s=i(194).LineDataSource,r=i(273).TrendLineRenderer,a=i(233),l=i(199);o.prototype.draw=function(t){var e,i,o;if(0!==this._points.length){for(t.beginPath(),t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._points[0],t.moveTo(e.x,e.y),i=0;i<this._points.length;i++)o=this._points[i],t.lineTo(o.x,o.y);this._data.filled&&this._data.fillBackground&&(t.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),this._data.linewidth>0&&t.stroke(),this._points.length>1&&(this._data.leftend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[1],this._points[0],t,t.lineWidth),this._data.rightend===s.LINEEND_ARROW&&r.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],t,t.lineWidth))}},o.prototype.hitTest=function(t){var e,i,o,s,r;if(void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(e=TradingView.isMobile.any()?24:3,i=1;i<this._points.length;i++)if(o=this._points[i-1],s=this._points[i],r=n.distanceToSegment(o,s,t),r.distance<=e)return this._hittest;return this._data.filled&&this._data.fillBackground&&this._points.length>0&&(o=this._points[0],
r.distance<=e)?this._hittest:this._data.filled&&this._data.fillBackground&&n.isInPolygon(this._data.points,t)?this._backHittest:null},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(53);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){t.width=e.w,t.height=e.h;var i=t.getContext("2d");i&&i.translate(.5,.5)}function n(t,e,i,o,n,s){t.save(),t.translate(-.5,-.5),t.fillStyle=s,t.fillRect(e,i,o,n),t.restore()}function s(t,e){var i=document.createElement("canvas");return t.append(i),o(i,e),i}i(26);var r=function(){function t(t,e){this.w=t,this.h=e}return t.prototype.equals=function(t){return this.w===t.w&&this.h===t.h},t}();e.Size=r,e.resizeCanvas=o,e.clearRect=n,e.addCanvasTo=s},function(t,e,i){"use strict";function o(t,e,i){var o=this._mtpStudyId()+"@mtp-mtpredictor",n=i||p.findStudyMetaInfo(t.studiesMetaData(),o),r=e||l(n,null,null,t.studyVersioning()),a=TradingView.Study.lineToolNameForPointsBasedStudy(o);s.call(this,t,this.createPaneViews(t),r,a),this._doNotNeedLine=!0,this._turnaroundCounter=0,this._nextTurnaround(),this._metaInfo=n,this._graphics=new c(n),this._formatter=new d}var n=i(287),s=n.StudyLineDataSource,r=n.StudyLineDataSourcePaneView,a=i(294),l=a.prepareStudyProperties,h=i(194).LineDataSource,c=i(289),d=i(304).VolumeFormatter,p=i(258);inherit(o,s),o.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()},o.prototype.calcIsActualSymbol=function(){return h.prototype.calcIsActualSymbol.call(this)},o.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter},o.prototype.createPaneViews=function(t){return[new r(this,t),new TradingView.Study.StudyPaneView_textmarks(this,t),new TradingView.Study.StudyPaneView_polygons(this,t),new TradingView.Study.StudyPaneView_lines(this,t)]},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)h.prototype.onData.call(this,t),this._points.length===this.pointsCount()&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return;TradingView.Study.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,""!==t.params.nonseries.d&&e._graphics.process(t.params.nonseries),t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}}, s=this._points[this._points.length-1],r=n.distanceToSegment(o,s,t),r.distance<=e)?this._hittest:this._data.filled&&this._data.fillBackground&&n.isInPolygon(this._data.points,t)?this._backHittest:null},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(53);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){t.width=e.w,t.height=e.h;var i=t.getContext("2d");i&&i.translate(.5,.5)}function n(t,e,i,o,n,s){t.save(),t.translate(-.5,-.5),t.fillStyle=s,t.fillRect(e,i,o,n),t.restore()}function s(t,e){var i=document.createElement("canvas");return t.append(i),o(i,e),i}i(26);var r=function(){function t(t,e){this.w=t,this.h=e}return t.prototype.equals=function(t){return this.w===t.w&&this.h===t.h},t}();e.Size=r,e.resizeCanvas=o,e.clearRect=n,e.addCanvasTo=s},function(t,e,i){"use strict";function o(t,e,i){var o=this._mtpStudyId()+"@mtp-mtpredictor",n=i||p.findStudyMetaInfo(t.studiesMetaData(),o),r=e||l(n,null,null,t.studyVersioning()),a=TradingView.Study.lineToolNameForPointsBasedStudy(o);s.call(this,t,this.createPaneViews(t),r,a),this._doNotNeedLine=!0,this._turnaroundCounter=0,this._nextTurnaround(),this._metaInfo=n,this._graphics=new c(n),this._formatter=new d}var n=i(287),s=n.StudyLineDataSource,r=n.StudyLineDataSourcePaneView,a=i(294),l=a.prepareStudyProperties,h=i(194).LineDataSource,c=i(289),d=i(304).VolumeFormatter,p=i(258);inherit(o,s),o.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()},o.prototype.calcIsActualSymbol=function(){return h.prototype.calcIsActualSymbol.call(this)},o.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter},o.prototype.createPaneViews=function(t){return[new r(this,t),new TradingView.Study.StudyPaneView_textmarks(this,t),new TradingView.Study.StudyPaneView_polygons(this,t),new TradingView.Study.StudyPaneView_lines(this,t)]},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)h.prototype.onData.call(this,t),this._points.length===this.pointsCount()&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return;TradingView.Study.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,""!==t.params.nonseries.d&&e._graphics.process(t.params.nonseries),
o.prototype._requestStudy=function(){var t=this,e=function(e){t.onData(e)},i=this._studyInputs();i&&(this._studyId?(this._nextTurnaround(),this._model.chartApi().modifyStudy(this._studyId,this._turnaround,i,e)):(this._studyId=TradingView.Study.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.id+"-1!",i,e)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolBarsPattern";var i=e||new f("linetoolbarspattern");a.call(this,t,new o(this,t),i),i.mirrored.listeners().subscribe(this,n.prototype.mirror),i.flipped.listeners().subscribe(this,n.prototype.flip),i.addExclusion("mirrored"),i.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(214).Action,p=i(233),u=i(234).PaneRendererLine,_=i(237),f=i(204).DefaultProperty,m=i(199);inherit(o,r),o.prototype.renderer=function(){var t,e,i,o,r,d,f,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._pattern&&2===this._source.points().length){if(t=this._source.points()[0].index,e=this._source.points()[1].index,!(i=t<e?this._points[0]:this._points[1]))return new _;if(o=parseInt(this._source.properties().mode.value(),10),r=Math.abs((this._points[0].x-this._points[1].x)/(this._pattern.length-1)),o===n.BARS_MODE||o===n.OPENCLOSE_MODE){for(d=new _,f=o===n.BARS_MODE?["high","low"]:["open","close"],g=f[0],v=f[1],y=0;y<this._pattern.length;y++)b=Math.round(i.x+y*r+.5),w=i.y+Math.round(this._pattern[y][g]),S=i.y+Math.round(this._pattern[y][v]),T={},T.points=[new s.Point(b-1,w),new s.Point(b+1,S)],T.color=this._source.properties().color.value(),T.linewidth=1,T.backcolor=this._source.properties().color.value(),T.fillBackground=!0,T.transparency=10,d.append(new h(T));return this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,T={},T.barSpacing=r,T.items=this._pattern,T.histogramBase=0,T.lineIndex=0,T.lineColor=m.generateColor(this._source.properties().color.value(),10),T.lineStyle=CanvasEx.LINESTYLE_SOLID,T.lineWidth=2,T.hittest=new p(p.MOVEPOINT),d.append(new u(T)),this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,this._points.length<2?d:(C=this._points[0],x=this._points[1],P={},P.points=[C],P.color="#808080",P.linewidth=1,P.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(P)),L={},L.points=[x],L.color="#808080",L.linewidth=1,L.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(L)),k={points:[C,x],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},d.append(new c(k)),d)}, t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}},o.prototype._requestStudy=function(){var t=this,e=function(e){t.onData(e)},i=this._studyInputs();i&&(this._studyId?(this._nextTurnaround(),this._model.chartApi().modifyStudy(this._studyId,this._turnaround,i,e)):(this._studyId=TradingView.Study.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.id+"-1!",i,e)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolBarsPattern";var i=e||new f("linetoolbarspattern");a.call(this,t,new o(this,t),i),i.mirrored.listeners().subscribe(this,n.prototype.mirror),i.flipped.listeners().subscribe(this,n.prototype.flip),i.addExclusion("mirrored"),i.addExclusion("flipped"),this._scaleCoeff=1,this.version=n.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,n.prototype.onModeChanged)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(214).Action,p=i(233),u=i(234).PaneRendererLine,_=i(237),f=i(204).DefaultProperty,m=i(199);inherit(o,r),o.prototype.renderer=function(){var t,e,i,o,r,d,f,g,v,y,b,w,S,T,C,x,P,L,k;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._pattern&&2===this._source.points().length){if(t=this._source.points()[0].index,e=this._source.points()[1].index,!(i=t<e?this._points[0]:this._points[1]))return new _;if(o=parseInt(this._source.properties().mode.value(),10),r=Math.abs((this._points[0].x-this._points[1].x)/(this._pattern.length-1)),o===n.BARS_MODE||o===n.OPENCLOSE_MODE){for(d=new _,f=o===n.BARS_MODE?["high","low"]:["open","close"],g=f[0],v=f[1],y=0;y<this._pattern.length;y++)b=Math.round(i.x+y*r+.5),w=i.y+Math.round(this._pattern[y][g]),S=i.y+Math.round(this._pattern[y][v]),T={},T.points=[new s.Point(b-1,w),new s.Point(b+1,S)],T.color=this._source.properties().color.value(),T.linewidth=1,T.backcolor=this._source.properties().color.value(),T.fillBackground=!0,T.transparency=10,d.append(new h(T));return this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,T={},T.barSpacing=r,T.items=this._pattern,T.histogramBase=0,T.lineIndex=0,T.lineColor=m.generateColor(this._source.properties().color.value(),10),T.lineStyle=CanvasEx.LINESTYLE_SOLID,T.lineWidth=2,T.hittest=new p(p.MOVEPOINT),d.append(new u(T)),this.isAnchorsRequired()&&d.append(this.createLineAnchor({points:this._points})),d}return d=new _,this._points.length<2?d:(C=this._points[0],x=this._points[1],P={},P.points=[C],P.color="#808080",P.linewidth=1,P.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(P)),L={},L.points=[x],L.color="#808080",L.linewidth=1,L.linestyle=CanvasEx.LINESTYLE_SOLID,d.append(new l(L)),k={points:[C,x],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
o.prototype.update=function(){r.prototype.update.call(this),this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l,h,c,d,p,u,_,f,m;!this._source.priceScale()||this._source.priceScale().isEmpty()||this._points.length<2||(this._source._pattern&&this._source._pattern.length>0&&2===this._source.points().length?(t=this._source.priceScale(),e=this._source.firstPatternPrice(),i=this._source.pressCoeff(),t=this._source.priceScale(),o=this._source.ownerSource().firstValue(),n=t.priceRange(),t.isPercent()?(a=n.convertToPercent(e,o),r=t.priceToCoordinate(a)):r=t.priceToCoordinate(e),l=function(s){var a=(s-e)*i+e;return t.isPercent()&&(a=n.convertToPercent(a,o)),t.priceToCoordinate(a)-r},h=parseInt(this._source.properties().mode.value()),c=this._source.points()[0].index,d=this._source.points()[1].index,p=c>d?1:0,u=this._points[p],_=u.x,f=Math.abs((this._points[0].x-this._points[1].x)/(this._source._pattern.length-1)),m={0:function(t){return{high:l(t[TradingView.HIGH_PLOT]),low:l(t[TradingView.LOW_PLOT])}},1:function(t,e){return new s.Point(_+e*f,l(t[TradingView.CLOSE_PLOT])+u.y)},2:function(t){return{open:l(t[TradingView.OPEN_PLOT]),close:l(t[TradingView.CLOSE_PLOT])}},3:function(t,e){return new s.Point(_+e*f,l(t[TradingView.OPEN_PLOT])+u.y)},4:function(t,e){return new s.Point(_+e*f,l(t[TradingView.HIGH_PLOT])+u.y)},5:function(t,e){return new s.Point(_+e*f,l(t[TradingView.LOW_PLOT])+u.y)},6:function(t,e){return new s.Point(_+e*f,l((t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2)+u.y)}},this._pattern=this._source._pattern.map(m[h])):delete this._pattern)},inherit(n,a),n.version=2,n.BARS_MODE=0,n.LINE_MODE=1,n.OPENCLOSE_MODE=2,n.LINEOPEN_MODE=3,n.LINEHIGH_MODE=4,n.LINELOW_MODE=5,n.LINEHL2_MODE=6,n.prototype.onModeChanged=function(){var t=this.patternPriceDiff();t*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+t},n.prototype.additionalActions=function(t){var e,i,o=new d({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),n=new d({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return o.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().mirrored,!o.properties().mirrored.value(),"Bats Pattern Mirroring"),o.updateAllViews(),o._model.updateSource(o)}),n.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().flipped,!o.properties().flipped.value(),"Bats Pattern Flipping"),o.updateAllViews(),o._model.updateSource(o)}),e=new d({checkable:!0,text:$.t("Restore Size")}),i=this,e.callbacks().subscribe(null,function(e){var o=i.points()[0],n=i.patternPriceDiff(),s=o.price+n,r=o.index+i._pattern.length-1;t.startChangingLinetool(i,{price:s,index:r},1,{}),t.changeLinePoint({price:s,index:r},{}),t.endChangingLinetool()}),[o,n,e]},n.prototype.pointsCount=function(){return 2},n.prototype.state=function(t){var e=a.prototype.state.call(this,t) extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},d.append(new c(k)),d)},o.prototype.update=function(){r.prototype.update.call(this),this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,r,a,l,h,c,d,p,u,_,f,m;!this._source.priceScale()||this._source.priceScale().isEmpty()||this._points.length<2||(this._source._pattern&&this._source._pattern.length>0&&2===this._source.points().length?(t=this._source.priceScale(),e=this._source.firstPatternPrice(),i=this._source.pressCoeff(),t=this._source.priceScale(),o=this._source.ownerSource().firstValue(),n=t.priceRange(),t.isPercent()?(a=n.convertToPercent(e,o),r=t.priceToCoordinate(a)):r=t.priceToCoordinate(e),l=function(s){var a=(s-e)*i+e;return t.isPercent()&&(a=n.convertToPercent(a,o)),t.priceToCoordinate(a)-r},h=parseInt(this._source.properties().mode.value()),c=this._source.points()[0].index,d=this._source.points()[1].index,p=c>d?1:0,u=this._points[p],_=u.x,f=Math.abs((this._points[0].x-this._points[1].x)/(this._source._pattern.length-1)),m={0:function(t){return{high:l(t[TradingView.HIGH_PLOT]),low:l(t[TradingView.LOW_PLOT])}},1:function(t,e){return new s.Point(_+e*f,l(t[TradingView.CLOSE_PLOT])+u.y)},2:function(t){return{open:l(t[TradingView.OPEN_PLOT]),close:l(t[TradingView.CLOSE_PLOT])}},3:function(t,e){return new s.Point(_+e*f,l(t[TradingView.OPEN_PLOT])+u.y)},4:function(t,e){return new s.Point(_+e*f,l(t[TradingView.HIGH_PLOT])+u.y)},5:function(t,e){return new s.Point(_+e*f,l(t[TradingView.LOW_PLOT])+u.y)},6:function(t,e){return new s.Point(_+e*f,l((t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2)+u.y)}},this._pattern=this._source._pattern.map(m[h])):delete this._pattern)},inherit(n,a),n.version=2,n.BARS_MODE=0,n.LINE_MODE=1,n.OPENCLOSE_MODE=2,n.LINEOPEN_MODE=3,n.LINEHIGH_MODE=4,n.LINELOW_MODE=5,n.LINEHL2_MODE=6,n.prototype.onModeChanged=function(){var t=this.patternPriceDiff();t*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+t},n.prototype.additionalActions=function(t){var e,i,o=new d({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),n=new d({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return o.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().mirrored,!o.properties().mirrored.value(),"Bats Pattern Mirroring"),o.updateAllViews(),o._model.updateSource(o)}),n.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().flipped,!o.properties().flipped.value(),"Bats Pattern Flipping"),o.updateAllViews(),o._model.updateSource(o)}),e=new d({checkable:!0,text:$.t("Restore Size")}),i=this,e.callbacks().subscribe(null,function(e){var o=i.points()[0],n=i.patternPriceDiff(),s=o.price+n,r=o.index+i._pattern.length-1;t.startChangingLinetool(i,{price:s,index:r},1,{}),t.changeLinePoint({price:s,index:r},{}),t.endChangingLinetool()}),[o,n,e]},n.prototype.pointsCount=function(){
;return e.pattern=this._pattern,e},n.prototype.restoreData=function(t){t.pattern&&(this._pattern=t.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.cloneData=function(t){this._pattern=TradingView.clone(t._pattern)},n.prototype.mirror=function(){var t,e,i,o,n,s=this._pattern,r=s[0][TradingView.HIGH_PLOT],a=Math.min(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]),l=Math.max(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]);for(t=1;t<s.length;t++)a=Math.min(a,s[t][TradingView.LOW_PLOT]),l=Math.max(l,s[t][TradingView.HIGH_PLOT]);if(a<l)for(e=(a+l)/2,i=function(t){return e-(t-e)},t=0;t<s.length;t++)s[t][TradingView.HIGH_PLOT]=i(s[t][TradingView.HIGH_PLOT]),s[t][TradingView.LOW_PLOT]=i(s[t][TradingView.LOW_PLOT]),s[t][TradingView.OPEN_PLOT]=i(s[t][TradingView.OPEN_PLOT]),s[t][TradingView.CLOSE_PLOT]=i(s[t][TradingView.CLOSE_PLOT]);o=s[0][TradingView.HIGH_PLOT]-r,n=s[s.length-1][TradingView.LOW_PLOT]-s[0][TradingView.HIGH_PLOT],this._points[0].price+=o,this._points[1].price=this._points[0].price+n,this.updateAllViews()},n.prototype.flip=function(){var t,e,i;for(this._points[0].price=this._points[1].price,t=0;t<this._pattern.length/2;t++)e=this._pattern[t],this._pattern[t]=this._pattern[this._pattern.length-t-1],this._pattern[this._pattern.length-t-1]=e;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[0][e])},n.prototype.lastPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[this._pattern.length-1][e])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var t=this.patternPriceDiff(),e=this.points()[0].price,i=this.points()[1].price,o=i-e,n=o/t;return this._pressCoeff=n,n},n.prototype.addPoint=function(t,e){var i,o,s,r,l,h,c,d,p,u,_=this._model.mainSeries(),f=_.nearestIndex(t.index,TradingView.SEARCH_NEAREST_RIGHT);if(this.properties().mode.value()===n.BARS_MODE?t.price=_.bars().valueAt(f)[TradingView.HIGH_PLOT]:t.price=_.bars().valueAt(f)[TradingView.CLOSE_PLOT],i=this.priceScale().priceRange().length(),t.price+=.05*i,o=_.priceScale(),o.isPercent()&&(s=_.firstValue(),t.price=o.priceRange().convertToPercent(t.price,s)),r=a.prototype.addPoint.call(this,t,e,!0)){ return 2},n.prototype.state=function(t){var e=a.prototype.state.call(this,t);return e.pattern=this._pattern,e},n.prototype.restoreData=function(t){t.pattern&&(this._pattern=t.pattern)},n.prototype.title=function(){return"Bars Pattern"},n.prototype.cloneData=function(t){this._pattern=TradingView.clone(t._pattern)},n.prototype.mirror=function(){var t,e,i,o,n,s=this._pattern,r=s[0][TradingView.HIGH_PLOT],a=Math.min(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]),l=Math.max(s[0][TradingView.LOW_PLOT],s[0][TradingView.HIGH_PLOT]);for(t=1;t<s.length;t++)a=Math.min(a,s[t][TradingView.LOW_PLOT]),l=Math.max(l,s[t][TradingView.HIGH_PLOT]);if(a<l)for(e=(a+l)/2,i=function(t){return e-(t-e)},t=0;t<s.length;t++)s[t][TradingView.HIGH_PLOT]=i(s[t][TradingView.HIGH_PLOT]),s[t][TradingView.LOW_PLOT]=i(s[t][TradingView.LOW_PLOT]),s[t][TradingView.OPEN_PLOT]=i(s[t][TradingView.OPEN_PLOT]),s[t][TradingView.CLOSE_PLOT]=i(s[t][TradingView.CLOSE_PLOT]);o=s[0][TradingView.HIGH_PLOT]-r,n=s[s.length-1][TradingView.LOW_PLOT]-s[0][TradingView.HIGH_PLOT],this._points[0].price+=o,this._points[1].price=this._points[0].price+n,this.updateAllViews()},n.prototype.flip=function(){var t,e,i;for(this._points[0].price=this._points[1].price,t=0;t<this._pattern.length/2;t++)e=this._pattern[t],this._pattern[t]=this._pattern[this._pattern.length-t-1],this._pattern[this._pattern.length-t-1]=e;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},n.prototype.firstPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[0][e])},n.prototype.lastPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===n.LINEHL2_MODE?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[this._pattern.length-1][e])},n.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},n.prototype.pressCoeff=function(){var t=this.patternPriceDiff(),e=this.points()[0].price,i=this.points()[1].price,o=i-e,n=o/t;return this._pressCoeff=n,n},n.prototype.addPoint=function(t,e){var i,o,s,r,l,h,c,d,p,u,_=this._model.mainSeries(),f=_.nearestIndex(t.index,TradingView.SEARCH_NEAREST_RIGHT);if(this.properties().mode.value()===n.BARS_MODE?t.price=_.bars().valueAt(f)[TradingView.HIGH_PLOT]:t.price=_.bars().valueAt(f)[TradingView.CLOSE_PLOT],i=this.priceScale().priceRange().length(),t.price+=.05*i,o=_.priceScale(),o.isPercent()&&(s=_.firstValue(),
for(l=Math.min(this.points()[0].index,this.points()[1].index),h=Math.max(this.points()[0].index,this.points()[1].index),f=this._model.mainSeries().nearestIndex(l,TradingView.SEARCH_NEAREST_RIGHT),c=this._model.mainSeries().nearestIndex(h,TradingView.SEARCH_NEAREST_LEFT),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],d=f;d<=c;d++)p=this._model.mainSeries().data().valueAt(d),this._pattern.push(TradingView.clone(p));this._pattern.length>0&&(u=this.patternPriceDiff(),this._points[1].price=this._points[0].price+u,this._points[1].index=this._points[0].index+(c-f),this.normalizePoints(),this.createServerPoints())}return r},n.prototype.setPoint=function(t,e,i){var o=this._points[0].price-this._points[1].price;1===t&&e.index<=this._points[0].index&&(e.index=this._points[0].index+1),0===t&&e.index>=this._points[1].index&&(e.index=this._points[1].index-1),a.prototype.setPoint.call(this,t,e,i),1===t?this._points[0].price=this._points[1].price+o:this._points[1].price=this._points[0].price-o},n.prototype.migrateVersion=function(t,e,i){if(1===t&&this._pattern.length>0){var o=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+o),2===this._points.length&&(this._points[1].price=this._points[0].price+o)}},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolTrendBasedFibTime";var i=e||new this.createPropertiesObject("linetooltrendbasedfibtime");l.call(this,t,new o(this,t),i),this.version=n.version}var s=i(53),r=i(288).VertLineRenderer,a=i(242),l=i(194).LineDataSource,h=i(267),c=i(243).TextRenderer,d=i(269).RectangleTransparencyRenderer,p=i(273).TrendLineRenderer,u=i(233),_=i(237);inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_,f;if(a.prototype.update.call(this),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._levels=[],e.index!==t.index&&(o=e.index-t.index,n=this._source.properties(),s=i.index,r=this._model.timeScale().visibleBars(),!r.isEmpty())))for(l=1;l<=11;l++)h="level"+l,c=n[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),u=Math.round(s+d*o),_=this._model.timeScale().indexToCoordinate(u),f={x:_,coeff:d,color:p,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:l},n.showCoeffs.value()&&(f.text=d,f.y=this._source.priceScale().height()),this._levels.push(f))},o.prototype.renderer=function(){var t,e,i,o,n,a,h,f,m,g,v,y,b,w,S,T,C,x;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,this._points.length<2)return t;if(e=this._points[0],i=this._points[1],o=this._source.properties(),o.trendline.visible.value()&&(n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(), t.price=o.priceRange().convertToPercent(t.price,s)),r=a.prototype.addPoint.call(this,t,e,!0)){for(l=Math.min(this.points()[0].index,this.points()[1].index),h=Math.max(this.points()[0].index,this.points()[1].index),f=this._model.mainSeries().nearestIndex(l,TradingView.SEARCH_NEAREST_RIGHT),c=this._model.mainSeries().nearestIndex(h,TradingView.SEARCH_NEAREST_LEFT),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],d=f;d<=c;d++)p=this._model.mainSeries().data().valueAt(d),this._pattern.push(TradingView.clone(p));this._pattern.length>0&&(u=this.patternPriceDiff(),this._points[1].price=this._points[0].price+u,this._points[1].index=this._points[0].index+(c-f),this.normalizePoints(),this.createServerPoints())}return r},n.prototype.setPoint=function(t,e,i){var o=this._points[0].price-this._points[1].price;1===t&&e.index<=this._points[0].index&&(e.index=this._points[0].index+1),0===t&&e.index>=this._points[1].index&&(e.index=this._points[1].index-1),a.prototype.setPoint.call(this,t,e,i),1===t?this._points[0].price=this._points[1].price+o:this._points[1].price=this._points[0].price-o},n.prototype.migrateVersion=function(t,e,i){if(1===t&&this._pattern.length>0){var o=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+o),2===this._points.length&&(this._points[1].price=this._points[0].price+o)}},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolTrendBasedFibTime";var i=e||new this.createPropertiesObject("linetooltrendbasedfibtime");l.call(this,t,new o(this,t),i),this.version=n.version}var s=i(53),r=i(288).VertLineRenderer,a=i(242),l=i(194).LineDataSource,h=i(267),c=i(243).TextRenderer,d=i(269).RectangleTransparencyRenderer,p=i(273).TrendLineRenderer,u=i(233),_=i(237);inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,r,l,h,c,d,p,u,_,f;if(a.prototype.update.call(this),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],e=this._source.points()[1],i=this._source.points()[2],this._levels=[],e.index!==t.index&&(o=e.index-t.index,n=this._source.properties(),s=i.index,r=this._model.timeScale().visibleBars(),!r.isEmpty())))for(l=1;l<=11;l++)h="level"+l,c=n[h],c.visible.value()&&(d=c.coeff.value(),p=c.color.value(),u=Math.round(s+d*o),_=this._model.timeScale().indexToCoordinate(u),f={x:_,coeff:d,color:p,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:l},n.showCoeffs.value()&&(f.text=d,f.y=this._source.priceScale().height()),this._levels.push(f))},o.prototype.renderer=function(){var t,e,i,o,n,a,h,f,m,g,v,y,b,w,S,T,C,x;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,this._points.length<2)return t;if(e=this._points[0],i=this._points[1],o=this._source.properties(),o.trendline.visible.value()&&(n={points:[e,i],
color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),this._points.length<3)return this.addAnchors(t),t;for(a=this._points[2],o.trendline.visible.value()&&(n={points:[i,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),h=o.fillBackground.value(),f=o.transparency.value(),m=0;m<this._levels.length;m++){if(m>0&&h&&(g=this._levels[m-1],e=new s.Point(g.x,0),i=new s.Point(this._levels[m].x,this._source.priceScale().height()),v={},v.points=[e,i],v.color=this._levels[m].color,v.linewidth=0,v.backcolor=this._levels[m].color,v.fillBackground=!0,v.transparency=f,t.append(new d(v))),void 0!==this._levels[m].text){switch(S=o.horzLabelsAlign.value(),S="left"===S?"right":"right"===S?"left":"center"){case"left":b=3;break;case"center":b=0;break;case"right":b=-3}switch(o.vertLabelsAlign.value()){case"top":y=new s.Point(this._levels[m].x,0),w=5;break;case"middle":y=new s.Point(this._levels[m].x,.5*this._levels[m].y),w=0;break;case"bottom":y=new s.Point(this._levels[m].x,this._levels[m].y),w=-10}T={points:[y],text:""+this._levels[m].text,color:this._levels[m].color,vertAlign:"middle",horzAlign:S,font:o.font.value(),offsetX:b,offsetY:w,fontsize:12},t.append(new c(T,this._rendererCache))}C={},C.points=[new s.Point(this._levels[m].x,0)],C.color=this._levels[m].color,C.linewidth=this._levels[m].linewidth,C.linestyle=this._levels[m].linestyle,x=new u(u.MOVEPOINT,null,this._levels[m].index),t.append(new r(C,x))}return this.addAnchors(t),t},inherit(n,l),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(t,e,i){},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._levels=[],this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolFibTimeZone";var i=e||this.createPropertiesObject("linetoolfibtimezone");a.call(this,t,new o(this,t),i),this.version=n.version}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(267),c=i(243).TextRenderer,d=i(269).RectangleTransparencyRenderer,p=i(273).TrendLineRenderer,u=i(233),_=i(237);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a,l,h,c,d;if(r.prototype.update.call(this),!(this._source.points().length<1)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0], width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),this._points.length<3)return this.addAnchors(t),t;for(a=this._points[2],o.trendline.visible.value()&&(n={points:[i,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.LINEEND_NORMAL,rightend:l.LINEEND_NORMAL},t.append(new p(n))),h=o.fillBackground.value(),f=o.transparency.value(),m=0;m<this._levels.length;m++){if(m>0&&h&&(g=this._levels[m-1],e=new s.Point(g.x,0),i=new s.Point(this._levels[m].x,this._source.priceScale().height()),v={},v.points=[e,i],v.color=this._levels[m].color,v.linewidth=0,v.backcolor=this._levels[m].color,v.fillBackground=!0,v.transparency=f,t.append(new d(v))),void 0!==this._levels[m].text){switch(S=o.horzLabelsAlign.value(),S="left"===S?"right":"right"===S?"left":"center"){case"left":b=3;break;case"center":b=0;break;case"right":b=-3}switch(o.vertLabelsAlign.value()){case"top":y=new s.Point(this._levels[m].x,0),w=5;break;case"middle":y=new s.Point(this._levels[m].x,.5*this._levels[m].y),w=0;break;case"bottom":y=new s.Point(this._levels[m].x,this._levels[m].y),w=-10}T={points:[y],text:""+this._levels[m].text,color:this._levels[m].color,vertAlign:"middle",horzAlign:S,font:o.font.value(),offsetX:b,offsetY:w,fontsize:12},t.append(new c(T,this._rendererCache))}C={},C.points=[new s.Point(this._levels[m].x,0)],C.color=this._levels[m].color,C.linewidth=this._levels[m].linewidth,C.linestyle=this._levels[m].linestyle,x=new u(u.MOVEPOINT,null,this._levels[m].index),t.append(new r(C,x))}return this.addAnchors(t),t},inherit(n,l),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Time"},n.prototype.migrateVersion=function(t,e,i){},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._levels=[],this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolFibTimeZone";var i=e||this.createPropertiesObject("linetoolfibtimezone");a.call(this,t,new o(this,t),i),this.version=n.version}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(267),c=i(243).TextRenderer,d=i(269).RectangleTransparencyRenderer,p=i(273).TrendLineRenderer,u=i(233),_=i(237);inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a,l,h,c,d;if(r.prototype.update.call(this),
2===this._source.points().length&&(e=this._source.points()[1]),i=this._source.properties(),o=this._source.points()[0].index,n=this._model.timeScale().visibleBars(),!n.isEmpty()))for(this._levels=[],s=e?e.index-t.index:1,a=1;a<=11;a++)l=i["level"+a],l.visible.value()&&(h=Math.round(o+l.coeff.value()*s),c=this._model.timeScale().indexToCoordinate(h),d={index:a,x:c,color:l.color.value(),width:l.linewidth.value(),style:l.linestyle.value()},i.showLabels.value()&&(d.text=l.coeff.value(),d.y=this._source.priceScale().height()),this._levels.push(d))},o.prototype.renderer=function(){var t,e,i,o,n,r,h,f,m,g,v,y,b,w,S;for(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e=this._source.properties(),i=0;i<this._levels.length;i++)if(o={},o.points=[new s.Point(this._levels[i].x,0)],o.color=this._levels[i].color,o.linewidth=this._levels[i].width,o.linestyle=this._levels[i].style,n=new u(u.MOVEPOINT,null,this._levels[i].index),t.append(new l(o,n)),i>0&&e.fillBackground.value()&&(r=this._levels[i-1],h=new s.Point(this._levels[i].x,0),f=new s.Point(r.x,this._source.priceScale().height()),m={},m.points=[h,f],m.color=this._levels[i].color,m.linewidth=0,m.backcolor=this._levels[i].color,m.fillBackground=!0,m.transparency=e.transparency.value(),t.append(new d(m))),void 0!==this._levels[i].text){switch(b=e.horzLabelsAlign.value(),b="left"===b?"right":"right"===b?"left":"center"){case"left":v=3;break;case"center":v=0;break;case"right":v=-3}switch(e.vertLabelsAlign.value()){case"top":g=new s.Point(this._levels[i].x,0),y=5;break;case"middle":g=new s.Point(this._levels[i].x,.5*this._levels[i].y),y=0;break;case"bottom":g=new s.Point(this._levels[i].x,this._levels[i].y),y=-10}w={points:[g],text:""+this._levels[i].text,color:o.color,vertAlign:"middle",horzAlign:b,font:e.font.value(),offsetX:v,offsetY:y,fontsize:12},t.append(new c(w,this._rendererCache))}return 2===this._points.length&&(S={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new p(S))),this.isAnchorsRequired()&&(2===this._source.points().length?t.append(this.createLineAnchor({points:this._points})):this._points.length>0&&t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:u.MOVEPOINT}))),t},inherit(n,a),n.version=2,n.prototype.migrateVersion=function(t,e,i){var o;if(1===t){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),o=2;o<=11;o++)i.properties["level"+o].color.setValue(i.properties.linecolor.value());for(o=1;o<=11;o++)i.properties["level"+o].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+o].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"}, !(this._source.points().length<1)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(t=this._source.points()[0],2===this._source.points().length&&(e=this._source.points()[1]),i=this._source.properties(),o=this._source.points()[0].index,n=this._model.timeScale().visibleBars(),!n.isEmpty()))for(this._levels=[],s=e?e.index-t.index:1,a=1;a<=11;a++)l=i["level"+a],l.visible.value()&&(h=Math.round(o+l.coeff.value()*s),c=this._model.timeScale().indexToCoordinate(h),d={index:a,x:c,color:l.color.value(),width:l.linewidth.value(),style:l.linestyle.value()},i.showLabels.value()&&(d.text=l.coeff.value(),d.y=this._source.priceScale().height()),this._levels.push(d))},o.prototype.renderer=function(){var t,e,i,o,n,r,h,f,m,g,v,y,b,w,S;for(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e=this._source.properties(),i=0;i<this._levels.length;i++)if(o={},o.points=[new s.Point(this._levels[i].x,0)],o.color=this._levels[i].color,o.linewidth=this._levels[i].width,o.linestyle=this._levels[i].style,n=new u(u.MOVEPOINT,null,this._levels[i].index),t.append(new l(o,n)),i>0&&e.fillBackground.value()&&(r=this._levels[i-1],h=new s.Point(this._levels[i].x,0),f=new s.Point(r.x,this._source.priceScale().height()),m={},m.points=[h,f],m.color=this._levels[i].color,m.linewidth=0,m.backcolor=this._levels[i].color,m.fillBackground=!0,m.transparency=e.transparency.value(),t.append(new d(m))),void 0!==this._levels[i].text){switch(b=e.horzLabelsAlign.value(),b="left"===b?"right":"right"===b?"left":"center"){case"left":v=3;break;case"center":v=0;break;case"right":v=-3}switch(e.vertLabelsAlign.value()){case"top":g=new s.Point(this._levels[i].x,0),y=5;break;case"middle":g=new s.Point(this._levels[i].x,.5*this._levels[i].y),y=0;break;case"bottom":g=new s.Point(this._levels[i].x,this._levels[i].y),y=-10}w={points:[g],text:""+this._levels[i].text,color:o.color,vertAlign:"middle",horzAlign:b,font:e.font.value(),offsetX:v,offsetY:y,fontsize:12},t.append(new c(w,this._rendererCache))}return 2===this._points.length&&(S={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e.trendline.color.value(),linewidth:e.trendline.linewidth.value(),linestyle:e.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new p(S))),this.isAnchorsRequired()&&(2===this._source.points().length?t.append(this.createLineAnchor({points:this._points})):this._points.length>0&&t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:u.MOVEPOINT}))),t},inherit(n,a),n.version=2,n.prototype.migrateVersion=function(t,e,i){var o;if(1===t){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),o=2;o<=11;o++)i.properties["level"+o].color.setValue(i.properties.linecolor.value());for(o=1;o<=11;o++)i.properties["level"+o].linewidth.setValue(i.properties.linewidth.value()),
n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._lines=[],this._invalidated=!0}function n(t,e){this._constructor="LineToolCircleLines";var i=e||new p("linetoolcirclelines");a.call(this,t,new o(this,t),i)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(273).TrendLineRenderer,c=i(233),d=i(237),p=i(204).DefaultProperty;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a;if(r.prototype.update.call(this),!(this._source.points().length<2)&&(t=this._model.timeScale(),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!t.isEmpty()&&(e=this._source.points()[0],i=this._source.points()[1],o=i?i.index-e.index:1,this._lines=[],0!==o)))if(n=t.visibleBars(),o>0)for(s=e.index,a=s;a<=n.lastBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)});else for(s=e.index,a=s;a>=n.firstBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)})},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2)return t;for(e=this._points[0],i=this._points[1],o=this._source.properties(),n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new h(n)),o=this._source.properties(),r=0;r<this._lines.length;r++)p={points:[new s.Point(this._lines[r].x,0)],color:o.linecolor.value(),linewidth:o.linewidth.value(),linestyle:o.linestyle.value()},t.append(new l(p));return this.isAnchorsRequired()&&(2===this._source.points().length?(u=[].concat(this._points),t.append(this.createLineAnchor({points:u}))):t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:c.MOVEPOINT}))),t},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolDateRange";var i=e||new p("linetooldaterange");r.call(this,t,new o(this,t),i)}var s=i(53),r=i(194).LineDataSource,a=i(242),l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(276).TimeSpanFormatter;inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e,i,o,n,a,p,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E;return this._invalidated&&this.updateImpl(),t=new d, i.properties["level"+o].linestyle.setValue(i.properties.linestyle.value())}},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Time Zone"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new h(t,e,i,{range:[1,11]})},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._lines=[],this._invalidated=!0}function n(t,e){this._constructor="LineToolCircleLines";var i=e||new p("linetoolcirclelines");a.call(this,t,new o(this,t),i)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(288).VertLineRenderer,h=i(273).TrendLineRenderer,c=i(233),d=i(237),p=i(204).DefaultProperty;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,s,a;if(r.prototype.update.call(this),!(this._source.points().length<2)&&(t=this._model.timeScale(),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!t.isEmpty()&&(e=this._source.points()[0],i=this._source.points()[1],o=i?i.index-e.index:1,this._lines=[],0!==o)))if(n=t.visibleBars(),o>0)for(s=e.index,a=s;a<=n.lastBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)});else for(s=e.index,a=s;a>=n.firstBar();a+=o)this._lines.push({x:t.indexToCoordinate(a)})},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2)return t;for(e=this._points[0],i=this._points[1],o=this._source.properties(),n={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:o.trendline.color.value(),linewidth:o.trendline.linewidth.value(),linestyle:o.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LINEEND_NORMAL,rightend:a.LINEEND_NORMAL},t.append(new h(n)),o=this._source.properties(),r=0;r<this._lines.length;r++)p={points:[new s.Point(this._lines[r].x,0)],color:o.linecolor.value(),linewidth:o.linewidth.value(),linestyle:o.linestyle.value()},t.append(new l(p));return this.isAnchorsRequired()&&(2===this._source.points().length?(u=[].concat(this._points),t.append(this.createLineAnchor({points:u}))):t.append(this.createLineAnchor({points:[new s.Point(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:c.MOVEPOINT}))),t},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Cyclic Lines"},t.exports=n},function(t,e,i){"use strict";function o(t,e){a.call(this,t,e),this._rendererCache={},this._invalidated=!0}function n(t,e){this._constructor="LineToolDateRange";var i=e||new p("linetooldaterange");r.call(this,t,new o(this,t),i)}var s=i(53),r=i(194).LineDataSource,a=i(242),l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(276).TimeSpanFormatter;inherit(o,a),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){a.prototype.update.call(this),this._invalidated=!1},
this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=r.LINEEND_NORMAL,n.rightend=r.LINEEND_NORMAL,t.append(new c(n))},a=this._points[0],p=this._points[1],n(a,new s.Point(a.x,p.y)),n(new s.Point(p.x,a.y),p),_=(a.y+p.y)/2,f=new s.Point(a.x,_),m=new s.Point(p.x,_),i={},i.points=[f,m],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=r.LINEEND_NORMAL,i.rightend=r.LINEEND_ARROW,t.append(new c(i)),g=this._source.points()[0].index,v=this._source.points()[1].index,y=v-g,b=this._model.timeScale().indexToUserTime(g),w=this._model.timeScale().indexToUserTime(v),S="",b&&w&&(T=(w.valueOf()-b.valueOf())/1e3,S=", "+(new u).format(T)),C=$.t("{0} bars").format(y)+S,i={},x={x:0,y:10},i.text=C,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=x.x,i.offsetY=x.y,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),P=.5*(a.x+p.x),L=p.y,k=new s.Point(P,L),I=new l(i,this._rendererCache),A=I.measure(),E={x:P+i.backgroundHorzInflate+A.textBgPadding-A.width/A.textBgPadding,y:a.y>p.y?k.y-A.height-2*A.textBgPadding-x.y>0?L-A.height-x.y-2*A.textBgPadding:x.y-2*A.textBgPadding:k.y+A.height+A.textBgPadding+x.y>i.height?i.height-A.height-x.y:L+A.textBgPadding},I.setPoints([new s.Point(P,E.y)]),t.append(I),this.addAnchors(t),t)},inherit(n,r),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new u,this._pipFormatter=null}function n(t,e){this._constructor="LineToolPriceRange";var i=e||new p("linetoolpricerange");a.call(this,t,new o(this,t),i)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(271).PercentageFormatter,_=i(316).PipFormatter;inherit(o,r), o.prototype.renderer=function(){var t,e,i,o,n,a,p,_,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=r.LINEEND_NORMAL,n.rightend=r.LINEEND_NORMAL,t.append(new c(n))},a=this._points[0],p=this._points[1],n(a,new s.Point(a.x,p.y)),n(new s.Point(p.x,a.y),p),_=(a.y+p.y)/2,f=new s.Point(a.x,_),m=new s.Point(p.x,_),i={},i.points=[f,m],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=r.LINEEND_NORMAL,i.rightend=r.LINEEND_ARROW,t.append(new c(i)),g=this._source.points()[0].index,v=this._source.points()[1].index,y=v-g,b=this._model.timeScale().indexToUserTime(g),w=this._model.timeScale().indexToUserTime(v),S="",b&&w&&(T=(w.valueOf()-b.valueOf())/1e3,S=", "+(new u).format(T)),C=$.t("{0} bars").format(y)+S,i={},x={x:0,y:10},i.text=C,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=x.x,i.offsetY=x.y,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),P=.5*(a.x+p.x),L=p.y,k=new s.Point(P,L),I=new l(i,this._rendererCache),A=I.measure(),E={x:P+i.backgroundHorzInflate+A.textBgPadding-A.width/A.textBgPadding,y:a.y>p.y?k.y-A.height-2*A.textBgPadding-x.y>0?L-A.height-x.y-2*A.textBgPadding:x.y-2*A.textBgPadding:k.y+A.height+A.textBgPadding+x.y>i.height?i.height-A.height-x.y:L+A.textBgPadding},I.setPoints([new s.Point(P,E.y)]),t.append(I),this.addAnchors(t),t)},inherit(n,r),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date Range"},t.exports=n},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new u,this._pipFormatter=null}function n(t,e){this._constructor="LineToolPriceRange";var i=e||new p("linetoolpricerange");a.call(this,t,new o(this,t),i)}
o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this)},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(n={},n.points=this._points,n.color="white",n.linewidth=0,n.backcolor=e.backgroundColor.value(),n.fillBackground=!0,n.transparency=e.backgroundTransparency.value(),t.append(new h(n))),r=this,p=function(e,i){var o={};o.points=[e,i],o.width=r._model.timeScale().width(),o.height=r._source.priceScale().height(),o.color=r._source.properties().linecolor.value(),o.linewidth=r._source.properties().linewidth.value(),o.linestyle=CanvasEx.LINESTYLE_SOLID,o.extendleft=!1,o.extendright=!1,o.leftend=a.LINEEND_NORMAL,o.rightend=a.LINEEND_NORMAL,t.append(new c(o))},i=this._points[0],o=this._points[1],o=new s.Point(o.x,i.y),p(i,o),i=this._points[0],o=this._points[1],i=new s.Point(i.x,o.y),p(i,o),i=this._points[0],o=this._points[1],u=(i.x+o.x)/2,f=new s.Point(u,i.y),m=new s.Point(u,o.y),n={},n.points=[f,m],n.width=r._model.timeScale().width(),n.height=r._source.priceScale().height(),n.color=r._source.properties().linecolor.value(),n.linewidth=r._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_DASHED,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_ARROW,t.append(new c(n)),g=this._source.points()[0].price,v=this._source.points()[1].price,y=v-g,b=100*y/g,w=this._model.mainSeries().symbolInfo(),!this._pipFormatter&&w&&(this._pipFormatter=new _(w.pricescale,w.minmov,w.type,w.minmove2)),S=this._source.priceScale().formatter().format(y)+" ("+this._percentageFormatter.format(b)+") "+(this._pipFormatter?this._pipFormatter.format(y):""),n={},v>g?(T=o.clone(),T.y-=2*e.fontsize.value(),T.x=.5*(i.x+o.x),n.points=[T]):(T=o.clone(),T.x=.5*(i.x+o.x),T.y+=.7*e.fontsize.value(),n.points=[T]),C={x:0,y:10},n.text=S,n.color=e.textcolor.value(),n.height=r._source.priceScale().height(),n.font=e.font.value(),n.offsetX=C.x,n.offsetY=C.y,n.vertAlign="middle",n.horzAlign="center",n.fontsize=e.fontsize.value(),n.backgroundRoundRect=4,n.backgroundHorzInflate=.4*e.fontsize.value(),n.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(n.backgroundColor=e.labelBackgroundColor.value(),n.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(n.borderColor=e.borderColor.value()),x=.5*(i.x+o.x),P=o.y,L=new s.Point(x,P),k=new l(n,this._rendererCache),I=k.measure(),A={x:x+n.backgroundHorzInflate+I.textBgPadding-I.width/I.textBgPadding,y:i.y>o.y?L.y-I.height-2*I.textBgPadding-C.y>0?P-I.height-C.y-2*I.textBgPadding:C.y-2*I.textBgPadding:L.y+I.height+I.textBgPadding+C.y>n.height?n.height-I.height-C.y:P+I.textBgPadding},k.setPoints([new s.Point(x,A.y)]),t.append(k),this.addAnchors(t),t)},inherit(n,a), var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(271).PercentageFormatter,_=i(316).PipFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this)},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,f,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(n={},n.points=this._points,n.color="white",n.linewidth=0,n.backcolor=e.backgroundColor.value(),n.fillBackground=!0,n.transparency=e.backgroundTransparency.value(),t.append(new h(n))),r=this,p=function(e,i){var o={};o.points=[e,i],o.width=r._model.timeScale().width(),o.height=r._source.priceScale().height(),o.color=r._source.properties().linecolor.value(),o.linewidth=r._source.properties().linewidth.value(),o.linestyle=CanvasEx.LINESTYLE_SOLID,o.extendleft=!1,o.extendright=!1,o.leftend=a.LINEEND_NORMAL,o.rightend=a.LINEEND_NORMAL,t.append(new c(o))},i=this._points[0],o=this._points[1],o=new s.Point(o.x,i.y),p(i,o),i=this._points[0],o=this._points[1],i=new s.Point(i.x,o.y),p(i,o),i=this._points[0],o=this._points[1],u=(i.x+o.x)/2,f=new s.Point(u,i.y),m=new s.Point(u,o.y),n={},n.points=[f,m],n.width=r._model.timeScale().width(),n.height=r._source.priceScale().height(),n.color=r._source.properties().linecolor.value(),n.linewidth=r._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_DASHED,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_ARROW,t.append(new c(n)),g=this._source.points()[0].price,v=this._source.points()[1].price,y=v-g,b=100*y/g,w=this._model.mainSeries().symbolInfo(),!this._pipFormatter&&w&&(this._pipFormatter=new _(w.pricescale,w.minmov,w.type,w.minmove2)),S=this._source.priceScale().formatter().format(y)+" ("+this._percentageFormatter.format(b)+") "+(this._pipFormatter?this._pipFormatter.format(y):""),n={},v>g?(T=o.clone(),T.y-=2*e.fontsize.value(),T.x=.5*(i.x+o.x),n.points=[T]):(T=o.clone(),T.x=.5*(i.x+o.x),T.y+=.7*e.fontsize.value(),n.points=[T]),C={x:0,y:10},n.text=S,n.color=e.textcolor.value(),n.height=r._source.priceScale().height(),n.font=e.font.value(),n.offsetX=C.x,n.offsetY=C.y,n.vertAlign="middle",n.horzAlign="center",n.fontsize=e.fontsize.value(),n.backgroundRoundRect=4,n.backgroundHorzInflate=.4*e.fontsize.value(),n.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(n.backgroundColor=e.labelBackgroundColor.value(),n.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(n.borderColor=e.borderColor.value()),x=.5*(i.x+o.x),P=o.y,L=new s.Point(x,P),k=new l(n,this._rendererCache),I=k.measure(),A={x:x+n.backgroundHorzInflate+I.textBgPadding-I.width/I.textBgPadding,
n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},t.exports=n},function(t,e,i){"use strict";var o=i(220),n=i(210),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 t.prototype.format.call(this,e*this._pipPriceScale/n,i,o)},e}(n.PriceFormatter);e.PipFormatter=s},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new u,this._pipFormatter=null}function n(t,e){this._constructor="LineToolDateAndPriceRange";var i=e||new p("linetooldateandpricerange");a.call(this,t,new o(this,t),i)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(271).PercentageFormatter,_=i(276).TimeSpanFormatter,f=i(316).PipFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,V,O,B,R,N,F;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_NORMAL,t.append(new c(n))},r=this._points[0],p=this._points[1],n(r,new s.Point(p.x,r.y)),n(new s.Point(r.x,p.y),p),n(r,new s.Point(r.x,p.y)),n(new s.Point(p.x,r.y),p),u=(r.y+p.y)/2,m=new s.Point(r.x,u),g=new s.Point(p.x,u),i={},i.points=[m,g],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL,i.rightend=a.LINEEND_ARROW,t.append(new c(i)),r=this._points[0],p=this._points[1],v=(r.x+p.x)/2,m=new s.Point(v,r.y),g=new s.Point(v,p.y),i={},i.points=[m,g],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL, y:i.y>o.y?L.y-I.height-2*I.textBgPadding-C.y>0?P-I.height-C.y-2*I.textBgPadding:C.y-2*I.textBgPadding:L.y+I.height+I.textBgPadding+C.y>n.height?n.height-I.height-C.y:P+I.textBgPadding},k.setPoints([new s.Point(x,A.y)]),t.append(k),this.addAnchors(t),t)},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Price Range"},t.exports=n},function(t,e,i){"use strict";var o=i(220),n=i(210),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 t.prototype.format.call(this,e*this._pipPriceScale/n,i,o)},e}(n.PriceFormatter);e.PipFormatter=s},function(t,e,i){"use strict";function o(t,e){r.call(this,t,e),this._rendererCache={},this._invalidated=!0,this._percentageFormatter=new u,this._pipFormatter=null}function n(t,e){this._constructor="LineToolDateAndPriceRange";var i=e||new p("linetooldateandpricerange");a.call(this,t,new o(this,t),i)}var s=i(53),r=i(242),a=i(194).LineDataSource,l=i(243).TextRenderer,h=i(269).RectangleRenderer,c=i(273).TrendLineRenderer,d=i(237),p=i(204).DefaultProperty,u=i(271).PercentageFormatter,_=i(276).TimeSpanFormatter,f=i(316).PipFormatter;inherit(o,r),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},o.prototype.renderer=function(){var t,e,i,o,n,r,p,u,m,g,v,y,b,w,S,T,C,x,P,L,k,I,A,E,M,D,V,O,B,R,N,F;return this._invalidated&&this.updateImpl(),t=new d,this._points.length<2||this._source.points().length<2?t:(e=this._source.properties(),e.fillBackground&&e.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=e.backgroundColor.value(),i.fillBackground=!0,i.transparency=e.backgroundTransparency.value(),t.append(new h(i))),o=this,n=function(e,i){var n={};n.points=[e,i],n.width=o._model.timeScale().width(),n.height=o._source.priceScale().height(),n.color=o._source.properties().linecolor.value(),n.linewidth=o._source.properties().linewidth.value(),n.linestyle=CanvasEx.LINESTYLE_SOLID,n.extendleft=!1,n.extendright=!1,n.leftend=a.LINEEND_NORMAL,n.rightend=a.LINEEND_NORMAL,t.append(new c(n))},r=this._points[0],p=this._points[1],n(r,new s.Point(p.x,r.y)),n(new s.Point(r.x,p.y),p),n(r,new s.Point(r.x,p.y)),n(new s.Point(p.x,r.y),p),u=(r.y+p.y)/2,m=new s.Point(r.x,u),g=new s.Point(p.x,u),i={},i.points=[m,g],i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL,i.rightend=a.LINEEND_ARROW,t.append(new c(i)),r=this._points[0],p=this._points[1],v=(r.x+p.x)/2,m=new s.Point(v,r.y),g=new s.Point(v,p.y),i={},i.points=[m,g],
i.rightend=a.LINEEND_ARROW,t.append(new c(i)),y=this._source.points()[0].price,b=this._source.points()[1].price,w=b-y,S=100*w/y,T=this._source.points()[0].index,C=this._source.points()[1].index,x=C-T,P=this._model.timeScale().indexToUserTime(T),L=this._model.timeScale().indexToUserTime(C),k="",P&&L&&(I=(L.valueOf()-P.valueOf())/1e3,k=", "+(new _).format(I)),A=this._model.mainSeries().symbolInfo(),!this._pipFormatter&&A&&(this._pipFormatter=new f(A.pricescale,A.minmov,A.type,A.minmove2)),E=this._source.priceScale().formatter().format(w)+" ("+this._percentageFormatter.format(Math.round(100*S)/100)+") "+(this._pipFormatter?this._pipFormatter.format(w):"")+"\n"+$.t("{0} bars").format(x)+k,i={},b>y?(M=p.clone(),M.y-=2*e.fontsize.value(),M.x=.5*(r.x+p.x),i.points=[M]):(M=p.clone(),M.x=.5*(r.x+p.x),M.y+=.7*e.fontsize.value(),i.points=[M]),D={x:0,y:10},i.text=E,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=D.x,i.offsetY=D.y,i.padding=5,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),V=.5*(r.x+p.x),O=p.y,B=new s.Point(V,O),R=new l(i,this._rendererCache),N=R.measure(),F={x:V+i.backgroundHorzInflate+N.textBgPadding-N.width/N.textBgPadding,y:r.y>p.y?B.y-N.height-2*N.textBgPadding-D.y>0?O-N.height-D.y+N.textBgPadding:D.y-2*N.textBgPadding:B.y+N.height+N.textBgPadding+D.y>i.height?i.height-N.height-D.y:O+N.textBgPadding},window.t1=o._source.priceScale().height(),window.t2=B.y+N.height+2*N.textBgPadding+D.y,R.setPoints([new s.Point(V,F.y)]),t.append(R),this.addAnchors(t),t)},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},t.exports=n},function(t,e,i){(function(e){"use strict";function o(t){this._data=t}function n(t,e){a.call(this,t,e),this._label=null,this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolTrendAngleLine";var i=e||new f("linetooltrendangle");l.call(this,t,new n(this,t),i),this._properties.addProperty("angle"),this._properties.angle=new s.AngleProperty(this)}var r=i(53),a=i(242),l=i(194).LineDataSource,h=i(273),c=h.TrendLineStatsRenderer,d=h.LineToolTrendLine,p=i(243).TextRenderer,u=i(273).TrendLineRenderer,_=i(237),f=i(204).DefaultProperty,m=i(271).PercentageFormatter;o.prototype.hitTest=function(){return null},o.prototype.draw=function(t){var e,i;t.save(),t.translate(this._data.point.x,this._data.point.y),t.strokeStyle=this._data.color,e=[1,2],"function"==typeof t.setLineDash?t.setLineDash(e):void 0!==t.mozDash?t.mozDash=e:void 0!==t.webkitLineDash&&(t.webkitLineDash=e),i=this._data.size,t.beginPath(),t.moveTo(0,0),t.lineTo(i,0), i.width=o._model.timeScale().width(),i.height=o._source.priceScale().height(),i.color=o._source.properties().linecolor.value(),i.linewidth=o._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=a.LINEEND_NORMAL,i.rightend=a.LINEEND_ARROW,t.append(new c(i)),y=this._source.points()[0].price,b=this._source.points()[1].price,w=b-y,S=100*w/y,T=this._source.points()[0].index,C=this._source.points()[1].index,x=C-T,P=this._model.timeScale().indexToUserTime(T),L=this._model.timeScale().indexToUserTime(C),k="",P&&L&&(I=(L.valueOf()-P.valueOf())/1e3,k=", "+(new _).format(I)),A=this._model.mainSeries().symbolInfo(),!this._pipFormatter&&A&&(this._pipFormatter=new f(A.pricescale,A.minmov,A.type,A.minmove2)),E=this._source.priceScale().formatter().format(w)+" ("+this._percentageFormatter.format(Math.round(100*S)/100)+") "+(this._pipFormatter?this._pipFormatter.format(w):"")+"\n"+$.t("{0} bars").format(x)+k,i={},b>y?(M=p.clone(),M.y-=2*e.fontsize.value(),M.x=.5*(r.x+p.x),i.points=[M]):(M=p.clone(),M.x=.5*(r.x+p.x),M.y+=.7*e.fontsize.value(),i.points=[M]),D={x:0,y:10},i.text=E,i.color=e.textcolor.value(),i.height=o._source.priceScale().height(),i.font=e.font.value(),i.offsetX=D.x,i.offsetY=D.y,i.padding=5,i.vertAlign="middle",i.horzAlign="center",i.fontsize=e.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*e.fontsize.value(),i.backgroundVertInflate=.2*e.fontsize.value(),e.fillLabelBackground&&e.fillLabelBackground.value()&&(i.backgroundColor=e.labelBackgroundColor.value(),i.backgroundTransparency=1-e.labelBackgroundTransparency.value()/100||0),e.drawBorder&&e.drawBorder.value()&&(i.borderColor=e.borderColor.value()),V=.5*(r.x+p.x),O=p.y,B=new s.Point(V,O),R=new l(i,this._rendererCache),N=R.measure(),F={x:V+i.backgroundHorzInflate+N.textBgPadding-N.width/N.textBgPadding,y:r.y>p.y?B.y-N.height-2*N.textBgPadding-D.y>0?O-N.height-D.y+N.textBgPadding:D.y-2*N.textBgPadding:B.y+N.height+N.textBgPadding+D.y>i.height?i.height-N.height-D.y:O+N.textBgPadding},window.t1=o._source.priceScale().height(),window.t2=B.y+N.height+2*N.textBgPadding+D.y,R.setPoints([new s.Point(V,F.y)]),t.append(R),this.addAnchors(t),t)},inherit(n,a),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Date and Price Range"},t.exports=n},function(t,e,i){(function(e){"use strict";function o(t){this._data=t}function n(t,e){a.call(this,t,e),this._label=null,this._rendererCache={},this._invalidated=!0}function s(t,e){this._constructor="LineToolTrendAngleLine";var i=e||new f("linetooltrendangle");l.call(this,t,new n(this,t),i),this._properties.addProperty("angle"),this._properties.angle=new s.AngleProperty(this)}var r=i(53),a=i(242),l=i(194).LineDataSource,h=i(273),c=h.TrendLineStatsRenderer,d=h.LineToolTrendLine,p=i(243).TextRenderer,u=i(273).TrendLineRenderer,_=i(237),f=i(204).DefaultProperty,m=i(271).PercentageFormatter;o.prototype.hitTest=function(){return null},o.prototype.draw=function(t){var e,i;t.save(),t.translate(this._data.point.x,this._data.point.y),
t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke(),t.restore()},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,l,h,c,d,p,u,_,f;a.prototype.update.call(this),this._points.length>0&&void 0!==this._source._angle&&(t=this._points[0],e=Math.cos(this._source._angle),i=-Math.sin(this._source._angle),o=new r.Point(e,i),this._secondPoint=t.addScaled(o,this._source._distance),this._secondPoint.data=1),this._label=null,this._source.points().length<2||(t=this._source.points()[0],n=this._source.points()[1],s=[],this._source.properties().showPriceRange.value()&&this._source.priceScale()&&(c=n.price-t.price,d=c/t.price,l=this._source.priceScale().formatter().format(c)+" ("+(new m).format(100*d)+")",p=this._model.mainSeries().base(),p&&(u=Math.round(c*p),l+=", "+u),s.push("priceRange")),_=this._source.properties().showBarsRange.value(),_&&(h="",f=n.index-t.index,h+=$.t("{0} bars").format(f),s.push("barsRange")),this._label=[l,h].filter(function(t){return t}).join("\n")||null,this._icons=s)},n.prototype.renderer=function(){var t,e,i,n,s,r,a,h,f,m;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e={},i=this.isAnchorsRequired(),n=i||this._source.properties().alwaysShowStats.value(),this._secondPoint&&this._points.length>0&&(e.points=[this._points[0],this._secondPoint],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=l.LINEEND_NORMAL,e.rightend=l.LINEEND_NORMAL,t.append(new u(e)),n&&this._label&&2===this._points.length&&(s={points:[this._secondPoint],text:this._label,color:this._source.properties().textcolor.value(),font:d.LABEL_FONT,fontsize:d.LABEL_FONTSIZE,lineSpacing:d.LABEL_LINESPACING,backgroundColor:d.LABEL_BGCOLOR,borderColor:d.LABEL_BORDERCOLOR,borderWidth:1,padding:d.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},r=d.LABEL_OFFSET,this._points[1].y<this._points[0].y?(s.vertAlign="bottom",s.offsetY=-r):s.offsetY=r,this._points[1].x<this._points[0].x?(s.horzAlign="right",s.offsetX=-r):s.offsetX=r,t.append(new c(s,this._rendererCache))),a={},a.point=this._points[0],a.angle=this._source._angle,a.color=this._source.properties().linecolor.value(),a.size=50,t.append(new o(a)),h=Math.round(180*a.angle/Math.PI)+"º",f=this._points[0].clone(),f.x=f.x+50,m={points:[f],text:h,color:this._source.properties().textcolor.value(),horzAlign:"left",font:this._source.properties().font.value(),offsetX:5,offsetY:0,bold:this._source.properties().bold.value(),italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value(),vertAlign:"middle"},t.append(new p(m,this._rendererCache))), t.strokeStyle=this._data.color,e=[1,2],"function"==typeof t.setLineDash?t.setLineDash(e):void 0!==t.mozDash?t.mozDash=e:void 0!==t.webkitLineDash&&(t.webkitLineDash=e),i=this._data.size,t.beginPath(),t.moveTo(0,0),t.lineTo(i,0),t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke(),t.restore()},inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,l,h,c,d,p,u,_,f;a.prototype.update.call(this),this._points.length>0&&void 0!==this._source._angle&&(t=this._points[0],e=Math.cos(this._source._angle),i=-Math.sin(this._source._angle),o=new r.Point(e,i),this._secondPoint=t.addScaled(o,this._source._distance),this._secondPoint.data=1),this._label=null,this._source.points().length<2||(t=this._source.points()[0],n=this._source.points()[1],s=[],this._source.properties().showPriceRange.value()&&this._source.priceScale()&&(c=n.price-t.price,d=c/t.price,l=this._source.priceScale().formatter().format(c)+" ("+(new m).format(100*d)+")",p=this._model.mainSeries().base(),p&&(u=Math.round(c*p),l+=", "+u),s.push("priceRange")),_=this._source.properties().showBarsRange.value(),_&&(h="",f=n.index-t.index,h+=$.t("{0} bars").format(f),s.push("barsRange")),this._label=[l,h].filter(function(t){return t}).join("\n")||null,this._icons=s)},n.prototype.renderer=function(){var t,e,i,n,s,r,a,h,f,m;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new _,e={},i=this.isAnchorsRequired(),n=i||this._source.properties().alwaysShowStats.value(),this._secondPoint&&this._points.length>0&&(e.points=[this._points[0],this._secondPoint],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=l.LINEEND_NORMAL,e.rightend=l.LINEEND_NORMAL,t.append(new u(e)),n&&this._label&&2===this._points.length&&(s={points:[this._secondPoint],text:this._label,color:this._source.properties().textcolor.value(),font:d.LABEL_FONT,fontsize:d.LABEL_FONTSIZE,lineSpacing:d.LABEL_LINESPACING,backgroundColor:d.LABEL_BGCOLOR,borderColor:d.LABEL_BORDERCOLOR,borderWidth:1,padding:d.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},r=d.LABEL_OFFSET,this._points[1].y<this._points[0].y?(s.vertAlign="bottom",s.offsetY=-r):s.offsetY=r,this._points[1].x<this._points[0].x?(s.horzAlign="right",s.offsetX=-r):s.offsetX=r,t.append(new c(s,this._rendererCache))),a={},a.point=this._points[0],a.angle=this._source._angle,a.color=this._source.properties().linecolor.value(),a.size=50,t.append(new o(a)),h=Math.round(180*a.angle/Math.PI)+"º",f=this._points[0].clone(),f.x=f.x+50,m={points:[f],text:h,color:this._source.properties().textcolor.value(),horzAlign:"left",font:this._source.properties().font.value(),offsetX:5,offsetY:0,bold:this._source.properties().bold.value(),
!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e&&e.points&&e.points.length>=2&&this._source.getAlertIsActive(function(i){t.append(new TradingView.PaneRendererClockIcon({point1:e.points[0],point2:e.points[1],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),this._secondPoint&&this._points.length>0&&i&&t.append(this.createLineAnchor({points:[this._points[0],this._secondPoint]})),t},inherit(s,l),s.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(s.AngleProperty,e),s.AngleProperty.prototype.value=function(){var t=this._lineSource._angle,e=180*t/Math.PI;return Math.round(e)},s.AngleProperty.prototype.setValue=function(t){var e,i,o,n,s,a,l=t*Math.PI/180;this._lineSource._angle=l,e=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),n=new r.Point(i,o),s=e.addScaled(n,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Trend Angle"},s.prototype._calculateAngle=function(){var t,e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.substract(e);o.length()>0?(o=o.normalized(),this._angle=Math.acos(o.x),o.y>0&&(this._angle=-this._angle),this._distance=i.substract(e).length()):delete this._angle,t=this.properties(),t.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},s.prototype.addPoint=function(t,e){var i=l.prototype.addPoint.call(this,t,e);return i&&this._calculateAngle(),i},s.prototype.setLastPoint=function(t,e){l.prototype.setLastPoint.call(this,t,e),this.points().length>1&&this._calculateAngle()},s.prototype.axisPoints=function(){var t,e,i,o,n,s;return this.points().length<2?[]:(t=[this.points()[0]],e=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,n=e.add(new r.Point(i,o)),s=this.screenPointToPoint(n),t.push(s),t)},s.prototype.setPoint=function(t,e,i){l.prototype.setPoint.call(this,t,e,i),this.points().length>1&&1===t&&this._calculateAngle()},s.prototype.restoreData=function(t){this._angle=t.angle,this._distance=t.distance},s.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.angle=this._angle,e.distance=this._distance,e},s.prototype.cloneData=function(t){this._angle=t._angle,this._distance=t._distance},s.prototype.canHasAlert=function(){return!0},s.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},t.exports=s}).call(e,i(195))},function(t,e,i){"use strict";function o(t,e){var i=e||new p("linetoolarrowmark") italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value(),vertAlign:"middle"},t.append(new p(m,this._rendererCache))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&e&&e.points&&e.points.length>=2&&this._source.getAlertIsActive(function(i){t.append(new TradingView.PaneRendererClockIcon({point1:e.points[0],point2:e.points[1],color:i?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),this._secondPoint&&this._points.length>0&&i&&t.append(this.createLineAnchor({points:[this._points[0],this._secondPoint]})),t},inherit(s,l),s.AngleProperty=function(t){e.call(this),this._lineSource=t},inherit(s.AngleProperty,e),s.AngleProperty.prototype.value=function(){var t=this._lineSource._angle,e=180*t/Math.PI;return Math.round(e)},s.AngleProperty.prototype.setValue=function(t){var e,i,o,n,s,a,l=t*Math.PI/180;this._lineSource._angle=l,e=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),n=new r.Point(i,o),s=e.addScaled(n,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},s.prototype.pointsCount=function(){return 2},s.prototype.title=function(){return"Trend Angle"},s.prototype._calculateAngle=function(){var t,e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.substract(e);o.length()>0?(o=o.normalized(),this._angle=Math.acos(o.x),o.y>0&&(this._angle=-this._angle),this._distance=i.substract(e).length()):delete this._angle,t=this.properties(),t.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},s.prototype.addPoint=function(t,e){var i=l.prototype.addPoint.call(this,t,e);return i&&this._calculateAngle(),i},s.prototype.setLastPoint=function(t,e){l.prototype.setLastPoint.call(this,t,e),this.points().length>1&&this._calculateAngle()},s.prototype.axisPoints=function(){var t,e,i,o,n,s;return this.points().length<2?[]:(t=[this.points()[0]],e=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,n=e.add(new r.Point(i,o)),s=this.screenPointToPoint(n),t.push(s),t)},s.prototype.setPoint=function(t,e,i){l.prototype.setPoint.call(this,t,e,i),this.points().length>1&&1===t&&this._calculateAngle()},s.prototype.restoreData=function(t){this._angle=t.angle,this._distance=t.distance},s.prototype.state=function(t){var e=l.prototype.state.call(this,t);return e.angle=this._angle,e.distance=this._distance,e},s.prototype.cloneData=function(t){this._angle=t._angle,this._distance=t._distance},s.prototype.canHasAlert=function(){return!0},s.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},t.exports=s}).call(e,i(195))
;h.call(this,t,new d(this,t,this.image,this.width,this.height,this.offsetX,this.offsetY),i)}function n(t,e){this._constructor="LineToolArrowMarkLeft",o.call(this,t,e),this._textPaneView=new c(this,t,22,-3,"middle","left"),this._textPaneView._noSelection=!0}function s(t,e){this._constructor="LineToolArrowMarkUp",o.call(this,t,e),this._textPaneView=new c(this,t,0,18,"top","center"),this._textPaneView._noSelection=!0}function r(t,e){this._constructor="LineToolArrowMarkRight",o.call(this,t,e),this._textPaneView=new c(this,t,-22,-3,"middle","right"),this._textPaneView._noSelection=!0}function a(t,e){this._constructor="LineToolArrowMarkDown",o.call(this,t,e),this._textPaneView=new c(this,t,0,-23,"bottom","center"),this._textPaneView._noSelection=!0}var l=i(53),h=i(194).LineDataSource,c=i(243).TextPaneView,d=i(320),p=i(204).DefaultProperty;inherit(o,h),o.prototype.width=21,o.prototype.height=21,o.prototype.offsetX=0,o.prototype.offsetY=0,o.prototype.paneViews=function(t){var e=h.prototype.paneViews.call(this,t);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Arrow Mark"},inherit(n,o),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",n.prototype.offsetX=1,n.prototype.offsetY=-10,n.prototype.title=function(){return"Arrow Mark Left"},inherit(s,o),s.prototype.image=new Image,s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",s.prototype.offsetX=-9,s.prototype.offsetY=0,s.prototype.title=function(){return"Arrow Mark Up"},inherit(r,o), },function(t,e,i){"use strict";function o(t,e){var i=e||new p("linetoolarrowmark");h.call(this,t,new d(this,t,this.image,this.width,this.height,this.offsetX,this.offsetY),i)}function n(t,e){this._constructor="LineToolArrowMarkLeft",o.call(this,t,e),this._textPaneView=new c(this,t,22,-3,"middle","left"),this._textPaneView._noSelection=!0}function s(t,e){this._constructor="LineToolArrowMarkUp",o.call(this,t,e),this._textPaneView=new c(this,t,0,18,"top","center"),this._textPaneView._noSelection=!0}function r(t,e){this._constructor="LineToolArrowMarkRight",o.call(this,t,e),this._textPaneView=new c(this,t,-22,-3,"middle","right"),this._textPaneView._noSelection=!0}function a(t,e){this._constructor="LineToolArrowMarkDown",o.call(this,t,e),this._textPaneView=new c(this,t,0,-23,"bottom","center"),this._textPaneView._noSelection=!0}var l=i(53),h=i(194).LineDataSource,c=i(243).TextPaneView,d=i(320),p=i(204).DefaultProperty;inherit(o,h),o.prototype.width=21,o.prototype.height=21,o.prototype.offsetX=0,o.prototype.offsetY=0,o.prototype.paneViews=function(t){var e=h.prototype.paneViews.call(this,t);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Arrow Mark"},inherit(n,o),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",n.prototype.offsetX=1,n.prototype.offsetY=-10,n.prototype.title=function(){return"Arrow Mark Left"},inherit(s,o),s.prototype.image=new Image,s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",s.prototype.offsetX=-9,
r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",r.prototype.offsetX=-19,r.prototype.offsetY=-10,r.prototype.title=function(){return"Arrow Mark Right"},inherit(a,o),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},r.prototype.version=n.prototype.version=a.prototype.version=s.prototype.version=2,a.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,21)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=-4)},s.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=18)},r.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=10)},n.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=21,this._textPaneView._offsetY=10)},e.LineToolArrowMark=o,e.LineToolArrowMarkLeft=n,e.LineToolArrowMarkRight=r,e.LineToolArrowMarkUp=s,e.LineToolArrowMarkDown=a},function(t,e,i){"use strict";function o(t){this._data=t} s.prototype.offsetY=0,s.prototype.title=function(){return"Arrow Mark Up"},inherit(r,o),r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",r.prototype.offsetX=-19,r.prototype.offsetY=-10,r.prototype.title=function(){return"Arrow Mark Right"},inherit(a,o),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},r.prototype.version=n.prototype.version=a.prototype.version=s.prototype.version=2,a.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,21)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=-4)},s.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=18)},r.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=10)},n.prototype.migrateVersion=function(t){1===t&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new l.Point(0,0)),this._textPaneView._offsetX=21,this._textPaneView._offsetY=10)},e.LineToolArrowMark=o,e.LineToolArrowMarkLeft=n,e.LineToolArrowMarkRight=r,e.LineToolArrowMarkUp=s,
function n(t,e,i,o,n,s,a){r.call(this,t,e),this._image=i,this._offsetX=s||0,this._offsetY=a||0,this._width=o,this._height=n,this._invalidated=!0}var s=i(53),r=i(242),a=i(233),l=i(232).SelectionRenderer,h=i(237);o.prototype.draw=function(t){var e,i;0!==this._data.points.length&&(e=this._data.points[0].x+this._data.offsetX,i=this._data.points[0].y+this._data.offsetY,t.translate(-.5,-.5),t.drawImage(this._data.image,e,i,this._data.width,this._data.height))},o.prototype.hitTest=function(t){if(0===this._data.points.length)return null;var e=this._data.points[0].clone();return this._data.offsetX&&(e.x+=this._data.offsetX),this._data.offsetY&&(e.y+=this._data.offsetY),s.pointInRect(t,e,e.add(new s.Point(this._data.width,this._data.height)))?new a(a.MOVEPOINT):null},inherit(n,r),n.prototype.setAnchors=function(t){this._anchorsOffset=t},n.prototype.renderer=function(){var t,e,i,n;if(this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.image=this._image,t.offsetX=this._offsetX,t.offsetY=this._offsetY,t.width=this._width,t.height=this._height,this.isAnchorsRequired()&&1===t.points.length){if(e=new h,e.append(new o(t)),this._anchorsOffset){for(i=[],n=0;n<t.points.length;n++)i.push(t.points[n].clone().add(this._anchorsOffset));e.append(new l({points:i}))}else e.append(new l({points:t.points}));return e}return new o(t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},t.exports=n},function(t,e,i){(function(t){"use strict";function o(t,e){this._pane=t,this._timeScale=e}function n(t){this._line=t}function s(t,e){this._data=t,this._adapter=e}function r(t,e){h.call(this,t,e),this._invalidated=!0}function a(t,e){this._adapter=new n(this),this._constructor="LineToolExecution";var i=e||new u("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},c.call(this,t,new r(this,t),i)}var l=i(53),h=i(242),c=i(194).LineDataSource,d=i(322),p=i(233),u=i(204).DefaultProperty;o.prototype._cachedByBarIndexOrderedExecutions={},o.recreateOrderedByBarsSourcesCache=function(t){var e,i,n,s,r;for(o.clearOrderedByBarsSourcesCache(),e=o.prototype,i=t.orderedSources(),n=0;n<i.length;++n)s=i[n],s._adapter&&void 0!==s._adapter._index&&(r=e._cachedByBarIndexOrderedExecutions[s._adapter._index],e._cachedByBarIndexOrderedExecutions[s._adapter._index]=r||[],e._cachedByBarIndexOrderedExecutions[s._adapter._index].push(s))},o.clearOrderedByBarsSourcesCache=function(){o.prototype._cachedByBarIndexOrderedExecutions={}},o.prototype.getXYCoordinate=function(t,e,i){var o,n,s,r,l,h,c,d,p,u,_=0,f=t.getDirection(),m="buy"===f,g=this._pane.model().mainSeries();if(g.bars&&(o=m?10:-10,(n=g.bars().search(i,TradingView.SEARCH_NEAREST_LEFT))&&(i=n.index,s=m?n.value[TradingView.LOW_PLOT]:n.value[TradingView.HIGH_PLOT],r=g.priceScale(),r.isPercent()&&(l=g.firstValue(),s=r.priceRange().convertToPercent(s,l)),_=r.priceToCoordinate(s)+o)),t._index=i,h=e.visibleBars(), e.LineToolArrowMarkDown=a},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e,i,o,n,s,a){r.call(this,t,e),this._image=i,this._offsetX=s||0,this._offsetY=a||0,this._width=o,this._height=n,this._invalidated=!0}var s=i(53),r=i(242),a=i(233),l=i(232).SelectionRenderer,h=i(237);o.prototype.draw=function(t){var e,i;0!==this._data.points.length&&(e=this._data.points[0].x+this._data.offsetX,i=this._data.points[0].y+this._data.offsetY,t.translate(-.5,-.5),t.drawImage(this._data.image,e,i,this._data.width,this._data.height))},o.prototype.hitTest=function(t){if(0===this._data.points.length)return null;var e=this._data.points[0].clone();return this._data.offsetX&&(e.x+=this._data.offsetX),this._data.offsetY&&(e.y+=this._data.offsetY),s.pointInRect(t,e,e.add(new s.Point(this._data.width,this._data.height)))?new a(a.MOVEPOINT):null},inherit(n,r),n.prototype.setAnchors=function(t){this._anchorsOffset=t},n.prototype.renderer=function(){var t,e,i,n;if(this._invalidated&&this.updateImpl(),t={},t.points=this._points,t.color=this._source.properties().color.value(),t.image=this._image,t.offsetX=this._offsetX,t.offsetY=this._offsetY,t.width=this._width,t.height=this._height,this.isAnchorsRequired()&&1===t.points.length){if(e=new h,e.append(new o(t)),this._anchorsOffset){for(i=[],n=0;n<t.points.length;n++)i.push(t.points[n].clone().add(this._anchorsOffset));e.append(new l({points:i}))}else e.append(new l({points:t.points}));return e}return new o(t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){r.prototype.update.call(this),this._invalidated=!1},t.exports=n},function(t,e,i){(function(t){"use strict";function o(t,e){this._pane=t,this._timeScale=e}function n(t){this._line=t}function s(t,e){this._data=t,this._adapter=e}function r(t,e){h.call(this,t,e),this._invalidated=!0}function a(t,e){this._adapter=new n(this),this._constructor="LineToolExecution";var i=e||new u("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},c.call(this,t,new r(this,t),i)}var l=i(53),h=i(242),c=i(194).LineDataSource,d=i(322),p=i(233),u=i(204).DefaultProperty;o.prototype._cachedByBarIndexOrderedExecutions={},o.recreateOrderedByBarsSourcesCache=function(t){var e,i,n,s,r;for(o.clearOrderedByBarsSourcesCache(),e=o.prototype,i=t.orderedSources(),n=0;n<i.length;++n)s=i[n],s._adapter&&void 0!==s._adapter._index&&(r=e._cachedByBarIndexOrderedExecutions[s._adapter._index],e._cachedByBarIndexOrderedExecutions[s._adapter._index]=r||[],e._cachedByBarIndexOrderedExecutions[s._adapter._index].push(s))},o.clearOrderedByBarsSourcesCache=function(){o.prototype._cachedByBarIndexOrderedExecutions={}},o.prototype.getXYCoordinate=function(t,e,i){var o,n,s,r,l,h,c,d,p,u,_=0,f=t.getDirection(),m="buy"===f,g=this._pane.model().mainSeries();if(g.bars&&(o=m?10:-10,(n=g.bars().search(i,TradingView.SEARCH_NEAREST_LEFT))&&(i=n.index,s=m?n.value[TradingView.LOW_PLOT]:n.value[TradingView.HIGH_PLOT],r=g.priceScale(),r.isPercent()&&(l=g.firstValue(),s=r.priceRange().convertToPercent(s,l)),
!isFinite(i)||!h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(c=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=c.length-1;d>=0;--d)if((p=c[d])instanceof a&&p._adapter._index===i&&p._adapter.getDirection()===f){if(p===t._line)break;u=p._adapter._height(),_=m?_+u:_-u}return{x:e.indexToCoordinate(i),y:_}},n.prototype._height=function(){var t,e=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&d.fontHeight(this.getFont()),t=10,e+i+0+t},n.prototype.getIndex=function(){return this._line._model.timeScale().m_points.lastTimePointIndex()-this._line.points()[0].index},n.prototype.setIndex=function(t){var e,i=this._line._model.timeScale(),o=i.m_points.lastTimePointIndex(),n=o-Math.abs(t);return this._line.startMoving(this._line.points()[0]),e=TradingView.merge({},this._line.points()[0]),e.index=n,this._line.move(e),this._line.endMoving(),this},n.prototype.getTime=function(){return this._unixtime},n.prototype.setTime=function(t){var e=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(t,e.interval(),e.symbolInfo()):t,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(t){return this._line.points().length>0&&(this._line.points()[0].price=t),this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},n.prototype.getText=function(){return this._line.properties().text.value()},n.prototype.setText=function(t){return this._line.properties().text.setValue(t||""),this._line.updateAllViewsAndRedraw(),this},n.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},n.prototype.setArrowHeight=function(t){return this._line.properties().arrowHeight.setValue(t||5),this},n.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},n.prototype.setArrowSpacing=function(t){return this._line.properties().arrowSpacing.setValue(t||1),this},n.prototype.getDirection=function(){return this._line.properties().direction.value()},n.prototype.setDirection=function(t){return this._line.properties().direction.setValue(t||"buy"),this},n.prototype.getArrowColor=function(){return d.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},n.prototype.setArrowColor=function(t){return d.setColorToProperties(t,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},n.prototype.getTextColor=function(){return d.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},n.prototype.setTextColor=function(t){return d.setColorToProperties(t,this._line.properties().textColor,this._line.properties().textTransparency),this},n.prototype.getFont=function(){ _=r.priceToCoordinate(s)+o)),t._index=i,h=e.visibleBars(),!isFinite(i)||!h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(c=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=c.length-1;d>=0;--d)if((p=c[d])instanceof a&&p._adapter._index===i&&p._adapter.getDirection()===f){if(p===t._line)break;u=p._adapter._height(),_=m?_+u:_-u}return{x:e.indexToCoordinate(i),y:_}},n.prototype._height=function(){var t,e=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&d.fontHeight(this.getFont()),t=10,e+i+0+t},n.prototype.getIndex=function(){return this._line._model.timeScale().m_points.lastTimePointIndex()-this._line.points()[0].index},n.prototype.setIndex=function(t){var e,i=this._line._model.timeScale(),o=i.m_points.lastTimePointIndex(),n=o-Math.abs(t);return this._line.startMoving(this._line.points()[0]),e=TradingView.merge({},this._line.points()[0]),e.index=n,this._line.move(e),this._line.endMoving(),this},n.prototype.getTime=function(){return this._unixtime},n.prototype.setTime=function(t){var e=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(t,e.interval(),e.symbolInfo()):t,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(t){return this._line.points().length>0&&(this._line.points()[0].price=t),this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},n.prototype.getText=function(){return this._line.properties().text.value()},n.prototype.setText=function(t){return this._line.properties().text.setValue(t||""),this._line.updateAllViewsAndRedraw(),this},n.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},n.prototype.setArrowHeight=function(t){return this._line.properties().arrowHeight.setValue(t||5),this},n.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},n.prototype.setArrowSpacing=function(t){return this._line.properties().arrowSpacing.setValue(t||1),this},n.prototype.getDirection=function(){return this._line.properties().direction.value()},n.prototype.setDirection=function(t){return this._line.properties().direction.setValue(t||"buy"),this},n.prototype.getArrowColor=function(){return d.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},n.prototype.setArrowColor=function(t){return d.setColorToProperties(t,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},n.prototype.getTextColor=function(){return d.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},n.prototype.setTextColor=function(t){return d.setColorToProperties(t,this._line.properties().textColor,this._line.properties().textTransparency),this},
return d.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},n.prototype.setFont=function(t){return d.setFontToProperties(t,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},n.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},s.prototype._textWidth=function(t){var e,i;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getFont(),e=5,i=t.measureText(this._adapter.getText()).width,t.restore(),e+i)},s.prototype._drawArrow=function(t,e,i){var o,n;t.save(),t.strokeStyle=this._adapter.getArrowColor(),t.fillStyle=this._adapter.getArrowColor(),o=this._adapter.getArrowHeight(),n=this._adapter.getDirection(),t.translate(e,i),"buy"!==n&&t.rotate(Math.PI),CanvasEx.drawArrow(t,0,0,0,o),t.restore()},s.prototype._drawText=function(t,e,i){var o,n,s=this._adapter.getText();s&&(t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getFont(),t.fillStyle=this._adapter.getTextColor(),o=e+this._textWidth(t)/2,n=i+d.fontHeight(this._adapter.getFont())/2,t.fillText(s,o,n-1),t.restore())},s.prototype.draw=function(t){var e,i,o,n,s,r,l,h;!this._data.points||this._data.points.length<a.POINTS_COUNT||(e=Math.round(this._data.points[0].x+.5),i=Math.round(this._data.points[0].y),this._drawArrow(t,e,i),0!==(o=this._textWidth(t))&&(n=this._adapter.getArrowHeight(),s=this._adapter.getArrowSpacing(),r=d.fontHeight(this._adapter.getFont()),l=this._adapter.getDirection(),h="buy"===l?i+n+s:i-n-s-r,this._drawText(t,Math.round(e-o/2),h)))},s.prototype.hitTest=function(t){var e,i,o,n,s,r;if(this._data.points&&!(this._data.points.length<a.POINTS_COUNT))return e=Math.round(this._data.points[0].x),i=Math.round(this._data.points[0].y),o=this._adapter.getArrowHeight(),"buy"===this._adapter.getDirection()?(n=i,s=i+o):(n=i-o,s=i),t.x>=e-2&&t.x<=e+2&&t.y>=n&&t.y<=s?(r=this._adapter.getTooltip(),new p(p.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget&&TradingView.TradingWidget.journalDialog()},tooltip:""!==r?{text:r,rect:{x:e,y:n,w:2,h:s-n}}:null})):void 0},inherit(r,h),r.prototype._renderer=null,r.prototype._rendererCached=!1,r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){h.prototype.update.call(this),this._renderer=null,this._rendererCached=!1,this._invalidated=!1},r.prototype.renderer=function(t){var e,i,o,n,r,a,h,c;return this._invalidated&&this.updateImpl(),this._rendererCached?this._renderer:(this._rendererCached=!0,e=this._source,i=e.points(),0===i.length?null:(o=e._adapter,n=e._model.timeScale(),r=this._source._model.paneForSource(this._source).executionsPositionController(),a=r.getXYCoordinate(o,n,i[0].index), n.prototype.getFont=function(){return d.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},n.prototype.setFont=function(t){return d.setFontToProperties(t,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},n.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},s.prototype._textWidth=function(t){var e,i;return 0===this._adapter.getText().length?0:(t.save(),t.font=this._adapter.getFont(),e=5,i=t.measureText(this._adapter.getText()).width,t.restore(),e+i)},s.prototype._drawArrow=function(t,e,i){var o,n;t.save(),t.strokeStyle=this._adapter.getArrowColor(),t.fillStyle=this._adapter.getArrowColor(),o=this._adapter.getArrowHeight(),n=this._adapter.getDirection(),t.translate(e,i),"buy"!==n&&t.rotate(Math.PI),CanvasEx.drawArrow(t,0,0,0,o),t.restore()},s.prototype._drawText=function(t,e,i){var o,n,s=this._adapter.getText();s&&(t.save(),t.textAlign="center",t.textBaseline="middle",t.font=this._adapter.getFont(),t.fillStyle=this._adapter.getTextColor(),o=e+this._textWidth(t)/2,n=i+d.fontHeight(this._adapter.getFont())/2,t.fillText(s,o,n-1),t.restore())},s.prototype.draw=function(t){var e,i,o,n,s,r,l,h;!this._data.points||this._data.points.length<a.POINTS_COUNT||(e=Math.round(this._data.points[0].x+.5),i=Math.round(this._data.points[0].y),this._drawArrow(t,e,i),0!==(o=this._textWidth(t))&&(n=this._adapter.getArrowHeight(),s=this._adapter.getArrowSpacing(),r=d.fontHeight(this._adapter.getFont()),l=this._adapter.getDirection(),h="buy"===l?i+n+s:i-n-s-r,this._drawText(t,Math.round(e-o/2),h)))},s.prototype.hitTest=function(t){var e,i,o,n,s,r;if(this._data.points&&!(this._data.points.length<a.POINTS_COUNT))return e=Math.round(this._data.points[0].x),i=Math.round(this._data.points[0].y),o=this._adapter.getArrowHeight(),"buy"===this._adapter.getDirection()?(n=i,s=i+o):(n=i-o,s=i),t.x>=e-2&&t.x<=e+2&&t.y>=n&&t.y<=s?(r=this._adapter.getTooltip(),new p(p.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget&&TradingView.TradingWidget.journalDialog()},tooltip:""!==r?{text:r,rect:{x:e,y:n,w:2,h:s-n}}:null})):void 0},inherit(r,h),r.prototype._renderer=null,r.prototype._rendererCached=!1,r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){h.prototype.update.call(this),this._renderer=null,this._rendererCached=!1,this._invalidated=!1},r.prototype.renderer=function(t){var e,i,o,n,r,a,h,c;return this._invalidated&&this.updateImpl(),this._rendererCached?this._renderer:(this._rendererCached=!0,e=this._source,i=e.points(),0===i.length?null:(o=e._adapter,n=e._model.timeScale(),r=this._source._model.paneForSource(this._source).executionsPositionController(),
!isFinite(a.y)||a.y<0||a.y>t||a.x<0?(this._renderer=null,null):(h=[new l.Point(a.x,a.y)],c={points:h},this._renderer=new s(c,o),this._renderer)))},inherit(a,c),a.POINTS_COUNT=1,a.skipMagnetting=!0,a.prototype.pointsCount=function(){return a.POINTS_COUNT},a.prototype.title=function(){return"Execution"},a.prototype.hasContextMenu=function(){return!1},a.prototype.state=function(){return null},a.prototype.updateAllViews=function(){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.updateAllViews.call(this):null},a.prototype.priceAxisViews=function(t,e){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.priceAxisViews.call(this,t,e):null},a.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?c.prototype.paneViews.call(this,e):null},a.prototype.userEditEnabled=function(){return!1},a.prototype.showInObjectTree=function(){return!1},e.ExecutionsPositionController=o,e.LineToolExecution=a}).call(e,i(1))},function(t,e,i){"use strict";var o=i(213),n={_fontHeightCache:{},_parsedColorCache:{}};n._parseColor=function(t){var e,i,o;return this._parsedColorCache[t]?this._parsedColorCache[t]:(e=document.createElement("div"),e.style.color=t,i=e.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||e.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),o={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[t]=o,o)},n.getColorFromProperties=function(t,e){var i=1-e.value()/100,o=this._parseColor(t.value());return"rgba("+o.r+","+o.g+","+o.b+","+i+")"},n.setColorToProperties=function(t,e,i){var o,n=this._parseColor(t);e.setValue("rgb("+n.r+","+n.g+","+n.b+")"),o=100*(1-n.a),i.setValue(Math.max(0,Math.min(o,100)))},n._parseFont=function(t){var e,i,o=document.createElement("div");return o.style.font=t,e=o.style.fontSize.match(/(\d+)pt/),i=e&&e[0]===o.style.fontSize,{family:o.style.fontFamily,size:i?e[1]:"",bold:"bold"===o.style.fontWeight,italic:"italic"===o.style.fontStyle}},n.getFontFromProperties=function(t,e,i,o){return[i.value()?"bold":"",o.value()?"italic":"",e.value()+"pt",t.value()].join(" ")},n.setFontToProperties=function(t,e,i,o,n){var s=this._parseFont(t);s.family.length>0&&e.setValue(s.family),s.size.length>0&&i.setValue(s.size),o.setValue(s.bold),n.setValue(s.italic)},n.fontHeight=function(t){var e,i;return this._fontHeightCache[t]||(e=document.createElement("span"),e.appendChild(document.createTextNode("height")),document.body.appendChild(e),e.style.cssText="font: "+t+"; white-space: nowrap; display: inline;",i=e.offsetHeight,document.body.removeChild(e),this._fontHeightCache[t]=Math.ceil(i)),this._fontHeightCache[t]},n.drawPolyHoverOrPress=function(t,e,i,o){o?(t.save(),t.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(t,e,!0),t.restore()):i&&(t.save(),t.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(t,e,!0),t.restore())},n.repaint=function(t){var e=new o(o.LIGHT_UPDATE);e.force=!0, a=r.getXYCoordinate(o,n,i[0].index),!isFinite(a.y)||a.y<0||a.y>t||a.x<0?(this._renderer=null,null):(h=[new l.Point(a.x,a.y)],c={points:h},this._renderer=new s(c,o),this._renderer)))},inherit(a,c),a.POINTS_COUNT=1,a.skipMagnetting=!0,a.prototype.pointsCount=function(){return a.POINTS_COUNT},a.prototype.title=function(){return"Execution"},a.prototype.hasContextMenu=function(){return!1},a.prototype.state=function(){return null},a.prototype.updateAllViews=function(){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.updateAllViews.call(this):null},a.prototype.priceAxisViews=function(t,e){return this._model.properties().tradingProperties.showExecutions.value()?c.prototype.priceAxisViews.call(this,t,e):null},a.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?c.prototype.paneViews.call(this,e):null},a.prototype.userEditEnabled=function(){return!1},a.prototype.showInObjectTree=function(){return!1},e.ExecutionsPositionController=o,e.LineToolExecution=a}).call(e,i(1))},function(t,e,i){"use strict";var o=i(213),n={_fontHeightCache:{},_parsedColorCache:{}};n._parseColor=function(t){var e,i,o;return this._parsedColorCache[t]?this._parsedColorCache[t]:(e=document.createElement("div"),e.style.color=t,i=e.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||e.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),o={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[t]=o,o)},n.getColorFromProperties=function(t,e){var i=1-e.value()/100,o=this._parseColor(t.value());return"rgba("+o.r+","+o.g+","+o.b+","+i+")"},n.setColorToProperties=function(t,e,i){var o,n=this._parseColor(t);e.setValue("rgb("+n.r+","+n.g+","+n.b+")"),o=100*(1-n.a),i.setValue(Math.max(0,Math.min(o,100)))},n._parseFont=function(t){var e,i,o=document.createElement("div");return o.style.font=t,e=o.style.fontSize.match(/(\d+)pt/),i=e&&e[0]===o.style.fontSize,{family:o.style.fontFamily,size:i?e[1]:"",bold:"bold"===o.style.fontWeight,italic:"italic"===o.style.fontStyle}},n.getFontFromProperties=function(t,e,i,o){return[i.value()?"bold":"",o.value()?"italic":"",e.value()+"pt",t.value()].join(" ")},n.setFontToProperties=function(t,e,i,o,n){var s=this._parseFont(t);s.family.length>0&&e.setValue(s.family),s.size.length>0&&i.setValue(s.size),o.setValue(s.bold),n.setValue(s.italic)},n.fontHeight=function(t){var e,i;return this._fontHeightCache[t]||(e=document.createElement("span"),e.appendChild(document.createTextNode("height")),document.body.appendChild(e),e.style.cssText="font: "+t+"; white-space: nowrap; display: inline;",i=e.offsetHeight,document.body.removeChild(e),this._fontHeightCache[t]=Math.ceil(i)),this._fontHeightCache[t]},n.drawPolyHoverOrPress=function(t,e,i,o){o?(t.save(),t.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(t,e,!0),t.restore()):i&&(t.save(),t.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(t,e,!0),t.restore())},n.repaint=function(t){
t.invalidate(e)},n.roundToMinTick=function(t,e){var i=t.mainSource().base(),o=1/i;return o*Math.round(e/o)},t.exports=n},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolPitchfan";var i=e||this.createPropertiesObject("linetoolpitchfan");r.call(this,t,new o(this,t),i)}var s=i(242),r=i(194).LineDataSource,a=i(267),l=i(324).ChannelRenderer,h=i(273).TrendLineRenderer,c=i(233),d=i(237);inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){s.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))},o.prototype.renderer=function(){var t,e,i,o,n,s,a,p,u,_,f,m,g,v,y,b;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,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:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(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:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(i)),o=0,n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._source.properties().fillBackground.value(),a=this._source.properties().transparency.value(),p=0;p<=8;p++)u="level"+p,_=this._source.properties()[u],_.visible.value()&&(f=this._medianPoint.addScaled(n,_.coeff.value()),m=this._medianPoint.addScaled(n,-_.coeff.value()),s&&(g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=f,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g)),g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=m,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,-o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g))),o=_.coeff.value(),v={points:[this._floatPoints[0],f],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0, var e=new o(o.LIGHT_UPDATE);e.force=!0,t.invalidate(e)},n.roundToMinTick=function(t,e){var i=t.mainSource().base(),o=1/i;return o*Math.round(e/o)},t.exports=n},function(t,e,i){"use strict";function o(t,e){s.call(this,t,e),this._invalidated=!0}function n(t,e){this._constructor="LineToolPitchfan";var i=e||this.createPropertiesObject("linetoolpitchfan");r.call(this,t,new o(this,t),i)}var s=i(242),r=i(194).LineDataSource,a=i(267),l=i(324).ChannelRenderer,h=i(273).TrendLineRenderer,c=i(233),d=i(237);inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){s.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))},o.prototype.renderer=function(){var t,e,i,o,n,s,a,p,u,_,f,m,g,v,y,b;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new d,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:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(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:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},t.append(new h(i)),o=0,n=this._floatPoints[2].substract(this._floatPoints[1]).scaled(.5),s=this._source.properties().fillBackground.value(),a=this._source.properties().transparency.value(),p=0;p<=8;p++)u="level"+p,_=this._source.properties()[u],_.visible.value()&&(f=this._medianPoint.addScaled(n,_.coeff.value()),m=this._medianPoint.addScaled(n,-_.coeff.value()),s&&(g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=f,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g)),g={},g.width=this._model.timeScale().width(),g.p1=this._floatPoints[0],g.p2=m,g.p3=this._floatPoints[0],g.p4=this._medianPoint.addScaled(n,-o),g.color=_.color.value(),g.transparency=a,g.hittestOnBackground=!0,t.append(new l(g))),o=_.coeff.value(),v={points:[this._floatPoints[0],f],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,
leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(v,y)),b={points:[this._floatPoints[0],m],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(b,y)));return this.addAnchors(t),t},inherit(n,r),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[0,8]})},t.exports=n},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(53),c=i(242),d=i(194).LineDataSource,p=i(267),u=i(273).TrendLineRenderer,_=i(214).Action,f=i(233),m=i(237),g=i(199);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], extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(v,y)),b={points:[this._floatPoints[0],m],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!0,leftend:r.LINEEND_NORMAL,rightend:r.LINEEND_NORMAL},y=new c(c.MOVEPOINT,null,p),t.append(new h(b,y)));return this.addAnchors(t),t},inherit(n,r),n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Pitchfan"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[0,8]})},t.exports=n},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(53),c=i(242),d=i(194).LineDataSource,p=i(267),u=i(273).TrendLineRenderer,_=i(214).Action,f=i(233),m=i(237),g=i(199);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(), 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(){ 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, 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,
@@ -369,29 +369,29 @@ n.prototype._drawQuantity=function(t,e,i,o){var n,s;t.save(),t.strokeStyle=this.
LineStudyMtpDownWave2OrB:i(375).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(375).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(375).LineStudyMtpDownWave4,LineStudyMtpDownWave5:i(375).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(375).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(375).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(375).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(375).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(375).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(375).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(375).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(294).Study,s=i(367);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()}, LineStudyMtpDownWave2OrB:i(375).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(375).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(375).LineStudyMtpDownWave4,LineStudyMtpDownWave5:i(375).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(375).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(375).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(375).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(375).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(375).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(375).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(375).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(294).Study,s=i(367);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(203))},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(53),s=i(234).PaneRendererStudyStrategyOrders,r=i(237);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), 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(203))},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(53),s=i(234).PaneRendererStudyStrategyOrders,r=i(237);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,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(53),l=i(222),h=i(294).Study,c=i(196),d=i(198),p=i(231),u=p.SeriesAreaPaneView,_=p.SeriesLinePaneView,f=p.SeriesHollowCandlesPaneView,m=p.SeriesCandlesPaneView,g=p.SeriesBarsPaneView,v=i(302),y=i(229),b=y.DataWindowView,w=y.DataWindowItem,S=i(240).SeriesBarColorer,T=i(241).HorzLineRenderer,C=i(245),x=i(233),P=i(250),L=i(213),k=i(210).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(){ 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,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(53),l=i(222),h=i(294).Study,c=i(196),d=i(198),p=i(231),u=p.SeriesAreaPaneView,_=p.SeriesLinePaneView,f=p.SeriesHollowCandlesPaneView,m=p.SeriesCandlesPaneView,g=p.SeriesBarsPaneView,v=i(302),y=i(229),b=y.DataWindowView,w=y.DataWindowItem,S=i(240).SeriesBarColorer,T=i(241).HorzLineRenderer,C=i(245),x=i(233),P=i(250),L=i(213),k=i(210).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.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: 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
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 t=i?i.name+", "+i.exchange: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(){ ;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 t=i?i.name+", "+i.exchange: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},
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,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(301).DataVendorStudyDataWindowView,s=i(245),r=i(213),a=i(210).PriceFormatter;inherit(o,TradingView.Study),o.prototype.createPlotLabels=function(t){},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,e,i,o){n.call(this,t,e,i,o)}var n=i(294).Study,s=i(252),r=i(259).assert;inherit(o,n),o.prototype.clearData=function(){n.prototype.clearData.call(this),this._underlyingData=new s(this._plotFields)},o.prototype._mergeData=function(t){var e,i,o,n=0===this._underlyingData._length()?null:this._underlyingData._indexAt(0);for(this._underlyingData.merge(t),n!==this._underlyingData._indexAt(0)&&(this.m_data=new s(this._underlyingData.columns())),this.m_data._start=this._underlyingData._start,this.m_data._end=this._underlyingData._end,e=this.m_data._length(),i=e;i<this._underlyingData._length();++i)o=TradingView.merge({},this._underlyingData._valueAt(i)),this.m_data.add(this._underlyingData._indexAt(i),o) 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,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(301).DataVendorStudyDataWindowView,s=i(245),r=i(213),a=i(210).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,e,i,o){n.call(this,t,e,i,o)}var n=i(294).Study,s=i(252),r=i(259).assert;inherit(o,n),o.prototype.clearData=function(){n.prototype.clearData.call(this),this._underlyingData=new s(this._plotFields)},o.prototype._mergeData=function(t){var e,i,o,n=0===this._underlyingData._length()?null:this._underlyingData._indexAt(0);for(this._underlyingData.merge(t),n!==this._underlyingData._indexAt(0)&&(this.m_data=new s(this._underlyingData.columns())),this.m_data._start=this._underlyingData._start,this.m_data._end=this._underlyingData._end,e=this.m_data._length(),
;return this._plotsForStrategyProcessing().forEach(function(t){this._createStrategy(t.strategy,t.strategyIndex,t.targetIndex,e).rebuildData(this.m_data)},this),this.m_data},o.prototype._plotsForStrategyProcessing=function(){var t=["dataoffset"],e=[];return this._metaInfo.plots.forEach(function(i,o){var n,s;t.indexOf(i.type)>-1&&(n=null,this._metaInfo.plots.forEach(function(t,e){t.id===i.target&&(n=e)}),r(n>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:o,targetIndex:n},e.push(s))},this),e},o.prototype._createStrategy=function(t,e,i,n){return new o["Strategy_"+t](e,i,n)},o.Strategy_dataoffset=function(t,e,i){this._strategyPlotIndex=t,this._targetPlotIndex=e,this._startIndex=i},o.Strategy_dataoffset.prototype.rebuildData=function(t){var e,i,o,n,s,r,a,l=this._targetPlotIndex+1,h=this._strategyPlotIndex+1,c=null,d=null;for(e=this._startIndex;e<t._length();++e)i=t._valueAt(e),o=i[l],n=i[h]?Math.round(i[h]):null,i[l]=null,i[h]=null,!n||n>0||(s=e+n,r={pointIndex:s,value:o},d?d.pointIndex!==r.pointIndex&&(s>=0&&(t._items[s].value[l]=o),a=!1,c&&(a=c.value<=d.value&&d.value<=o||c.value>=d.value&&d.value>=o),a?d.pointIndex>=0&&(t._items[d.pointIndex].value[l]=null):c=d,d=r):d=r)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_tsanalysis"},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),this.properties().inputs.shouldFilterSTFTrends.value()]:null},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this._symbolIntervalChanged=!1,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_decisionpoint"},o.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1e3*e[TradingView.TIME_PLOT]]:null},o.prototype.onData=function(t){n.prototype.onData.call(this,t),this._symbolIntervalChanged=!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_riskreward"},o.prototype.pointsCount=function(){return 3},o.getTooltipText=function(t){ i=e;i<this._underlyingData._length();++i)o=TradingView.merge({},this._underlyingData._valueAt(i)),this.m_data.add(this._underlyingData._indexAt(i),o);return this._plotsForStrategyProcessing().forEach(function(t){this._createStrategy(t.strategy,t.strategyIndex,t.targetIndex,e).rebuildData(this.m_data)},this),this.m_data},o.prototype._plotsForStrategyProcessing=function(){var t=["dataoffset"],e=[];return this._metaInfo.plots.forEach(function(i,o){var n,s;t.indexOf(i.type)>-1&&(n=null,this._metaInfo.plots.forEach(function(t,e){t.id===i.target&&(n=e)}),r(n>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:o,targetIndex:n},e.push(s))},this),e},o.prototype._createStrategy=function(t,e,i,n){return new o["Strategy_"+t](e,i,n)},o.Strategy_dataoffset=function(t,e,i){this._strategyPlotIndex=t,this._targetPlotIndex=e,this._startIndex=i},o.Strategy_dataoffset.prototype.rebuildData=function(t){var e,i,o,n,s,r,a,l=this._targetPlotIndex+1,h=this._strategyPlotIndex+1,c=null,d=null;for(e=this._startIndex;e<t._length();++e)i=t._valueAt(e),o=i[l],n=i[h]?Math.round(i[h]):null,i[l]=null,i[h]=null,!n||n>0||(s=e+n,r={pointIndex:s,value:o},d?d.pointIndex!==r.pointIndex&&(s>=0&&(t._items[s].value[l]=o),a=!1,c&&(a=c.value<=d.value&&d.value<=o||c.value>=d.value&&d.value>=o),a?d.pointIndex>=0&&(t._items[d.pointIndex].value[l]=null):c=d,d=r):d=r)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_tsanalysis"},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),this.properties().inputs.shouldFilterSTFTrends.value()]:null},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this._symbolIntervalChanged=!1,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_decisionpoint"},o.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return e?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1e3*e[TradingView.TIME_PLOT]]:null},o.prototype.onData=function(t){n.prototype.onData.call(this,t),this._symbolIntervalChanged=!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(309);inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_riskreward"},
return t&&0!==t._points.length?1===t._points.length?"Select Stop Bar":2===t._points.length?"Select Target Point":null:"Select Entry Setup Bar"},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this.points()[1].index,i=this.points()[2].index,o=this._model.mainSeries().bars().valueAt(t),n=this._model.mainSeries().bars().valueAt(e),s=this._model.mainSeries().bars().valueAt(i);return o&&n&&s?[1e3*o[TradingView.TIME_PLOT],1e3*n[TradingView.TIME_PLOT],1e3*s[TradingView.TIME_PLOT],this.points()[2].price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()]:null},t.exports=o},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(309);inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return 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(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(309);inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o=[this.properties().inputs.displayZoneLabels.value()];for(t=0;t<this.pointsCount();++t){if(e=this.points()[t].index,!(i=this._model.mainSeries().bars().valueAt(e)))return null;o.push(1e3*i[TradingView.TIME_PLOT])}return o},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){ o.prototype.pointsCount=function(){return 3},o.getTooltipText=function(t){return t&&0!==t._points.length?1===t._points.length?"Select Stop Bar":2===t._points.length?"Select Target Point":null:"Select Entry Setup Bar"},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this.points()[1].index,i=this.points()[2].index,o=this._model.mainSeries().bars().valueAt(t),n=this._model.mainSeries().bars().valueAt(e),s=this._model.mainSeries().bars().valueAt(i);return o&&n&&s?[1e3*o[TradingView.TIME_PLOT],1e3*n[TradingView.TIME_PLOT],1e3*s[TradingView.TIME_PLOT],this.points()[2].price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()]:null},t.exports=o},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(309);inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t=this.points()[0].index,e=this._model.mainSeries().bars().valueAt(t);return 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(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(309);inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o=[this.properties().inputs.displayZoneLabels.value()];for(t=0;t<this.pointsCount();++t){if(e=this.points()[t].index,!(i=this._model.mainSeries().bars().valueAt(e)))return null;o.push(1e3*i[TradingView.TIME_PLOT])}return o},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 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){(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(53),l=i(194).LineDataSource,h=i(377),c=i(378),d=i(379),p=i(273).TrendLineRenderer,u=i(243).TextRenderer,_=i(269).RectangleRenderer,f=i(202).DataSource,m=i(206),g=i(234),v=g.PaneRendererCrossHair,y=g.PaneRendererCrossHairLock,b=i(237),w=i(213),S=i(271).PercentageFormatter,T=i(276).TimeSpanFormatter,C=i(199);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 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){(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(53),l=i(194).LineDataSource,h=i(377),c=i(378),d=i(379),p=i(273).TrendLineRenderer,u=i(243).TextRenderer,_=i(269).RectangleRenderer,f=i(202).DataSource,m=i(206),g=i(234),v=g.PaneRendererCrossHair,y=g.PaneRendererCrossHairLock,b=i(237),w=i(213),S=i(271).PercentageFormatter,T=i(276).TimeSpanFormatter,C=i(199);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
;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.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)} ;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.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()){
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), 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),
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(){ _=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,
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(56))},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(198),s=i(196),r=i(210).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){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(229),s=n.DataWindowView,r=n.DataWindowItem,a=i(210).PriceFormatter,l=i(211).DateFormatter,h=i(209).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){n.call(this),this._crosshair=t,this._model=e,this._rendererData={visible:!1,background:"#585858",color:"white",text:""}}var n=i(200),s=i(201),r=i(208).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){(function(e,o){"use strict";function n(t,i,s){var r,a;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new h(new e(r),s.properties().scalesProperties),a=i.leftAxisProperties.state(),a.autoScale=!0,this.m_leftPriceScale=new h(new e(a),s.properties().scalesProperties),this.m_dataSources=[], 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(56))},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(198),s=i(196),r=i(210).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){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(229),s=n.DataWindowView,r=n.DataWindowItem,a=i(210).PriceFormatter,l=i(211).DateFormatter,h=i(209).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){n.call(this),this._crosshair=t,this._model=e,this._rendererData={visible:!1,background:"#585858",color:"white",text:""}}var n=i(200),s=i(201),r=i(208).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){(function(e,o){"use strict";function n(t,i,s){var r,a;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new h(new e(r),s.properties().scalesProperties),a=i.leftAxisProperties.state(),a.autoScale=!0,
this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=s,this._tagsChanged=new o,i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1}var s=i(321).ExecutionsPositionController,r=i(194).LineDataSource,a=i(202).PriceDataSource,l=i(54).getLogger("Chart.Pane"),h=i(381);n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins)},n.prototype.setPaneSize=function(t){var e={large:1,medium:.6,small:.3,tiny:.15};if(!e[t])throw Error("Unknown size enum value: "+t);this._stretchFactor=e[t]*n.DEFAULT_STRETCH_FACTOR},n.sortSources=function(t){return t.map(function(t){var e,i,o=t._constructor;return isFunction(t.metaInfo)&&(o=t.metaInfo().id),i=n.sortSourcesPreOrdered[o]||0,e=i>0?1/0:i<0?-1/0:t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},n.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;t<this.m_dataSources.length;t++)(e=this.m_dataSources[t])instanceof TradingView.Study&&this.isOverlay(e)&&"Volume"!==e.metaInfo().shortId&&e.priceScale()&&e.priceScale()!==this.m_leftPriceScale&&e.priceScale()===this.m_rightPriceScale&&(e.priceScale().setTopMargin(i),e.priceScale().setBottomMargin(o),this.recalculatePriceScale(e.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},n.prototype.model=function(){return this._model},n.prototype.width=function(){return this.m_width},n.prototype.height=function(){return this.m_height},n.prototype.setWidth=function(t){this.m_width=t,this.updateAllViews()},n.prototype.setHeight=function(t){var e,i;for(this.m_height=t,this.m_leftPriceScale.setHeight(t),this.m_rightPriceScale.setHeight(t),e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(t);this.updateAllViews()},n.prototype.leftPriceScale=function(){return this.m_leftPriceScale},n.prototype.rightPriceScale=function(){return this.m_rightPriceScale},n.prototype.timeScale=function(){return this.m_timeScale},n.prototype.dataSources=function(){return this.m_dataSources}, this.m_leftPriceScale=new h(new e(a),s.properties().scalesProperties),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=s,this._tagsChanged=new o,i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1}var s=i(321).ExecutionsPositionController,r=i(194).LineDataSource,a=i(202).PriceDataSource,l=i(54).getLogger("Chart.Pane"),h=i(381);n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins)},n.prototype.setPaneSize=function(t){var e={large:1,medium:.6,small:.3,tiny:.15};if(!e[t])throw Error("Unknown size enum value: "+t);this._stretchFactor=e[t]*n.DEFAULT_STRETCH_FACTOR},n.sortSources=function(t){return t.map(function(t){var e,i,o=t._constructor;return isFunction(t.metaInfo)&&(o=t.metaInfo().id),i=n.sortSourcesPreOrdered[o]||0,e=i>0?1/0:i<0?-1/0:t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},n.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;t<this.m_dataSources.length;t++)(e=this.m_dataSources[t])instanceof TradingView.Study&&this.isOverlay(e)&&"Volume"!==e.metaInfo().shortId&&e.priceScale()&&e.priceScale()!==this.m_leftPriceScale&&e.priceScale()===this.m_rightPriceScale&&(e.priceScale().setTopMargin(i),e.priceScale().setBottomMargin(o),this.recalculatePriceScale(e.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},n.prototype.model=function(){return this._model},n.prototype.width=function(){return this.m_width},n.prototype.height=function(){return this.m_height},n.prototype.setWidth=function(t){this.m_width=t,this.updateAllViews()},n.prototype.setHeight=function(t){var e,i;for(this.m_height=t,this.m_leftPriceScale.setHeight(t),this.m_rightPriceScale.setHeight(t),e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(t);this.updateAllViews()},n.prototype.leftPriceScale=function(){return this.m_leftPriceScale},n.prototype.rightPriceScale=function(){return this.m_rightPriceScale},n.prototype.timeScale=function(){return this.m_timeScale
n.prototype.isOverlay=function(t){return t._isOverlay},n.prototype._processMainSourceChange=function(){var t,e,i,o,s,l,h;if(null===this.m_mainDataSource)for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,t=!0;break}if(this.m_mainDataSource&&t){for(o=[],e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],TradingView.isInherited(i.constructor,r)&&o.push(i);for(o=n.sortSources(o),e=0;e<o.length;e++)this.move(o[e],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),i.setPriceScale(this.m_rightPriceScale),s=this._model.children(i),h=0;h<s.length;h++)l=s[h],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},n.prototype._newZOrderForLineTool=function(){var t,e,i,o=null;for(t=0;t<this.m_dataSources.length;++t)(e=this.m_dataSources[t])instanceof r&&(i=e.zorder(),(null===o||i>o)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(t,e,i){var o;t instanceof r&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},n.prototype.insertDataSource=function(t,i,o){var s,r,l;this.m_dataSources.push(t),s=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,s=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,s=!0),t._isOverlay=!1,null!==i||this.canHaveMoreNoScaleSources()||(i=this.rightPriceScale()),null===i&&(r=this.m_rightPriceScale.topMargin(),l=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(r=.75,l=0),i=new h(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties),i.setHeight(this.m_height),i.setTopMargin(r),i.setBottomMargin(l),t._isOverlay=!0),i.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(i),t.onTagsChanged&&t.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),t.setZorder(o),s&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i), },n.prototype.dataSources=function(){return this.m_dataSources},n.prototype.isOverlay=function(t){return t._isOverlay},n.prototype._processMainSourceChange=function(){var t,e,i,o,s,l,h;if(null===this.m_mainDataSource)for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,t=!0;break}if(this.m_mainDataSource&&t){for(o=[],e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],TradingView.isInherited(i.constructor,r)&&o.push(i);for(o=n.sortSources(o),e=0;e<o.length;e++)this.move(o[e],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),i.setPriceScale(this.m_rightPriceScale),s=this._model.children(i),h=0;h<s.length;h++)l=s[h],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},n.prototype._newZOrderForLineTool=function(){var t,e,i,o=null;for(t=0;t<this.m_dataSources.length;++t)(e=this.m_dataSources[t])instanceof r&&(i=e.zorder(),(null===o||i>o)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(t,e,i){var o;t instanceof r&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},n.prototype.insertDataSource=function(t,i,o){var s,r,l;this.m_dataSources.push(t),s=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,s=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,s=!0),t._isOverlay=!1,null!==i||this.canHaveMoreNoScaleSources()||(i=this.rightPriceScale()),null===i&&(r=this.m_rightPriceScale.topMargin(),l=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(r=.75,l=0),i=new h(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties),i.setHeight(this.m_height),i.setTopMargin(r),i.setBottomMargin(l),t._isOverlay=!0),i.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(i),t.onTagsChanged&&t.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),t.setZorder(o),s&&this._processMainSourceChange(),this._tagsChanged.fire(),
this.invalidateSourcesCache()},n.prototype.removeDataSource=function(t,e){var i,o=this.m_dataSources.indexOf(t);if(-1===o)return void l.logDebug("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(o,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(t)?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(t)&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(t,e){t.startScale(e)},n.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},n.prototype.endScalePrice=function(t){t.endScale()},n.prototype.startScrollPrice=function(t,e){t.startScroll(e)},n.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},n.prototype.endScrollPrice=function(t){t.endScroll()},n.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},n.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},n.prototype.updateAllViews=function(){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){ TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.removeDataSource=function(t,e){var i,o=this.m_dataSources.indexOf(t);if(-1===o)return void l.logDebug("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(o,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(t)?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(t)&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(t,e){t.startScale(e)},n.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},n.prototype.endScalePrice=function(t){t.endScale()},n.prototype.startScrollPrice=function(t,e){t.startScroll(e)},n.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},n.prototype.endScrollPrice=function(t){t.endScroll()},n.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},n.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},n.prototype.updateAllViews=function(){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()
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}, ;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
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(195),i(56))},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), ;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(195),i(56))},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{
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(53),h=i(382),c=i(194).LineDataSource,d=i(202).PriceDataSource,p=i(222),u=i(210).PriceFormatter,_=i(271).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, 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(53),h=i(382),c=i(194).LineDataSource,d=i(202).PriceDataSource,p=i(222),u=i(210).PriceFormatter,_=i(271).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[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(){ 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.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), ;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),
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(380),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)}, 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(380),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(),
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), 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_isLog&&this._properties.log.setValue(t.m_isLog),this.m_priceRange=e?new o(e):null,void 0!==t.m_height&&(this.m_height=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], ;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=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=[],
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(56),i(223))},function(t,e){"use strict";function i(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}i.prototype.format=function(t){var e,i;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=i},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(199),s=i(230).translatedIntervalString;t.exports=o}).call(e,i(1))},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={} 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(56),i(223))},function(t,e){"use strict";function i(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}i.prototype.format=function(t){var e,i;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=i},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(199),s=i(230).translatedIntervalString;t.exports=o}).call(e,i(1))},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(){
;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,i){this._magnetProperty=t,this._timeScale=e}var n=i(222);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,o){"use strict";function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function s(t){this._model=t,this._properties=t.properties().timeScale,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._defaultRightOffset=this._properties.rightOffset.value(),this.m_rightOffset=this._properties.rightOffset.value(),this.m_points=new u,this.m_barSpacing=this._properties.barSpacing.value(),this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks=new h,this._locked=!1,this._formattedBySpan={},this._onScroll=new e}var r=i(53),a=i(239),l=i(382),h=i(387),c=i(213),d=i(204).saveDefaultProperties,p=i(210).numberToStringWithLeadingZero,u=i(388),_=i(389),f=i(54).getLogger("Chart.TimeScale"),m=i(1),g=null,v=50,y=m.enabled("high_density_bars")?.025:.5 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,i){this._magnetProperty=t,this._timeScale=e}var n=i(222);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,o){"use strict";function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function s(t){this._model=t,this._properties=t.properties().timeScale,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._defaultRightOffset=this._properties.rightOffset.value(),this.m_rightOffset=this._properties.rightOffset.value(),this.m_points=new u,this.m_barSpacing=this._properties.barSpacing.value(),this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks=new h,this._locked=!1,this._formattedBySpan={},this._onScroll=new e}var r=i(53),a=i(239),l=i(382),h=i(387),c=i(213),d=i(204).saveDefaultProperties,p=i(210).numberToStringWithLeadingZero,u=i(388),_=i(389),f=i(54).getLogger("Chart.TimeScale"),m=i(1),g=null,v=50,y=m.enabled("high_density_bars")?.025:.5
;s.prototype.tickMarks=function(){return this.m_tickmarks},s.prototype.reset=function(){this._visibleBarsCache=null,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks.reset()},s.prototype.restoreDefault=function(){this._visibleBarsCache=null,this.m_barSpacing=_.DEFAULT_BAR_SPACING,this.m_rightOffset=this._properties.rightOffset.value(),this.saveDefault("barSpacing"),this._correctOffset(),this.recalcLockedScale()},s.prototype.rightOffset=function(){return this.m_rightOffset},s.prototype.scrollToRealtime=function(t){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.tickMarks=function(){return this.m_tickmarks},s.prototype.reset=function(){this._visibleBarsCache=null,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks.reset()},s.prototype.restoreDefault=function(){this._visibleBarsCache=null,this.m_barSpacing=_.DEFAULT_BAR_SPACING,this.m_rightOffset=this._properties.rightOffset.value(),this.saveDefault("barSpacing"),this._correctOffset(),this.recalcLockedScale()},s.prototype.rightOffset=function(){return this.m_rightOffset},s.prototype.scrollToRealtime=function(t){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, 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() 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()
@@ -540,7 +540,7 @@ var e,i,o,n,s,r,a,l,h,c,d,p,u=this._model.model(),_=u.mainSeries();for(_.propert
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(56))},function(t,e,i){"use strict";function o(t,e,i,n){var r,a,l;if(n=!n||n<1e12?Date.now():n,r=n-t,a=Math.min(i.endValue,i.endValue*s.easingFunc.easeOutCubic(r/i.duration)),l=a-e,i.onStep(l),r>=i.duration)return void(i.onComplete&&i.onComplete());requestAnimationFrame(o.bind(null,t,a,i))}function n(t){t.duration=t.duration||250,requestAnimationFrame(o.bind(null,Date.now(),0,t))}var s=i(166);e.doAnimate=n},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(74)},function(t,e,i){(function(e){"use strict";function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null, 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(56))},function(t,e,i){"use strict";function o(t,e,i,n){var r,a,l;if(n=!n||n<1e12?Date.now():n,r=n-t,a=Math.min(i.endValue,i.endValue*s.easingFunc.easeOutCubic(r/i.duration)),l=a-e,i.onStep(l),r>=i.duration)return void(i.onComplete&&i.onComplete());requestAnimationFrame(o.bind(null,t,a,i))}function n(t){t.duration=t.duration||250,requestAnimationFrame(o.bind(null,Date.now(),0,t))}var s=i(166);e.doAnimate=n},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(74)},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(485),n=i(461),s=i(194).LineDataSource,r=i(246),a=i(214),l=a.ActionSeparator,h=i(463),c=i(213),d=i(308),p=d.resizeCanvas,u=d.clearRect,_=d.addCanvasTo,f=d.Size,m=i(453).setMouseEventHandler,g=i(65).trackEvent,v=i(247).makeFont,y=i(389),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")}, 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(485),n=i(461),s=i(194).LineDataSource,r=i(246),a=i(214),l=a.ActionSeparator,h=i(463),c=i(213),d=i(308),p=d.resizeCanvas,u=d.clearRect,_=d.addCanvasTo,f=d.Size,m=i(453).setMouseEventHandler,g=i(65).trackEvent,v=i(247).makeFont,y=i(389),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")&&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), 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")&&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}).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(), 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(1))},function(t,e){},function(t,e,i){(function(e){"use strict";function o(t){var e,i;o.visibilityProperty.value()||(e="NavigationButtons.visibility",o.visibilityProperty.subscribe(null,function(){var t=o.visibilityProperty.value();t!==TVSettings.getValue(e)&&TVSettings.setValue(e,t),n.subscribeOnEvents("visibleOnMouseOver"===t)}),i=TVSettings.getValue(e,Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),o.visibilityProperty.setValue(i)),this._widgets=[],this._chart=t,o.visibilityProperty.subscribe(null,this._onVisibilityPropertyChanged.bind(this))}var n=i(487);o.visibilityProperty=new e,o.visibilityPropertyAvailableValues={visibleOnMouseOver:$.t("Visible on Mouse Over"),alwaysOn:$.t("Always Visible"),alwaysOff:$.t("Always Invisible")},o.prototype.addWidget=function(t){this._widgets.push(t.widget);var e=$.extend({callback:this._onMouseMove.bind(this)},t);n.addWidget(e),this._updateOpacityState([t.widget])},o.prototype._onVisibilityPropertyChanged=function(){this._updateOpacityState(this._widgets)},o.prototype._updateWidgetVisibility=function(t){t.css("visibility",t._state?"visible":"hidden")}, 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(1))},function(t,e){},function(t,e,i){(function(e){"use strict";function o(t){var e,i;o.visibilityProperty.value()||(e="NavigationButtons.visibility",o.visibilityProperty.subscribe(null,function(){var t=o.visibilityProperty.value();t!==TVSettings.getValue(e)&&TVSettings.setValue(e,t),n.subscribeOnEvents("visibleOnMouseOver"===t)}),i=TVSettings.getValue(e,Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),o.visibilityProperty.setValue(i)),this._widgets=[],this._chart=t,o.visibilityProperty.subscribe(null,this._onVisibilityPropertyChanged.bind(this))}var n=i(487);o.visibilityProperty=new e,o.visibilityPropertyAvailableValues={visibleOnMouseOver:$.t("Visible on Mouse Over"),alwaysOn:$.t("Always Visible"),alwaysOff:$.t("Always Invisible")},o.prototype.addWidget=function(t){this._widgets.push(t.widget);var e=$.extend({callback:this._onMouseMove.bind(this)},t);n.addWidget(e),this._updateOpacityState([t.widget])},o.prototype._onVisibilityPropertyChanged=function(){this._updateOpacityState(this._widgets)},o.prototype._updateWidgetVisibility=function(t){t.css("visibility",t._state?"visible":"hidden")},
o.prototype._updateOpacityState=function(t,e){void 0===e&&(e="alwaysOn"===o.visibilityProperty.value());var i=this;t.forEach(function(t){if(t._state!==e){t._state=e,t.css("visibility","visible");var o=e?1:0;if(t.css("opacity")===o)return void i._updateWidgetVisibility(t);t.animate({opacity:o},i._updateWidgetVisibility.bind(i,t))}})},o.prototype._onMouseMove=function(t,e){this._chart.model().lineBeingCreated()||this._updateOpacityState([t],!e)},t.exports=o}).call(e,i(195))},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){(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(213);o.visibilityProperty=new e,o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent),$('<div class="control-bar">').append($(i(489)).attr("class","move-left-button-control-bar")).append($(i(490)).attr("class","zoom-out-right-button-control-bar").css("fill","#8A8B8D")).append($(i(491)).attr("class","turn-button-control-bar")).append($(i(492)).attr("class","zoom-in-button-control-bar").css("fill","#8A8B8D")).append($(i(493)).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(494)).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(){ o.prototype._updateOpacityState=function(t,e){void 0===e&&(e="alwaysOn"===o.visibilityProperty.value());var i=this;t.forEach(function(t){if(t._state!==e){t._state=e,t.css("visibility","visible");var o=e?1:0;if(t.css("opacity")===o)return void i._updateWidgetVisibility(t);t.animate({opacity:o},i._updateWidgetVisibility.bind(i,t))}})},o.prototype._onMouseMove=function(t,e){this._chart.model().lineBeingCreated()||this._updateOpacityState([t],!e)},t.exports=o}).call(e,i(195))},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){(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(213);o.visibilityProperty=new e,o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent),$('<div class="control-bar">').append($(i(489)).attr("class","move-left-button-control-bar")).append($(i(490)).attr("class","zoom-out-right-button-control-bar").css("fill","#8A8B8D")).append($(i(491)).attr("class","turn-button-control-bar")).append($(i(492)).attr("class","zoom-in-button-control-bar").css("fill","#8A8B8D")).append($(i(493)).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(494)).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._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"

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={3: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:"library",1:"objecttreedialog"}[t]||t)+"."+{0:"cec2791c5c9708b2d671",1:"3e1d74398fc01d2c7c7e",2:"8735d7b7f4b0e23dc4ac"}[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(168),n(802),n(803),n(26),n(754),n(976),n(64),n(72),n(30),n(977),n(978),n(184),n(979),n(980),n(70),n(520),n(981),n(982),n(514),n(983),n(984),t.exports=n(8)},,,,,,,,function(t,e,n){t.exports=n(9).default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var r,o;Object.defineProperty(e,"__esModule",{value:!0}),r=n(10),o=i(r),e.default=o.default},function(t,e,n){"use strict";function i(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 r(t){return t&&t.__esModule?t:{default:t}}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))}var u,c,h,f,d,p,g,m,y,v,b,_,w,x,k,S,M,D,T,C,P,O,E,N,L,A;Object.defineProperty(e,"__esModule",{value:!0}),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},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=n(11),f=r(h),d=n(12),p=r(d),g=n(13),m=r(g),y=n(15),v=r(y),b=n(18),_=r(b),w=n(19),x=r(w),k=n(20),S=r(k),M=n(21),D=r(M),T=n(22),C=r(T),P=n(23),O=n(16),E=r(O),N=n(17),L=i(N),A=function(t){function e(){var n,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=arguments[1];return s(this,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={3: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:"library",1:"objecttreedialog"}[t]||t)+"."+{0:"be34b1ef974d83562ad7",1:"3e1d74398fc01d2c7c7e",2:"8735d7b7f4b0e23dc4ac"}[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(168),n(802),n(803),n(26),n(754),n(976),n(64),n(72),n(30),n(977),n(978),n(184),n(979),n(980),n(70),n(520),n(981),n(982),n(514),n(983),n(984),t.exports=n(8)},,,,,,,,function(t,e,n){t.exports=n(9).default},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var r,o;Object.defineProperty(e,"__esModule",{value:!0}),r=n(10),o=i(r),e.default=o.default},function(t,e,n){"use strict";function i(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 r(t){return t&&t.__esModule?t:{default:t}}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))}var u,c,h,f,d,p,g,m,y,v,b,_,w,x,k,S,M,D,T,C,P,O,E,N,L,A;Object.defineProperty(e,"__esModule",{value:!0}),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},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=n(11),f=r(h),d=n(12),p=r(d),g=n(13),m=r(g),y=n(15),v=r(y),b=n(18),_=r(b),w=n(19),x=r(w),k=n(20),S=r(k),M=n(21),D=r(M),T=n(22),C=r(T),P=n(23),O=n(16),E=r(O),N=n(17),L=i(N),A=function(t){function e(){var n,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=arguments[1];return s(this,e),
n=a(this,t.call(this)),n.options=(0,P.transformOptions)(i),n.services={},n.logger=f.default,n.modules={},r&&!n.isInitialized&&n.init(i,r),n}return l(e,t),e.prototype.init=function(t,e){function n(t){if(t)return"function"==typeof t?new t:t}var i,r,o,s,a=this;return"function"==typeof t&&(e=t,t={}),t||(t={}),"v1"===t.compatibilityAPI?this.options=c({},(0,P.get)(),(0,P.transformOptions)(L.convertAPIOptions(t)),{}):"v1"===t.compatibilityJSON?this.options=c({},(0,P.get)(),(0,P.transformOptions)(L.convertJSONOptions(t)),{}):this.options=c({},(0,P.get)(),this.options,(0,P.transformOptions)(t)),e||(e=function(){}),this.options.isClone||(this.modules.logger?f.default.init(n(this.modules.logger),this.options):f.default.init(null,this.options),i=new _.default(this.options),this.store=new m.default(this.options.resources,this.options),r=this.services,r.logger=f.default,r.resourceStore=this.store,r.resourceStore.on("added removed",function(t,e){r.cacheConnector.save()}),r.languageUtils=i,r.pluralResolver=new x.default(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON}),r.interpolator=new S.default(this.options),r.backendConnector=new D.default(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))}),r.backendConnector.on("loaded",function(t){r.cacheConnector.save()}),r.cacheConnector=new C.default(n(this.modules.cache),r.resourceStore,r,this.options),r.cacheConnector.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))}),this.modules.languageDetector&&(r.languageDetector=n(this.modules.languageDetector),r.languageDetector.init(r,this.options.detection,this.options)),this.translator=new v.default(this.services,this.options),this.translator.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))})),o=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle"],o.forEach(function(t){a[t]=function(){return this.store[t].apply(this.store,arguments)}}),"v1"===this.options.compatibilityAPI&&L.appendBackwardsAPI(this),s=function(){a.changeLanguage(a.options.lng,function(t,n){a.emit("initialized",a.options),a.logger.log("initialized",a.options),e(t,n)})},this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),this},e.prototype.loadResources=function(t){var e,n=this;if(t||(t=function(){}),this.options.resources)t(null);else if(e=function(){var e,i;if(n.language&&"cimode"===n.language.toLowerCase())return{v:t()};e=[],i=function(t){n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){e.indexOf(t)<0&&e.push(t)})},i(n.language),n.options.preload&&n.options.preload.forEach(function(t){i(t)}),n.services.cacheConnector.load(e,n.options.ns,function(){n.services.backendConnector.load(e,n.options.ns,t)})}(), n=a(this,t.call(this)),n.options=(0,P.transformOptions)(i),n.services={},n.logger=f.default,n.modules={},r&&!n.isInitialized&&n.init(i,r),n}return l(e,t),e.prototype.init=function(t,e){function n(t){if(t)return"function"==typeof t?new t:t}var i,r,o,s,a=this;return"function"==typeof t&&(e=t,t={}),t||(t={}),"v1"===t.compatibilityAPI?this.options=c({},(0,P.get)(),(0,P.transformOptions)(L.convertAPIOptions(t)),{}):"v1"===t.compatibilityJSON?this.options=c({},(0,P.get)(),(0,P.transformOptions)(L.convertJSONOptions(t)),{}):this.options=c({},(0,P.get)(),this.options,(0,P.transformOptions)(t)),e||(e=function(){}),this.options.isClone||(this.modules.logger?f.default.init(n(this.modules.logger),this.options):f.default.init(null,this.options),i=new _.default(this.options),this.store=new m.default(this.options.resources,this.options),r=this.services,r.logger=f.default,r.resourceStore=this.store,r.resourceStore.on("added removed",function(t,e){r.cacheConnector.save()}),r.languageUtils=i,r.pluralResolver=new x.default(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON}),r.interpolator=new S.default(this.options),r.backendConnector=new D.default(n(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))}),r.backendConnector.on("loaded",function(t){r.cacheConnector.save()}),r.cacheConnector=new C.default(n(this.modules.cache),r.resourceStore,r,this.options),r.cacheConnector.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))}),this.modules.languageDetector&&(r.languageDetector=n(this.modules.languageDetector),r.languageDetector.init(r,this.options.detection,this.options)),this.translator=new v.default(this.services,this.options),this.translator.on("*",function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];a.emit.apply(a,[t].concat(n))})),o=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle"],o.forEach(function(t){a[t]=function(){return this.store[t].apply(this.store,arguments)}}),"v1"===this.options.compatibilityAPI&&L.appendBackwardsAPI(this),s=function(){a.changeLanguage(a.options.lng,function(t,n){a.emit("initialized",a.options),a.logger.log("initialized",a.options),e(t,n)})},this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),this},e.prototype.loadResources=function(t){var e,n=this;if(t||(t=function(){}),this.options.resources)t(null);else if(e=function(){var e,i;if(n.language&&"cimode"===n.language.toLowerCase())return{v:t()};e=[],i=function(t){n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){e.indexOf(t)<0&&e.push(t)})},i(n.language),n.options.preload&&n.options.preload.forEach(function(t){i(t)}),n.services.cacheConnector.load(e,n.options.ns,function(){n.services.backendConnector.load(e,n.options.ns,t)})}(),
"object"===(void 0===e?"undefined":u(e)))return e.v},e.prototype.reloadResources=function(t,e){t||(t=this.languages),e||(e=this.options.ns),this.services.backendConnector.reload(t,e)},e.prototype.use=function(t){return"backend"===t.type&&(this.modules.backend=t),"cache"===t.type&&(this.modules.cache=t),("logger"===t.type||t.log&&t.warn&&t.warn)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"postProcessor"===t.type&&E.default.addPostProcessor(t),this},e.prototype.changeLanguage=function(t,e){var n=this,i=function(i){t&&(n.emit("languageChanged",t),n.logger.log("languageChanged",t)),e&&e(i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.t.apply(n,e)})};!t&&this.services.languageDetector&&(t=this.services.languageDetector.detect()),t&&(this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.translator.changeLanguage(t),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage(t)),this.loadResources(function(t){i(t)})},e.prototype.getFixedT=function(t,e){var n=this,i=function t(e,i){return i=i||{},i.lng=i.lng||t.lng,i.ns=i.ns||t.ns,n.t(e,i)};return i.lng=t,i.ns=e,i},e.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},e.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},e.prototype.setDefaultNamespace=function(t){this.options.defaultNS=t},e.prototype.loadNamespaces=function(t,e){var n=this;if(!this.options.ns)return e&&e();"string"==typeof t&&(t=[t]),t.forEach(function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)}),this.loadResources(e)},e.prototype.loadLanguages=function(t,e){var n,i;if("string"==typeof t&&(t=[t]),n=this.options.preload||[],i=t.filter(function(t){return n.indexOf(t)<0}),!i.length)return e();this.options.preload=n.concat(i),this.loadResources(e)},e.prototype.dir=function(t){return t||(t=this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl"},e.prototype.createInstance=function(){return new e(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],arguments[1])},e.prototype.cloneInstance=function(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=arguments[1],r=new e(c({},n,this.options,{isClone:!0}),i);return["store","translator","services","language"].forEach(function(e){r[e]=t[e]}),r},e}(p.default),e.default=new A},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 "object"===(void 0===e?"undefined":u(e)))return e.v},e.prototype.reloadResources=function(t,e){t||(t=this.languages),e||(e=this.options.ns),this.services.backendConnector.reload(t,e)},e.prototype.use=function(t){return"backend"===t.type&&(this.modules.backend=t),"cache"===t.type&&(this.modules.cache=t),("logger"===t.type||t.log&&t.warn&&t.warn)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"postProcessor"===t.type&&E.default.addPostProcessor(t),this},e.prototype.changeLanguage=function(t,e){var n=this,i=function(i){t&&(n.emit("languageChanged",t),n.logger.log("languageChanged",t)),e&&e(i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.t.apply(n,e)})};!t&&this.services.languageDetector&&(t=this.services.languageDetector.detect()),t&&(this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.translator.changeLanguage(t),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage(t)),this.loadResources(function(t){i(t)})},e.prototype.getFixedT=function(t,e){var n=this,i=function t(e,i){return i=i||{},i.lng=i.lng||t.lng,i.ns=i.ns||t.ns,n.t(e,i)};return i.lng=t,i.ns=e,i},e.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},e.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},e.prototype.setDefaultNamespace=function(t){this.options.defaultNS=t},e.prototype.loadNamespaces=function(t,e){var n=this;if(!this.options.ns)return e&&e();"string"==typeof t&&(t=[t]),t.forEach(function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)}),this.loadResources(e)},e.prototype.loadLanguages=function(t,e){var n,i;if("string"==typeof t&&(t=[t]),n=this.options.preload||[],i=t.filter(function(t){return n.indexOf(t)<0}),!i.length)return e();this.options.preload=n.concat(i),this.loadResources(e)},e.prototype.dir=function(t){return t||(t=this.language),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr":"rtl"},e.prototype.createInstance=function(){return new e(arguments.length<=0||void 0===arguments[0]?{}:arguments[0],arguments[1])},e.prototype.cloneInstance=function(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=arguments[1],r=new e(c({},n,this.options,{isClone:!0}),i);return["store","translator","services","language"].forEach(function(e){r[e]=t[e]}),r},e}(p.default),e.default=new A},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){"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,n){"use strict";function i(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 r(t){return t&&t.__esModule?t:{default:t}}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) ;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){"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,n){"use strict";function i(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 r(t){return t&&t.__esModule?t:{default:t}}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)

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.fdf3134341551f124cdca28c3e01e727.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 b,e=/\+/g,d=/([^&=]+)=?([^&]*)/g,h=function(i){return decodeURIComponent(i.replace(e," ")).replace(/<\/?[^>]+(>|$)/g,"")},f=function(){var j=location.href;var i=j.indexOf("#");if(i>=0){return j.substring(i+1)}else{throw"Unexpected use of this page"}}(),a={};while(b=d.exec(f)){a[h(b[1])]=h(b[2])}var c=window.parent[a.uid];for(var g in c){if(g=="tradingController"){window.tradingController=c[g]}else{if(g!="datafeed"&&g!="customFormatters"){a[g]=JSON.stringify(c[g])}}}return a})();window.language=urlParams.locale;window.actualLanguage=urlParams.locale;</script><script src="bundles/vendors.6aee73007c0a7e84f2ba.js"></script><script src="bundles/library.cec2791c5c9708b2d671.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.fdf3134341551f124cdca28c3e01e727.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 b,e=/\+/g,d=/([^&=]+)=?([^&]*)/g,h=function(i){return decodeURIComponent(i.replace(e," ")).replace(/<\/?[^>]+(>|$)/g,"")},f=function(){var j=location.href;var i=j.indexOf("#");if(i>=0){return j.substring(i+1)}else{throw"Unexpected use of this page"}}(),a={};while(b=d.exec(f)){a[h(b[1])]=h(b[2])}var c=window.parent[a.uid];for(var g in c){if(g=="tradingController"){window.tradingController=c[g]}else{if(g!="datafeed"&&g!="customFormatters"){a[g]=JSON.stringify(c[g])}}}return a})();window.language=urlParams.locale;window.actualLanguage=urlParams.locale;</script><script src="bundles/vendors.ea89b46d8a5b9bee0e4e.js"></script><script src="bundles/library.be34b1ef974d83562ad7.js"></script></body></html>