You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
36 KiB

webpackJsonp([1],{1040:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm3.34 2.123l3.66 3.66 3.66-3.66 1.217 1.22-3.66 3.658 3.66 3.66-1.22 1.22-3.658-3.66-3.66 3.66-1.22-1.22 3.66-3.66-3.66-3.66z"/></svg>'},1148:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zM6 2v4H2v1h4v4h1V7h4V6H7V2H6z"/></svg>'},1149:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zm1-6v1h9V6H2z"/></svg>'},1150:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2.69c3.018 0 5.172 3.232 5.172 4.31 0 1.077-2.154 4.31-5.172 4.31S1.828 8.08 1.828 7c0-1.077 2.154-4.31 5.172-4.31zm0 1.508C5.49 4.198 4.198 5.49 4.198 7S5.49 9.802 7 9.802 9.802 8.51 9.802 7 8.51 4.198 7 4.198zm0 1.68c.646 0 1.12.476 1.12 1.122 0 .646-.473 1.12-1.12 1.12-.646 0-1.12-.473-1.12-1.12 0-.646.473-1.12 1.12-1.12z"/></svg>'},1151:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm6.086 1.803H5.52v1.332c.416.1.805.258 1.166.48l.944-.935 1.297 1.297-.943.943c.215.35.38.748.48 1.164H9.8v1.837H8.463c-.1.417-.257.806-.48 1.167l.935.944-1.296 1.298-.944-.943c-.35.215-.747.38-1.164.48v1.332H3.677v-1.33c-.415-.102-.804-.258-1.165-.482l-.943.936-1.298-1.296.94-.945c-.216-.35-.38-.748-.482-1.165H-.597v-1.835H.737c.1-.416.257-.805.48-1.166l-.935-.944 1.296-1.297.944.943c.35-.215.747-.38 1.164-.48zm.912 3.053c-1.188 0-2.143.963-2.143 2.143 0 1.187.963 2.143 2.143 2.143 1.18 0 2.14-.963 2.145-2.145 0-1.188-.966-2.144-2.145-2.144z"/></svg>'},1152:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2l2.8 3H8v6H6V5H4.2z"/></svg>'},1153:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M14 14V0H0v14zm-7-2L4.2 9H6V3h2v6h1.8z"/></svg>'},1154:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 1l2.8 3H8v2.5H6V4H4.2zM6 7.5h2V10h1.8L7 13l-2.8-3H6z"/></svg>'},1155:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0H0zm6 1.5h2V4h1.8L7 7l2.8 3H8v2.5H6V10H4.2L7 7 4.2 4H6V1.5z"/></svg>'},1178:function(t,e){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){
for(var e=this;e&&1===e.nodeType;e=e.parentNode)if(e.matches(t))return e;return null})},1179:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M2 7h10"/></svg>'},1180:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 18" width="14" height="18"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path d="M1 10a6 6 0 1 0 6-6H3"/><path d="M5 1L2.5 4 5 7"/></g></svg>'},1181:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 2v10M2 7h10"/></svg>'},1182:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6.5 1.5l5 5.5-5 5.5M3 4l2.5 3L3 10"/></svg>'},1183:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 7" width="9" height="7"><path fill="currentColor" d="M.5 3.5L4 0v3h5v1H4v3z"/></svg>'},1184:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 7" width="9" height="7"><path fill="currentColor" d="M8.5 3.5L5 0v3H0v1h5v3z"/></svg>'},1185:function(t,e){},814:function(t,e,i){"use strict";(function(t){function s(t,e,i,s){var n,o;this._options=Object.assign({},h,s),this._model=e,this._paneWidget=t,this._chart=t._chart,this.$el=$(document.createElement("div")).addClass("pane-legend"),this._itemsBinding=[],this._mouseEventHandlers=[],this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showBarChange.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showOnlyPriceSource.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout),this._model.mainSeries().properties().style.listeners().subscribe(this,this.updateLayout),n=this._chart.properties().scalesProperties.textColor,n.listeners().subscribe(this,function(t){this.$el.css("color",t.value())}),this.$el.css("color",n.value()),o=this._chart.properties().paneProperties.legendProperties.showLegend,o.subscribe(this,this.updateLayout),this.updateLayout()}var n=(i(34).Study,i(39).trackEvent),o=(i(4).getLogger("Chart.LegendWidget"),i(29)),r=i(197).showEditObjectDialog,a=i(38).IS_RTL,l=i(110).MouseEventHandler,h={contextMenuEnabled:!0,sourceSelectionEnabled:!0,symbolMarkerEnabled:!1};s.prototype.destroy=function(){this._removeMouseEventHandlers(),
this._chart.properties().paneProperties.legendProperties.showLegend.unsubscribeAll(this),this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().unsubscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().unsubscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().unsubscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showBarChange.listeners().unsubscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showOnlyPriceSource.listeners().unsubscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().unsubscribe(this,this.updateLayout),this._model.mainSeries().properties().style.listeners().unsubscribe(this,this.updateLayout)},s.prototype.contextMenuEvent=function(t,e){if(!this._model.chartModel().readOnly()&&this._options.contextMenuEnabled){var i=e.source;this._paneWidget.showContextMenuForSource(i,t)}},s.prototype._removeMouseEventHandlers=function(){this._mouseEventHandlers.forEach(function(t){t.destroy()}),this._mouseEventHandlers=[]},s.prototype.updateLayout=function(){var e,s,n,o,r,a,h,d,u,p,c;if(this._removeMouseEventHandlers(),this._itemsBinding.length=0,this.$el.find(".apply-common-tooltip").trigger("mouseleave"),this.$el.empty(),(e=this._paneWidget.state())&&this._model){for(s={showStudyTitles:this._model.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value(),showLegend:this._model.model().properties().paneProperties.legendProperties.showLegend.value()},n=this._model.mainSeries(),o=e.orderedSources().slice(),r=o.indexOf(n),r>-1&&(o.splice(r,1),o.push(n)),a=o.length-1;a>=0;a--)h=o[a],(d=h.statusView())&&(!(u=h===n)||s.showSeriesTitle||s.showSeriesOHLC||s.showStudyTitles||s.showStudyValues)&&(u&&t.enabled("fundamental_widget")||(s.showLegend||!u?(u||s.showStudyTitles||s.showStudyValues)&&s.showLegend&&(p=$("<div>").addClass("pane-legend-line pane-legend-wrap"),this._options.sourceSelectionEnabled||p.addClass("legend-selection-disabled"),p.appendTo(this.$el),p.source=h,u?this._chartHasStudies()?(c=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Hide")+'"></a>').append($(i(1149)).attr({class:"expand"})),p.addClass("main").append(c.on("click touchend",this.toggleTitles.bind(this)))):p.addClass("pane-legend-line--without-child-studies"):p.addClass("study"),h.properties().visible.value()||p.addClass("disabled"),this._generateItemsForRow(p,d,s),this._mouseEventHandlers.push(new l(p,this,!0))):this.$el.find(".expand-line").length||(p=$("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line"),
this._options.sourceSelectionEnabled||p.addClass("legend-selection-disabled"),p.appendTo(this.$el),this._chartHasStudies()?(c=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Show")+'"></a>').append($(i(1148)).attr({class:"expand closed"})),p.append(c.on("click touchend",this.toggleTitles.bind(this)))):p.addClass("pane-legend-line--without-child-studies"),p.source=h,h.properties().visible.value()||p.addClass("disabled"),s={showStudyTitles:!1,showSeriesTitle:s.showSeriesTitle,showSeriesOHLC:s.showSeriesOHLC,showStudyValues:!1},this._generateItemsForRow(p,d,s),this._mouseEventHandlers.push(new l(p,this,!0)),this.update())));this.update()}},s.prototype._chartHasStudies=function(){return this._model.model().allStudies().some(function(t){return t.statusView()})},s.prototype._generateItemsForRow=function(e,s,n){var o,r,l,h,d,u,p,c,_,v,m,g=e.source,b=this,y=g===this._model.mainSeries();if((y&&n.showSeriesTitle||!y&&n.showStudyTitles)&&(r=$("<span>"),r.addClass("pane-legend-line apply-overflow-tooltip"),this._options.contextMenuEnabled&&!this._chart.readOnly()||r.addClass("no-context-menu"),this._options.sourceSelectionEnabled||r.addClass("legend-selection-disabled"),y&&r.addClass("main"),g.properties().visible.value()||r.addClass("disabled"),r.css({"font-weight":s.bold()?"bold":"normal","font-size":s.size()}),this._options.contextMenuEnabled&&r.click(function(t){b.contextMenuEvent(t,e)}),r.appendTo(e),this._itemsBinding.push({value:s,cell:r,source:e.source}),!this._chart.readOnly()&&g.userEditEnabled()&&t.enabled("edit_buttons_in_legend")&&(o=$('<span class="pane-legend-icon-container">'),a||o.appendTo(e),!y&&t.enabled("show_hide_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').append($(i(1150)).attr({width:14,height:14})).appendTo(o).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,g)),!y&&t.enabled("property_pages")&&t.enabled("format_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').append($(i(1151)).attr({width:14,height:14})).appendTo(o).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,g)),!y&&t.enabled("delete_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+$.t("Delete")+'">').append($(i(1040)).attr({width:14,height:14})).appendTo(o).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,g)))),l=g.legendView(),this.isDataWindowValuesVisible(l)&&l.isValuesVisible()){for(h=[],d=[],u=$('<div class="pane-legend-item-value-container">'),this._options.contextMenuEnabled||u.addClass("no-context-menu"),this._options.sourceSelectionEnabled||u.addClass("legend-selection-disabled"),p=0;p<l.items().length;p++)c=$("<span class='pane-legend-item-value-wrap'>").appendTo(u),_=y?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(c):null,v=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(c),y&&(_.addClass("pane-legend-item-value-title__main"),
v.addClass("pane-legend-item-value__main")),g.properties().visible.value()||(v.addClass("disabled"),_&&_.addClass("disabled")),h.push(v),_&&d.push(_);m=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(u.appendTo(e)),this._itemsBinding.push({value:l,cell:h,titleCells:d.length?d:null,source:g,additional:m})}o&&a&&o.appendTo(e)},s.prototype.isDataWindowValuesVisible=function(t){return this._chart.onWidget()?!!t&&!this._chart.isSmall():!!t},s.prototype._generateItemsForRow._onShowhideClick=function(t){this._model.setProperty(t.properties().visible,!t.properties().visible.value(),"Show/Hide "+t.title())},s.prototype._generateItemsForRow._onFormatClick=function(t,e){t.userEditEnabled()&&(TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),r(t,this._model))},s.prototype._generateItemsForRow._onDeleteClick=function(t){t.isUserDeletable()&&(t.hasChildren()?showDeleteStudyTreeConfirm(this._model.removeSource.bind(this._model,t)):this._model.removeSource(t))},s.prototype._generateItemsForRow._onAddChildSourceClick=function(t){var e,i,s=this._chart.showIndicators(t);s&&(e=function(){n("SOS","Apply SOS","Apply by Plus SOS")},i=this._model.model().studyInserted(),i.subscribe(this,e),s.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))},s.prototype._generateItemsForRow._onViewSorceClick=function(t){var e=t.metaInfo();this._getPineSourceCode(e).done(function(t){TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab(t)})},s.prototype._getPineSourceCode=function(t){return $.Deferred()},s.prototype.setItemEnabled=function(t,e){var i=!t.hasClass("disabled"),s=t.closest(".pane-legend-wrap");e&&!i?(t.removeClass("disabled"),s.removeClass("disabled")):!e&&i&&(t.addClass("disabled"),s.addClass("disabled"))},s.prototype.valueChanged=function(t,e,i){return t[e]!==i&&(t[e]=i,!0)},s.prototype.firstTitle=function(){return this.$el.find(".pane-legend-line.pane-legend-wrap:first-child")},s.prototype.updateTitle=function(){var e,i,s,n,o,r,a,l,h,d,u,p,c;for(s=this._itemsBinding.length;s--;)i=this._itemsBinding[s],Array.isArray(i.cell)||(i.last||(i.last={}),n=i.last,o=i.source,e=o.properties().visible.value(),this.valueChanged(n,"sourceVisible",e)&&this.setItemEnabled(i.cell,e),r=i.value.color(),a=o!==this._model.mainSeries()&&o===this._model.selectedSource()?"bold":"normal","function"==typeof i.value.getSplitTitle?(u=i.value.getSplitTitle(),l=u[0].trim(),h=u[1].trim(),d=u[2].trim()):(l=i.value.text().trim(),h="",d=""),t.enabled("fundamental_widget")&&(p=this._model.mainSeries(),c=p.symbolInfo(),l=(c?c.name:p.actualSymbol())+" "+l),i.isCellInited||(i.isCellInited=!0,d||h?(i.titleElement=document.createElement("div"),i.titleElement.classList.add("pane-legend-title__container"),i.cell[0].appendChild(i.titleElement),i.descriptionElement=document.createElement("div"),i.descriptionElement.classList.add("pane-legend-title__description"),i.titleElement.appendChild(i.descriptionElement),h&&(i.intervalElement=document.createElement("div"),
i.intervalElement.classList.add("pane-legend-title__interval"),i.titleElement.appendChild(i.intervalElement)),d&&(i.detailsElement=document.createElement("div"),i.detailsElement.classList.add("pane-legend-title__details"),i.titleElement.appendChild(i.detailsElement)),i.titleElement.classList.add("apply-overflow-tooltip","apply-overflow-tooltip--allow-text","apply-overflow-tooltip--check-children")):(i.titleElement=i.cell[0],i.descriptionElement=i.titleElement,i.descriptionElement.classList.add("apply-overflow-tooltip"))),(this.valueChanged(n,"color",r)||this.valueChanged(n,"fontWeight",a))&&(i.titleElement.style.color=r,i.titleElement.style.borderColor=r,i.titleElement.style.fontWeight=a),l!==i.description&&(i.descriptionElement.textContent=TradingView.clean(l,!0),i.description=l),i.intervalElement&&h&&h!==i.interval&&(i.intervalElement.textContent=TradingView.clean(h,!0),i.interval=h),i.detailsElement&&d&&d!==i.details&&(i.detailsElement.textContent=TradingView.clean(d,!0),i.details=d));this._chart.resizeIndicator()},s.prototype.update=function(t){var e,i,s,n,r,a,l,h,d,u,p;for(this.updateTitle(),h=this._itemsBinding.length;h--;)if(n=this._itemsBinding[h],e=n.cell,i=n.titleCells,s=n.source.properties().visible.value(),Array.isArray(e))for(n.last||(n.last={},n.last.dwView||(n.last.dwView={})),d=n.last,r=n.value.items(),u=this.valueChanged(d,"sourceVisible",s),a=0;a<e.length;a++)l=r[a],d[a]||(d[a]={}),u&&this.setItemEnabled(e[a],s),p=l.visible(),e[a][0].classList.toggle("js-hidden",!p),this.valueChanged(d[a],"text",l.text())&&(e[a][0].textContent=l.text()),e[a][0].classList.toggle("js-hidden",!p),l.color()&&this.valueChanged(d[a],"color",l.color())&&e[a].css("color",o.resetTransparency(l.color())),i&&(this.valueChanged(d[a],"sourceVisible",s)&&this.setItemEnabled(i[a],s),this.valueChanged(d[a],"title",l.title())&&(i[a][0].textContent=l.title()),i[a][0].classList.toggle("js-hidden",!p));this._chart.resizeIndicator()},s.prototype.dataSourceAtPoint=function(t,e){return null},s.prototype.renderTo=function(t,e,i){var s,n,o,r,a,l,h;for(t.save(),t.fillStyle=this._chart.properties().scalesProperties.textColor.value(),t.textBaseline="middle",s=0,n=0;n<this._itemsBinding.length;++n)o=this._itemsBinding[n],r=o.value,a=o.source===this._model.mainSeries(),l=a?12:8,h=a?25:17,Array.isArray(o.cell)||(t.font=r.size()+" Verdana, Arial",t.fillText(r.text(),e,i+s+l),s+=h);t.restore()},s.prototype.toggleTitles=function(t){var e=this._chart.properties().paneProperties.legendProperties.showLegend;e.setValue(!e.value())},e.LegendWidget=s}).call(e,i(5))},815:function(t,e,i){"use strict";function s(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.jqDiv=$('<div class="pane-controls">'),this._initVisibility(),this.update(),this.jqDiv.appendTo(i)}var n=i(976);s.prototype.update=function(){var t,e,s,n,o,r,a,l=this._paneWidget.state();if(l){if(!this._visible||!this._chart.isActive())return void this.jqDiv[0].classList.add("pane-controls--hidden");if(this.jqDiv[0].classList.remove("pane-controls--hidden"),t=this,
e=t._model,s=e.panes().indexOf(l),this.jqDiv.toggleClass("toppane",0===s||this._chart.isMaximizedPane()),n=!1,!l.containsMainSeries()&&!this._chart.isMaximizedPane()){for(o=0,r=l.dataSources(),a=r.length;a--;)if(r[a]instanceof TradingView.Study&&++o>1){n=!0;break}r=null}s>0&&!this._chart.isMaximizedPane()?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").append($(i(1152)).attr({width:14,height:14})).attr("title",$.t("Move Up")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach(),s<this._model.panes().length-1&&!this._chart.isMaximizedPane()?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").append($(i(1153)).attr({width:14,height:14})).attr("title",$.t("Move Down")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach(),n?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(1040)).attr({width:14,height:14})).attr("title",$.t("Delete")).on("click",function(){t._model.removePane(t._chart,t._model.panes().indexOf(t._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach(),this._model.panes().length>1&&!this._chart.isMaximizedPane()?(this._$maximizeButton||(this._$maximizeButton=$(document.createElement("a")).addClass("pane-legend-icon maximize").append($(i(1154)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$maximizeButton.appendTo(this.jqDiv)):this._$maximizeButton&&this._$maximizeButton.detach(),this._model.panes().length>1&&this._chart.isMaximizedPane()?(this._$restoreButton||(this._$restoreButton=$(document.createElement("a")).addClass("pane-legend-icon restore").append($(i(1155)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$restoreButton.appendTo(this.jqDiv)):this._$restoreButton&&this._$restoreButton.detach()}},s.prototype.destroy=function(){this._visibilityProperty&&(this._visibilityProperty.unsubscribe(this,this._onVisibilityPropertyChange),this._visibilityProperty=null),this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler,!1),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),this.jqDiv.remove()},s.prototype._initVisibility=function(){this._visible=!0,this._visibilityProperty=n.actualBehavior(),this._visibilityProperty.subscribe(this,this._onVisibilityPropertyChange),this._onVisibilityPropertyChange()},s.prototype._onVisibilityPropertyChange=function(){var t=this._visibilityProperty.value()
;"alwaysOn"===t||"alwaysOff"===t?(this._visible="alwaysOn"===t,this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler),this._boundMouseHandler=null)):(this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._mainDiv[0].addEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].addEventListener("mouseleave",this._boundMouseHandler)),this._visible=!1),this.update()},s.prototype._visibilityMouseHandler=function(t){this._visible="mouseenter"===t.type,this.update()},t.exports=s},817:function(t,e,i){"use strict";var s,n,o,r,a,l,h,d,u,p,c,_,v,m,g,b,y,w,f,M,B,C,S,x,T;Object.defineProperty(e,"__esModule",{value:!0}),i.d(e,"ControlBarNavigation",function(){return T}),i(11),s=i(1178),i.n(s),n=i(976),o=i(38),r=i(202),a=i(29),l=i(306),h=i(71),i.n(h),i(39),d=i(873),i.n(d),u=i(1179),i.n(u),p=i(1180),i.n(p),c=i(1181),i.n(c),_=i(973),i.n(_),v=i(1182),i.n(v),m=i(1183),i.n(m),g=i(1184),i.n(g),b=i(1185),i.n(b),w=Object(l.b)({keys:["Alt","R"],text:"{0} + {1}"}),f=Object(l.b)({keys:[m],text:"{0}"}),M=Object(l.b)({keys:[g],text:"{0}"}),B='<div class="control-bar-wrapper">\n\t<div class="control-bar control-bar--hidden">\n\t\t<div class="control-bar__group js-btn-group js-btn-group-left">\n\t\t\t<div class="control-bar__btn control-bar__btn--zoom-out apply-common-tooltip" title="'+window.t("Zoom Out")+'">\n\t\t\t\t'+u+'\n\t\t\t</div>\n\t\t\t<div class="control-bar__btn control-bar__btn--zoom-in apply-common-tooltip" title="'+window.t("Zoom In")+'">\n\t\t\t\t'+c+'\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="control-bar__group js-btn-group js-btn-group-right">\n\t\t\t<div class="control-bar__btn control-bar__btn--move-left apply-common-tooltip" title="'+window.t("Scroll to the Left")+'" data-tooltip-hotkey="'+f+'">\n\t\t\t\t'+d+'\n\t\t\t</div>\n\t\t\t<div class="control-bar__btn control-bar__btn--move-right apply-common-tooltip" title="'+window.t("Scroll to the Right")+'" data-tooltip-hotkey="'+M+'">\n\t\t\t\t'+_+'\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="control-bar__btn control-bar__btn--turn-button control-bar__btn--btn-hidden apply-common-tooltip js-btn-reset" title="'+window.t("Reset to Default Settings")+'" data-tooltip-hotkey="'+w+'">\n\t\t\t'+p+"\n\t\t</div>\n\t</div>\n</div>",C='<div class="control-bar control-bar__btn control-bar__btn--back-present control-bar__btn--btn-hidden apply-common-tooltip" title="'+window.t("Scroll to the Most Recent Bar")+'">\n\t'+v+"\n</div>",y={},y.moving="wait_finishing",y.wait_finishing="stop",y.stop="moving",S=y,x="control-bar__btn--btn-hidden",T=function(){function t(t,e){this._back=null,this._backButtonVisible=!1,this._boundKeydownHandler=null,this._boundKeyupHandler=null,this._boundMouseHandler=null,this._chartBackgroundProperty=null,this._chartModel=null,this._checkIntervalId=0,this._controlBar=null,this._controlBarVisible=!1,this._currentDistance=0,this._deferredFinishTimeout=0,this._finishingTimeout=0,this._moveType="",
this._movingTimeout=0,this._pressedKey=[],this._priceAxisChanged=null,this._resetAvailabilityChanged=null,this._priceAxisName="",this._rafId=0,this._startTime=0,this._state="stop",this._visibilityTypeProperty=null,this._widget=null,this._btnGroups=null,this._chart=t,this._parent=e,this._init(),this._initHandlers()}return t.prototype.destroy=function(){null!==this._visibilityTypeProperty&&(this._visibilityTypeProperty.unsubscribe(this,this._onVisibilityTypeChange),this._visibilityTypeProperty=null),null!==this._boundMouseHandler&&(this._parent.removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent.removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),null!==this._boundKeydownHandler&&(this._parent.ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),null!==this._boundKeyupHandler&&(this._parent.ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),this._boundKeyupHandler=null),clearTimeout(this._movingTimeout),null!==this._priceAxisChanged&&(this._priceAxisChanged.unsubscribe(this,this._updateBackBtnPosition),this._priceAxisChanged=null),null!==this._chartBackgroundProperty&&(clearInterval(this._checkIntervalId),this._chartBackgroundProperty.unsubscribe(this,this._updateBgBarStyle),this._chartBackgroundProperty=null),null!==this._resetAvailabilityChanged&&(this._resetAvailabilityChanged.unsubscribe(this,this._updateResetScalesButtonVisibility),this._resetAvailabilityChanged=null),this._chart=null},t.prototype.updatePosition=function(t){null!==this._widget&&null!==this._controlBar&&this._updateBtnGroupVisibility(t)},t.prototype._init=function(){var t,e,i,s=this;if(this._widget=Object(r.a)(B).querySelector(".control-bar-wrapper"),this._back=Object(r.a)(C).querySelector(".control-bar__btn--back-present"),this._controlBar=this._widget.querySelector(".control-bar"),this._btnGroups=Array.from(this._controlBar.querySelectorAll(".js-btn-group")),h.CheckMobile.any())for(t=0,e=this._btnGroups;t<e.length;t++)i=e[t],i.classList.add("js-hidden");this._buttons={zoomIn:this._widget.querySelector(".control-bar__btn--zoom-in"),zoomOut:this._widget.querySelector(".control-bar__btn--zoom-out"),moveLeft:this._widget.querySelector(".control-bar__btn--move-left"),moveRight:this._widget.querySelector(".control-bar__btn--move-right"),turn:this._widget.querySelector(".control-bar__btn--turn-button")},this._updateControlBarPosition(),this._initVisibility(),this._parent.appendChild(this._widget),this._parent.appendChild(this._back),this._backButtonVisible=!1,this._priceAxisName=o.IS_RTL?"left":"right",this._chart.withModel(this,function(){s._chartModel=s._chart.model(),s._priceAxisChanged=s._chart.getPriceAxisWidthChangedByName(s._priceAxisName),s._resetAvailabilityChanged=s._chartModel.model().isScalesResetAvailableChanged(),s._priceAxisChanged.subscribe(s,s._updateBackBtnPosition),s._resetAvailabilityChanged.subscribe(s,s._updateResetScalesButtonVisibility),s._updateBackBtnPosition(),
null!==s._back&&s._back.addEventListener("click",function(){null!==s._chartModel&&s._chartModel.timeScale().scrollToRealtime(!0)}),s._checkIntervalId=setInterval(function(){return s._check()},1e3),s._chartBackgroundProperty=s._chartModel.model().properties().paneProperties.background,null!==s._chartBackgroundProperty&&s._chartBackgroundProperty.subscribe(s,s._updateBgBarStyle),s._updateBgBarStyle()})},t.prototype._initHandlers=function(){var t,e,i,s=this,n=Modernizr.touch?"touchstart":"mousedown",o=Modernizr.touch?["touchend"]:["mouseup","mouseout"];for(this._buttons.moveLeft.addEventListener(n,function(t){t.preventDefault(),s._moveByBar(1),s._trackEvent("Move Left")}),this._buttons.moveRight.addEventListener(n,function(t){t.preventDefault(),s._moveByBar(-1),s._trackEvent("Move Right")}),t=0,e=o;t<e.length;t++)i=e[t],this._buttons.moveLeft.addEventListener(i,function(){return s._stopMoveByBar()}),this._buttons.moveRight.addEventListener(i,function(){return s._stopMoveByBar()});this._buttons.turn.addEventListener("click",function(t){t.preventDefault(),s._chart.GUIResetScales(),s._trackEvent("Reset to Default Settings")}),this._buttons.zoomOut.addEventListener("click",function(t){t.preventDefault(),null!==s._chartModel&&s._chartModel.zoomOut(),s._trackEvent("Zoom Out")}),this._buttons.zoomIn.addEventListener("click",function(t){t.preventDefault(),null!==s._chartModel&&s._chartModel.zoomIn(),s._trackEvent("Zoom In")}),this._boundKeydownHandler=this._keydownHandler.bind(this),this._boundKeyupHandler=this._keyupHandler.bind(this),this._parent.ownerDocument.addEventListener("keydown",this._boundKeydownHandler),this._parent.ownerDocument.addEventListener("keyup",this._boundKeyupHandler)},t.prototype._check=function(){if(null!==this._chartModel&&null!==this._back){var t=this._chartModel.timeScale().rightOffset()<0;t!==this._backButtonVisible&&(this._backButtonVisible=t,this._back.classList.toggle(x,!this._backButtonVisible))}},t.prototype._initVisibility=function(){this._visibilityTypeProperty=Object(n.actualBehavior)(),this._visibilityTypeProperty.subscribe(this,this._onVisibilityTypeChange),this._onVisibilityTypeChange()},t.prototype._onVisibilityTypeChange=function(){if(null!==this._visibilityTypeProperty){var t=this._visibilityTypeProperty.value();"alwaysOn"===t||"alwaysOff"===t?(this._controlBarVisible="alwaysOn"===t,null!==this._boundMouseHandler&&(this._parent.removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent.removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null)):(this._controlBarVisible=!1,this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._parent.addEventListener("mousemove",this._boundMouseHandler),this._parent.addEventListener("mouseleave",this._boundMouseHandler))),this._updateControlBarVisibility()}},t.prototype._visibilityMouseHandler=function(t){var e,i;t.buttons||null!==this._chartModel&&this._chartModel.lineBeingCreated()||(e=!1,
"mousemove"!==t.type&&"mouseleave"!==t.type||null===this._widget||(i=this._widget.getBoundingClientRect(),e=t.clientX>=i.left-100&&t.clientX<=i.right+100&&t.clientY>=i.top-100&&t.clientY<=i.bottom+100),this._controlBarVisible!==e&&(this._controlBarVisible=e,null!==this._controlBar&&null===this._rafId&&(this._rafId=this._controlBar.ownerDocument.defaultView.requestAnimationFrame(this._updateControlBarVisibility.bind(this)))))},t.prototype._updateControlBarVisibility=function(){this._rafId=null,null!==this._controlBar&&this._controlBar.classList.toggle("control-bar--hidden",!this._controlBarVisible)},t.prototype._updateBackBtnPosition=function(){if("left"===this._priceAxisName||"right"===this._priceAxisName){var t=this._chart.getPriceAxisMaxWidthByName(this._priceAxisName)+14;t&&null!==this._back&&(this._back.style.marginRight=t+"px")}},t.prototype._updateBgBarStyle=function(){var t,e,i,s;if(null!==this._chartModel){for(t=Object(a.getLuminance)(this._chartModel.model().properties().paneProperties.background.value())<.5,e=0,i=Object.values(this._buttons);e<i.length;e++)s=i[e],s.classList.toggle("control-bar__btn--dark",t);null!==this._back&&this._back.classList.toggle("control-bar__btn--dark",t)}},t.prototype._updateBtnGroupVisibility=function(t){var e,i,s,n,o,r;if(null!==this._btnGroups&&(e=[{breakPoint:390,className:"js-btn-group-right"},{breakPoint:290,className:"js-btn-group-left"}],!h.CheckMobile.any()))for(i=0,s=e;i<s.length;i++)n=s[i],o=t<=n.breakPoint,void 0!==(r=this._getBtnGroup(n.className))&&o!==r.classList.contains("js-hidden")&&(r.classList.toggle("js-hidden",o),this._updateControlBarPosition())},t.prototype._getBtnGroup=function(t){if(null!==this._btnGroups)return this._btnGroups.find(function(e){return e.classList.contains(t)})},t.prototype._updateControlBarPosition=function(){var t,e;null!==this._widget&&null!==this._controlBar&&(t=0,e=this._controlBar.querySelectorAll(".js-btn-group:not(.js-hidden)"),t=e.length>0?86*e.length:50,this._widget.style.left="calc(50% - "+Math.ceil(t/2)+"px)")},t.prototype._updateResetScalesButtonVisibility=function(){if(null!==this._chartModel){var t=this._chartModel.model().isScalesResetAvailable();this._buttons.turn.classList.toggle(x,!t)}},t.prototype._move=function(t){var e,i,s,n=this;null!==this._chartModel&&"stop"===this._state&&this._chartModel.beginUndoMacro(1===t?"Move Left":"Move Right"),this._state=S.stop,this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=Date.now(),0===this._movingTimeout&&(e=this._startTime,i=10,s=function(){n._moveStep(e,0,50*t,1e3),n._movingTimeout=setTimeout(s.bind(n),i)},this._movingTimeout=setTimeout(s.bind(this),i))},t.prototype._moveStep=function(t,e,i,s){var n,o,r;return null===this._chartModel||this._chartModel.timeScale().isEmpty()?void 0:(n=Date.now(),n<t&&(t=n),o=(n-t)/s,(o>1||!isFinite(o))&&(o=1),r=1-Math.pow(1-o,3),this._currentDistance=(i-e)*r+e,
this._chartModel.scrollChart(this._currentDistance),o)},t.prototype._finishMove=function(){var t,e,i,s=this;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0,t=this._currentDistance,e=Date.now(),i=function(){var n=s._moveStep(e,t,0,700);n&&n<1?s._finishingTimeout=setTimeout(i.bind(s),10):null!==s._chartModel&&(s._state=S.wait_finishing,s._moveType="",s._movingTimeout=0,s._currentDistance=0,s._chartModel.endUndoMacro())},this._finishingTimeout=setTimeout(i.bind(this),10)},t.prototype._stopMove=function(){"moving"===this._state&&(this._state=S.moving,Date.now()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-(Date.now()-this._startTime)):this._finishMove())},t.prototype._moveByBar=function(t){var e,i,s,n,o,r,a=this;if(null!==this._chartModel){if(e=this._chartModel.timeScale(),e.isEmpty())return;"stop"===this._state&&this._chartModel.beginUndoMacro(1===t?"Move Left":"Move Right"),null!==e.visibleBars()&&(i=e.indexToCoordinate(e.visibleBars().lastBar())+e.barSpacing()/2,Math.abs(e.width()-i)>e.barSpacing()/6&&this._chartModel.scrollChart(e.width()-i)),this._state=S.stop,this._moveType="by_bar",this._startTime=Date.now(),this._movingTimeout||(s=0,n=150,o=400,r=function(){a._moveByBarStep(t),s++,n>100&&(n-=s/5*20),a._movingTimeout=setTimeout(r,n)},this._movingTimeout=setTimeout(r,o),this._moveByBarStep(t))}},t.prototype._moveByBarStep=function(t){if(null!==this._chartModel){if(this._chartModel.timeScale().isEmpty())return;this._chartModel.scrollChartByBar(t)}},t.prototype._stopMoveByBar=function(){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state=S.wait_finishing,this._moveType="",this._movingTimeout=0,this._currentDistance=0,null!==this._chartModel&&this._chartModel.endUndoMacro())},t.prototype._keydownHandler=function(t){var e,i;t.metaKey||37!==(e=t.which)&&39!==e||this._pressedKey[e]||(this._pressedKey[e]=!0,t.target.closest("input, textarea")||(i=37===e?1:-1,t.ctrlKey||t.altKey?this._move(i):this._moveByBar(i),t.preventDefault()))},t.prototype._keyupHandler=function(t){var e=t.which;37!==e&&39!==e||t.target.closest("input, textarea")||(this._pressedKey[t.which]=!1,"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove())},t.prototype._trackEvent=function(t){},t}()},873:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8.5 1.5L3.5 7l5 5.5"/></svg>'},973:function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.5 1.5l5 5.5-5 5.5"/></svg>'},976:function(t,e,i){"use strict";function s(t){return"alwaysOn"===t||"alwaysOff"===t?t:"visibleOnMouseOver"}function n(){if(!u){var t="NavigationButtons.visibility";u=new h.a,u.setValue(s(d.getValue(t))),u.subscribe(u,function(e){d.setValue(t,s(e.value()))})}return u}function o(){
return[{value:"visibleOnMouseOver",title:window.t("Visible on Mouse Over")},{value:"alwaysOn",title:window.t("Always Visible")},{value:"alwaysOff",title:window.t("Always Invisible")}]}function r(){var t,e;return p||(p=new h.a,t=n(),e=function(){var e=t.value();"alwaysOn"!==e&&"alwaysOff"!==e&&(e=Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),p&&p.setValue(e)},t.subscribe(p,e),e()),p}var a,l,h,d,u,p;Object.defineProperty(e,"__esModule",{value:!0}),e.property=n,e.availableValues=o,e.actualBehavior=r,i(11),a=i(127),i.n(a),l=i(13),h=i.n(l),d=i(49),i.n(d)}});