',
).append(r.addClass('tv-dialog__scroll-wrap-inner')));
var l = $('
').append(i).append(n);
e.customControls &&
i.find('.js-custom-controls').append(e.customControls);
if (!0 !== e.doNotCreatePages)
for (var c = 0; c < e.tabs.length; ++c)
r.append(
$('
').append(
e.tabs[c].page,
),
);
var d = e.tabStateSaveKey,
p = e.activeTab,
h = e.tabsScrollBoxAddClass,
u = e.tabAddClass;
delete e.tabs,
delete e.activeTab,
delete e.customControls,
delete e.tabStateSaveKey,
delete e.customControlsContainerAddClass,
delete e.tabsScrollBoxAddClass,
delete e.tabAddClass,
(e.closeButtonAddClass = 'tv-tabbed-dialog__close'),
(e.contentWrapTemplate = l);
var b = (0, o.createDialog)(e),
f = new a.Tabs(i.find('.tv-tabs').get(0), r.get(0), {
addLeftArrowsClass: 'tv-tabbed-dialog__tabs-arrow-left',
addRightArrowsClass: 'tv-tabbed-dialog__tabs-arrow-right',
addScrollBoxClass: h,
tabClass: u,
saveTab: d,
activeTab: p,
});
return (
b.on('afterOpen', function () {
f.setActivePage(f.index(), !0, !0);
}),
{ dialog: b, tabs: f }
);
});
var a = i('pIOw'),
o = i('YDhE');
i('FxnJ');
var s = { tabs: [] };
}.call(this, i('nbsC')));
},
UnpO: function (t, e, i) {
'use strict';
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.AddSymbolTab = void 0);
var a = (function () {
function t(t, e) {
for (var i = 0; i < e.length; i++) {
var a = e[i];
(a.enumerable = a.enumerable || !1),
(a.configurable = !0),
'value' in a && (a.writable = !0),
Object.defineProperty(t, a.key, a);
}
}
return function (e, i, a) {
return i && t(e.prototype, i), a && t(e, a), e;
};
})(),
o = i('dKfe'),
s = i('pZll');
i('UxRG'), i('k47Q');
var n =
'\n\t
\n\t\t\n\t\t\n\t
';
e.AddSymbolTab = (function () {
function t(e, i) {
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
})(this, t),
(this._chartWidgetCollection = e),
(this._dialog = i),
(this._$popup = null),
this.init();
}
return (
a(t, [
{
key: 'init',
value: function () {
var t = this;
(this.$tab = $(n)),
(this._$input = this.$tab.find('.js-add-symbol-tab-input')),
(this._checkbox = new o.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, s.symbolSearchUIService)().bindToInput(this._$input, {
callback: function (e) {
var i = t._chartWidgetCollection.activeChartWidget.value();
i && i.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, i) {},
dKfe: function (t, e, i) {
'use strict';
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.AddSymbolCheckbox = void 0);
var a,
o = i('QwKQ'),
s = (a = o) && a.__esModule ? a : { default: a };
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 i = (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 (
i.$checkbox.change(function () {
setTimeout(function () {
TVSettings.setValue(
'showAddSymbolDialog.checkboxState',
i.checked,
);
});
}),
i
);
}
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, t),
e
);
})(s.default);
},
frtK: function (t, e, i) {},
jPTo: function (t, e, i) {},
k47Q: function (t, e, i) {},
ocUP: function (t, e, i) {
'use strict';
(function (t, a) {
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.CompareTab = void 0);
var o = (function () {
function t(t, e) {
for (var i = 0; i < e.length; i++) {
var a = e[i];
(a.enumerable = a.enumerable || !1),
(a.configurable = !0),
'value' in a && (a.writable = !0),
Object.defineProperty(t, a.key, a);
}
}
return function (e, i, a) {
return i && t(e.prototype, i), a && t(e, a), e;
};
})(),
s = i('pZll'),
n = i('PC8g');
i('UxRG'), i('b6p+'), i('frtK');
var r =
'\n\t
\n\t\t\n\t
',
l =
'\n\t
\n\t\t\n\t
';
e.CompareTab = (function () {
function e(i, a) {
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
})(this, e),
(this.selectedSymbols = []),
(this._chartWidgetCollection = i),
(this._dialog = a),
(this._$popup = null),
(this._predefines = {}),
(this._symbolAlias = {}),
(this._isBovespa = t.enabled('bovespa_widget')),
(this._predefines =
this._chartWidgetCollection.activeChartWidget
.value()
.compareSymbols() || []),
this.init();
}
return (
o(e, [
{
key: '_addCompareSymbol',
value: function (t, e, i) {
var a = this._chartWidgetCollection.activeChartWidget.value();
if (a)
return (
this.selectedSymbols.push(t),
a.addCompareStudy(t).then(function (t) {
var e = null !== t;
return e && (0, n.trackEvent)('GUI', 'Add Compare'), e;
})
);
},
},
{
key: 'removeCompareSymbol',
value: function (t) {
var e = this,
i = this._chartWidgetCollection.activeChartWidget.value();
if (i) {
var a = i.model();
a &&
((this.selectedSymbols = this.selectedSymbols.filter(
function (e) {
return e !== t;
},
)),
a.dataSources().forEach(function (i) {
if (
i._metaInfo &&
'Compare@tv-basicstudies' === i._metaInfo.id
) {
var o = i.properties().inputs.symbol.value();
(o === t ||
(e._symbolAlias[o] && e._symbolAlias[o] === t)) &&
a.removeSource(i);
}
}));
}
},
},
{
key: 'init',
value: function () {
var t = this,
e = this._chartWidgetCollection.activeChartWidget.value();
if (e) {
var i = e.model();
if (i) {
var a = i.dataSources();
(this.$tab = $(r)),
this._initSymbolSearch(),
this._createPredefinesList();
var o = this.$tab.find('.js-compare-tab-predefines');
o.find('.js-predefine-checkbox').attr('checked', !1),
this._predefines.forEach(function (e) {
var i = e.symbol,
s = t._symbolToId(i),
n = o.find('#' + s);
a.forEach(function (e) {
if (
e._metaInfo &&
'Compare@tv-basicstudies' === e._metaInfo.id
) {
var a = e.properties().inputs.symbol.value();
(a === i ||
(t._symbolAlias[a] &&
t._symbolAlias[a] === i)) &&
(n.attr('checked', !0),
t.selectedSymbols.push(a));
}
});
});
}
}
},
},
{
key: '_initSymbolSearch',
value: function () {
var t = this;
(this._$input = this.$tab.find('.js-compare-tab-input')),
(0, s.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 () {
var t = this,
e = this;
function i(t) {
var i = this;
setTimeout(function () {
$(i).is(':checked')
? e._addCompareSymbol(t.data.symbol).then(function (t) {
t || $(i).attr('checked', !1);
})
: e.removeCompareSymbol(t.data.symbol);
});
}
var o = $(
'',
);
this._predefines.forEach(function (e) {
var s = e.symbol,
n = e.title,
r = $(
a.render(l, {
symbolId: t._symbolToId(s),
label: n,
additionalClass: t._isBovespa
? 'tv-compare-tab__predefine-cell--wide'
: '',
}),
);
r.find('.js-predefine-checkbox').change({ symbol: s }, i),
r.appendTo(o);
}),
o.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, i('Kxc7'), i('nbsC')));
},
ohga: function (t, e, i) {},
pIOw: function (t, e, i) {
'use strict';
i.r(e);
i('ohga');
var a = i('Eyy1');
i('P5fv');
function o() {
return new Promise(function (t) {
i.e('lazy-velocity')
.then(
function (e) {
i('WJ2Z'), t();
}.bind(null, i),
)
.catch(void 0);
});
}
$.fn.velocity = function () {
for (var t = this, e = [], i = 0; i < arguments.length; i++)
e[i] = arguments[i];
return (
o().then(function () {
$.fn.velocity.apply(t, e);
}),
this
);
};
i('bf9a');
var s,
n = i('j1f4'),
r = i('FIi8'),
l = i('aIyQ'),
c = i.n(l),
d = i('MjtL'),
p = i('/NcV'),
h = i('Vdly'),
u = i('Ialn');
i.d(e, 'Tabs', function () {
return v;
}),
(function (t) {
(t[(t.Left = 0)] = 'Left'), (t[(t.Right = 1)] = 'Right');
})(s || (s = {}));
var b = {
saveTab: '',
noSlider: !1,
onTabClick: !1,
loadedClass: 'i-loaded',
tabsContainerClass: 'tv-tabs',
tabClass: 'tv-tabs__tab',
tabDisabledClass: 'disabled',
activeTabClass: 'i-active',
activePageClass: 'active',
sliderClass: 'tv-tabs__slider',
scrollBoxClass: 'tv-tabs__scroll-box',
scrollWrapClass: 'tv-tabs__scroll-wrap',
lArrowClass: 'tv-tabs__left-arrow',
rArrowClass: 'tv-tabs__right-arrow',
},
f = d,
_ = p,
v = (function () {
function t(t, e, i) {
void 0 === i && (i = {}),
(this._animating = !1),
(this._prevWidth = -1),
(this._bindings = []),
(this._options = Object(r.deepExtend)({}, b, i)),
(this.tabChanged = new c.a()),
(this._elTabs = t),
(this._elPages = e),
(this._elScrollWrap = this._findOrCreateElement(
this._options.scrollWrapClass || '',
this._elTabs,
'wrapInner',
)),
(this._elScrollBox = this._findOrCreateElement(
this._options.scrollBoxClass || '',
this._elScrollWrap,
'wrapInner',
)),
this._options.noSlider ||
(this._elSlider = this._findOrCreateElement(
this._options.sliderClass || '',
this._elScrollBox,
'append',
)),
Modernizr.mobiletouch ||
((this._elArrowLeft = this._findOrCreateElement(
this._options.lArrowClass || '',
this._elTabs,
'append',
'