(window.webpackJsonp=window.webpackJsonp||[]).push([["add-compare-dialog"],{UnpO:function(t,e,o){"use strict";var a,n,i,c;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolTab=void 0,a=function(){function t(t,e){var o,a;for(o=0;o\n\t\t\n\t\t
\n\t',e.AddSymbolTab=function(){function t(e,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._chartWidgetCollection=e,this._dialog=o,this._$popup=null,this.init()}return a(t,[{key:"init",value:function(){var t=this;this.$tab=$(c),this._$input=this.$tab.find(".js-add-symbol-tab-input"),this._checkbox=new n.AddSymbolCheckbox({labelRight:$.t("Overlay the main chart"),labelAddClass:"tv-add-symbol-tab__checkbox-label",boxAddClass:"tv-add-symbol-tab__checkbox-box"}),this.$tab.find(".js-add-symbol-tab-checkbox").append(this._checkbox.$el),(0,i.symbolSearchUIService)().bindToInput(this._$input,{callback:function(e){var o=t._chartWidgetCollection.activeChartWidget.value();o&&o.addOverlayStudy(e,t._checkbox.checked)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"focus",value:function(){Modernizr.mobiletouch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),t}()},UxRG:function(t,e,o){},dKfe:function(t,e,o){"use strict";var a,n,i;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolCheckbox=void 0,a=o("QwKQ"),n=(i=a)&&i.__esModule?i:{default:i},e.AddSymbolCheckbox=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t.checked=TVSettings.getBool("showAddSymbolDialog.checkboxState",!0);var o=function(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}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return o.$checkbox.change(function(){setTimeout(function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",o.checked)})}),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,n.default),e}()},frtK:function(t,e,o){},jPTo:function(t,e,o){},k47Q:function(t,e,o){}, ocUP:function(t,e,o){"use strict";(function(t,a){var n,i,c,l,r,s;Object.defineProperty(e,"__esModule",{value:!0}),e.CompareTab=void 0,n=function(){function t(t,e){var o,a;for(o=0;o\n\t\t\n\t',r='
',s='\n\t
\n\t\t\n\t
',e.CompareTab=function(){function e(t,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this._chartWidgetCollection=t,this._dialog=o,this._$popup=null,this._predefines={},this._symbolAlias={},this.init()}return n(e,[{key:"_addCompareSymbol",value:function(t,e,o){var a=this._chartWidgetCollection.activeChartWidget.value();if(a)return a.addCompareStudy(t).then(function(t){var e=null!==t;return e&&(0,c.trackEvent)("GUI","Add Compare"),e})}},{key:"removeCompareSymbol",value:function(t){var e,o=this,a=this._chartWidgetCollection.activeChartWidget.value();a&&(e=a.model())&&e.dataSources().forEach(function(a){if(a._metaInfo&&"Compare@tv-basicstudies"===a._metaInfo.id){var n=a.properties().inputs.symbol.value();(n===t||o._symbolAlias[n]&&o._symbolAlias[n]===t)&&e.removeSource(a)}})}},{key:"init",value:function(){var e,o,a,n=this,i=this._chartWidgetCollection.activeChartWidget.value();i&&(e=i.model())&&(o=e.dataSources(),this.$tab=$(l),this._initSymbolSearch(),t.enabled("charting_library_base")||(this._createPredefinesList(),(a=this.$tab.find(".js-compare-tab-predefines")).find(".js-predefine-checkbox").attr("checked",!1),Object.keys(this._predefines).forEach(function(t){var e=n._symbolToId(t),i=a.find("#"+e);o.forEach(function(e){if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var o=e.properties().inputs.symbol.value();(o===t||n._symbolAlias[o]&&n._symbolAlias[o]===t)&&i.attr("checked",!0)}})})))}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),(0,i.symbolSearchUIService)().bindToInput(this._$input,{callback:function(e){return t._addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0, clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){$(e).is(":checked")?o._addCompareSymbol(t.data.symbol).then(function(t){t||$(e).attr("checked",!1)}):o.removeCompareSymbol(t.data.symbol)})}var e=this,o=this,n=$(r);Object.keys(this._predefines).forEach(function(o){var i=$(a.render(s,{symbolId:e._symbolToId(o),label:e._predefines[o],additionalClass:e._isBovespa?"tv-compare-tab__predefine-cell--wide":""})),c=i.find(".js-predefine-checkbox");c.change({symbol:o},t),i.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.mobiletouch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}()}).call(this,o("Kxc7"),o("OiQe"))},tkV1:function(t,e,o){"use strict";var a,n,i,c,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddCompareDialog=void 0,a=function(){function t(t,e){var o,a;for(o=0;o