webpackJsonp([17,27],{357:function(t,e,i){"use strict";(function(e){function o(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}var n=i(0).LineDataSource,a=i(34).Study,s=i(63).Series,r=i(28).DataSource,l=i(31),c=i(847).bindPopupMenu,p=i(874),u=i(883).TVOldDialogs,d=i(39).trackEvent,h=i(73).isLineTool;i(845),o.prototype.hide=function(t){u.destroy(this._dialogTitle,{undoChanges:!!t})},o.prototype._onDestroy=function(t,e){var i,o,n=(e||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog"),n?(i=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this._model.undoToCheckpoint(i):this._source.hasAlert.value()&&(o=this._source,setTimeout(function(){o.localAndServerAlersMismatch&&o.synchronizeAlert(!0)})),this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},o.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},o.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},o.prototype.switchTab=function(t,e){var i,o;if(this._tabs)return i=null,t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,function(e,o){if(o.name===t)return i=o,!1}),"object"==typeof t&&$.each(this._tabs,function(e,o){if(t===o||$(o.labelObject).is(t)||$(o.wrapperObject).is(t))return i=o,!1}),i||(i=this._tabs[~~t]),!!i&&($.each(this._tabs,function(t,e){var o=e===i;$(e.wrapperObject)[o?"show":"hide"](),$(e.labelObject)[o?"addClass":"removeClass"]("active")}),e&&(o=this.activeTabSettingsName())&&TVSettings.setValue(o,i.name),this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0)},o.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),o=i.width();e.css({height:$(window).height()/1.4,overflow:"auto"}),i.css("width",o+20),t.isScrollable=!0},o.prototype.appendToTab=function(t,e,i,o,n,a){var s,r;$(t).is("table")&&!$(t).find("tr").size()||(this._tabs||(this._tabs=[]),$.each(this._tabs,function(t,i){if(i.name===e)return s=t,!1}),void 0===s&&(this._tabs.push({name:e,localizedName:$.t(e),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!n,callback:n?a||function(){}:null}),s=this._tabs.length-1),r=this._tabs[s],r.objects=r.objects.add(t),r.displayPriority=Math.max(r.displayPriority||0,i||0),r.defaultOpen=Math.max(r.defaultOpen||0,o||0))},o.prototype.insertTabs=function(){function t(t){a&&a===t.name&&(t.defaultOpen=Math.max(~~t.defaultOpen,p.TabOpenFrom.UserSave)),(!o||~~o.defaultOpen<~~t.defaultOpen)&&(o=t),t.labelObject=$('').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.on("mousedown",function(t){function e(t){var e=5;return Math.abs(n-t.pageX)>e||Math.abs(a-t.pageY)>e}function o(t){s=s||e(t)}var n=t.pageX,a=t.pageY,s=!1,r=this;$(r).on("mousemove",o),$(r).one("mouseup",function(){s||i.switchTab(r,!0),$(r).off("mousemove",o)})});var e=$('
');t.wrapperObject=$().add(e), t.objects.each(function(i,o){var n=$(o);n.is("table")?(n.data("layout-separated")&&(t.wrapperObject=t.wrapperObject.add('
').add(e=$('
')),n.removeData("layout-separated")),e.append(n),n.children("tbody").each(function(i,n){if(0!==i&&$(n).data("layout-separated")){t.wrapperObject=t.wrapperObject.add('
').add(e=$('
'));var a=$(o).clone(!0,!1).appendTo(e);a.children().remove(),a.append(n),$(n).removeData("layout-separated")}})):e.append(n)}),t.wrapperObject.appendTo(i._container)}function e(t){t.labelObject=$('').text(t.localizedName).appendTo(i._tabContainer),t.labelObject.bind("click",t.callback)}var i,o,n,a;this._tabs&&(this._tabs.sort(function(t,e){return(e.displayPriority||0)-(t.displayPriority||0)}),i=this,o=null,n=this.activeTabSettingsName(),n&&(a=TVSettings.getValue(n)),$.each(this._tabs,function(i,o){o.isButton?e(o):t(o)}),this.switchTab(o))},o.prototype.activeTabSettingsName=function(){var t=this._source;if(t)return t instanceof s?"properties_dialog.active_tab.chart":t instanceof n?"properties_dialog.active_tab.drawing":t instanceof a?"properties_dialog.active_tab.study":void 0},o.prototype.show=function(t){function o(t,e){C.hide(!!e)}var f,v,g,_,m,y,b,T,C,w,x,k,D,P,S,M,O,I,V,E,N,A,F,B,z,L,R;if(e.enabled("property_pages")&&(f=i(693),t=t||{},v=t.onWidget||!1,TradingView.isInherited(this._source.constructor,s)&&d("GUI","Series Properties"),TradingView.isInherited(this._source.constructor,a)&&(g=!this._source.isPine()||this._source.isStandardPine()?this._source.metaInfo().description:"Custom Pine",d("GUI","Study Properties",g)),h(this._source)&&d("GUI","Drawing Properties",this._source.name()),TradingView.isInherited(this._source.constructor,r)&&this._model.setSelectedSource(this._source),_=f.createStudyStrategyPropertyPage(this._source,this._model),m=f.createInputsPropertyPage(this._source,this._model),y=f.createStylesPropertyPage(this._source,this._model),b=f.createVisibilitiesPropertyPage(this._source,this._model),T=f.createDisplayPropertyPage(this._source,this._model),m&&!m.widget().is(":empty")||y||_))return C=this,w=null!==m,x=this._source.title(),k=t.ownerDocument||this._model._chartWidget.widget().prop("ownerDocument"),D=u.createDialog(x,{hideTitle:!0,dragHandle:".properties-tabs",ownerDocument:k}),P=D.find("._tv-dialog-content"),S=$('
').appendTo(P),O=[],I=400,this._tabs=O,this._dialog=D,this._dialogTitle=x,this._container=P,this._tabContainer=S,this._undoCheckpointOnShow=this._model.createUndoCheckpoint(),D.on("destroy",function(t,e){var e=e||{};M&&(e.undoChanges?M.restore():M.applyTheme()),m&&m.destroy(),_&&_.destroy(),y&&y.destroy(),T&&T.destroy(),b&&b.destroy(),$("select",P).each(function(){$(this).selectbox("detach")}),C._onDestroy(t,e)}),t.selectScales&&y.setScalesOpenTab&&y.setScalesOpenTab(),t.selectTmz&&y.setTmzOpenTab&&y.setTmzOpenTab(), !this._model.readOnly()&&_&&_.widget().each(function(t,e){var i,o,n=+$(e).data("layout-tab-priority");isNaN(n)&&(n=p.TabPriority.Properties),i=~~$(e).data("layout-tab-open"),o=$(e).data("layout-tab"),void 0===o&&(o=p.TabNames.properties),C.appendToTab(e,o,n,i)}),this._model.readOnly()||!w||m.widget().is(":empty")||m.widget().each(function(t,e){var o,n,a=i(691),s=m instanceof a,r=+$(e).data("layout-tab-priority");TradingView.isNaN(r)&&(r=s?p.TabPriority.Coordinates:p.TabPriority.Inputs),o=~~$(e).data("layout-tab-open"),n=$(e).data("layout-tab"),void 0===n&&(n=s?p.TabNames.coordinates:p.TabNames.inputs),C.appendToTab(e,n,r,o)}),y&&y.widget().each(function(t,e){var o,n,a,s=+$(e).data("layout-tab-priority");TradingView.isNaN(s)&&(s=p.TabPriority.Style),o=~~$(e).data("layout-tab-open"),n=i(825),!o&&y instanceof n&&(o=p.TabOpenFrom.Default),a=$(e).data("layout-tab"),void 0===a&&(a=p.TabNames.style),C.appendToTab(e,a,s,o)}),T&&T.widget().each(function(t,e){var i,o,n=+$(e).data("layout-tab-priority");TradingView.isNaN(n)&&(n=p.TabPriority.Display),i=~~$(e).data("layout-tab-open"),o=$(e).data("layout-tab"),void 0===o&&(o=p.TabNames.properties),C.appendToTab(e,o,n,i)}),b&&b.widget().each(function(t,e){C.appendToTab(e,p.TabNames.visibility,p.TabPriority.Display,!1)}),N=this._source instanceof a&&!!this._source.metaInfo().pine,N&&this._source.metaInfo(),this.insertTabs(),this._helpItemRequired()&&this._createHelp(),A=110,$(".js-dialog").each(function(){var t=parseInt($(this).css("z-index"),10);t>A&&(A=t)}),D.css("z-index",A),V=$('
').appendTo(P),E=$('
').appendTo(V),F=function(){function t(e){e._childs&&e._childs.length&&$.each(e._childs,function(i,o){"percentage"===o?e.percentage.listeners().fire(e.percentage):t(e[o])})}var e,i,o=[];y&&"function"==typeof y.defaultProperties&&(o=o.concat(y.defaultProperties())),m&&"function"==typeof m.defaultProperties&&(o=o.concat(m.defaultProperties())),0===o.length&&C._source.properties?o=[C._source.properties()]:C._source._sessionsStudy&&(o=o.concat(C._source._sessionsStudy.properties())),o.length&&(e=C._source.priceScale().mode(),$.each(o,function(e,i){C._model.restoreFactoryDefaults(i),C._source.calcIsActualSymbol&&C._source.calcIsActualSymbol(),t(i)}),i=C._source.priceScale(),i&&i.modeChanged().fire(e,i.mode()),C._source.properties().minTick&&C._source.properties().minTick.listeners().fire(C._source.properties().minTick),C._source.properties().precision&&C._source.properties().precision.listeners().fire(C._source.properties().precision),m&&m.loadData(),_&&_.loadData(),y.onResoreDefaults&&y.onResoreDefaults(),y&&y.loadData(),b&&b.loadData())},B=function(){b&&b.loadData(),m&&m.loadData()},(!v||window.is_authenticated)&&y&&"function"==typeof y.createTemplateButton&&e.enabled("linetoolpropertieswidget_template_button")?(M&&E[0].appendChild(M.domNode),C._templateButton=y.createTemplateButton({popupZIndex:A,defaultsCallback:F,loadTemplateCallback:B }).addClass("tv-left").appendTo(E)):TradingView.isInherited(this._source.constructor,a)?(z=[{title:$.t("Reset Settings"),action:F},{title:$.t("Save As Default"),action:function(){C._source.properties().saveDefaults()}}],L=$(''+$.t("Defaults")+''),L.on("click",function(t){t.preventDefault();var e=$(this);e.is(".active")||e.trigger("button-popup",[z,!0])}).appendTo(E),c(L,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0,zIndex:A})):$(''+$.t("Defaults")+"").appendTo(E).click(F),$(''+$.t("OK")+"").appendTo(E).click(function(){C.hide()}),$(''+$.t("Cancel")+"").appendTo(E).on("click",function(t){o(t,!0)}),D.find("._tv-dialog-title a").on("click",o),$(window).bind("keyup.hidePropertyDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(C._templateButton&&C._templateButton.trigger("hide-popup"),C.hide())}),$("select",P).each(function(){var t=$(this),e="tv-select-container dialog";t.hasClass("tv-select-container-fontsize")&&(e+=" tv-select-container-fontsize"),t.selectbox({speed:100,classHolder:e})}),$('input[type="text"]',P).addClass("tv-text-input inset dialog"),$("input.ticker",P).TVTicker(),D.css("min-width",I+"px"),u.applyHandlers(D,t),R={top:($(window).height()-D.height())/2,left:($(window).width()-D.width())/2},y&&"function"==typeof y.dialogPosition&&(R=y.dialogPosition(R,D)||R),u.positionDialog(D,R),window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide(),l.emit("edit_object_dialog",{objectType:this._source===this._model.mainSeries()?"mainSeries":this._source instanceof n?"drawing":this._source instanceof a?"study":"other",scriptTitle:this._source.title()}),D},o.prototype._helpItemRequired=function(){return this._source._metaInfo&&!!this._source._metaInfo.helpURL},o.prototype._createHelp=function(){var t=$('');t.attr("href",this._source._metaInfo.helpURL),this._tabContainer.prepend(t)},t.exports=o}).call(e,i(5))},691:function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e),this._linetool=i,this.prepareLayout()}var n=i(823),a=n.PropertyPage,s=n.GreateTransformer,r=n.LessTransformer,l=n.ToIntTransformer,c=n.SimpleStringBinder;i(845),inherit(o,a),o.BarIndexPastLimit=-5e4,o.BarIndexFutureLimit=15e3,o.prototype.bindBarIndex=function(t,e,i,n){var a=[l(t.value()),s(o.BarIndexPastLimit),r(o.BarIndexFutureLimit)];this.bindControl(this.createStringBinder(e,t,a,!0,i,n))},o.prototype.createPriceEditor=function(t){var e,i,o,n=this._linetool,a=n.ownerSource().formatter(),s=function(t){return a.format(t)},r=function(t){var e=a.parse(t);if(e.res)return e.price?e.price:e.value},l=$("");return l.TVTicker({step:a._minMove/a._priceScale||1,formatter:s,parser:r}),t&&(e=[function(e){var i=r(e);return void 0===i?t.value():i}],i="Change "+n.title()+" point price",o=this.createStringBinder(l,t,e,!1,this.model(),i), o.addFormatter(function(t){return a.format(t)}),this.bindControl(o)),l},o.prototype._createPointRow=function(t,e,i){var o,n,a,s,r,l=$(""),c=$("");return c.html($.t("Price")+i),c.appendTo(l),o=$(""),o.appendTo(l),n=this.createPriceEditor(e.price),n.appendTo(o),a=$(""),a.html($.t("Bar #")),a.appendTo(l),s=$(""),s.appendTo(l),r=$(""),r.appendTo(s),r.addClass("ticker"),this.bindBarIndex(e.bar,r,this.model(),"Change "+this._linetool.title()+" point bar index"),l},o.prototype.prepareLayoutForTable=function(t){var e,i,o,n,a,s=this._linetool.points(),r=s.length;for(e=0;e1?" "+(e+1):"",a=this._createPointRow(i,o,n),a.appendTo(t))},o.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},o.prototype.widget=function(){return this._table},o.prototype.createStringBinder=function(t,e,i,o,n,a){return new c(t,e,i,o,n,a)},t.exports=o},693:function(t,e,i){"use strict";e.createInputsPropertyPage=function(t,e){var i=t.getInputsPropertyPage();return null==i?null:new i(t.properties(),e,t)},e.createStudyStrategyPropertyPage=function(t,e){var i=t.getStrategyPropertyPage();return null==i?null:new i(t.properties(),e,t)},e.createStylesPropertyPage=function(t,e){var i=t.getStylesPropertyPage();return null==i?null:new i(t.properties(),e,t)},e.createDisplayPropertyPage=function(t,e){var i=t.getDisplayPropertyPage();return null==i?null:new i(t.properties(),e,t)},e.createVisibilitiesPropertyPage=function(t,e){var i=t.getVisibilitiesPropertyPage();return null==i?null:new i(t.properties(),e,t)},e.hasInputsPropertyPage=function(t){return null!==t.getInputsPropertyPage()},e.hasStylesPropertyPage=function(t){return null!==t.getStylesPropertyPage()}},823:function(t,e,i){"use strict";(function(t){function o(t,e){return'"}function n(t,e){this._model=e,this._bindings=[],this._property=t,this.supportThemeSwitcher=!1}function a(t){return t.toUpperCase()}function s(t){return function(e){return et?t:e}}function l(t){return function(e){var i=parseInt(e,10);return E(i)?t:i}}function c(t){var e=new L;return function(i){var o=e.parse(i);return E(o)?t:o}}function p(t){var e=new L;return function(i){var o=e.parse(i);return E(o)?t():o}}function u(t,e){var i=new R(e);return function(e){var o=i.format(e);return E(o)?t:o}}function d(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function h(t){return function(e){return 0===e.length?t:e}}function f(t,e){return function(i){var o=t();return i===e.value()&&o&&(o.ticker||o.full_name)?o.ticker||o.full_name:i}}function v(t,e,i,o,n,a,s){U.call(this,t,e,o,n,a),this._transformFunction=i,this._setter=s,this._attachToControl(t,o)}function g(t,e,i,o,n){ v.call(this,t,e,c(e.value()),i,o,n),this.addFormatter(function(t){return(new L).format(t)})}function _(t,e,i,o,n,a){this._subControlIds=e,U.call(this,t,i,o,n,a),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function m(t,e,i,o,n,a,s){this._model=o,this._mainSeries=a,this._toIntTransformer=l(s),this._disabled=!1,U.call(this,t,e,i,o,n);var r=this;i&&t.change(function(){r.setValueToProperty(r.value())}),this._mainSeries.dataEvents().barReceived().subscribe(this,function(){r.setValue(this.property().value())})}function y(t,e,i,o,n,a,s){U.call(this,t,e,i,o,n),this._transform=a,i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e),this.setValue(e)}.bind(this)),s&&(s.subscribe(this,this._updateDisplayedSymbol),this._updateDelegate=s)}function b(t,e,i,o,n,a,s,r){U.call(this,t,e,o,n,a),this._transformFunction=i,this._propertyChangedHook=r,this._setter=s;var l=this;o&&t.change(function(){l._setter?l._setter.call(l,l.value()):l.setValueToProperty(l.value())})}function T(t,e){U.call(this,t,e)}function C(t,e,i,o,n,a){if(!t.is(":checkbox, :radio"))return new x(t,e,i,o,n);U.call(this,t,e,i,o,n),this._setter=a;var s=this;i&&t.change(function(){s._setter?s._setter.call(s,s.value()):s.setValueToProperty(s.value())})}function w(t,e,i,o,n,a){U.call(this,t,e,i,o,n),this._inverted=!0===a}function x(t,e,i,o,n){U.call(this,t,e,i,o,n);var a=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");a.setValueToProperty(t)})}function k(t,e,i,o,n,a){var s,r;s=t.is("input")?t:t.find("input"),U.call(this,s,e,i,o,n),this._transparencyProperty=a,this.applyOldTransparency(),r=this,i&&s.change(function(){r.setValueToProperty(r.value())})}function D(e,i,o,n,a,s){function r(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||il._transformers[1]&&$(a[1]).val(l._transformers[1]),-1!==$.inArray(t.keyCode,[46,8,9,27,13,110,190])||65===t.keyCode&&!0===t.ctrlKey||67===t.keyCode&&!0===t.ctrlKey||88===t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(a[0]).on("keyup",function(t){parseInt($(this).val())l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(a[1]).val())&&$(this).val(a[1].val()),l._control.slider("values",0,$(this).val()),O.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(a[1]).on("keyup",function(t){parseInt($(this).val())l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())<$(a[0]).val()&&$(this).val(a[0].val()),l._control.slider("values",1,$(this).val()),O.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,O.prototype.propertyChanged),this._propTo.listeners().subscribe(this,O.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){a&&($(a[0]).val(l._control.slider("values",0)),$(a[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){a&&($(a[0]).val(l._control.slider("values",0)),$(a[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)}})}function I(t,e,i,o,n,a){U.call(this,t,e,i,o,n),this._separator=a||" ";var s=this;i&&t.change(function(){s.setValueToProperty(s.value())})}var V,E,N,A,F,B,z,L,R,H,j,U,W;i(866),V=i(7).ensureNotNull,E=i(83).isNaN,N=i(24),A=N.rgba,F=N.rgbaToString,B=N.parseRgb,z=i(72).TimePointIndexSearchMode,L=i(105).NumericFormatter,R=i(193).LimitedPrecisionNumericFormatter,H=i(29), j=i(829).addColorPicker,U=i(317).Binding,W=i(4).getLogger("Chart.PropertyPage"),n.prototype.model=function(){return this._model},n.prototype.bindControl=function(t){return this._bindings.push(t),t},n.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},n.prototype.loadData=function(){var t,e,i;for(t=0;t',t).slider({max:4,min:1,step:1})},n.prototype.createColorPicker=function(t){return j(null,t)},n.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i).addClass("tv-control-input")},n.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},n.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},n.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},n.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},n.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="",$(n)},n.prototype.createPrecisionEditor=function(){var t,e="",$(e)},n.prototype.createLabeledCell=function(t,e,i){var o,n,a,s,r=null ;return"number"==typeof t.valueOf()?(r=t,o=e,n=i):(o=t,n=e),o+="",a=this._labelToId(o),s=$(""),$("